v7 roboto taisimas
Taskas
parašyta 2012-08-22 08:41
Apšylantis
Reputacija:
0 Pranešimai: 91
Įstojo: 2011-05-23
Code
/*-------------------------------------------------------+
| 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).
+--------------------------------------------------------*/
if (!defined(\"IN_FUSION\")) { die(\"Access Denied\"); }
$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)\", DB_SHOUTBOX, \"shout_id='\".$_GET['shout_id'].\"' AND shout_name='\".$userdata['user_id'].\"'\"))) {
$result = dbquery(\"DELETE FROM \".DB_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 .= \" \";
$chars = 0;
}
$res .= $chr;
}
return $res;
}
openside($locale['global_150']);
if (iMEMBER || $settings['guestposts'] == \"1\") {
include_once INCLUDES.\"bbcode_include.php\";
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); }
}
$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|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|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?).*\" => \"\".$userdata['user_name'].\" , 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
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)\", DB_SHOUTBOX, \"shout_id='\".$_GET['shout_id'].\"' AND shout_name='\".$userdata['user_id'].\"'\"))) {
if ($shout_message) {
$result = dbquery(\"UPDATE \".DB_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) {
//boto uzklausa
$result = dbquery(\"INSERT INTO \".DB_SHOUTBOX.\" (shout_name, shout_message, shout_datestamp, shout_ip) VALUES ('Pagalbos Robotukas', '$atsakymas', '\".(time() + 1).\"', '0.0.0.0')\");
$result = dbquery(\"INSERT INTO \".DB_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_SHOUTBOX.\" ts
LEFT JOIN \".DB_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 \" \n\";
echo \"\n \n\";
} else {
echo \"\".$locale['global_154'].\"
\n\";
}
$numrows = dbcount(\"(shout_id)\", DB_SHOUTBOX);
$result = dbquery(
\"SELECT ts.*, tu.user_id, tu.user_name FROM \".DB_SHOUTBOX.\" ts
LEFT JOIN \".DB_USERS.\" tu ON ts.shout_name=tu.user_id
ORDER BY ts.shout_datestamp DESC LIMIT 0,\".$settings['numofshouts']
);
if (dbrows($result)) {
$i = 0;
while ($data = dbarray($result)) {
echo \"\n\";
echo \"\";
echo \"\n\";
if ((iADMIN && checkrights(\"S\")) || (iMEMBER && $data['shout_name'] == $userdata['user_id'] && isset($data['user_name']))) {
echo \"[\".$locale['global_076'].\" ]\n\";
echo \"[\".$locale['global_157'].\" ] \n\";
}
$i++;
if ($i != $numrows) { echo \" \n\"; }
}
if ($numrows > $settings['numofshouts']) {
echo \"\n\";
}
} else {
echo \"\".$locale['global_156'].\"
\n\";
}
closeside();
?>
Sita radau internete bet jis neveikia,kaip speju cia senai v7 versijai,gal kas galetumet padaryt ant naujausio v7? vakar iki 4 ryto meginau visokius variantus ir nieko gero nesigavo....
Redagavo Taskas 2012-08-22 08:41
AntKablio.LT - Zvejybos asu namai tau ir tavo draugams...
Greitu metu pasirodys naujas projektas *galvoju*
Padejau? uzmesk 10+ aciu ;]
domas3215
parašyta 2012-09-13 19:46
Pradinukas
Reputacija:
0 Pranešimai: 26
Įstojo: 2011-01-22
aga ir man reiketu ant php v7.02
tabux
parašyta 2012-09-14 06:46
S.Administratorius
Reputacija:
0 Pranešimai: 1009
Įstojo: 2008-10-16
persiskaitykit straipsniuk� ir suprasit kod�l met� klaid� http://phpfusion....rsijos,s45
Redagavo Wyciokazz 2012-09-14 10:16
jawa
parašyta 2012-11-29 11:58
Savekas
Reputacija:
0 Pranešimai: 126
Įstojo: 2007-04-24
na tai o kaip tada pataisyti sita bota ? tabux , gal gali padeti ?
http://sensation-...
MariukasR
parašyta 2012-11-29 13:21
Moderatorius
Reputacija:
0 Pranešimai: 435
Įstojo: 2010-11-12
Yra para?yta pvz ereg() funkcij� pakeisti � prerg_match().
Taip yra tod�l, kad tobul�jame ne vien mes programavime, bet tobul�ja ir m�s� mylimoji PHP kalba ;) Kuri leid?ia vis papras�iau dirbti :P
moderator
Exceptio
parašyta 2012-11-29 17:52
Administratorius
Reputacija:
0 Pranešimai: 438
Įstojo: 2008-11-10
Kad viskas puikiai veikia isimetus i shoutbox ta kodo iskarpa..
Code
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 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).
+--------------------------------------------------------*/
if (!defined(\"IN_FUSION\")) { die(\"Access Denied\"); }
include_once INFUSIONS.\"shoutbox_panel/infusion_db.php\";
include_once INCLUDES.\"infusions_include.php\";
// Check if locale file is available matching the current site locale setting.
if (file_exists(INFUSIONS.\"shoutbox_panel/locale/\".$settings['locale'].\".php\")) {
// Load the locale file matching the current site locale setting.
include INFUSIONS.\"shoutbox_panel/locale/\".$settings['locale'].\".php\";
} else {
// Load the infusion's default locale file.
include INFUSIONS.\"shoutbox_panel/locale/English.php\";
}
$shout_settings = get_settings(\"shoutbox_panel\");
$link = FUSION_SELF.(FUSION_QUERY ? \"?\".FUSION_QUERY : \"\");
$link = preg_replace(\"^(&|\?)s_action=(edit|delete)&shout_id=\d*^\", \"\", $link);
$sep = stristr($link, \"?\") ? \"&\" : \"?\";
$shout_link = \"\"; $shout_message = \"\";
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)\", DB_SHOUTBOX, \"shout_id='\".$_GET['shout_id'].\"' AND shout_name='\".$userdata['user_id'].\"'\"))) {
$result = dbquery(\"DELETE FROM \".DB_SHOUTBOX.\" WHERE shout_id='\".$_GET['shout_id'].\"'\".(iADMIN ? \"\" : \" AND shout_name='\".$userdata['user_id'].\"'\"));
}
redirect($link);
}
if (!function_exists(\"sbwrap\")) {
function sbwrap($text) {
global $locale;
$i = 0; $tags = 0; $chars = 0; $res = \"\";
$str_len = strlen($text);
for ($i = 0; $i < $str_len; $i++) {
$chr = mb_substr($text, $i, 1, $locale['charset']);
if ($chr == \"<\") {
if (mb_substr($text, ($i + 1), 6, $locale['charset']) == \"a href\" || mb_substr($text, ($i + 1), 3, $locale['charset']) == \"img\") {
$chr = \" \".$chr;
$chars = 0;
}
$tags++;
} elseif ($chr == \"&\") {
if (mb_substr($text, ($i + 1), 5, $locale['charset']) == \"quot;\") {
$chars = $chars - 5;
} elseif (mb_substr($text, ($i + 1), 4, $locale['charset']) == \"amp;\" || mb_substr($text, ($i + 1), 4, $locale['charset']) == \"#39;\" || mb_substr($text, ($i + 1), 4, $locale['charset']) == \"#92;\") {
$chars = $chars - 4;
} elseif (mb_substr($text, ($i + 1), 3, $locale['charset']) == \"lt;\" || mb_substr($text, ($i + 1), 3, $locale['charset']) == \"gt;\") {
$chars = $chars - 3;
}
} elseif ($chr == \">\") {
$tags--;
} elseif ($chr == \" \") {
$chars = 0;
} elseif (!$tags) {
$chars++;
}
if (!$tags && $chars == 18) {
$chr .= \" \";
$chars = 0;
}
$res .= $chr;
}
return $res;
}
}
openside($locale['SB_title']);
if (iMEMBER || $shout_settings['guest_shouts'] == \"1\") {
include_once INCLUDES.\"bbcode_include.php\";
if (isset($_POST['post_shout'])) {
$flood = false;
if (iMEMBER) {
$shout_name = $userdata['user_id'];
} elseif ($shout_settings['guest_shouts'] == \"1\") {
$shout_name = trim(stripinput($_POST['shout_name']));
$shout_name = preg_replace(\"(^[+0-9\s]*)\", \"\", $shout_name);
if (isnum($shout_name)) { $shout_name = \"\"; }
include_once INCLUDES.\"captchas/securimage/securimage.php\";
$securimage = new Securimage();
if (!isset($_POST['sb_captcha_code']) || $securimage->check($_POST['sb_captcha_code']) == false) { redirect($link); }
}
$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|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|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?).*\" => \"\".$userdata['user_name'].\" , 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
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)\", DB_SHOUTBOX, \"shout_id='\".$_GET['shout_id'].\"' AND shout_name='\".$userdata['user_id'].\"'\"))) {
if ($shout_message) {
$result = dbquery(\"UPDATE \".DB_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) {
require_once INCLUDES.\"flood_include.php\";
if (!flood_control(\"shout_datestamp\", DB_SHOUTBOX, \"shout_ip='\".USER_IP.\"'\")) {
$result = dbquery(\"INSERT INTO \".DB_SHOUTBOX.\" (shout_name, shout_message, shout_datestamp, shout_ip) VALUES ('Pagalbos Robotukas', '$atsakymas', '\".(time() + 1).\"', '0.0.0.0')\");
$result = dbquery(\"INSERT INTO \".DB_SHOUTBOX.\" (shout_name, shout_message, shout_datestamp, shout_ip, shout_ip_type, shout_hidden) VALUES ('$shout_name', '$shout_message', '\".time().\"', '\".USER_IP.\"', '\".USER_IP_TYPE.\"', '0')\");
}
}
redirect($link);
}
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == \"edit\") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$esresult = dbquery(
\"SELECT ts.shout_id, ts.shout_name, ts.shout_message, tu.user_id, tu.user_name
FROM \".DB_SHOUTBOX.\" ts
LEFT JOIN \".DB_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 \" \n\";
echo \"\n\";
if (iGUEST) {
echo $locale['SB_name'].\" \n\";
echo \" \n\";
echo $locale['SB_message'].\" \n\";
}
echo \"\".$shout_message.\" \n\";
echo display_bbcodes(\"150px;\", \"shout_message\", \"shout_form\", \"smiley|b|u|url|color\").\"\n\";
if (iGUEST) {
echo $locale['SB_validation_code'].\" \n\";
echo \" \n\";
echo \" \n\";
echo \"> \n\";
echo $locale['SB_enter_validation_code'].\" \n \n\";
}
echo \" \n\";
echo \" \n \n\";
} else {
echo \"\".$locale['SB_login_req'].\"
\n\";
}
$numrows = dbcount(\"(shout_id)\", DB_SHOUTBOX, \"shout_hidden='0'\");
$result = dbquery(
\"SELECT ts.shout_id, ts.shout_name, ts.shout_message, ts.shout_datestamp, tu.user_id, tu.user_name, tu.user_status
FROM \".DB_SHOUTBOX.\" ts
LEFT JOIN \".DB_USERS.\" tu ON ts.shout_name=tu.user_id
WHERE shout_hidden='0'
ORDER BY ts.shout_datestamp DESC LIMIT 0,\".$shout_settings['visible_shouts']
);
if (dbrows($result)) {
$i = 0;
while ($data = dbarray($result)) {
echo \"\n\";
echo \"\";
echo \"\n\";
if ((iADMIN && checkrights(\"S\")) || (iMEMBER && $data['shout_name'] == $userdata['user_id'] && isset($data['user_name']))) {
echo \"[\".$locale['SB_edit'].\" ]\n\";
echo \"[>\".$locale['SB_delete'].\"] \n\";
}
$i++;
if ($i != $numrows) { echo \" \n\"; }
}
if ($numrows > $shout_settings['visible_shouts']) {
echo \"\n\";
}
} else {
echo \"\".$locale['SB_no_msgs'].\"
\n\";
}
closeside();
?>
Redagavo Exceptio 2012-11-29 17:53
MariukasR
parašyta 2012-11-29 17:56
Moderatorius
Reputacija:
0 Pranešimai: 435
Įstojo: 2010-11-12
Neveiks ant naujausios PHP versijos nes naudojama ereg f-ja :)
Gal ne visk� pakei�iau, bet jei Neono nesuveiks variantas meginkit mano ki?ti *nezinau*
Code
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| 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/licen... Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined(\"IN_FUSION\")) { die(\"Access Denied\"); }
include_once INFUSIONS.\"shoutbox_panel/infusion_db.php\";
include_once INCLUDES.\"infusions_include.php\";
// Check if locale file is available matching the current site locale setting.
if (file_exists(INFUSIONS.\"shoutbox_panel/locale/\".$settings['locale'].\".php\")) {
// Load the locale file matching the current site locale setting.
include INFUSIONS.\"shoutbox_panel/locale/\".$settings['locale'].\".php\";
} else {
// Load the infusion's default locale file.
include INFUSIONS.\"shoutbox_panel/locale/English.php\";
}
$shout_settings = get_settings(\"shoutbox_panel\");
$link = FUSION_SELF.(FUSION_QUERY ? \"?\".FUSION_QUERY : \"\");
$link = preg_replace(\"^(&|\?)s_action=(edit|delete)&shout_id=\d*^\", \"\", $link);
$sep = stristr($link, \"?\") ? \"&\" : \"?\";
$shout_link = \"\"; $shout_message = \"\";
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)\", DB_SHOUTBOX, \"shout_id='\".$_GET['shout_id'].\"' AND shout_name='\".$userdata['user_id'].\"'\"))) {
$result = dbquery(\"DELETE FROM \".DB_SHOUTBOX.\" WHERE shout_id='\".$_GET['shout_id'].\"'\".(iADMIN ? \"\" : \" AND shout_name='\".$userdata['user_id'].\"'\"));
}
redirect($link);
}
if (!function_exists(\"sbwrap\")) {
function sbwrap($text) {
global $locale;
$i = 0; $tags = 0; $chars = 0; $res = \"\";
$str_len = strlen($text);
for ($i = 0; $i < $str_len; $i++) {
$chr = mb_substr($text, $i, 1, $locale['charset']);
if ($chr == \"<\") {
if (mb_substr($text, ($i + 1), 6, $locale['charset']) == \"a href\" || mb_substr($text, ($i + 1), 3, $locale['charset']) == \"img\") {
$chr = \" \".$chr;
$chars = 0;
}
$tags++;
} elseif ($chr == \"&\") {
if (mb_substr($text, ($i + 1), 5, $locale['charset']) == \"quot;\") {
$chars = $chars - 5;
} elseif (mb_substr($text, ($i + 1), 4, $locale['charset']) == \"amp;\" || mb_substr($text, ($i + 1), 4, $locale['charset']) == \"#39;\" || mb_substr($text, ($i + 1), 4, $locale['charset']) == \"#92;\") {
$chars = $chars - 4;
} elseif (mb_substr($text, ($i + 1), 3, $locale['charset']) == \"lt;\" || mb_substr($text, ($i + 1), 3, $locale['charset']) == \"gt;\") {
$chars = $chars - 3;
}
} elseif ($chr == \">\") {
$tags--;
} elseif ($chr == \" \") {
$chars = 0;
} elseif (!$tags) {
$chars++;
}
if (!$tags && $chars == 18) {
$chr .= \" \";
$chars = 0;
}
$res .= $chr;
}
return $res;
}
}
openside($locale['SB_title']);
if (iMEMBER || $shout_settings['guest_shouts'] == \"1\") {
include_once INCLUDES.\"bbcode_include.php\";
if (isset($_POST['post_shout'])) {
$flood = false;
if (iMEMBER) {
$shout_name = $userdata['user_id'];
} elseif ($shout_settings['guest_shouts'] == \"1\") {
$shout_name = trim(stripinput($_POST['shout_name']));
$shout_name = preg_replace(\"(^[+0-9\s]*)\", \"\", $shout_name);
if (isnum($shout_name)) { $shout_name = \"\"; }
include_once INCLUDES.\"captchas/securimage/securimage.php\";
$securimage = new Securimage();
if (!isset($_POST['sb_captcha_code']) || $securimage->check($_POST['sb_captcha_code']) == false) { redirect($link); }
}
$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|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|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?).*\" => \"\".$userdata['user_name'].\" , 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 (preg_match($q, $msg)) {
$rezas = true;
$atsakymas = $a;
break;
}
}
//botas baigesi
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)\", DB_SHOUTBOX, \"shout_id='\".$_GET['shout_id'].\"' AND shout_name='\".$userdata['user_id'].\"'\"))) {
if ($shout_message) {
$result = dbquery(\"UPDATE \".DB_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) {
require_once INCLUDES.\"flood_include.php\";
if (!flood_control(\"shout_datestamp\", DB_SHOUTBOX, \"shout_ip='\".USER_IP.\"'\")) {
$result = dbquery(\"INSERT INTO \".DB_SHOUTBOX.\" (shout_name, shout_message, shout_datestamp, shout_ip) VALUES ('Pagalbos Robotukas', '$atsakymas', '\".(time() + 1).\"', '0.0.0.0')\");
$result = dbquery(\"INSERT INTO \".DB_SHOUTBOX.\" (shout_name, shout_message, shout_datestamp, shout_ip, shout_ip_type, shout_hidden) VALUES ('$shout_name', '$shout_message', '\".time().\"', '\".USER_IP.\"', '\".USER_IP_TYPE.\"', '0')\");
}
}
redirect($link);
}
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == \"edit\") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$esresult = dbquery(
\"SELECT ts.shout_id, ts.shout_name, ts.shout_message, tu.user_id, tu.user_name
FROM \".DB_SHOUTBOX.\" ts
LEFT JOIN \".DB_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 \" \n\";
echo \"\n\";
if (iGUEST) {
echo $locale['SB_name'].\" \n\";
echo \" \n\";
echo $locale['SB_message'].\" \n\";
}
echo \"\".$shout_message.\" \n\";
echo display_bbcodes(\"150px;\", \"shout_message\", \"shout_form\", \"smiley|b|u|url|color\").\"\n\";
if (iGUEST) {
echo $locale['SB_validation_code'].\" \n\";
echo \" \n\";
echo \" \n\";
echo \"> \n\";
echo $locale['SB_enter_validation_code'].\" \n \n\";
}
echo \" \n\";
echo \" \n \n\";
} else {
echo \"\".$locale['SB_login_req'].\"
\n\";
}
$numrows = dbcount(\"(shout_id)\", DB_SHOUTBOX, \"shout_hidden='0'\");
$result = dbquery(
\"SELECT ts.shout_id, ts.shout_name, ts.shout_message, ts.shout_datestamp, tu.user_id, tu.user_name, tu.user_status
FROM \".DB_SHOUTBOX.\" ts
LEFT JOIN \".DB_USERS.\" tu ON ts.shout_name=tu.user_id
WHERE shout_hidden='0'
ORDER BY ts.shout_datestamp DESC LIMIT 0,\".$shout_settings['visible_shouts']
);
if (dbrows($result)) {
$i = 0;
while ($data = dbarray($result)) {
echo \"\n\";
echo \"\";
echo \"\n\";
if ((iADMIN && checkrights(\"S\")) || (iMEMBER && $data['shout_name'] == $userdata['user_id'] && isset($data['user_name']))) {
echo \"[\".$locale['SB_edit'].\" ]\n\";
echo \"[>\".$locale['SB_delete'].\"] \n\";
}
$i++;
if ($i != $numrows) { echo \" \n\"; }
}
if ($numrows > $shout_settings['visible_shouts']) {
echo \"\n\";
}
} else {
echo \"\".$locale['SB_no_msgs'].\"
\n\";
}
closeside();
?>
Redagavo MariukasR 2012-11-29 17:58
moderator
jawa
parašyta 2012-11-29 19:26
Savekas
Reputacija:
0 Pranešimai: 126
Įstojo: 2007-04-24
pas mane ajax shoutas. galite i ji ikishti, stai shoutas ;)
http://cshard.lt/..._panel.rar
http://sensation-...
gipsy
parašyta 2012-11-29 21:50
Moderatorius
Reputacija:
0 Pranešimai: 585
Įstojo: 2009-10-21
Neveik su naujausiu Mariuk..
Gryzau
MariukasR
parašyta 2012-11-29 22:16
Moderatorius
Reputacija:
0 Pranešimai: 435
Įstojo: 2010-11-12
O su neono ?
moderator
gipsy
parašyta 2012-11-29 22:37
Moderatorius
Reputacija:
0 Pranešimai: 585
Įstojo: 2009-10-21
Tai pat.
Uzduodant koki nors klausima pvz: Kiek valandu arba Labas rytas
Gale ismeta tesiog nauja post be teksto.
Cia ant abieju kodu
Redagavo gipsy 2012-11-29 22:38
Gryzau
MariukasR
parašyta 2012-11-29 22:46
Moderatorius
Reputacija:
0 Pranešimai: 435
Įstojo: 2010-11-12
Reikia perdaryti vis� exp�, nes jau�iu iki atsakymo nedaeina :S
moderator
jawa
parašyta 2012-11-30 06:46
Savekas
Reputacija:
0 Pranešimai: 126
Įstojo: 2007-04-24
Ai beto, pas mane botas po kiekvieno posto atrasho. bet ka rasai i shoutboxa, jis vistiek raso tuscia zinute.
P.S. pas mane tai pat nei MariukasR nei Neono neveikia
http://sensation-...
gipsy
parašyta 2012-11-30 20:16
Moderatorius
Reputacija:
0 Pranešimai: 585
Įstojo: 2009-10-21
Na jaigu kas gales su savo svelniomis ir sventomis rankutemes prisilieskit prie koduko sio ir istaisikit :D:|
Gryzau
lux66x
parašyta 2012-12-02 21:33
Naujokas
Reputacija:
0 Pranešimai: 7
Įstojo: 2010-09-04
Turiu padaryta ant v7 ajax ?aukyklos. Tik jis integruotas su minecraft servu
jawa
parašyta 2012-12-03 14:33
Savekas
Reputacija:
0 Pranešimai: 126
Įstojo: 2007-04-24
lux66x , numesk cia failus jeigu gali, pasiziuresim ...
Na tai viskas. pakeleme tema, o dabar tyla ? ...
Redagavo jawa 2012-12-05 15:26
http://sensation-...