Changeset 835 in ExiteCMS for trunk/includes/comments_include.php
- Timestamp:
- 09/23/07 23:34:47 (5 years ago)
- File:
-
- 1 edited
-
trunk/includes/comments_include.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/comments_include.php
r834 r835 21 21 function showcomments($comment_type,$cdb,$ccol,$comment_id,$clink) { 22 22 23 global $ settings,$locale,$userdata,$aidlink,23 global $db_prefix, $settings,$locale,$userdata,$aidlink, 24 24 $template_panels, $template_variables; 25 25 … … 28 28 if ((iMEMBER || $settings['guestposts'] == "1") && isset($_POST['post_comment'])) { 29 29 $flood = false; 30 if (dbrows(dbquery("SELECT $ccol FROM ". DB_PREFIX."$cdb WHERE $ccol='$comment_id'"))==0) {30 if (dbrows(dbquery("SELECT $ccol FROM ".$db_prefix."$cdb WHERE $ccol='$comment_id'"))==0) { 31 31 fallback(BASEDIR."index.php"); 32 32 } … … 41 41 $comment_smileys = isset($_POST['disable_smileys']) ? "0" : "1"; 42 42 if ($comment_name != "" && $comment_message != "") { 43 $result = dbquery("SELECT MAX(comment_datestamp) AS last_comment FROM ". DB_PREFIX."comments WHERE comment_ip='".USER_IP."'");43 $result = dbquery("SELECT MAX(comment_datestamp) AS last_comment FROM ".$db_prefix."comments WHERE comment_ip='".USER_IP."'"); 44 44 if (!iSUPERADMIN || dbrows($result) > 0) { 45 45 $data = dbarray($result); … … 52 52 } 53 53 } 54 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 ('$comment_id', '$comment_type', '$comment_name', '$comment_message', '$comment_smileys', '".time()."', '".USER_IP."')");54 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 ('$comment_id', '$comment_type', '$comment_name', '$comment_message', '$comment_smileys', '".time()."', '".USER_IP."')"); 55 55 } 56 56 redirect($clink); … … 58 58 59 59 $result = dbquery( 60 "SELECT tcm.*,user_name FROM ". DB_PREFIX."comments tcm61 LEFT JOIN ". DB_PREFIX."users tcu ON tcm.comment_name=tcu.user_id60 "SELECT tcm.*,user_name FROM ".$db_prefix."comments tcm 61 LEFT JOIN ".$db_prefix."users tcu ON tcm.comment_name=tcu.user_id 62 62 WHERE comment_item_id='$comment_id' AND comment_type='$comment_type' 63 63 ORDER BY comment_datestamp ASC"
Note: See TracChangeset
for help on using the changeset viewer.
