Peržiūrėti temą
PHP-Fusion Mods :: PHP-Fusion modifikacijų forumas :: Taisymas
|
Komentaru captcha
|
|||
| djdviper |
parašyta 2010-09-28 09:55
|
||
|
Naujokas ![]() Reputacija: 0 Pranešimai: 8 Įstojo: 2007-09-01 |
Sveiki, mginau sidti captcha, kai komentarus ra?o neregistruoti nariai. Nepavyko. Jau net galva apsisuko :D ?inau, kad yra sintakss klaida prad?ioje, o gal ir dar ka?kas ne taip. ?tai kodas (kurioje vietoje yra blogai, paboldinau): if (!defined("IN_FUSION")) { header("Location:../index.php"); exit; } include LOCALE.LOCALESET."comments.php"; function showcomments($ctype,$cdb,$ccol,$cid,$clink) { global $settings,$locale,$userdata,$aidlink; if ((iMEMBER || $settings['guestposts'] == "1") && isset($_POST['post_comment'])) { $flood = false; if (dbrows(dbquery("SELECT $ccol FROM ".DB_PREFIX."$cdb WHERE $ccol='$cid'"))==0) { if (!check_captcha($_POST['captcha_encode'], $_POST['captcha_code'])) { $error .= "Neteisingas patvirtinimo kodas \n"; { fallback(BASEDIR."index.php"); } if (iMEMBER) { $comment_name = $userdata['user_id']; } elseif ($settings['guestposts'] == "1") { $comment_name = trim(stripinput($_POST['comment_name'])); $comment_name = preg_replace("(^[0-9]*)", "", $comment_name); if (isNum($comment_name)) $comment_name=""; } $comment_message = trim(stripinput(censorwords($_POST['comment_message']))); $comment_smileys = isset($_POST['disable_smileys']) ? "0" : "1"; if ($comment_name != "" && $comment_message != "") { $result = dbquery("SELECT MAX(comment_datestamp) AS last_comment FROM ".DB_PREFIX."comments WHERE comment_ip='".USER_IP."'"); if (!iSUPERADMIN || dbrows($result) > 0) { $data = dbarray($result); if ((time() - $data['last_comment']) < $settings['flood_interval']) { $flood = true; $result = dbquery("INSERT INTO ".DB_PREFIX."flood_control (flood_ip, flood_timestamp) VALUES ('".USER_IP."', '".time()."')"); if (dbcount("(flood_ip)", "flood_control", "flood_ip='".USER_IP."'") > 4) { if (iMEMBER) $result = dbquery("UPDATE ".DB_PREFIX."users SET user_status='1' WHERE user_id='".$userdata['user_id']."'"); } } } if (!$flood) $result = dbquery("INSERT INTO ".DB_PREFIX."comments (comment_item_id, comment_type, comment_name, comment_message, comment_smileys, comment_datestamp, comment_ip) VALUES ('$cid', '$ctype', '$comment_name', '$comment_message', '$comment_smileys', '".time()."', '".USER_IP."')"); } redirect($clink); } tablebreak(); opentable($locale['c100']); $result = dbquery( "SELECT tcm.*,user_name FROM ".DB_PREFIX."comments tcm LEFT JOIN ".DB_PREFIX."users tcu ON tcm.comment_name=tcu.user_id WHERE comment_item_id='$cid' AND comment_type='$ctype' ORDER BY comment_datestamp ASC" ); if (dbrows($result) != 0) { $i = 0; echo " class='tbl-border'>\n"; while ($data = dbarray($result)) { echo "
| 2==0?"tbl1":"tbl2")."'>\n"; if ($data['user_name']) { echo "".$data['user_name'].""; } else { echo " color='#216db9'>".$data['comment_name'].""; } if ($data['comment_smileys'] == "1") { $comment_message = parsesmileys($data['comment_message']); } else { $comment_message = $data['comment_message']; } $comment_message = nl2br(parseubb($comment_message)); echo "\n class='small'>".$locale['041'].showdate("longdate", $data['comment_datestamp'])." \n"; echo $comment_message."\n $i++; } if (checkrights("C")) echo "
| class='".($i% 2==0?"tbl1":"tbl2")."'> href='".ADMIN."comments.php".$aidlink."&ctype=$ctype&cid=$cid'>".$lo cale['c106']."\n echo " |
} else {
echo $locale['c101']."\n";
}
closetable();
tablebreak();
opentable($locale['c102']);
if (iMEMBER || $settings['guestposts'] == "1") {
echo "\n";
} else {
echo $locale['c105']."\n";
}
closetable();
}
?>
Puslapyje meta:
Parse error: syntax error, unexpected $end in /home/sportasgyv/domains/kkmazeikiai.lt/public_html/priedai/comments_include.php on line 115
Jei atvirai, tai ne?inau ar ir i?taisius tent klaid viskas veiks, tad jei galit kas nors terpkit normaliai captcha ? kod. Dkingas ;)
parašyta 2010-09-28 12:27
S.Administratorius

Reputacija: 0
Pranešimai: 1009
Įstojo: 2008-10-16
parašyta 2010-09-28 15:47
Naujokas

Reputacija: 0
Pranešimai: 8
Įstojo: 2007-09-01
| Peršokti į forumą: |


