Visualizzazione dei risultati da 1 a 7 su 7
  1. #1
    Utente di HTML.it
    Registrato dal
    Jan 2006
    Messaggi
    157

    modifica a plugin di wordpress

    ciao, ho installato wordpress su un mio spazio e mi sono fatto il mio blog.... l'indirizzo è: http://3h4e.netsons.org
    ho installato un plugin di WP ke funge da chat, è sulla colonna di destra in alto...... è ottimo ma alcuni utenti mi hanno kiesto se potevo modificarla in modo da fare un segnale acustico all'arrivo di ogni messaggio xke senno nn si vedono i messaggi appena arrivati e nn ce se ne accorge....
    quindi volevo kiedere: esiste un modo per fare kuel segnale acustico? il segnale acustico c penso io, lo script, visto ke c capisco ancora poco di php, ki me lo può fare??
    allora gli script sono:

    kuesto è un css, nn penso serva ma lo metto lo stesso.....
    codice:
    <?php
    	
    	/*
    	This file is php so that admins can control its look without editing the code.
    	The headers below tell the browser to cache the file and also tell the browser it is css.
    	*/
    	
    	header("Cache-Control: must-revalidate");
    	$offset = 60*60*24*60;
    	$ExpStr = "Expires: ".gmdate("D, d M Y H:i:s",time() + $offset)." GMT";
    	header($ExpStr);
    	header('Content-Type: text/css');
    	
    	include("../../../wp-config.php");
    ?>
    
    /*
    This file controls the look of the Live shoutbox...
    */
    
    
    #chatoutput {
    
    /* Height of the shoutbox*/
    height: 200px;
    
    /*Uncomment width below*/
    /*width: 220px;*/
    
    /* Horizontal Scrollbar Killer */
    padding: 6px 8px; 
    
    /* Borders */
    border: 1px solid #<?php echo get_option('shoutbox_name_color'); ?>;
    border-width: 1px 2px;
    
    font: 13px "Trebuchet MS", arial, sans-serif;
    font-weight: bold
    color: #<?php echo get_option('shoutbox_text_color'); ?>;
    background: #<?php echo get_option('shoutbox_fade_to'); ?>;
    overflow: auto;
    margin-top: 10px;
    }
    
    #chatoutput span {
    font-weight: bold
    font-size: 1.1em;
    color: #<?php echo get_option('shoutbox_name_color'); ?>;
    }
    
    #chatForm label, #shoutboxAdmin {
    display: block;
    font-weight: bold
    margin: 4px 0;
    }
    
    #chatoutput a {
    font-style: normal;
    font-weight: bold;
    color: #<?php echo get_option('shoutbox_name_color'); ?>
    }
    
    /* User names with links */
    #chatoutput li span a {
    font-weight: bold;
    display: inline !important;
    border-bottom: 1px dotted #<?php echo get_option('shoutbox_name_color'); ?>
    }
    
    #chatForm input, #chatForm textarea {
    width: 120px;
    font-weight: bold
    display: block;
    margin: 0 auto;
    }
    
    #chatForm textarea {
    width: 150px;
    }
    
    
    #chatForm input#submitchat {
    width: 70px;
    font-weight: bold
    margin: 10px auto;
    border: 2px outset;
    padding: 2px;
    }
    
    #chatoutput ul#outputList {
    padding: 0;
    position: static;
    margin: 0;
    font-weight: bold
    }
    
    #chatoutput ul#outputList li {
    padding: 4px;
    margin: 0;
    font-weight: bold
    color: #<?php echo get_option('shoutbox_text_color'); ?>;
    background: none;
    font-size: 1em;
    list-style: none;
    }
    
    /* No bullets from Kubrick et al. */
    #chatoutput ul#outputList li:before {
    content: '';
    }
    
    ul#outputList li:first-line {
    line-height: 16px;
    }
    
    #lastMessage {
    font-weight: blod
    padding-bottom: 2px;
    text-align: center;
    border-bottom: 2px dotted #<?php echo get_option('shoutbox_fade_from'); ?>;
    }
    
    em#responseTime {
    font-style: normal;
    display: block;
    }
    
    #chatoutput .wp-smiley {
    vertical-align: middle;
    }

  2. #2
    Utente di HTML.it
    Registrato dal
    Jan 2006
    Messaggi
    157
    poi lo script è composto anke da altri 2 files.... ecco il primo ke si kiama fatAjax.php


    codice:
    <?php
    // Why is this file php? so that wordpress can find its url and print it for the ajax...this saves
    // some setup time in if you have a blog not in the root
    // The headers below cache the file and make it javascript
    	
    	header("Cache-Control: must-revalidate");
    	$offset = 60*60*24*60;
    	$ExpStr = "Expires: ".gmdate("D, d M Y H:i:s",time() + $offset)." GMT";
    	header($ExpStr);
    	header('Content-Type: application/x-javascript');
    	include("../../../wp-config.php");
    	
    ?>
    // This script file contains 2 major sections, one for the AJAX chat, and one for the FAT
    // technique. The AJAX chat script part is below the FAT part
    
    // @name      The Fade Anything Technique
    // @namespace http://www.axentric.com/aside/fat/
    // @version   1.0-RC1
    // @author    Adam Michela
    
    var Fat = {
    	make_hex : function (r,g,b) 
    	{
    		r = r.toString(16); if (r.length == 1) r = '0' + r;
    		g = g.toString(16); if (g.length == 1) g = '0' + g;
    		b = b.toString(16); if (b.length == 1) b = '0' + b;
    		return "#" + r + g + b;
    	},
    	fade_all : function ()
    	{
    		var a = document.getElementsByTagName("*");
    		for (var i = 0; i < a.length; i++) 
    		{
    			var o = a[i];
    			var r = /fade-?(\w{3,6})?/.exec(o.className);
    			if (r)
    			{
    				if (!r[1]) r[1] = "";
    				if (o.id) Fat.fade_element(o.id,null,null,"#"+r[1]);
    			}
    		}
    	},
    	fade_element : function (id, fps, duration, from, to) 
    	{
    		if (!fps) fps = 30;
    		if (!duration) duration = 3000;
    		if (!from || from=="#") from = "#FFFF33";
    		if (!to) to = this.get_bgcolor(id);
    		
    		var frames = Math.round(fps * (duration / 1000));
    		var interval = duration / frames;
    		var delay = interval;
    		var frame = 0;
    		
    		if (from.length < 7) from += from.substr(1,3);
    		if (to.length < 7) to += to.substr(1,3);
    		
    		var rf = parseInt(from.substr(1,2),16);
    		var gf = parseInt(from.substr(3,2),16);
    		var bf = parseInt(from.substr(5,2),16);
    		var rt = parseInt(to.substr(1,2),16);
    		var gt = parseInt(to.substr(3,2),16);
    		var bt = parseInt(to.substr(5,2),16);
    		
    		var r,g,b,h;
    		while (frame < frames)
    		{
    			r = Math.floor(rf * ((frames-frame)/frames) + rt * (frame/frames));
    			g = Math.floor(gf * ((frames-frame)/frames) + gt * (frame/frames));
    			b = Math.floor(bf * ((frames-frame)/frames) + bt * (frame/frames));
    			h = this.make_hex(r,g,b);
    		
    			setTimeout("Fat.set_bgcolor('"+id+"','"+h+"')", delay);
    
    			frame++;
    			delay = interval * frame; 
    		}
    		setTimeout("Fat.set_bgcolor('"+id+"','"+to+"')", delay);
    	},
    	set_bgcolor : function (id, c)
    	{
    		var o = document.getElementById(id);
    		o.style.backgroundColor = c;
    	},
    	get_bgcolor : function (id)
    	{
    		var o = document.getElementById(id);
    		while(o)
    		{
    			var c;
    			if (window.getComputedStyle) c = window.getComputedStyle(o,null).getPropertyValue("background-color");
    			if (o.currentStyle) c = o.currentStyle.backgroundColor;
    			if ((c != "" && c != "transparent") || o.tagName == "BODY") { break; }
    			o = o.parentNode;
    		}
    		if (c == undefined || c == "" || c == "transparent") c = "#FFFFFF";
    		var rgb = c.match(/rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/);
    		if (rgb) c = this.make_hex(parseInt(rgb[1]),parseInt(rgb[2]),parseInt(rgb[3]));
    		return c;
    	}
    }
    
    
    function jal_apply_filters(s) {
    	return filter_smilies(make_links((s)));
    }
    
    var smilies =  [[':\\)',	'icon_smile.gif'], 
    		[':\\-\\)',	'icon_smile.gif'], 
    		[':D',		'icon_biggrin.gif'], 
    		[':\\-D',	'icon_biggrin.gif'], 
    		[':grin:',  'icon_biggrin.gif'], 
    		[':smile:',  'icon_smile.gif'],
    		[':\\(',	'icon_sad.gif'], 
    		[':\\-\\(',	'icon_sad.gif'], 
    		[':sad:',  'icon_sad.gif'], 
    		[':o',		'icon_surprised.gif'], 
    		[':\\-o',	'icon_surprised.gif'], 
    		['8o',		'icon_eek.gif'], 
    		['8\\-o',	'icon_eek.gif'], 
    		['8\\-0',	'icon_eek.gif'], 
    		[':eek:',	'icon_surprised.gif'], 
    		[':s',		'icon_confused.gif'],
    		[':\\-s',	'icon_confused.gif'],
    		[':lol:',	'icon_lol.gif'],
    		[':cool:',	'icon_cool.gif'],
    		['8\\)',	'icon_cool.gif'],
    		['8\\-\\)',	'icon_cool.gif'],
    		[':x',		'icon_mad.gif'],
    		[':-x',		'icon_mad.gif'],
    		[':mad:',	'icon_mad.gif'],
    		[':p',		'icon_razz.gif'],
    		[':\\-p',	'icon_razz.gif'],
    		[':razz:',	'icon_razz.gif'],
    		[':\\$',	'icon_redface.gif'],
    		[':\\-\\$',	'icon_redface.gif'],
    		[':\'\\(',	'icon_cry.gif'],
    		[':evil:',	'icon_evil.gif'],
    		[':twisted:','icon_twisted.gif'],
    		[':cry:',	'icon_cry.gif'],
    		[':roll:',	'icon_rolleyes.gif'],
    		[':wink:',	'icon_wink.gif'],
    		[';\\)',	'icon_wink.gif'],
    		[';\\-\\)',	'icon_wink.gif'],
    		[':!:',		'icon_exclaim.gif'],
    		[':\\?',	'icon_question.gif'],
    		[':\\-\\?',	'icon_question.gif'],
    		[':idea:',	'icon_idea.gif'],
    		[':arrow:',	'icon_arrow.gif'],
    		[':\\|',	'icon_neutral.gif'],
    		[':neutral:',	'icon_neutral.gif'],
    		[':\\-\\|',	'icon_neutral.gif'],
    		[':mrgreen:',	'icon_mrgreen.gif']];
    
    function make_links (s) {
    	var re = /((http|https|ftp):\/\/[^ ]*)/gi;
    	text = s.replace(re,"<a href=\"$1\">&laquo;link&raquo;</a>");
    	return text;
    }
    
    function filter_smilies(s) {
    	for (var i = 0; i < smilies.length; i++) {
    		var search = smilies[i][0];
    		var replace = '[img]<?php bloginfo('wpurl'); ?>/wp-images/smilies/' + smilies[i][1] + '[/img]';
    		re = new RegExp(search, 'gi');
    		s = s.replace(re, replace);
    	}
    
    	return s;
    };
    
    // XHTML live Chat
    // author: alexander kohlhofer
    // version: 1.0
    // http://www.plasticshore.com
    // http://www.plasticshore.com/projects/chat/
    // please let the author know if you put any of this to use
    // XHTML live Chat (including this script) is published under a creative commons license
    // license: http://creativecommons.org/licenses/by-nc-sa/2.0/
    
    
    var jal_loadtimes;
    var jal_org_timeout = <?php echo get_option('shoutbox_update_seconds'); ?>;
    var jal_timeout = jal_org_timeout;
    var GetChaturl = "<?php echo dirname($_SERVER['PHP_SELF']); ?>/wordspew.php?jalGetChat=yes";
    var SendChaturl = "<?php echo dirname($_SERVER['PHP_SELF']); ?>/wordspew.php?jalSendChat=yes";
    var httpReceiveChat;
    var httpSendChat;
    
    ///////////////////////////////////////
    //
    //  Generic onload by Brothercake
    //  http://www.brothercake.com/
    //
    ///////////////////////////////////////
    
    //onload function
    
    //setup onload function
    if(typeof window.addEventListener != 'undefined')
    {
    	//.. gecko, safari, konqueror and standard
    	window.addEventListener('load', initJavaScript, false);
    }
    else if(typeof document.addEventListener != 'undefined')
    {
    	//.. opera 7
    	document.addEventListener('load', initJavaScript, false);
    }
    else if(typeof window.attachEvent != 'undefined')
    {
    	//.. win/ie
    	window.attachEvent('onload', initJavaScript);
    }
    
    function initJavaScript() {
    	if (!document.getElementById('chatbarText')) { return; }
    	document.forms['chatForm'].elements['chatbarText'].setAttribute('autocomplete','off'); //this non standard attribute prevents firefox' autofill function to clash with this script
    	// initiates the two objects for sending and receiving data
    	checkStatus(''); //sets the initial value and state of the input comment
    	checkName(); //checks the initial value of the input name
    	checkUrl();
    	
    	jal_loadtimes = 1;
    	
    	httpReceiveChat = getHTTPObject();
    	httpSendChat = getHTTPObject();
    	
    	setTimeout('receiveChatText()', jal_timeout); //initiates the first data query
    	
    	document.getElementById('shoutboxname').onblur = checkName;
    	document.getElementById('shoutboxurl').onblur = checkUrl;
    	document.getElementById('chatbarText').onfocus = function () { checkStatus('active'); }	
    	document.getElementById('chatbarText').onblur = function () { checkStatus(''); }
    	document.getElementById('submitchat').onclick = sendComment;
        document.getElementById('chatForm').onsubmit = function () { return false; }
    	// When user mouses over shoutbox
        document.getElementById('chatoutput').onmouseover = function () {
        	if (jal_loadtimes > 9) {
        		jal_loadtimes = 1;
    			receiveChatText();
        	}
        	jal_timeout = jal_org_timeout;
        }
    }
    
    //initiates the first data query
    function receiveChatText() {
    	jal_lastID = parseInt(document.getElementById('jal_lastID').value) - 1;
    	if (httpReceiveChat.readyState == 4 || httpReceiveChat.readyState == 0) {
      		httpReceiveChat.open("GET",GetChaturl + '&jal_lastID=' + jal_lastID + '&rand='+Math.floor(Math.random() * 1000000), true);
    		httpReceiveChat.onreadystatechange = handlehHttpReceiveChat; 
      		httpReceiveChat.send(null);
    		jal_loadtimes++;
    	    if (jal_loadtimes > 9) jal_timeout = jal_timeout * 5 / 4;
    	}
        	setTimeout('receiveChatText()',jal_timeout);
    
    }
    
    //deals with the servers' reply to requesting new content
    function handlehHttpReceiveChat() {
      if (httpReceiveChat.readyState == 4) {
        results = httpReceiveChat.responseText.split('---'); //the fields are seperated by ---
        if (results.length > 4) {
    	    for(i=0;i < (results.length-1);i=i+5) { //goes through the result one message at a time
    	    	insertNewContent(results[i+1],results[i+2],results[i+3],results[i+4], results[i]); //inserts the new content into the page
    	    	document.getElementById('jal_lastID').value = parseInt(results[i]) + 1;
    	    }
        	jal_timeout = jal_org_timeout;
        	jal_loadtimes = 1;
    
        }
      }
    }
    
    //inserts the new content into the page
    function insertNewContent(liName,liText,lastResponse, liUrl, liId) {
        response = document.getElementById("responseTime");
        response.replaceChild(document.createTextNode(lastResponse), response.firstChild);
    	insertO = document.getElementById("outputList");
    	oLi = document.createElement('li');
    	oLi.setAttribute('id','comment-new'+liId);
    
    	oSpan = document.createElement('span');
    	oSpan.setAttribute('class','name');
    	
    	oName = document.createTextNode(liName);
    	
    	if (liUrl != "http://" && liUrl != '') {
    		oURL = document.createElement('a');
    		oURL.href = liUrl;
    		oURL.appendChild(oName);
    	} else {
    		oURL = oName;
    	}

  3. #3
    Utente di HTML.it
    Registrato dal
    Jan 2006
    Messaggi
    157
    (fa ancora parte dello script precedente)
    codice:
    	oSpan.appendChild(oURL);
    	oSpan.appendChild(document.createTextNode(' : '));
    	oLi.appendChild(oSpan);
    	oLi.innerHTML += jal_apply_filters(liText);
    	insertO.insertBefore(oLi, insertO.firstChild);
    	Fat.fade_element("comment-new"+liId, 30, <?php echo get_option('shoutbox_fade_length'); ?>, "#<?php echo get_option('shoutbox_fade_from'); ?>", "#<?php echo get_option('shoutbox_fade_to'); ?>");
    }
    
    
    //stores a new comment on the server
    function sendComment() {
    	currentChatText = document.forms['chatForm'].elements['chatbarText'].value;
    	if (httpSendChat.readyState == 4 || httpSendChat.readyState == 0) {
    		if (currentChatText == '') return;
    		currentName = document.getElementById('shoutboxname').value;
    		currentUrl = document.getElementById('shoutboxurl').value;
    		param = 'n='+ encodeURIComponent(currentName)+'&c='+ encodeURIComponent(currentChatText) +'&u='+ encodeURIComponent(currentUrl);	
    		httpSendChat.open("POST", SendChaturl, true);
    		httpSendChat.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
      		httpSendChat.onreadystatechange = receiveChatText;
      		httpSendChat.send(param);
      		document.forms['chatForm'].elements['chatbarText'].value = '';
    	}
    }
    
    // http://www.codingforums.com/showthread.php?t=63818
    function pressedEnter(field,event) {
    	var theCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
    	if (theCode == 13) {
    		sendComment();
    		return false;
    	} 
    	else return true;
    }
    
    
    //does clever things to the input and submit
    function checkStatus(focusState) {
    	currentChatText = document.forms['chatForm'].elements['chatbarText'];
    	oSubmit = document.forms['chatForm'].elements['submit'];
    	if (currentChatText.value != '' || focusState == 'active') {
    		oSubmit.disabled = false;
    	} else {
    		oSubmit.disabled = true;
    	}
    }
    
    function jal_getCookie(name) {
      var dc = document.cookie;
      var prefix = name + "=";
      var begin = dc.indexOf("; " + prefix);
      if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
      } else
        begin += 2;
      var end = document.cookie.indexOf(";", begin);
      if (end == -1)
        end = dc.length;
      return unescape(dc.substring(begin + prefix.length, end));
    }
    
    
    //autoasigns a random name to a new user
    //If the user has chosen a name, use that
    function checkName() {
    	
    	jalCookie = jal_getCookie("jalUserName");
    	currentName = document.getElementById('shoutboxname');
    		
    	if (currentName.value != jalCookie) {
    		document.cookie = "jalUserName="+currentName.value+"; expires=<?php echo gmdate("D, d M Y H:i:s",time() + $offset)." UTC"; ?>;"
    	}
    		
    	if (jalCookie && currentName.value == '') {
    		currentName.value = jalCookie;
    		return;
    	}
    	
    	if (currentName.value == '') {
    		currentName.value = 'guest_'+ Math.floor(Math.random() * 10000);
    	}
    	
    }
    
    function checkUrl() {
    	
    	jalCookie = jal_getCookie("jalUrl");
    	currentName = document.getElementById('shoutboxurl');
    
    	if (currentName.value == '')
    		return;
    		
    	if (currentName.value != jalCookie) {
    		document.cookie = "jalUrl="+currentName.value+"; expires=<?php echo gmdate("D, d M Y H:i:s",time() + $offset)." UTC"; ?>;"
    		return;
    	}
    		
    	if (jalCookie && ( currentName.value == '' || currentName.value == "http://")) {
    		currentName.value = jalCookie;
    		return;
    	}		
    }
    
    
    //initiates the XMLHttpRequest object
    //as found here: http://www.webpasties.com/xmlHttpRequest
    function getHTTPObject() {
      var xmlhttp;
      /*@cc_on
      @if (@_jscript_version >= 5)
        try {
          xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
          try {
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
          } catch (E) {
            xmlhttp = false;
          }
        }
      @else
      xmlhttp = false;
      @end @*/
      if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
        try {
          xmlhttp = new XMLHttpRequest();
        } catch (e) {
          xmlhttp = false;
        }
      }
      return xmlhttp;
    }

    ecco l'ultimo dei 3 files.... si kiama wordspew.php è il nome dello script anke....


    codice:
    <?php
    /*
    Plugin Name: Jalenack's Wordspew
    Plugin URI: http://blog.jalenack.com/ajax/
    Description: A plugin that creates a live shoutbox, using AJAX as a backend. Users can chat freely from your blog without refreshing the page! It uses the Fade Anything Technique for extra glamour
    Author: Andrew Sutherland
    Version: 1.16
    Author URI: http://blog.jalenack.com
    */
    
    // Version of this plugin. Not very useful for you, but for the dev
    $jal_version = "1.16";
    
    // The required user level needed to access the admin page for this plugin
    $jal_admin_user_level = 8;
    
    // The number of comments that should show up in one viewing.
    $jal_number_of_comments = 35;
    
    /*
    ==================// Important Info //=======================================
    
    This file is called in three different places. First, it is called by Wordpress
    so that it can display the jal_get_shoutbox function.
    
    Secondly, it is called by javascript. Because it is called by javascript and not by wordpress,
    normal plugin procedure won't work without directly calling the wp-config file in your root
    directory. We cannot use the $wpdb object. So instead, we open up the config file, comment out
    the bit about calling the rest of Wordpress, and then evaluate the config file to extract how to 
    access the database. We do all this so that the entirety of Wordpress is not loaded by each call
    to the server, which would put great unneccessary load on the server and conflict with other plugins.
    
    To differentiate between the two remote calls, I've used the $jalGetChat and $jalSendChat variables.
    These two variables are sent by the javascript file as "yes". That way, the script will only perform
    certain actions if it is called by the javascript file.
    
    Thirdly, it is called by the wordpress admin panel, which allows users to edit settings for this plugin
    
    ==================// End of Info //==========================================
    */
    
    // Register globals - Thanks Karan et Etienne
    $jal_lastID    = isset($_GET['jal_lastID']) ? $_GET['jal_lastID'] : "";
    $jal_user_name = isset($_POST['n']) ? $_POST['n'] : ""; 
    $jal_user_url  = isset($_POST['u']) ? $_POST['u'] : "";
    $jal_user_text = isset($_POST['c']) ? $_POST['c'] : "";
    $jalGetChat    = isset($_GET['jalGetChat']) ? $_GET['jalGetChat'] : "";
    $jalSendChat   = isset($_GET['jalSendChat']) ? $_GET['jalSendChat'] : "";
    
    function jal_install_shout () {
    	global $table_prefix, $wpdb, $user_level, $jal_admin_user_level;
    	
        get_currentuserinfo();
        if ($user_level < $jal_admin_user_level) return; 
    	
      	$result = mysql_list_tables(DB_NAME);
      	$tables = array();
    
      	while ($row = mysql_fetch_row($result)) { $tables[] = $row[0]; }
      
        if (!in_array($table_prefix."liveshoutbox", $tables)) {
        	$first_install = "yes";
        }
    
    	require_once(ABSPATH . 'wp-admin/upgrade-functions.php');
    	
    	dbDelta("CREATE TABLE ".$table_prefix."liveshoutbox (
    		     id mediumint(7) NOT NULL AUTO_INCREMENT,
    		     time bigint(11) DEFAULT '0' NOT NULL,
    		     name tinytext NOT NULL,
    		     text text NOT NULL,
    		     url text NOT NULL,
    		     UNIQUE KEY id (id)
    		    );");
    		
    	if ($first_install == "yes") {
    		
    		$welcome_name = "Jalenack";
    		$welcome_text = "Congratulations, you just completed the installation of this shoutbox.";
    	
    		$wpdb->query("INSERT INTO ".$table_prefix."liveshoutbox (time,name,text) VALUES ('".time()."','".$welcome_name."','".$welcome_text."')");
    		
    		// Default shoutbox color config
    		add_option('shoutbox_fade_from', "666666");
    		add_option('shoutbox_fade_to', "FFFFFF");
    		add_option('shoutbox_update_seconds', 4000);
    		add_option('shoutbox_fade_length', 1500);
    		add_option('shoutbox_text_color', "333333");
    		add_option('shoutbox_name_color', "0066CC");
    		add_option('shoutbox_regisitered_only', '0');
    	}
    }
    
    if (isset($_GET['activate']) && $_GET['activate'] == 'true') {
    	add_action('init', 'jal_install_shout');
    }
    
    
    // function to print the external javascript and css links
    function jal_add_to_head () {
        global $jal_version;
      
          //$jal_wp_url = (dirname($_SERVER['PHP_SELF']) == "/") ? "/" : dirname($_SERVER['PHP_SELF']) . "/";
          $jal_wp_url = get_bloginfo('wpurl') . "/";
        
        echo '
        
        <link rel="stylesheet" href="'.$jal_wp_url.'wp-content/plugins/wordspew/css.php" type="text/css" />
        <script type="text/javascript" src="'.$jal_wp_url.'wp-content/plugins/wordspew/fatAjax.php"></script>
    		';
    }
    
    // In the administration page, add some style...
    function jal_add_to_admin_head () {
    ?>
    <style type="text/css">
    
    /* Styles added by Wordspew shoutbox plugin */
    
    input[name=jal_delete]:hover, #jal_truncate_all:hover {
    background: #c22;
    color: #fff;
    cursor: pointer;
    }
    
    input[name=jal_edit]:hover {
    background: #2c2;
    color: #fff;
    cursor: pointer;
    }
    
    #shoutbox_options p {
    text-indent: 15px;
    padding: 5px 0;
    color: #555;
    }
    
    #shoutbox_options span {
    border: 1px dotted #ccc;
    padding: 4px 14px;
    }
    </style>
    
    <?php
    }
    	
    // HTML printed to the admin panel
    function jal_shoutbox_admin () { 
    	global $jal_admin_user_level, $wpdb, $user_level, $table_prefix, $jal_number_of_comments;
    	get_currentuserinfo(); // Gets logged in user.
    	
    	// If user is not allowed to use the admin page
    	if ($user_level < $jal_admin_user_level) { 
    		echo '<div class="wrap"><h2>No Access for you!</h2></div>';
    	} else {
     ?>
     		<?php if (isset($_GET['jal_delete'])) { ?>
                <div class="updated">
                    
    
    The comment was deleted successfully.</p>
                </div>
    		<?php } if (isset($_GET['jal_edit'])) { ?>
                <div class="updated">
                    
    
    The comment was edited successfully.</p>
                </div>
    		<?php } if (isset($_GET['jal_truncate'])) { ?>
                <div class="updated">
                    
    
    The shoutbox database has been wiped. You now have a fresh slate!</p>
                </div>
    		<?php } ?>
    		
    	<div class="wrap">
    		<h2>Jalenack's Live Shoutbox</h2>
    
    		
    
    When you update the Times and Colors, you may need to refresh/empty cache before you see the changes take effect</p>
    		
    
    There have been <?php
    		 $results = $wpdb->get_var("SELECT id FROM ".$table_prefix."liveshoutbox ORDER BY id DESC LIMIT 1");
    		 echo $results; ?> messages in this shoutbox
    		<form name="shoutbox_options" action="" method="get" id="shoutbox_options"> 
      			<fieldset> 
      				<legend>Colors (Must be 6 digit hex)</legend>
      				<input type="hidden" name="page" value="wordspew" />
      				Fade from: #<input type="text" maxlength="6" name="fade_from" value="<?php echo get_option('shoutbox_fade_from'); ?>" size="6" /> <span style="background: #<?php echo get_option('shoutbox_fade_from'); ?>;"></span>
      				
    
    The color that new messages fade in from. Default: <span style="color: #666">666666</span></p>
      				Fade to: #<input type="text" maxlength="6" name="fade_to" value="<?php echo get_option('shoutbox_fade_to'); ?>" size="6" /> <span style="background: #<?php echo get_option('shoutbox_fade_to'); ?>;"></span>
    				
    
    Also used as the background color of the box. Default: FFFFFF (white)</p>
      				Text Color: #<input type="text" maxlength="6" name="text_color" value="<?php echo get_option('shoutbox_text_color'); ?>" size="6" /> <span style="background: #<?php echo get_option('shoutbox_text_color'); ?>;"></span>
    				
    
    The color of text within the box. Default: <span style="color: #333">333333</span></p>
    				Name Color: #<input type="text" maxlength="6" name="name_color" value="<?php echo get_option('shoutbox_name_color'); ?>" size="6" /> <span style="background: #<?php echo get_option('shoutbox_name_color'); ?>;"></span>
    				
    
    The color of peoples' names. Default: <span style="color: #06c">0066CC</span></p>
    
      			</fieldset>

  4. #4
    Utente di HTML.it
    Registrato dal
    Jan 2006
    Messaggi
    157
    (fa ancora parte dello script precedente)
    codice:
      			<fieldset> 
      				<legend>Other</legend>
      				Update Every: <input type="text" maxlength="3" name="update_seconds" value="<?php echo get_option('shoutbox_update_seconds') / 1000; ?>" size="2" /> Seconds 
    
      					
    
    This determines how "live" the shoutbox is. With a bigger number, it will take more time for messages to show up, but also decrease the server load. You may use decimals. This number is used as the base for the first 8 javascript loads. After that, the number gets successively bigger. Adding a new comment or mousing over the shoutbox will reset the interval to the number suplied above. Default: 4 Seconds</p>
      				Fade Length: <input type="text" maxlength="3" name="fade_length" value="<?php echo get_option('shoutbox_fade_length') / 1000; ?>" size="2" /> Seconds 
    
    					
    
    The amount of time it takes for the fader to completely blend with the background color. You may use decimals. Default 1.5 seconds</p>
                Use textarea: <input type="checkbox" name="use_textarea" <?php if(get_option('shoutbox_use_textarea') == 'true') { echo 'checked="checked" '; } ?>/>
                   
    
    A textarea is a bigger type of input box. Users will have more room to type their comments, but it will take up more space.</p>
                Use URL field: <input type="checkbox" name="use_url" <?php if(get_option('shoutbox_use_url') == 'true') echo 'checked="checked" '; ?>/>
                   
    
    Check this if you want users to have an option to add their URL when submitting a message.</p>
    				Only allow registered users: <input type="checkbox" name="registered_only" <?php if(get_option('shoutbox_registered_only') == '1') echo 'checked="checked" '; ?>/>
      					
    
    This will only let your registered users use the form that allows one to type messages. Users who are NOT logged in will be able to watch the chat and a message saying they must be logged in to comment. Note: this is not completely "secure" .. If someone REALLY wanted to, they could write a script that interacts directly with the message receiving file. They'd have to know what they're doing and it would be quite pointless.</p>
    </fieldset>
    
      						 
      			<input type="submit" name="jal_admin_options" value="Save" class="button" style="font-size: 140%"  />
    
    
      			<input type="submit" name="jal_truncate" id="jal_truncate_all" onclick="return confirm('You are about to delete ALL messages in the shoutbox. It will completely erase all messages. Are you sure you want to do this?');" value="Delete ALL messages" />
    
    
    		</form>
      			
      			<fieldset> 
      				<legend>Data (showing the last <?php echo $jal_number_of_comments; ?> messages)</legend>
      				
    
    Reminder: You MUST have at LEAST one comment in your shoutbox at all times. This is not live. New comments made while viewing this page will not magically appear like they do in the real thing.</p>
    				
    				<?php
     						$results = $wpdb->get_results("SELECT * FROM ".$table_prefix."liveshoutbox ORDER BY id DESC LIMIT ". $jal_number_of_comments);
     						if (!$results) { echo "You must have at least 1 message in your shoutbox at all times!
     Go to your shoutbox and add a messages."; } else {
     						$jal_first_time = "yes"; // Will only add the last message div if it is looping for the first time
    						foreach( $results as $r ) { // Loops the messages into a list
    							
    							$url = (empty($r->url) && $r->url = "http://") ? $r->name : ''.$r->name.'';
    
    							if ($jal_first_time == "yes") {	echo '<div id="lastMessage"><span>Last Message</span> <em id="responseTime">'.jal_time_since( $r->time ).' ago[/i]</div>
     						<ul id="outputList">
     						'; }
    						        echo '[*]<form name="shoutbox_options" action="" method="get"><span>'.stripslashes($url).' : </span><input type="text" name="jal_text" value="'.stripslashes($r->text).'" size="60" />
    						        <input type="hidden" name="page" value="wordspew" />
    						        <input type="hidden" name="jal_comment_id" value="'.$r->id.'" />
    						        <input type="submit" name="jal_delete" value="Delete" />
    						        <input type="submit" name="jal_edit" value="Edit" /></form>
    
    						        '; 
    					$jal_first_time = "0";	} }
    				?>
    				[/list]
    
    
      			</fieldset>
    	</div>
    
    <?php } }
    
    // To add administration page under Management Section
    function shoutbox_admin_page() {
    	global $jal_admin_user_level;
    	add_management_page('Shoutbox Management', 'Live Shoutbox', $jal_admin_user_level, "wordspew", 'jal_shoutbox_admin');
    }
    
    // Time Since function courtesy 
    // http://blog.natbat.co.uk/archive/200...jal_time_since
    
    // Works out the time since the entry post, takes a an argument in unix time (seconds)
    function jal_time_since($original) {
        // array of time period chunks
        $chunks = array(
            array(60 * 60 * 24 * 365 , 'year'),
            array(60 * 60 * 24 * 30 , 'month'),
            array(60 * 60 * 24 * 7, 'week'),
            array(60 * 60 * 24 , 'day'),
            array(60 * 60 , 'hour'),
            array(60 , 'minute'),
        );
        $original = $original - 10; // Shaves a second, eliminates a bug where $time and $original match.
        $today = time(); /* Current unix time  */
        $since = $today - $original;
        
        // $j saves performing the count function each time around the loop
        for ($i = 0, $j = count($chunks); $i < $j; $i++) {
            
            $seconds = $chunks[$i][0];
            $name = $chunks[$i][1];
            
            // finding the biggest chunk (if the chunk fits, break)
            if (($count = floor($since / $seconds)) != 0) {
                break;
            }
        }
        
        $print = ($count == 1) ? '1 '.$name : "$count {$name}s";
        
        if ($i + 1 < $j) {
            // now getting the second item
            $seconds2 = $chunks[$i + 1][0];
            $name2 = $chunks[$i + 1][1];
            
            // add second item if it's greater than 0
            if (($count2 = floor(($since - ($seconds * $count)) / $seconds2)) != 0) {
                $print .= ($count2 == 1) ? ', 1 '.$name2 : ", $count2 {$name2}s";
            }
        }
        return $print;
    }
    
    ////////////////////////////////////////////////////////////
    // Functions Below are for getting comments from the database
    ////////////////////////////////////////////////////////////
    
    // Never cache this page
    if ($jalGetChat == "yes" || $jalSendChat == "yes") {
    	header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); 
    	header( "Last-Modified: ".gmdate( "D, d M Y H:i:s" )."GMT" ); 
    	header( "Cache-Control: no-cache, must-revalidate" ); 
    	header( "Pragma: no-cache" );
    	header("Content-Type: text/html; charset=utf-8");
    	
    	//if the request does not provide the id of the last know message the id is set to 0
    	if (!$jal_lastID) $jal_lastID = 0;
    }
    
    // retrieves all messages with an id greater than $jal_lastID
    if ($jalGetChat == "yes") {
    	jal_getData($jal_lastID);
    }
    
    // Where the shoutbox receives information
    function jal_getData ($jal_lastID) {
    
    	$html = implode('', file("../../../wp-config.php"));
    	$html = str_replace ("require_once", "// ", $html);
    	$html = str_replace ("<?php", "", $html);
    	eval($html);
    	$conn = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
    	mysql_select_db(DB_NAME, $conn);
    
    	$sql = "SELECT * FROM ".$table_prefix."liveshoutbox WHERE id > ".$jal_lastID." ORDER BY id DESC";
    	$results = mysql_query($sql, $conn);
    	$loop = "";
    	while ($row = mysql_fetch_array($results)) {
    
    		$id   = $row[0];
    		$time = $row[1];
    		$name = $row[2];
    		$text = $row[3];
    		$url  = $row[4];
    		
    		// append the new id's to the beginning of $loop
    		$loop = $id."---".stripslashes($name)."---".stripslashes($text)."---".jal_time_since($time)." ago---".stripslashes($url)."---" . $loop; // --- is being used to separate the fields in the output
    	}
    	echo $loop;
    	
    	// if there's no new data, send one byte. Fixes a bug where safari gives up w/ no data
    	if (empty($loop)) { echo "0"; }
    }
    
    function jal_special_chars ($s) {
      $s = htmlspecialchars($s, ENT_COMPAT,'UTF-8');
      return str_replace("---","&minus;-&minus;",$s);
    }
    
    ////////////////////////////////////////////////////////////
    // Functions Below are for submitting comments to the database
    ////////////////////////////////////////////////////////////
    
    // When user submits and javascript fails
    if (isset($_POST['shout_no_js'])) {
    	if ($_POST['shoutboxname'] != '' && $_POST['chatbarText'] != '') {
    		jal_addData($_POST['shoutboxname'], $_POST['chatbarText'], $_POST['shoutboxurl']);
    		
    		jal_deleteOld(); //some database maintenance
        	
        	setcookie("jalUserName",$_POST['shoutboxname'],time()+60*60*24*30*3,'/');
        	setcookie("jalUrl",$_POST['shoutboxurl'],time()+60*60*24*30*3,'/');
            //take them right back where they left off
    		header('location: '.$_SERVER['HTTP_REFERER']);
    	} else echo "You must have a name and a comment";
    }
    
    	//only if a name and a message have been provides the information is added to the db
    if ($jal_user_name != '' && $jal_user_text != '' && $jalSendChat == "yes") {
    		jal_addData($jal_user_name,$jal_user_text,$jal_user_url); //adds new data to the database
    		jal_deleteOld(); //some database maintenance
    		echo "0";
    }
    
    function jal_addData($jal_user_name,$jal_user_text,$jal_user_url) {
    	//the message is cut of after 500 letters
    	$jal_user_text = substr($jal_user_text,0,500); 
    	
    	$jal_user_name = substr(trim($jal_user_name), 0,18);
    
    ///// The code below can mess up multibyte strings
    
    // If there isn't a url, truncate the words to 25 chars each
    //	if (!preg_match("`(http|ftp)+(s)?:(//)((\w|\.|\-|_)+)(/)?(\S+)?`i", $jal_user_text, $matches))
    //		$jal_user_text = preg_replace("/([^\s]{25})/","$1 ",$jal_user_text);
    
    
    	// CENSORS .. default is off. To turn it on, uncomment the line below. Add new lines with new censors as needed.	
    	//$jal_user_text = str_replace("fuck", "****", $jal_user_text);
    
    	$jal_user_text = jal_special_chars(trim($jal_user_text));
    	$jal_user_name = (empty($jal_user_name)) ? "Anonymous" : jal_special_chars($jal_user_name);
    	$jal_user_url = ($jal_user_url == "http://") ? "" : jal_special_chars($jal_user_url);
    
    	$html = implode('', file("../../../wp-config.php"));
    	$html = str_replace ("require_once", "// ", $html);
    	$html = str_replace ("<?php", "", $html);
    	eval($html);
    	$conn = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
    	mysql_select_db(DB_NAME, $conn);
    	
    	mysql_query("INSERT INTO ".$table_prefix."liveshoutbox (time,name,text,url) VALUES ('".time()."','".mysql_real_escape_string($jal_user_name)."','".mysql_real_escape_string($jal_user_text)."','".mysql_real_escape_string($jal_user_url)."')", $conn);
    }
    
    //Maintains the database by deleting past comments
    function jal_deleteOld() {
    	global $jal_number_of_comments;
    
    	$html = implode('', file("../../../wp-config.php"));
    	$html = str_replace ("require_once", "// ", $html);
    	$html = str_replace ("<?php", "", $html);
    	eval($html);
    	$conn = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
    	mysql_select_db(DB_NAME, $conn);
    
    	$results = mysql_query("SELECT * FROM ".$table_prefix."liveshoutbox ORDER BY id DESC LIMIT ".$jal_number_of_comments, $conn);	
    
    	while ($row = mysql_fetch_array($results)) { $id = $row[0]; }
    	
    	if ($id) mysql_query("DELETE FROM ".$table_prefix."liveshoutbox WHERE id < ".$id, $conn);
    
    }
    
    // Prints the html structure for the shoutbox
    	function jal_get_shoutbox () {
    	global $wpdb, $table_prefix, $jal_number_of_comments;
    ?>
                <div id="wordspew">
    				<div id="chatoutput">

  5. #5
    Utente di HTML.it
    Registrato dal
    Jan 2006
    Messaggi
    157
    (fa ancora parte dello script precedente.... meno male kuesta è l'ultima pagina....)
    codice:
    					
    <?php
    								 								
     								$wpdb->hide_errors();
    								$results = $wpdb->get_results("SELECT * FROM ".$table_prefix."liveshoutbox ORDER BY id DESC LIMIT ".$jal_number_of_comments);
    								$wpdb->show_errors();
    								
    								// Will only add the last message div if it is looping for the first time
    								$jal_first_time = true; 
    								
    								// Loops the messages into a list
    								if($results) {foreach( $results as $r ) { 
    								
    								// Add links								
    								$r->text = preg_replace( "`(http|ftp)+(s)?:(//)((\w|\.|\-|_)+)(/)?(\S+)?`i", "<a href=\"\\0\">&laquo;link&raquo;</a>", $r->text);
    
    								if ($jal_first_time == true) { echo '<div id="lastMessage"><span>'.__("Latest Message").'</span> <em id="responseTime">'.jal_time_since( $r->time ).' ago[/i]</div>
     						<ul id="outputList">
     						'; }
     						
     						if ($jal_first_time == true) $lastID = $r->id;
     						
     						$url = (empty($r->url) && $r->url = "http://") ? $r->name : ''.$r->name.'';
     						 						
    						        echo '[*]<span title="'.jal_time_since( $r->time ).'">'.stripslashes($url).' : </span>'.convert_smilies(" ".stripslashes($r->text)).'
    						        '; 
    						        
    					$jal_first_time = false; } 
    					
    					// If there is less than one entry in the box
    					} else {
    					echo "You need at least one entry in your shoutbox! Just type in a message now and reload, then you should be fine.";
    					}
    					
    					$use_url = (get_option('shoutbox_use_url') == "true") ? TRUE : FALSE;
    					$use_textarea = (get_option('shoutbox_use_textarea') == "true") ? TRUE : FALSE;
    					$registered_only = (get_option('shoutbox_registered_only') == "1") ? TRUE : FALSE;
    					
    					global $user_level, $user_nickname, $user_url, $user_ID, $jal_admin_user_level;
    					get_currentuserinfo(); // Gets logged in user.
    
    				?>[/list]
    
    				</div>
    		<?php if (!$registered_only || ($registered_only && $user_ID)) { ?>
    				<form id="chatForm" method="post" action="<?php bloginfo('wpurl'); ?>/wp-content/plugins/wordspew/wordspew.php">
    				    
    
    <?php
    					
    					if ($user_level >= $jal_admin_user_level) { // If user is allowed to use the admin page
    						echo ''.__('Admin').'';
    					} 
    					if (!empty($user_nickname)) { /* If they are logged in, then print their nickname */ ?>
    						
    					<label><?php _e('Name'); ?>: <?php echo $user_nickname ?></label>
    					
    					<input type="hidden" name="shoutboxname" id="shoutboxname" value="<?php echo $user_nickname; ?>" />
    					<input type="hidden" name="shoutboxurl" id="shoutboxurl" value="<?php if($use_url) { echo $user_url; } ?>" />
    					<?php } else { echo "\n"; /* Otherwise allow the user to pick their own name */ ?>
    					<label for="shoutboxname"><?php _e('Name'); ?>:</label>
    					<input type="text" name="shoutboxname" id="shoutboxname" value="<?php if ($_COOKIE['jalUserName']) { echo $_COOKIE['jalUserName']; } ?>" />
    					<?php if (!$use_url) { echo '<span style="display: none">'; } ?>
    					<label for="shoutboxurl"><?php _e('URL'); ?>:</label>
    					<input type="text" name="shoutboxurl" id="shoutboxurl" value="<?php if ($_COOKIE['jalUrl']) { echo $_COOKIE['jalUrl']; } else { echo 'http://'; } ?>" />
    					<?php if (!$use_url) { echo "</span>"; } ?>
    					<?php  } echo "\n"; ?>
    					<label for="chatbarText"><?php _e('Message') ?>:</label>
    					<?php if ($use_textarea) { ?>
    					<textarea rows="4" cols="16" name="chatbarText" id="chatbarText" onkeypress="return pressedEnter(this,event);"></textarea>
    					<?php } else { ?>
    					<input type="text" name="chatbarText" id="chatbarText" />
    					<?php } ?>
    					<input type="hidden" id="jal_lastID" value="<?php echo $lastID + 1; ?>" name="jal_lastID" />
    					<input type="hidden" name="shout_no_js" value="true" />
    					<input type="submit" id="submitchat" name="submit" value="<?php _e('Invia'); ?>" />
    					</p>
    				</form>
    		<?php } else echo "
    
    You must be a registered user to participate in this chat</p>"; ?>
                </div>
    <?php }
    
    function jal_admin_options() {
        global $wpdb, $table_prefix, $user_level, $jal_admin_user_level;
        
        // Security
        get_currentuserinfo();
        if ($user_level <  $jal_admin_user_level)
            die('Nice try, you cheeky monkey!');
    
    	// Convert from milliseconds
    	$fade_length = $_GET['fade_length'] * 1000;
    	$update_seconds = $_GET['update_seconds'] * 1000;
    
    	// Update choices from admin panel
    	update_option('shoutbox_fade_from', $_GET['fade_from']);
    	update_option('shoutbox_fade_to', $_GET['fade_to']);
    	update_option('shoutbox_update_seconds', $update_seconds);
    	update_option('shoutbox_fade_length', $fade_length);
    	update_option('shoutbox_text_color', $_GET['text_color']);
    	update_option('shoutbox_name_color', $_GET['name_color']);
    	
    	$use_url = ($_GET['use_url']) ? "true" : "";
    	$use_textarea = ($_GET['use_textarea']) ? "true" : "";
    	$registered_only = ($_GET['registered_only']) ? "1" : "0";
    
    	update_option('shoutbox_use_url', $use_url);
    	update_option('shoutbox_use_textarea', $use_textarea);
    	update_option('shoutbox_registered_only', $registered_only);
    
    }
    
    function jal_shout_edit() {
        global $wpdb, $table_prefix, $user_level, $jal_admin_user_level;
        
        // Security
        get_currentuserinfo();
        if ($user_level <  $jal_admin_user_level)
            die('Nice try, you cheeky monkey!');
    
    	$wpdb->query("UPDATE ".$table_prefix."liveshoutbox SET text = '".$wpdb->escape($_GET['jal_text'])."' WHERE id = ".$wpdb->escape($_GET['jal_comment_id']));
    }
    
    function jal_shout_delete() {
        global $wpdb, $table_prefix, $user_level, $jal_admin_user_level;
        
        // Security
        get_currentuserinfo();
        if ($user_level <  $jal_admin_user_level)
            die('Nice try, you cheeky monkey!');
    
    	$wpdb->query("DELETE FROM ".$table_prefix."liveshoutbox WHERE id = ".$wpdb->escape($_GET['jal_comment_id']));
    }
    
    function jal_shout_truncate() {
        global $wpdb, $table_prefix, $user_level, $jal_admin_user_level;
        
        // Security
        get_currentuserinfo();
        if ($user_level <  $jal_admin_user_level)
            die('Nice try, you cheeky monkey!');
    
    	$wpdb->query("TRUNCATE TABLE ".$table_prefix."liveshoutbox");
    			
       $welcome_name = "Jalenack";
       $welcome_text = "Your shoutbox is blank. Add a message!";
    
    	$wpdb->query("INSERT INTO ".$table_prefix."liveshoutbox (time,name,text) VALUES ('".time()."','".$welcome_name."','".$welcome_text."')");
    }
    
    // If user has updated the admin panel
    if (isset($_GET['jal_admin_options']))
        add_action('init', 'jal_admin_options');
    
    // If someone has deleted an entry through the admin panel
    if (isset($_GET['jal_delete']))
        add_action('init', 'jal_shout_delete');
    
    // If someone has edited an entry through the admin panel
    if (isset($_GET['jal_edit']))
        add_action('init', 'jal_shout_edit');
    
    // If someone has clicked the "delete all" button
    if (isset($_GET['jal_truncate']))
        add_action('init', 'jal_shout_truncate');
    
    // Print to the <script> and <link> (for css) to the head of the document
    // And adds the admin menu
    if (function_exists('add_action')) {
    	add_action('wp_head', 'jal_add_to_head');
    	add_action('admin_menu', 'shoutbox_admin_page');
    	if (strstr($_SERVER['REQUEST_URI'], 'wordspew'))
    	   add_action('admin_head', 'jal_add_to_admin_head');
    } ?>
    grazie mille per la disponibilità! ciaoooooo!!

    -Seso7-™

  6. #6
    Utente di HTML.it L'avatar di pgm
    Registrato dal
    Apr 2002
    Messaggi
    1,281


    un poco lunghino. che dici?

  7. #7
    Utente di HTML.it
    Registrato dal
    Jan 2006
    Messaggi
    157
    un pokino tanto lungo.... però nn conoscendo il php nn so dv mettere le mani.... pensavo ke a un esperto basta capire di ke si sta parlando e poi lui mi dice ke mettere e in kuale dei 2 mettere!!
    senno se cìè da studiarlo tt è cm

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.