From: Javier B. <jb...@us...> - 2004-11-16 10:46:26
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21741/modules Modified Files: Quote.php Added Files: View.php Log Message: clase view; el este mola maaaaaas --- NEW FILE: View.php --- <?php /* * Display XHTML in a fancy way * We love you HnZeKtO :D */ class view { function ask_quote() { global $add;?> <form id="addquote" action="?page=quote&action=insert" method="post"> <p><textarea id="quote" name="quote" class="textarea" cols="60%" rows="10"></textarea></p> <p><input type="text" id="author" name="author" /><?=$add['author'];?></p> <p><input type="text" id="channel" name="channel" /><?=$add['channel'];?></p> <p><input type="text" id="network" name="network" /><?=$add['network'];?></p> <p> <input type="button" id="preview" value="<?=$add['preview'];?>" /> <input type="submit" id="submit" value="<?=$add['submit'];?>" /> <input type="button" id="reset" value="<?=$add['reset'];?>" /> </p> </form> <p><?=$add['tip'];?></p> <p><?=$add['privacy'];?></p><? } function view_quote($id, $points, $quote, $author, $channel, $network, $ip) { global $quote_language;?> <p class="quote"> <a href="" title="<?=$quote_language['permalink']?>"><b>#<?=$id?></b></a> <a href="rox=312" class="qa">+</a>(<?=$points?>) <a href="sux=312" class="qa">-</a> <a href="rev=312" onClick="return confirm('Flag quote for review?');" class="qa">[X]</a> </p> <p class="qt"><?=$quote?></p><?php } } Index: Quote.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/Quote.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Quote.php 15 Nov 2004 20:26:25 -0000 1.3 --- Quote.php 16 Nov 2004 10:46:14 -0000 1.4 *************** *** 8,29 **** class Quote { - function ask_quote() - { - global $add;?> - <form id="addquote" action="?page=quote&action=insert" method="post"> - <p><textarea id="quote" name="quote" class="textarea" cols="60%" rows="10"></textarea></p> - <p><input type="text" id="author" name="author" /><?=$add['author'];?></p> - <p><input type="text" id="channel" name="channel" /><?=$add['channel'];?></p> - <p><input type="text" id="network" name="network" /><?=$add['network'];?></p> - <p> - <input type="button" id="preview" value="<?=$add['preview'];?>" /> - <input type="submit" id="submit" value="<?=$add['submit'];?>" /> - <input type="button" id="reset" value="<?=$add['reset'];?>" /> - </p> - </form> - <p><?=$add['tip'];?></p> - <p><?=$add['privacy'];?></p><? - } - function insert_quote($quote, $author, $channel, $network, $ip) { --- 8,11 ---- *************** *** 53,73 **** } ! function show_quote($id) { include ("config.php"); $sql = "SELECT points,quote,author,channel,network,ip FROM quote WHERE id='$id' AND quote.purge=0 AND pending=0"; $quote = $bd->_Execute($sql); ! if($quote->RecordCount() == 1) { ?> ! <p class="quote"> ! <a href="" title="Permanent link to this quote."><b>#<?=$id?></b></a> ! <a href="rox=312" class="qa">+</a>(<?=$quote->fields['points']?>) ! <a href="sux=312" class="qa">-</a> ! <a href="rev=312" onClick="return confirm('Flag quote for review?');" class="qa">[X]</a> ! </p> ! <p class="qt"><?=$quote->fields['quote']?></p><?php } else { return (0); } } ! function show_quotes_by_id($order, $start, $end) { include ("config.php"); --- 35,50 ---- } ! function get_quote($id) { include ("config.php"); + $view = new view(); $sql = "SELECT points,quote,author,channel,network,ip FROM quote WHERE id='$id' AND quote.purge=0 AND pending=0"; $quote = $bd->_Execute($sql); ! if($quote->RecordCount() == 1) { ! $view->view_quote($id, $quote->fields['points'], $quote->fields['quote'], $quote->fields['author'], $quote->fields['channel'], $quote->fields['network'], $quote->fields['ip']); } else { return (0); } } ! function get_quotes_by_id($order, $start, $end) { include ("config.php"); *************** *** 75,83 **** $ids = $bd->_Execute($sql); if($ids->RecordCount()) { ! while (!$ids->EOF) { $this->show_quote($ids->fields['id']); $ids->MoveNext(); } } else { return (0); } } ! function show_quotes_by_top($top) { include ("config.php"); --- 52,60 ---- $ids = $bd->_Execute($sql); if($ids->RecordCount()) { ! while (!$ids->EOF) { $this->get_quote($ids->fields['id']); $ids->MoveNext(); } } else { return (0); } } ! function get_quotes_by_top($top) { include ("config.php"); *************** *** 87,91 **** <table cellpadding="2" cellspacing="0" width="80%"> <tr><td><?php ! while (!$ids->EOF) { $this->show_quote($ids->fields['id']); $ids->MoveNext(); } ?> </td></tr> </table><?php --- 64,68 ---- <table cellpadding="2" cellspacing="0" width="80%"> <tr><td><?php ! while (!$ids->EOF) { $this->get_quote($ids->fields['id']); $ids->MoveNext(); } ?> </td></tr> </table><?php |