From: Javier B. <jb...@us...> - 2004-11-18 16:36:04
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11610/modules Modified Files: Quote.php Log Message: tema de puntuaciones, renombrado de alguna funcion et al Index: Quote.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/Quote.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Quote.php 18 Nov 2004 12:27:09 -0000 1.11 --- Quote.php 18 Nov 2004 16:35:51 -0000 1.12 *************** *** 37,41 **** $view->view_non_inserted_quote(); } else { ! $this->mail_warning($author, $quote, $ip); $url = '?page=quote&action=single&quote='.$bd->Insert_ID(); $view->view_inserted_quote($url); --- 37,41 ---- $view->view_non_inserted_quote(); } else { ! $this->mail_pending_quote($author, $quote, $ip); $url = '?page=quote&action=single&quote='.$bd->Insert_ID(); $view->view_inserted_quote($url); *************** *** 132,136 **** } ! function mail_warning($author, $quote, $ip) { include ("config.php"); --- 132,176 ---- } ! function set_quote_score($score_id, $score_action) ! { ! include ("config.php"); ! $ip = get_ipaddr(); ! ! /* ! * check last vote ! */ ! ! $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; ! } ! if (isset($sql2)) { $bd->_Execute($sql2); } ! } ! } ! ! function mail_revision_quote($id) ! { ! 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"; ! ! $from = "From: webmaster@$_SERVER[SERVER_NAME]\nReply-To: $author\nX-Mailer: OpenBash MSG Alert System"; ! mail($rcpt, $subject, $body, $from); ! } ! } ! ! function mail_pending_quote($author, $quote, $ip) { include ("config.php"); |