Exemple #1
0
}
//////////////////////////////////////////////////////
// Functions Below are for submitting comments to the database
//////////////////////////////////////////////////////
// When user submits and javascript fails
if (isset($_POST['shout_no_js'])) {
    $myURL = isset($_POST['shoutboxU']) ? $_POST['shoutboxU'] : "";
    if ($_POST['shoutboxname'] != '' && $_POST['chatbarText'] != '') {
        jal_addData($_POST['shoutboxname'], $_POST['chatbarText'], $myURL);
    } 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
    echo "0";
}
if ($delID != '' && $mode == "del") {
    del($delID);
    //delete data from the database
    echo "0";
}
function mySplit($captures)
{
    // si url ou email, on passe...
    if (preg_match('#^(?:(?:http|ftp)s?://|[-_a-z0-9]+(?:\\.[-_a-z0-9]+)*@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]{2,6})#i', $captures[0])) {
        $return = $captures[0];
    } else {
        $splited = preg_replace("/([^\\s]{" . split . "})/iu", "\$1 ", $captures[0]);
Exemple #2
0
}

//////////////////////////////////////////////////////
// Functions Below are for submitting comments to the database
//////////////////////////////////////////////////////
// When user submits and javascript fails
if (isset($_POST['shout_no_js'])) {
	$myURL = isset($_POST['shoutboxU']) ? $_POST['shoutboxU'] : ""; 
	if ($_POST['shoutboxname'] != '' && $_POST['chatbarText'] != '')
		jal_addData($_POST['shoutboxname'], $_POST['chatbarText'], $myURL);
	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
	echo "0";
}

function mySplit ($captures){
	// si url ou email, on passe...
	if(preg_match('#^(?:(?:http|ftp)s?://|[-_a-z0-9]+(?:\.[-_a-z0-9]+)*@[-a-z0-9]+(?:\.[-a-z0-9]+)*\.[a-z]{2,6})#i',$captures[0])) {
		$return = $captures[0];
	}
	else {
		$splited = preg_replace("/([^\s]{".split."})/iu","$1 ",$captures[0]);
		$return = trim($splited);
	}
	return $return;
}