Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Kaip pridėti ikoną prie nick'o
Parašė bobalt· 2010 Rugp. 12 15:08:06
#1
Kaip reikia padaryti, kad prie tam tikroje grupėje esančio nario vardo šaukykloje, rodytų tam tikrą paveikslėlį?
Šaukyklos kodas:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: shoutbox_panel.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
|
| & ported from SEVEN to SIX by Die
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
$l_codetitle = 'Rėkykla:';
$l_codebox = 'Āāåäčņå źīä:';
define('SHOUT_PANEL_NAME','shoutbox_panel_tmod');
$loc_edit = '<img border="0" alt="Edit!" title="Edit!" src="'.INFUSIONS.SHOUT_PANEL_NAME.'/images/edit.png">';
$loc_del = '<img border="0" alt="Delete!" title="Delete!" src="'.INFUSIONS.SHOUT_PANEL_NAME.'/images/delete.png">';
$overflow_h = false; //scroll bar
$over_h = 350 ;//used ONLY if ovwerflow true!
include_once(INFUSIONS.SHOUT_PANEL_NAME.'/shoutb_bbcode.php');
// Show smiley icons in comments, forum and other post pages
function displaysmileysS($textarea) {
$smiles = "";
$smileys = array (
":)" => "smile.png",
";)" => "wink.png",
":|" => "Supershock.png",
":(" => "Sad.png",
":o" => "Surprised.png",
":D" => "Laugh.png",
":@" => "angry.png",
":P" => "Teasing.png"
);
foreach($smileys as $key=>$smiley) $smiles .= "<img style='cursor:pointer;cursor:hand;' src='".IMAGES."smiley/$smiley' alt='SmileY' onClick=\"insertTextAS('$textarea', '$key','chatform');\">\n";
return $smiles;
}
echo '<script type="text/javascript" src="'.INFUSIONS.SHOUT_PANEL_NAME.'/sb_p_script.js"></script>';
//start of 7 code
$link = FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "");
$link = preg_replace("^(&|\?)s_action=(edit|delete)&shout_id=\d*^", "", $link);
$sep = stristr($link, "?") ? "&" : "?";
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == 'delete') && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
if ((iADMIN && checkrights("S")) || (iMEMBER && dbcount("(shout_id)", 'shoutbox', "shout_id='".$_GET['shout_id']."' AND shout_name='".$userdata['user_id']."'"))) {
$result = dbquery("DELETE FROM ".DB_PREFIX."shoutbox WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
}
redirect($link);
}
function sbwrap($text) {
$i = 0; $tags = 0; $chars = 0; $res = "";
$str_len = strlen($text);
for ($i = 0; $i < $str_len; $i++) {
$chr = substr($text, $i, 1);
if ($chr == "<") {
if (substr($text, ($i + 1), 6) == "a href" || substr($text, ($i + 1), 3) == "img") {
$chr = " ".$chr;
$chars = 0;
}
$tags++;
} elseif ($chr == "&") {
if (substr($text, ($i + 1), 5) == "quot;") {
$chars = $chars - 5;
} elseif (substr($text, ($i + 1), 4) == "amp;" || substr($text, ($i + 1), 4) == "#39;" || substr($text, ($i + 1), 4) == "#92;") {
$chars = $chars - 4;
} elseif (substr($text, ($i + 1), 3) == "lt;" || substr($text, ($i + 1), 3) == "gt;") {
$chars = $chars - 3;
}
} elseif ($chr == ">") {
$tags--;
} elseif ($chr == " ") {
$chars = 0;
} elseif (!$tags) {
$chars++;
}
if (!$tags && $chars == 18) {
$chr .= "<br />";
$chars = 0;
}
$res .= $chr;
}
return $res;
}
openside($locale['120']);
if (iMEMBER || $settings['guestposts'] == "1") {
if (isset($_POST['post_shout'])) {
$flood = false;
if (iMEMBER) {
$shout_name = $userdata['user_id'];
} elseif ($settings['guestposts'] == "1") {
$shout_name = trim(stripinput($_POST['shout_name']));
$shout_name = preg_replace("(^[0-9]*)", "", $shout_name);
if (isnum($shout_name)) { $shout_name = ""; }
/*include_once INCLUDES."securimage/securimage.php";
$securimage = new Securimage();
if (!isset($_POST['sb_captcha_code']) || $securimage->check($_POST['sb_captcha_code']) == false) { redirect($link); }*/
if (!check_captcha($_POST['captcha_encode'], $_POST['captcha_code'])) {
redirect($link);
exit;
}
}
$shout_message = str_replace("\n", " ", $_POST['shout_message']);
$shout_message = preg_replace("/^(.{255}).*$/", "$1", $shout_message);
$shout_message = trim(stripinput(censorwords($shout_message)));
//pradedam boto koda
$h = date("H", time());
if ($h > 00 && $h <= 05) {
$time = "Laba naktis";
$timemsg = "Ne laikas miegoti dar?";
} elseif ($h > 05 && $h <= 10) {
$time = "Labas rytas";
$timemsg = "Kaip miegojai?";
} elseif ($h > 10 && $h <= 18) {
$time = "Laba diena";
$timemsg = "Kaip einasi?";
} elseif ($h > 18 && $h <= 21) {
$time = "Labas vakaras";
$timemsg = "Kaip sekasi?";
} elseif ($h > 21 && $h <= 23) {
$time = "Laba naktis";
$timemsg = "Ne laikas miegoti dar?";
}
$msg = strtolower($_POST['shout_message']);
$msg = str_replace(array(":","<",">","@","#","$","%","^","&","*","(",")","_","=","+","/","-", "?", ",", "'", "`", "!", "."), "", $msg);
$msg = str_replace(array("ą", "č", "ę", "ė", "į", "š", "ų", "ū", "ž"), array("a", "c", "e", "e", "i", "s", "u", "u", "z"), $msg);
// klausimus rasom be zenklu, kurie yra $pakeisti array'uje
$QA = array (
"(.{0,10}(sveik|Sveik|laba|swx|svx|sveix).*[a-z,0-9]*\040(ro){0,1}bot.*|.{0,10}(ro){0,1}bot[a-z,0-9]*\040(sveik|Sveik|laba|swx|svx|sveix).*)" => "$time, $userdata[user_name]. $timemsg",
".{0,7}(norm|ger|nuosta|ideal).*[a-z,0-9]*\040(ro){0,1}bot.*" => "Nuostabu :D Džiaugiuosi dėl tavęs :)",
"(dux|duch|lox|loch|ble|nx|nach|nah|nax|pisk|cbb|bbd|debi|peder|pydar|rupus miltai|posimts pypkiu|paci|aš).*" => "<font style=\"color:red;\">".$userdata['user_name']."</font>, Nesikeik! :|",
".{0,10}(ro){0,1}bot[a-z,0-9]*\040(uzmu|nuzud|papj).*" => "Jau bėgu :D",
"[^[a-z,0-9]]*.*bot.*" => "Aš robotas :). Kas kvietėt?"
);
$rezas = false;
foreach ($QA as $q => $a) {
if (ereg($q, $msg)) {
$rezas = true;
$atsakymas = $a;
break;
}
}
//botas baigesi
//boto uzklausa
if ($rezas) $result = dbquery("INSERT INTO ".$db_prefix."shoutbox (shout_name, shout_message, shout_datestamp, shout_ip) VALUES ('Robotukas', '$atsakymas', '".(time() + 1)."', '0.0.0.0')");
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$comment_updated = false;
if ((iADMIN && checkrights("S")) || (iMEMBER && dbcount("(shout_id)", 'shoutbox', "shout_id='".$_GET['shout_id']."' AND shout_name='".$userdata['user_id']."'"))) {
if ($shout_message) {
$result = dbquery("UPDATE ".DB_PREFIX."shoutbox SET shout_message='$shout_message' WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
}
}
redirect($link);
} elseif ($shout_name && $shout_message) { //antiflood is ok
require_once INFUSIONS.SHOUT_PANEL_NAME.'/flood_include.php';
if (!flood_control('shout_datestamp', 'shoutbox', "shout_ip='".USER_IP."'")) {
$result = dbquery("INSERT INTO ".DB_PREFIX."shoutbox (shout_name, shout_message, shout_datestamp, shout_ip) VALUES ('$shout_name', '$shout_message', '".time()."', '".USER_IP."')");
}
}
redirect($link);
}
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$esresult = dbquery(
"SELECT ts.*, tu.user_id, tu.user_name FROM ".DB_PREFIX."shoutbox ts
LEFT JOIN ".DB_PREFIX."users tu ON ts.shout_name=tu.user_id
WHERE ts.shout_id='".$_GET['shout_id']."'"
);
if (dbrows($esresult)) {
$esdata = dbarray($esresult);
if ((iADMIN && checkrights("S")) || (iMEMBER && $esdata['shout_name'] == $userdata['user_id'] && isset($esdata['user_name']))) {
if ((isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$edit_url = $sep."s_action=edit&shout_id=".$esdata['shout_id'];
} else {
$edit_url = "";
}
$shout_link = $link.$edit_url;
$shout_message = $esdata['shout_message'];
}
} else {
$shout_link = $link;
$shout_message = "";
}
} else {
$shout_link = $link;
$shout_message = "";
}
echo "<a id='edit_shout' name='edit_shout'></a>\n";
//name?
echo "<form name='chatform' method='post' action='".$shout_link."'>\n";
if (iGUEST) {
echo $locale['121']."<br />\n";
echo "<input type='text' name='shout_name' value='' class='textbox' maxlength='30' style='width:140px' /><br />\n";
echo $locale['122']."<br />\n";
}
echo '<div id="shoutbox_smiles_link" style="text-align:center"><a class="border" href="#" onclick="shoutbox_smiles_block.style.display=\'block\';shoutbox_smiles_link.style.display=\'none\';return false;"> Šypsenos </a></div>
<div id="shoutbox_smiles_block" class="border" style="text-align:center;display: none;">'.displaysmileysS('shout_message').'</div>';
echo "<textarea name='shout_message' rows='4' cols='20' class='textbox' style='width:140px'>".$shout_message."</textarea><br />\n";
echo '
<input type="button" value="b" class="button" style="font-weight:bold;width:20px;" onClick=\'addTextAS("shout_message", "", "","chatform");\'>
<input type="button" value="i" class="button" style="font-style:italic;width:20px;" onClick=\'addTextAS("shout_message", "", "","chatform");\'>
<input type="button" value="u" class="button" style="text-decoration:underline;width:20px;" onClick=\'addTextAS("shout_message", "", "","chatform");\'>
<select name="bbcolor" class="textbox" style="width:70px;" onChange=\'addTextAS("shout_message", "[color=" + this.options[this.selectedIndex].value + "]", "[/color]","chatform");this.selectedIndex=0;\'>
<option value="">[none]</option>
<option value="black" style="background-color:black">Black</option>
<option value="white" style="background-color:white">White</option>
<option value="skyblue" style="background-color:skyblue">Skyblue</option>
<option value="royalblue" style="background-color:royalblue">Royalblue</option>
<option value="blue" style="background-color:blue">Blue</option>
<option value="darkblue" style="background-color:darkblue">Darkblue</option>
<option value="purple" style="background-color:purple">Purple</option>
<option value="orange" style="background-color:orange">Orange</option>
<option value="yellow" style="background-color:yellow">Yellow</option>
<option value="gold" style="background-color:gold">Gold</option>
<option value="tomato" style="background-color:tomato">Tomato</option>
<option value="coral" style="background-color:coral">Coral</option>
<option value="orangered" style="background-color:orangered">Orangered</option>
<option value="crimson" style="background-color:crimson">Crimson</option>
<option value="red" style="background-color:red">Red</option>
<option value="firebrick" style="background-color:firebrick">Firebrick</option>
<option value="darkred" style="background-color:darkred">Darkred</option>
<option value="green" style="background-color:green">Green</option>
<option value="limegreen" style="background-color:limegreen">Limegreen</option>
<option value="seagreen" style="background-color:seagreen">Seagreen</option>
<option value="deeppink" style="background-color:deeppink">Deeppink</option>
<option value="purple" style="background-color:purple">Purple</option>
<option value="indigo" style="background-color:indigo">Indigo</option>
<option value="burlywood" style="background-color:burlywood">Burlywood</option>
<option value="sandybrown" style="background-color:sandybrown">Sandybrown</option>
<option value="sienna" style="background-color:sienna">Sienna</option>
<option value="choclate" style="background-color:chocolate">Chocolate</option>
<option value="teal" style="background-color:teal">Teal</option>
<option value="silver" style="background-color:silver">Silver</option>
<option value="gray" style="background-color:gray">Gray</option>
</select>
<br>';
/*if (iGUEST) {
echo $locale['global_158']."<br />\n";
echo "<img id='sb_captcha' src='".INCLUDES."securimage/securimage_show.php' alt='' /><br />\n";
echo "<a href='".INCLUDES."securimage/securimage_play.php'><img src='".INCLUDES."securimage/images/audio_icon.gif' alt='' class='tbl-border' style='margin-bottom:1px' /></a>\n";
echo "<a href='#' onclick=\"document.getElementById('sb_captcha').src = '".INCLUDES."securimage/securimage_show.php?sid=' + Math.random(); return false\"><img src='".INCLUDES."securimage/images/refresh.gif' alt='' class='tbl-border' /></a><br />\n";
echo $locale['global_159']."<br />\n<input type='text' name='sb_captcha_code' class='textbox' style='width:100px' /><br />\n";
}*/
if(iGUEST) {
echo "<span style='color:#ff0000'>*</span> $l_codetitle<br /><div style='overflow:auto'>".make_captcha()."</div><br /><span style='color:#ff0000'>*</span> $l_codebox<br /><input type='text' name='captcha_code' class='textbox' style='width:100px'>";
}
echo "<br /><input type='submit' name='post_shout' value='".$locale['123']."' class='button' />\n";
echo "</form>\n<br />\n";
} else {
echo '<div class="quote" align="text-align:center">'.$locale['125'].'</div><br>';
}
$numrows = dbcount("(shout_id)", 'shoutbox');
$result = dbquery(
"SELECT ts.*, tu.user_id, tu.user_name,user_avatar FROM ".DB_PREFIX."shoutbox ts
LEFT JOIN ".DB_PREFIX."users tu ON ts.shout_name=tu.user_id
ORDER BY ts.shout_datestamp DESC LIMIT 0,".$settings['numofshouts']
);
if (dbrows($result)) {
echo ( $overflow_h ? '<div style="height:'.$over_h.'px; padding: 5px ;overflow-x:visible;overflow-y:auto" >' : '' ) ; //overflow start
$i = 0;
while ($data = dbarray($result)) {
$avatar = ( $data['user_avatar'] != '' ? ' alt="'.$locale['on106'].'" title="'.$locale['on106'].'" src="'.IMAGES.'avatars/'.$data['user_avatar'].'" ' : ' alt="'.$locale['on107'].'" title="'.$locale['on107'].'" src="'.INFUSIONS.SHOUT_PANEL_NAME.'/images/noimage32x.gif" ' ) ;
echo "<div class='shoutboxname'>";
echo '<img border="0" height="32" width="32" hspace="5" vspace="2" '.$avatar.'align="left"> ';
if ($data['user_name']) {
echo "<a href='".BASEDIR."u".$data['shout_name']."-".$data['user_name']."' class='side'>".$data['user_name']."</a>\n";
} else {
echo $data['shout_name']."\n";
}
echo "</div>\n";
echo "<div class='shoutboxdate'>".showdate("shortdate", $data['shout_datestamp'])."</div>";
echo "<div class='shoutbox'>".sbwrap(parse_simple_bb(parsesmileys($data['shout_message'])))."</div>\n";
if ((iADMIN && checkrights("S")) || (iMEMBER && $data['shout_name'] == $userdata['user_id'] && isset($data['user_name']))) {
echo "<div align='center'>
<a href='".$link.$sep."s_action=edit&shout_id=".$data['shout_id']."#edit_shout"."' class='button'>".$loc_edit."</a>\n";
echo "<a href='".$link.$sep."s_action=delete&shout_id=".$data['shout_id']."' class='button'>".$loc_del."</a>
</div>
<br />\n";
}
$i++;
if ($i != $numrows) { echo "<br />\n"; }
}
echo ( $overflow_h ? '</div>' : '' ) ; //overflow end
echo "<hr><div style='text-align:center'>";
if ($numrows > $settings['numofshouts']) {
echo "<a href='saukyklos-archyvas' class='side'>".$locale['126']."</a>
<br>";
}
echo "<a href='saukyklos-pagalba' class='side'>".$locale['124']."</a>
</div>";
} else {
echo "<div>".$locale['127']."</div>\n";
}
closeside();
?>
Čia kaip suprantu, reikia kažką keisti šitoje vietoje:
if (iMEMBER) {
$shout_name = $userdata['user_id'];
Bet ką tiksliai, tai nežinau :S
Parašė bobalt· 2010 Rugp. 12 18:08:48
#2
Čia kažką tokio reiktų daryt?
if (iVIP) {
$shout_name = <img src="img.png"> $userdata['user_id'];
Parašė Noyz· 2010 Rugp. 12 19:08:00
#3
Mano manymu reikia iš pradžių padaryti grupę, tada per failus nustatyti grupės idą, prie kurių bus dedamas paveiksliukas.
Parašė bobalt· 2010 Rugp. 12 19:08:19
#4
nu grupes sukurt nėr kas. man svarbu failą susitvarkyt
Parašė Jaunelis· 2010 Rugp. 12 20:08:16
#5
bobalt parašė:
nu grupes sukurt nėr kas. man svarbu failą susitvarkyt
tai tu pirma sukurk grupę :) nes tada nepatikrinsi ar failas veikia gerai ar ne :)
Parašė bobalt· 2010 Rugp. 12 21:08:04
#6
Susikūriau. Bet reikia, kad, kai yra 3 grupės, tai pagal grupę ir ikoną uždėtų. Lauksiu pagalbos ;)
Parašė bobalt· 2010 Rugp. 13 08:08:56
#7
Grupių ID:
3, 4 ir 5
Parašė utx· 2010 Rugp. 13 08:08:03
#8
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: shoutbox_panel.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
|
| & ported from SEVEN to SIX by Die
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
$l_codetitle = 'Rėkykla:';
$l_codebox = 'Āāåäčņå źīä:';
define('SHOUT_PANEL_NAME','shoutbox_panel_tmod');
$loc_edit = '<img border="0" alt="Edit!" title="Edit!" src="'.INFUSIONS.SHOUT_PANEL_NAME.'/images/edit.png">';
$loc_del = '<img border="0" alt="Delete!" title="Delete!" src="'.INFUSIONS.SHOUT_PANEL_NAME.'/images/delete.png">';
$overflow_h = false; //scroll bar
$over_h = 350 ;//used ONLY if ovwerflow true!
include_once(INFUSIONS.SHOUT_PANEL_NAME.'/shoutb_bbcode.php');
// Show smiley icons in comments, forum and other post pages
function displaysmileysS($textarea) {
$smiles = "";
$smileys = array (
":)" => "smile.png",
";)" => "wink.png",
":|" => "Supershock.png",
":(" => "Sad.png",
":o" => "Surprised.png",
":D" => "Laugh.png",
":@" => "angry.png",
":P" => "Teasing.png"
);
foreach($smileys as $key=>$smiley) $smiles .= "<img style='cursor:pointer;cursor:hand;' src='".IMAGES."smiley/$smiley' alt='SmileY' onClick=\"insertTextAS('$textarea', '$key','chatform');\">\n";
return $smiles;
}
echo '<script type="text/javascript" src="'.INFUSIONS.SHOUT_PANEL_NAME.'/sb_p_script.js"></script>';
//start of 7 code
$link = FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "");
$link = preg_replace("^(&|\?)s_action=(edit|delete)&shout_id=\d*^", "", $link);
$sep = stristr($link, "?") ? "&" : "?";
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == 'delete') && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
if ((iADMIN && checkrights("S")) || (iMEMBER && dbcount("(shout_id)", 'shoutbox', "shout_id='".$_GET['shout_id']."' AND shout_name='".$userdata['user_id']."'"))) {
$result = dbquery("DELETE FROM ".DB_PREFIX."shoutbox WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
}
redirect($link);
}
function sbwrap($text) {
$i = 0; $tags = 0; $chars = 0; $res = "";
$str_len = strlen($text);
for ($i = 0; $i < $str_len; $i++) {
$chr = substr($text, $i, 1);
if ($chr == "<") {
if (substr($text, ($i + 1), 6) == "a href" || substr($text, ($i + 1), 3) == "img") {
$chr = " ".$chr;
$chars = 0;
}
$tags++;
} elseif ($chr == "&") {
if (substr($text, ($i + 1), 5) == "quot;") {
$chars = $chars - 5;
} elseif (substr($text, ($i + 1), 4) == "amp;" || substr($text, ($i + 1), 4) == "#39;" || substr($text, ($i + 1), 4) == "#92;") {
$chars = $chars - 4;
} elseif (substr($text, ($i + 1), 3) == "lt;" || substr($text, ($i + 1), 3) == "gt;") {
$chars = $chars - 3;
}
} elseif ($chr == ">") {
$tags--;
} elseif ($chr == " ") {
$chars = 0;
} elseif (!$tags) {
$chars++;
}
if (!$tags && $chars == 18) {
$chr .= "<br />";
$chars = 0;
}
$res .= $chr;
}
return $res;
}
openside($locale['120']);
if (iMEMBER || $settings['guestposts'] == "1") {
if (isset($_POST['post_shout'])) {
$flood = false;
if (iMEMBER) {
$shout_name = $userdata['user_id'];
if (i3) {
$shout_name = <img src="img.png"> $userdata['user_id'];
if (i4) {
$shout_name = <img src="img.png"> $userdata['user_id'];
if (i5) {
$shout_name = <img src="img.png"> $userdata['user_id'];
} elseif ($settings['guestposts'] == "1") {
$shout_name = trim(stripinput($_POST['shout_name']));
$shout_name = preg_replace("(^[0-9]*)", "", $shout_name);
if (isnum($shout_name)) { $shout_name = ""; }
/*include_once INCLUDES."securimage/securimage.php";
$securimage = new Securimage();
if (!isset($_POST['sb_captcha_code']) || $securimage->check($_POST['sb_captcha_code']) == false) { redirect($link); }*/
if (!check_captcha($_POST['captcha_encode'], $_POST['captcha_code'])) {
redirect($link);
exit;
}
}
$shout_message = str_replace("\n", " ", $_POST['shout_message']);
$shout_message = preg_replace("/^(.{255}).*$/", "$1", $shout_message);
$shout_message = trim(stripinput(censorwords($shout_message)));
//pradedam boto koda
$h = date("H", time());
if ($h > 00 && $h <= 05) {
$time = "Laba naktis";
$timemsg = "Ne laikas miegoti dar?";
} elseif ($h > 05 && $h <= 10) {
$time = "Labas rytas";
$timemsg = "Kaip miegojai?";
} elseif ($h > 10 && $h <= 18) {
$time = "Laba diena";
$timemsg = "Kaip einasi?";
} elseif ($h > 18 && $h <= 21) {
$time = "Labas vakaras";
$timemsg = "Kaip sekasi?";
} elseif ($h > 21 && $h <= 23) {
$time = "Laba naktis";
$timemsg = "Ne laikas miegoti dar?";
}
$msg = strtolower($_POST['shout_message']);
$msg = str_replace(array(":","<",">","@","#","$","%","^","&","*","(",")","_","=","+","/","-", "?", ",", "'", "`", "!", "."), "", $msg);
$msg = str_replace(array("ą", "č", "ę", "ė", "į", "š", "ų", "ū", "ž"), array("a", "c", "e", "e", "i", "s", "u", "u", "z"), $msg);
// klausimus rasom be zenklu, kurie yra $pakeisti array'uje
$QA = array (
"(.{0,10}(sveik|Sveik|laba|swx|svx|sveix).*[a-z,0-9]*\040(ro){0,1}bot.*|.{0,10}(ro){0,1}bot[a-z,0-9]*\040(sveik|Sveik|laba|swx|svx|sveix).*)" => "$time, $userdata[user_name]. $timemsg",
".{0,7}(norm|ger|nuosta|ideal).*[a-z,0-9]*\040(ro){0,1}bot.*" => "Nuostabu :D Džiaugiuosi dėl tavęs :)",
"(dux|duch|lox|loch|ble|nx|nach|nah|nax|pisk|cbb|bbd|debi|peder|pydar|rupus miltai|posimts pypkiu|paci|aš).*" => "<font style=\"color:red;\">".$userdata['user_name']."</font>, Nesikeik! :|",
".{0,10}(ro){0,1}bot[a-z,0-9]*\040(uzmu|nuzud|papj).*" => "Jau bėgu :D",
"[^[a-z,0-9]]*.*bot.*" => "Aš robotas :). Kas kvietėt?"
);
$rezas = false;
foreach ($QA as $q => $a) {
if (ereg($q, $msg)) {
$rezas = true;
$atsakymas = $a;
break;
}
}
//botas baigesi
//boto uzklausa
if ($rezas) $result = dbquery("INSERT INTO ".$db_prefix."shoutbox (shout_name, shout_message, shout_datestamp, shout_ip) VALUES ('Robotukas', '$atsakymas', '".(time() + 1)."', '0.0.0.0')");
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$comment_updated = false;
if ((iADMIN && checkrights("S")) || (iMEMBER && dbcount("(shout_id)", 'shoutbox', "shout_id='".$_GET['shout_id']."' AND shout_name='".$userdata['user_id']."'"))) {
if ($shout_message) {
$result = dbquery("UPDATE ".DB_PREFIX."shoutbox SET shout_message='$shout_message' WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
}
}
redirect($link);
} elseif ($shout_name && $shout_message) { //antiflood is ok
require_once INFUSIONS.SHOUT_PANEL_NAME.'/flood_include.php';
if (!flood_control('shout_datestamp', 'shoutbox', "shout_ip='".USER_IP."'")) {
$result = dbquery("INSERT INTO ".DB_PREFIX."shoutbox (shout_name, shout_message, shout_datestamp, shout_ip) VALUES ('$shout_name', '$shout_message', '".time()."', '".USER_IP."')");
}
}
redirect($link);
}
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$esresult = dbquery(
"SELECT ts.*, tu.user_id, tu.user_name FROM ".DB_PREFIX."shoutbox ts
LEFT JOIN ".DB_PREFIX."users tu ON ts.shout_name=tu.user_id
WHERE ts.shout_id='".$_GET['shout_id']."'"
);
if (dbrows($esresult)) {
$esdata = dbarray($esresult);
if ((iADMIN && checkrights("S")) || (iMEMBER && $esdata['shout_name'] == $userdata['user_id'] && isset($esdata['user_name']))) {
if ((isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$edit_url = $sep."s_action=edit&shout_id=".$esdata['shout_id'];
} else {
$edit_url = "";
}
$shout_link = $link.$edit_url;
$shout_message = $esdata['shout_message'];
}
} else {
$shout_link = $link;
$shout_message = "";
}
} else {
$shout_link = $link;
$shout_message = "";
}
echo "<a id='edit_shout' name='edit_shout'></a>\n";
//name?
echo "<form name='chatform' method='post' action='".$shout_link."'>\n";
if (iGUEST) {
echo $locale['121']."<br />\n";
echo "<input type='text' name='shout_name' value='' class='textbox' maxlength='30' style='width:140px' /><br />\n";
echo $locale['122']."<br />\n";
}
echo '<div id="shoutbox_smiles_link" style="text-align:center"><a class="border" href="#" onclick="shoutbox_smiles_block.style.display=\'block\';shoutbox_smiles_link.style.display=\'none\';return false;"> Šypsenos </a></div>
<div id="shoutbox_smiles_block" class="border" style="text-align:center;display: none;">'.displaysmileysS('shout_message').'</div>';
echo "<textarea name='shout_message' rows='4' cols='20' class='textbox' style='width:140px'>".$shout_message."</textarea><br />\n";
echo '
<input type="button" value="b" class="button" style="font-weight:bold;width:20px;" onClick=\'addTextAS("shout_message", "", "","chatform");\'>
<input type="button" value="i" class="button" style="font-style:italic;width:20px;" onClick=\'addTextAS("shout_message", "", "","chatform");\'>
<input type="button" value="u" class="button" style="text-decoration:underline;width:20px;" onClick=\'addTextAS("shout_message", "", "","chatform");\'>
<select name="bbcolor" class="textbox" style="width:70px;" onChange=\'addTextAS("shout_message", "[color=" + this.options[this.selectedIndex].value + "]", "[/color]","chatform");this.selectedIndex=0;\'>
<option value="">[none]</option>
<option value="black" style="background-color:black">Black</option>
<option value="white" style="background-color:white">White</option>
<option value="skyblue" style="background-color:skyblue">Skyblue</option>
<option value="royalblue" style="background-color:royalblue">Royalblue</option>
<option value="blue" style="background-color:blue">Blue</option>
<option value="darkblue" style="background-color:darkblue">Darkblue</option>
<option value="purple" style="background-color:purple">Purple</option>
<option value="orange" style="background-color:orange">Orange</option>
<option value="yellow" style="background-color:yellow">Yellow</option>
<option value="gold" style="background-color:gold">Gold</option>
<option value="tomato" style="background-color:tomato">Tomato</option>
<option value="coral" style="background-color:coral">Coral</option>
<option value="orangered" style="background-color:orangered">Orangered</option>
<option value="crimson" style="background-color:crimson">Crimson</option>
<option value="red" style="background-color:red">Red</option>
<option value="firebrick" style="background-color:firebrick">Firebrick</option>
<option value="darkred" style="background-color:darkred">Darkred</option>
<option value="green" style="background-color:green">Green</option>
<option value="limegreen" style="background-color:limegreen">Limegreen</option>
<option value="seagreen" style="background-color:seagreen">Seagreen</option>
<option value="deeppink" style="background-color:deeppink">Deeppink</option>
<option value="purple" style="background-color:purple">Purple</option>
<option value="indigo" style="background-color:indigo">Indigo</option>
<option value="burlywood" style="background-color:burlywood">Burlywood</option>
<option value="sandybrown" style="background-color:sandybrown">Sandybrown</option>
<option value="sienna" style="background-color:sienna">Sienna</option>
<option value="choclate" style="background-color:chocolate">Chocolate</option>
<option value="teal" style="background-color:teal">Teal</option>
<option value="silver" style="background-color:silver">Silver</option>
<option value="gray" style="background-color:gray">Gray</option>
</select>
<br>';
/*if (iGUEST) {
echo $locale['global_158']."<br />\n";
echo "<img id='sb_captcha' src='".INCLUDES."securimage/securimage_show.php' alt='' /><br />\n";
echo "<a href='".INCLUDES."securimage/securimage_play.php'><img src='".INCLUDES."securimage/images/audio_icon.gif' alt='' class='tbl-border' style='margin-bottom:1px' /></a>\n";
echo "<a href='#' onclick=\"document.getElementById('sb_captcha').src = '".INCLUDES."securimage/securimage_show.php?sid=' + Math.random(); return false\"><img src='".INCLUDES."securimage/images/refresh.gif' alt='' class='tbl-border' /></a><br />\n";
echo $locale['global_159']."<br />\n<input type='text' name='sb_captcha_code' class='textbox' style='width:100px' /><br />\n";
}*/
if(iGUEST) {
echo "<span style='color:#ff0000'>*</span> $l_codetitle<br /><div style='overflow:auto'>".make_captcha()."</div><br /><span style='color:#ff0000'>*</span> $l_codebox<br /><input type='text' name='captcha_code' class='textbox' style='width:100px'>";
}
echo "<br /><input type='submit' name='post_shout' value='".$locale['123']."' class='button' />\n";
echo "</form>\n<br />\n";
} else {
echo '<div class="quote" align="text-align:center">'.$locale['125'].'</div><br>';
}
$numrows = dbcount("(shout_id)", 'shoutbox');
$result = dbquery(
"SELECT ts.*, tu.user_id, tu.user_name,user_avatar FROM ".DB_PREFIX."shoutbox ts
LEFT JOIN ".DB_PREFIX."users tu ON ts.shout_name=tu.user_id
ORDER BY ts.shout_datestamp DESC LIMIT 0,".$settings['numofshouts']
);
if (dbrows($result)) {
echo ( $overflow_h ? '<div style="height:'.$over_h.'px; padding: 5px ;overflow-x:visible;overflow-y:auto" >' : '' ) ; //overflow start
$i = 0;
while ($data = dbarray($result)) {
$avatar = ( $data['user_avatar'] != '' ? ' alt="'.$locale['on106'].'" title="'.$locale['on106'].'" src="'.IMAGES.'avatars/'.$data['user_avatar'].'" ' : ' alt="'.$locale['on107'].'" title="'.$locale['on107'].'" src="'.INFUSIONS.SHOUT_PANEL_NAME.'/images/noimage32x.gif" ' ) ;
echo "<div class='shoutboxname'>";
echo '<img border="0" height="32" width="32" hspace="5" vspace="2" '.$avatar.'align="left"> ';
if ($data['user_name']) {
echo "<a href='".BASEDIR."u".$data['shout_name']."-".$data['user_name']."' class='side'>".$data['user_name']."</a>\n";
} else {
echo $data['shout_name']."\n";
}
echo "</div>\n";
echo "<div class='shoutboxdate'>".showdate("shortdate", $data['shout_datestamp'])."</div>";
echo "<div class='shoutbox'>".sbwrap(parse_simple_bb(parsesmileys($data['shout_message'])))."</div>\n";
if ((iADMIN && checkrights("S")) || (iMEMBER && $data['shout_name'] == $userdata['user_id'] && isset($data['user_name']))) {
echo "<div align='center'>
<a href='".$link.$sep."s_action=edit&shout_id=".$data['shout_id']."#edit_shout"."' class='button'>".$loc_edit."</a>\n";
echo "<a href='".$link.$sep."s_action=delete&shout_id=".$data['shout_id']."' class='button'>".$loc_del."</a>
</div>
<br />\n";
}
$i++;
if ($i != $numrows) { echo "<br />\n"; }
}
echo ( $overflow_h ? '</div>' : '' ) ; //overflow end
echo "<hr><div style='text-align:center'>";
if ($numrows > $settings['numofshouts']) {
echo "<a href='saukyklos-archyvas' class='side'>".$locale['126']."</a>
<br>";
}
echo "<a href='saukyklos-pagalba' class='side'>".$locale['124']."</a>
</div>";
} else {
echo "<div>".$locale['127']."</div>\n";
}
closeside();
?>
Kažkas tokio.
Parašė bobalt· 2010 Rugp. 13 09:08:56
#9
Parse error: syntax error, unexpected '<' in /home/bobalt/domains/efects.ipp.lt/public_html/infusions/shoutbox_panel_tmod/shoutbox_panel_tmod.php on line 113
kodas:
if (i3) {
$shout_name = <img src="img.png"> $userdata['user_id'];
if (i4) {
$shout_name = <img src="img.png"> $userdata['user_id'];
if (i5) {
$shout_name = <img src="img.png"> $userdata['user_id'];
Kur eina <img.... tai dėl to < pyksta :(
Parašė utx· 2010 Rugp. 13 09:08:30
#10
Vietoj " pakeisk į ' , nepastebėjau
Kad aiškiau, kodą sutvarkysiu
if (i3) {
$shout_name = <img src='img.png'> $userdata['user_id'];
if (i4) {
$shout_name = <img src='img.png'> $userdata['user_id'];
if (i5) {
$shout_name = <img src='img.png'> $userdata['user_id'];
Redagavo utx· 2010 Rugp. 13 09:08:30
Parašė bobalt· 2010 Rugp. 13 09:08:35
#11
Pakeičiau, vistiek taspats. Ne dėl to pyksta. Sako, kad tipo iš lempos tas <. Su juo problema :( Reik kažkaip aprašyt, kad
HTML kodas čia prasideda ir ten baigiasi.
Parašė utx· 2010 Rugp. 13 09:08:27
#12
Bandyk su include kodu
Parašė utx· 2010 Rugp. 13 09:08:26
#13
Palauk, numesk image į PM, ar adresą, pažiūrėsiu
Parašė edeni· 2010 Rugp. 14 09:08:22
#14
if (i3) {
$shout_name = "<img src="img.png"> $userdata['user_id']";
if (i4) {
$shout_name = "<img src="img.png"> $userdata['user_id']";
if (i5) {
$shout_name = "<img src="img.png"> $userdata['user_id']";
Parašė bobalt· 2010 Rugp. 14 09:08:14
#15
Rezultatas:
Kodas dabar atrodo taip:
if (isset($_POST['post_shout'])) {
$flood = false;
if (iMEMBER) {
$shout_name = $userdata['user_id'];
if (i3) {
$shout_name = "<img src="img.png"> $userdata['user_id']";
if (i4) {
$shout_name = "<img src="img.png"> $userdata['user_id']";
if (i5) {
$shout_name = "<img src="img.png"> $userdata['user_id']";
} elseif ($settings['guestposts'] == "1") {
$shout_name = trim(stripinput($_POST['shout_name']));
$shout_name = preg_replace("(^[0-9]*)", "", $shout_name);
if (isnum($shout_name)) { $shout_name = ""; }
Klaida:
Parse error: syntax error, unexpected T_STRING in /home/bobalt/domains/efects.ipp.lt/public_html/infusions/shoutbox_panel_tmod/shoutbox_panel_tmod.php on line 113
113 eilutė:
$shout_name = "<img src="img.png"> $userdata['user_id']";
Parašė Narysx· 2010 Rugp. 14 10:08:35
#16
if (isset($_POST['post_shout'])) {
$flood = false;
if (iMEMBER) {
$shout_name = $userdata['user_id'];
if (i3) {
$shout_name = "<img src='img.png'> $userdata['user_id']";
if (i4) {
$shout_name = "<img src='img.png'> $userdata['user_id']";
if (i5) {
$shout_name = "<img src='img.png'> $userdata['user_id']";
} elseif ($settings['guestposts'] == "1") {
$shout_name = trim(stripinput($_POST['shout_name']));
$shout_name = preg_replace("(^[0-9]*)", "", $shout_name);
if (isnum($shout_name)) { $shout_name = ""; }
Parašė bobalt· 2010 Rugp. 17 11:08:01
#17
Naudojant Narysx duotą kodą.
Klaida:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/bobalt/domains/efects.ipp.lt/public_html/infusions/shoutbox_panel_tmod/shoutbox_panel_tmod.php on line 113
113 eilutė:
$shout_name = "<img src='img.png'> $userdata['user_id']";
Negi nieks nežino kaip? Beto jei tai kąnors keičia tai pas mane v6 fusion'as
Parašė Narysx· 2010 Rugp. 17 11:08:35
#18
if (isset($_POST['post_shout'])) {
$flood = false;
if (iMEMBER) {
$shout_name = $userdata['user_id'];
if (i3) {
$shout_name = "<img src='img.png'> ".$userdata['user_id']."";
if (i4) {
$shout_name = "<img src='img.png'> ".$userdata['user_id']."";
if (i5) {
$shout_name = "<img src='img.png'> ".$userdata['user_id']."";
} elseif ($settings['guestposts'] == "1") {
$shout_name = trim(stripinput($_POST['shout_name']));
$shout_name = preg_replace("(^[0-9]*)", "", $shout_name);
if (isnum($shout_name)) { $shout_name = ""; }
o taip? :?
Parašė Kelmas· 2010 Rugp. 17 11:08:57
#19
Narysx parašė:
if (isset($_POST['post_shout'])) {
$flood = false;
if (iMEMBER) {
$shout_name = $userdata['user_id'];
} elseif (i3) {
$shout_name = "<img src='img.png'> ".$userdata['user_id']."";
} elseif (i4) {
$shout_name = "<img src='img.png'> ".$userdata['user_id']."";
} elseif (i5) {
$shout_name = "<img src='img.png'> ".$userdata['user_id']."";
} elseif ($settings['guestposts'] == "1") {
$shout_name = trim(stripinput($_POST['shout_name']));
$shout_name = preg_replace("(^[0-9]*)", "", $shout_name);
if (isnum($shout_name)) { $shout_name = ""; }
o taip? :?
Parašė bobalt· 2010 Rugp. 18 10:08:41
#20
Nu dabar visas kodas atrodo taip:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: shoutbox_panel.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
|
| & ported from SEVEN to SIX by Die
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
$l_codetitle = 'Rėkykla:';
$l_codebox = 'Āāåäčņå źīä:';
define('SHOUT_PANEL_NAME','shoutbox_panel_tmod');
$loc_edit = '<img border="0" alt="Edit!" title="Edit!" src="'.INFUSIONS.SHOUT_PANEL_NAME.'/images/edit.png">';
$loc_del = '<img border="0" alt="Delete!" title="Delete!" src="'.INFUSIONS.SHOUT_PANEL_NAME.'/images/delete.png">';
$overflow_h = false; //scroll bar
$over_h = 350 ;//used ONLY if ovwerflow true!
include_once(INFUSIONS.SHOUT_PANEL_NAME.'/shoutb_bbcode.php');
// Show smiley icons in comments, forum and other post pages
function displaysmileysS($textarea) {
$smiles = "";
$smileys = array (
":)" => "smile.png",
";)" => "wink.png",
":|" => "Supershock.png",
":(" => "Sad.png",
":o" => "Surprised.png",
":D" => "Laugh.png",
":@" => "angry.png",
":P" => "Teasing.png"
);
foreach($smileys as $key=>$smiley) $smiles .= "<img style='cursor:pointer;cursor:hand;' src='".IMAGES."smiley/$smiley' alt='SmileY' onClick=\"insertTextAS('$textarea', '$key','chatform');\">\n";
return $smiles;
}
echo '<script type="text/javascript" src="'.INFUSIONS.SHOUT_PANEL_NAME.'/sb_p_script.js"></script>';
//start of 7 code
$link = FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "");
$link = preg_replace("^(&|\?)s_action=(edit|delete)&shout_id=\d*^", "", $link);
$sep = stristr($link, "?") ? "&" : "?";
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == 'delete') && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
if ((iADMIN && checkrights("S")) || (iMEMBER && dbcount("(shout_id)", 'shoutbox', "shout_id='".$_GET['shout_id']."' AND shout_name='".$userdata['user_id']."'"))) {
$result = dbquery("DELETE FROM ".DB_PREFIX."shoutbox WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
}
redirect($link);
}
function sbwrap($text) {
$i = 0; $tags = 0; $chars = 0; $res = "";
$str_len = strlen($text);
for ($i = 0; $i < $str_len; $i++) {
$chr = substr($text, $i, 1);
if ($chr == "<") {
if (substr($text, ($i + 1), 6) == "a href" || substr($text, ($i + 1), 3) == "img") {
$chr = " ".$chr;
$chars = 0;
}
$tags++;
} elseif ($chr == "&") {
if (substr($text, ($i + 1), 5) == "quot;") {
$chars = $chars - 5;
} elseif (substr($text, ($i + 1), 4) == "amp;" || substr($text, ($i + 1), 4) == "#39;" || substr($text, ($i + 1), 4) == "#92;") {
$chars = $chars - 4;
} elseif (substr($text, ($i + 1), 3) == "lt;" || substr($text, ($i + 1), 3) == "gt;") {
$chars = $chars - 3;
}
} elseif ($chr == ">") {
$tags--;
} elseif ($chr == " ") {
$chars = 0;
} elseif (!$tags) {
$chars++;
}
if (!$tags && $chars == 18) {
$chr .= "<br />";
$chars = 0;
}
$res .= $chr;
}
return $res;
}
openside($locale['120']);
if (iMEMBER || $settings['guestposts'] == "1") {
if (isset($_POST['post_shout'])) {
$flood = false;
if (iMEMBER) {
$shout_name = $userdata['user_id'];
if (i3) {
$shout_name = "<img src='img.png'> ".$userdata['user_id']."";
if (i4) {
$shout_name = "<img src='img.png'> ".$userdata['user_id']."";
if (i5) {
$shout_name = "<img src='img.png'> ".$userdata['user_id']."";
} elseif ($settings['guestposts'] == "1") {
$shout_name = trim(stripinput($_POST['shout_name']));
$shout_name = preg_replace("(^[0-9]*)", "", $shout_name);
if (isnum($shout_name)) { $shout_name = ""; }
/*include_once INCLUDES."securimage/securimage.php";
$securimage = new Securimage();
if (!isset($_POST['sb_captcha_code']) || $securimage->check($_POST['sb_captcha_code']) == false) { redirect($link); }*/
if (!check_captcha($_POST['captcha_encode'], $_POST['captcha_code'])) {
redirect($link);
exit;
}
}
$shout_message = str_replace("\n", " ", $_POST['shout_message']);
$shout_message = preg_replace("/^(.{255}).*$/", "$1", $shout_message);
$shout_message = trim(stripinput(censorwords($shout_message)));
//pradedam boto koda
$h = date("H", time());
if ($h > 00 && $h <= 05) {
$time = "Laba naktis";
$timemsg = "Ne laikas miegoti dar?";
} elseif ($h > 05 && $h <= 10) {
$time = "Labas rytas";
$timemsg = "Kaip miegojai?";
} elseif ($h > 10 && $h <= 18) {
$time = "Laba diena";
$timemsg = "Kaip einasi?";
} elseif ($h > 18 && $h <= 21) {
$time = "Labas vakaras";
$timemsg = "Kaip sekasi?";
} elseif ($h > 21 && $h <= 23) {
$time = "Laba naktis";
$timemsg = "Ne laikas miegoti dar?";
}
$msg = strtolower($_POST['shout_message']);
$msg = str_replace(array(":","<",">","@","#","$","%","^","&","*","(",")","_","=","+","/","-", "?", ",", "'", "`", "!", "."), "", $msg);
$msg = str_replace(array("ą", "č", "ę", "ė", "į", "š", "ų", "ū", "ž"), array("a", "c", "e", "e", "i", "s", "u", "u", "z"), $msg);
// klausimus rasom be zenklu, kurie yra $pakeisti array'uje
$QA = array (
"(.{0,10}(sveik|Sveik|laba|swx|svx|sveix).*[a-z,0-9]*\040(ro){0,1}bot.*|.{0,10}(ro){0,1}bot[a-z,0-9]*\040(sveik|Sveik|laba|swx|svx|sveix).*)" => "$time, $userdata[user_name]. $timemsg",
".{0,7}(norm|ger|nuosta|ideal).*[a-z,0-9]*\040(ro){0,1}bot.*" => "Nuostabu :D Džiaugiuosi dėl tavęs :)",
"(dux|duch|lox|loch|ble|nx|nach|nah|nax|pisk|cbb|bbd|debi|peder|pydar|rupus miltai|posimts pypkiu|paci|aš).*" => "<font style=\"color:red;\">".$userdata['user_name']."</font>, Nesikeik! :|",
".{0,10}(ro){0,1}bot[a-z,0-9]*\040(uzmu|nuzud|papj).*" => "Jau bėgu :D",
"[^[a-z,0-9]]*.*bot.*" => "Aš robotas :). Kas kvietėt?"
);
$rezas = false;
foreach ($QA as $q => $a) {
if (ereg($q, $msg)) {
$rezas = true;
$atsakymas = $a;
break;
}
}
//botas baigesi
//boto uzklausa
if ($rezas) $result = dbquery("INSERT INTO ".$db_prefix."shoutbox (shout_name, shout_message, shout_datestamp, shout_ip) VALUES ('Robotukas', '$atsakymas', '".(time() + 1)."', '0.0.0.0')");
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$comment_updated = false;
if ((iADMIN && checkrights("S")) || (iMEMBER && dbcount("(shout_id)", 'shoutbox', "shout_id='".$_GET['shout_id']."' AND shout_name='".$userdata['user_id']."'"))) {
if ($shout_message) {
$result = dbquery("UPDATE ".DB_PREFIX."shoutbox SET shout_message='$shout_message' WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
}
}
redirect($link);
} elseif ($shout_name && $shout_message) { //antiflood is ok
require_once INFUSIONS.SHOUT_PANEL_NAME.'/flood_include.php';
if (!flood_control('shout_datestamp', 'shoutbox', "shout_ip='".USER_IP."'")) {
$result = dbquery("INSERT INTO ".DB_PREFIX."shoutbox (shout_name, shout_message, shout_datestamp, shout_ip) VALUES ('$shout_name', '$shout_message', '".time()."', '".USER_IP."')");
}
}
redirect($link);
}
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$esresult = dbquery(
"SELECT ts.*, tu.user_id, tu.user_name FROM ".DB_PREFIX."shoutbox ts
LEFT JOIN ".DB_PREFIX."users tu ON ts.shout_name=tu.user_id
WHERE ts.shout_id='".$_GET['shout_id']."'"
);
if (dbrows($esresult)) {
$esdata = dbarray($esresult);
if ((iADMIN && checkrights("S")) || (iMEMBER && $esdata['shout_name'] == $userdata['user_id'] && isset($esdata['user_name']))) {
if ((isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$edit_url = $sep."s_action=edit&shout_id=".$esdata['shout_id'];
} else {
$edit_url = "";
}
$shout_link = $link.$edit_url;
$shout_message = $esdata['shout_message'];
}
} else {
$shout_link = $link;
$shout_message = "";
}
} else {
$shout_link = $link;
$shout_message = "";
}
echo "<a id='edit_shout' name='edit_shout'></a>\n";
//name?
echo "<form name='chatform' method='post' action='".$shout_link."'>\n";
if (iGUEST) {
echo $locale['121']."<br />\n";
echo "<input type='text' name='shout_name' value='' class='textbox' maxlength='30' style='width:140px' /><br />\n";
echo $locale['122']."<br />\n";
}
echo '<div id="shoutbox_smiles_link" style="text-align:center"><a class="border" href="#" onclick="shoutbox_smiles_block.style.display=\'block\';shoutbox_smiles_link.style.display=\'none\';return false;"> Šypsenos </a></div>
<div id="shoutbox_smiles_block" class="border" style="text-align:center;display: none;">'.displaysmileysS('shout_message').'</div>';
echo "<textarea name='shout_message' rows='4' cols='20' class='textbox' style='width:140px'>".$shout_message."</textarea><br />\n";
echo '
<input type="button" value="b" class="button" style="font-weight:bold;width:20px;" onClick=\'addTextAS("shout_message", "", "","chatform");\'>
<input type="button" value="i" class="button" style="font-style:italic;width:20px;" onClick=\'addTextAS("shout_message", "", "","chatform");\'>
<input type="button" value="u" class="button" style="text-decoration:underline;width:20px;" onClick=\'addTextAS("shout_message", "", "","chatform");\'>
<select name="bbcolor" class="textbox" style="width:70px;" onChange=\'addTextAS("shout_message", "[color=" + this.options[this.selectedIndex].value + "]", "[/color]","chatform");this.selectedIndex=0;\'>
<option value="">[none]</option>
<option value="black" style="background-color:black">Black</option>
<option value="white" style="background-color:white">White</option>
<option value="skyblue" style="background-color:skyblue">Skyblue</option>
<option value="royalblue" style="background-color:royalblue">Royalblue</option>
<option value="blue" style="background-color:blue">Blue</option>
<option value="darkblue" style="background-color:darkblue">Darkblue</option>
<option value="purple" style="background-color:purple">Purple</option>
<option value="orange" style="background-color:orange">Orange</option>
<option value="yellow" style="background-color:yellow">Yellow</option>
<option value="gold" style="background-color:gold">Gold</option>
<option value="tomato" style="background-color:tomato">Tomato</option>
<option value="coral" style="background-color:coral">Coral</option>
<option value="orangered" style="background-color:orangered">Orangered</option>
<option value="crimson" style="background-color:crimson">Crimson</option>
<option value="red" style="background-color:red">Red</option>
<option value="firebrick" style="background-color:firebrick">Firebrick</option>
<option value="darkred" style="background-color:darkred">Darkred</option>
<option value="green" style="background-color:green">Green</option>
<option value="limegreen" style="background-color:limegreen">Limegreen</option>
<option value="seagreen" style="background-color:seagreen">Seagreen</option>
<option value="deeppink" style="background-color:deeppink">Deeppink</option>
<option value="purple" style="background-color:purple">Purple</option>
<option value="indigo" style="background-color:indigo">Indigo</option>
<option value="burlywood" style="background-color:burlywood">Burlywood</option>
<option value="sandybrown" style="background-color:sandybrown">Sandybrown</option>
<option value="sienna" style="background-color:sienna">Sienna</option>
<option value="choclate" style="background-color:chocolate">Chocolate</option>
<option value="teal" style="background-color:teal">Teal</option>
<option value="silver" style="background-color:silver">Silver</option>
<option value="gray" style="background-color:gray">Gray</option>
</select>
<br>';
/*if (iGUEST) {
echo $locale['global_158']."<br />\n";
echo "<img id='sb_captcha' src='".INCLUDES."securimage/securimage_show.php' alt='' /><br />\n";
echo "<a href='".INCLUDES."securimage/securimage_play.php'><img src='".INCLUDES."securimage/images/audio_icon.gif' alt='' class='tbl-border' style='margin-bottom:1px' /></a>\n";
echo "<a href='#' onclick=\"document.getElementById('sb_captcha').src = '".INCLUDES."securimage/securimage_show.php?sid=' + Math.random(); return false\"><img src='".INCLUDES."securimage/images/refresh.gif' alt='' class='tbl-border' /></a><br />\n";
echo $locale['global_159']."<br />\n<input type='text' name='sb_captcha_code' class='textbox' style='width:100px' /><br />\n";
}*/
if(iGUEST) {
echo "<span style='color:#ff0000'>*</span> $l_codetitle<br /><div style='overflow:auto'>".make_captcha()."</div><br /><span style='color:#ff0000'>*</span> $l_codebox<br /><input type='text' name='captcha_code' class='textbox' style='width:100px'>";
}
echo "<br /><input type='submit' name='post_shout' value='".$locale['123']."' class='button' />\n";
echo "</form>\n<br />\n";
} else {
echo '<div class="quote" align="text-align:center">'.$locale['125'].'</div><br>';
}
$numrows = dbcount("(shout_id)", 'shoutbox');
$result = dbquery(
"SELECT ts.*, tu.user_id, tu.user_name,user_avatar FROM ".DB_PREFIX."shoutbox ts
LEFT JOIN ".DB_PREFIX."users tu ON ts.shout_name=tu.user_id
ORDER BY ts.shout_datestamp DESC LIMIT 0,".$settings['numofshouts']
);
if (dbrows($result)) {
echo ( $overflow_h ? '<div style="height:'.$over_h.'px; padding: 5px ;overflow-x:visible;overflow-y:auto" >' : '' ) ; //overflow start
$i = 0;
while ($data = dbarray($result)) {
$avatar = ( $data['user_avatar'] != '' ? ' alt="'.$locale['on106'].'" title="'.$locale['on106'].'" src="'.IMAGES.'avatars/'.$data['user_avatar'].'" ' : ' alt="'.$locale['on107'].'" title="'.$locale['on107'].'" src="'.INFUSIONS.SHOUT_PANEL_NAME.'/images/noimage32x.gif" ' ) ;
echo "<div class='shoutboxname'>";
echo '<img border="0" height="32" width="32" hspace="5" vspace="2" '.$avatar.'align="left"> ';
if ($data['user_name']) {
echo "<a href='".BASEDIR."u".$data['shout_name']."-".$data['user_name']."' class='side'>".$data['user_name']."</a>\n";
} else {
echo $data['shout_name']."\n";
}
echo "</div>\n";
echo "<div class='shoutboxdate'>".showdate("shortdate", $data['shout_datestamp'])."</div>";
echo "<div class='shoutbox'>".sbwrap(parse_simple_bb(parsesmileys($data['shout_message'])))."</div>\n";
if ((iADMIN && checkrights("S")) || (iMEMBER && $data['shout_name'] == $userdata['user_id'] && isset($data['user_name']))) {
echo "<div align='center'>
<a href='".$link.$sep."s_action=edit&shout_id=".$data['shout_id']."#edit_shout"."' class='button'>".$loc_edit."</a>\n";
echo "<a href='".$link.$sep."s_action=delete&shout_id=".$data['shout_id']."' class='button'>".$loc_del."</a>
</div>
<br />\n";
}
$i++;
if ($i != $numrows) { echo "<br />\n"; }
}
echo ( $overflow_h ? '</div>' : '' ) ; //overflow end
echo "<hr><div style='text-align:center'>";
if ($numrows > $settings['numofshouts']) {
echo "<a href='saukyklos-archyvas' class='side'>".$locale['126']."</a>
<br>";
}
echo "<a href='saukyklos-pagalba' class='side'>".$locale['124']."</a>
</div>";
} else {
echo "<div>".$locale['127']."</div>\n";
}
closeside();
?>
Klaida:
Parse error: syntax error, unexpected $end in /home/bobalt/domains/efects.ipp.lt/public_html/infusions/shoutbox_panel_tmod/shoutbox_panel_tmod.php on line 357
357 eilutė:
?>
Parašė ExPerT· 2010 Rugp. 18 10:08:12
#21
Vietoj if elseif rašyk. Pilną kodą karolis aukščiau pateikė ;)