From: Javier B. <jb...@us...> - 2004-11-18 17:21:44
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22109/modules Modified Files: Quote.php Log Message: añadido campo voter en quote para almacenar la ip del ultimo votante y evitar tramposos ; corregido un bug de una consulta en el metodo set_quote_score Index: Quote.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/Quote.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Quote.php 18 Nov 2004 16:35:51 -0000 1.12 --- Quote.php 18 Nov 2004 17:21:32 -0000 1.13 *************** *** 141,150 **** */ ! $sql = "SELECT voter FROM quotes WHERE id='$score_id'"; $voter = $bd->_Execute($sql); if (strcmp($ip, $voter->fields['voter'])) { switch ($score_action) { ! case 'rox': $sql2 = "UPDATE quotes SET points=points+1,voter='$ip' WHERE id='$score_id'"; break; ! case 'sux': $sql2 = "UPDATE quotes SET points=points-1,voter='$ip' WHERE id='$score_id'"; break; case 'rev': $this->mail_revision_quote($score_id); break; } --- 141,150 ---- */ ! $sql = "SELECT voter FROM quote WHERE id='$score_id'"; $voter = $bd->_Execute($sql); if (strcmp($ip, $voter->fields['voter'])) { switch ($score_action) { ! case 'rox': $sql2 = "UPDATE quote SET points=points+1,voter='$ip' WHERE id='$score_id'"; break; ! case 'sux': $sql2 = "UPDATE quote SET points=points-1,voter='$ip' WHERE id='$score_id'"; break; case 'rev': $this->mail_revision_quote($score_id); break; } *************** *** 156,167 **** { include ("config.php"); ! $sql = "SELECT quote FROM quotes WHERE id='$id'"; $quote = $bd->_Execute($sql); if ($quote->RecordCount()) { $rcpt = $moderator_email; $subject = "[ OpenBash ] quote $id may need a revision"; $body = "This quote: ! $quote Seems to need a revision. Please go to control panel and check it"; --- 156,168 ---- { include ("config.php"); ! $sql = "SELECT quote FROM quote WHERE id='$id'"; $quote = $bd->_Execute($sql); if ($quote->RecordCount()) { + $q = $quote->fields['quote']; $rcpt = $moderator_email; $subject = "[ OpenBash ] quote $id may need a revision"; $body = "This quote: ! $q Seems to need a revision. Please go to control panel and check it"; |