|
From: Javier B. <jb...@us...> - 2005-03-31 11:26:23
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11940/modules Modified Files: Quote.php View.php Log Message: Ya se pueden listar las quotes pendientes y aprobarlas, aunque de manera algo rudimentaria. Index: View.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/View.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** View.php 4 Jan 2005 11:33:41 -0000 1.20 --- View.php 31 Mar 2005 11:25:57 -0000 1.21 *************** *** 50,53 **** --- 50,66 ---- } + function view_admin_quote($data) + { + global $quote_language;?> + <p class="quote"> + <a href="?page=quote&action=single&quote=<?=$data['id']?>" title="<?=$quote_language['permalink']?>"><b>#<?=$data['id']?></b></a> + <a href="?page=quote&action=score&rox=<?=$data['id']?>" class="qa">+</a> (<?=$data['points']?>) + <a href="?page=quote&action=score&sux=<?=$data['id']?>" class="qa">-</a> + <a href="?page=admin&a_opt=quotes&a_act=delete&quote=<?=$data['id']?>" class="qa">[X]</a> + <a href="?page=admin&a_opt=quotes&a_act=aprove&quote=<?=$data['id']?>" class="qa">[V]</a> + </p> + <p class="qt"><?=$data['quote']?></p><?php + } + function view_pending_quote() { Index: Quote.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/Quote.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Quote.php 27 Jan 2005 16:52:54 -0000 1.20 --- Quote.php 31 Mar 2005 11:25:57 -0000 1.21 *************** *** 71,74 **** --- 71,82 ---- return (0); } + + function get_admin_quote($data) + { + $sql = "SELECT id,points,quote,author,channel,network,ip,pending FROM quote WHERE id='$data[id]'"; + $quote = $this->bd->Execute($sql); + if($quote->RecordCount() == 1) { return ($quote->fields); } + return (0); + } function get_quotes_by_id($order, $start, $end) *************** *** 89,92 **** --- 97,120 ---- return (0); } + + function get_quotes_by_pending($start, $end) + { + if (empty($start)) $start = 0; + if (empty($end)) $end = 50; + $sql = "SELECT id FROM quote WHERE deleted=0 AND pending=1 ORDER BY id LIMIT $start,$end"; + $ids = $this->bd->Execute($sql); + if($ids->RecordCount()) { + while (!$ids->EOF) { + if (empty($ret)) { + $ret = array($ids->fields); + } else { + array_push($ret, $ids->fields); + } + $ids->MoveNext(); + } + return ($ret); + } + return (0); + } function get_quotes_by_top($top) *************** *** 184,187 **** --- 212,233 ---- } } + + function set_quote_aproved($id) + { + $sql = "UPDATE quote SET pending=0 WHERE id='$id'"; + $this->bd->_Execute($sql); + } + + function set_quote_pending($id) + { + $sql = "UPDATE quote SET pending=1 WHERE id='$id'"; + $this->bd->_Execute($sql); + } + + function set_quote_deleted($id) + { + $sql = "UPDATE quote SET deleted=1 WHERE id='$id'"; + $this->bd->_Execute($sql); + } function mail_revision_quote($id) |