--- HEAD +++ Modified In Working Tree @@ -1,4 +1,5 @@ cid; - $ip = $user->hostname; + $ip = $user->hostname; - $vote = simple_comment_rate_check_vote($cid, $ip, $user->uid); + $vote = simple_comment_rate_check_vote($cid, $ip, $user->uid); $comment->voted = $vote; list($rows_up_numb, $rows_down_numb) = simple_comment_rate_getcommentrate($cid); - $comment->voted_up_numb = $rows_up_numb; + $comment->voted_up_numb = $rows_up_numb; $comment->voted_down_numb = $rows_down_numb; } @@ -122,7 +123,7 @@ exit(); } - $ip = $user->hostname; + $ip = $user->hostname; simple_comment_rate_updatetable($cid, $ip, $user->uid, $rate); @@ -158,7 +159,7 @@ * Check to see whether the user has voted already based on IP or user ID. */ function simple_comment_rate_check_vote($cid, $ip, $uid) { - $vote = db_query("SELECT ips, uids FROM {simple_comment_rate} where cid = :cid", array(':cid' => $cid))->fetchAssoc(); + $vote = db_query("SELECT ips, uids FROM {simple_comment_rate} where cid = :cid", array(':cid' => $cid))->fetchAssoc(); if ($vote === FALSE) { return FALSE; @@ -180,7 +181,7 @@ * Returns UP and DOWN votes for a given comment ID. */ function simple_comment_rate_getcommentrate($cid) { - $row = db_query("SELECT rateup, ratedown FROM {simple_comment_rate} where cid = :cid", array(':cid' => $cid))->fetchAssoc(); + $row = db_query("SELECT rateup, ratedown FROM {simple_comment_rate} where cid = :cid", array(':cid' => $cid))->fetchAssoc(); if (!$row) { return array(0, 0); @@ -201,7 +202,7 @@ * Updates simple_comment_rate table when user votes on comment. */ function simple_comment_rate_updatetable($cid, $ip, $uid, $rate) { - $row = db_query("SELECT * FROM {simple_comment_rate} where cid = :cid", array(':cid' => $cid))->fetchAssoc(); + $row = db_query("SELECT * FROM {simple_comment_rate} where cid = :cid", array(':cid' => $cid))->fetchAssoc(); if (!$row) { $res = db_insert('simple_comment_rate') @@ -285,7 +286,6 @@ $form['#submit'][] = 'simple_comment_rate_admin_settings_submit'; return system_settings_form($form); - } /** @@ -379,7 +379,7 @@ $title_attribute_like = 'title = "' . $t("You don't have permissions to vote") . '"'; $title_attribute_disike = 'title = "' . $t("You don't have permissions to vote") . '"'; - $picup = $pics_path . "gray_up.png"; + $picup = $pics_path . "gray_up.png"; $picdown = $pics_path . "gray_down.png"; $rateclass = ""; @@ -388,7 +388,7 @@ $title_attribute_like = "title = '" . $t('Log in to vote') . "'"; $title_attribute_disike = "title = '" . $t('Log in to vote') . "'"; - $picup = $pics_path . "gray_up.png"; + $picup = $pics_path . "gray_up.png"; $picdown = $pics_path . "gray_down.png"; $rateclass = ""; @@ -399,7 +399,6 @@ " . $numbdowntext . ""; return $output; - } /**