You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(20) |
Sep
|
Oct
(7) |
Nov
(81) |
Dec
(6) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(4) |
Feb
|
Mar
(6) |
Apr
(1) |
May
(2) |
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: José M. M. <ri...@us...> - 2005-08-30 10:21:50
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1590 Modified Files: Quote.php common.php Log Message: Ahora se utiliza el qstr() de ADODB para limpiar los datos introducidos por los usuarios. Index: Quote.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/Quote.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Quote.php 28 Aug 2005 20:01:35 -0000 1.23 --- Quote.php 30 Aug 2005 10:21:39 -0000 1.24 *************** *** 26,33 **** --- 26,38 ---- { $view = new view(); + $magic = get_magic_quotes_gpc(); $quote = nl2br(variable_clean($quote)); + $quote_clean = $this->bd->qstr($quote, $magic); //$author = check_email($author); + $author_clean = $this->bd->qstr($author, $magic); $channel = variable_clean($channel); + $channel_clean = $this->bd->qstr($channel, $magic); $network = variable_clean($network); + $network_clean = $this->bd->qstr($network, $magic); //$ip = check_ipv4($ip); $deleted = 0; // by default the quote is not purged, of course xD *************** *** 40,47 **** '$points', '$deleted', ! '$quote', ! '$author', ! '$channel', ! '$network', '$pending', '$ip')"; --- 45,52 ---- '$points', '$deleted', ! '$quote_clean', ! '$author_clean', ! '$channel_clean', ! '$network_clean', '$pending', '$ip')"; Index: common.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/common.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** common.php 26 Dec 2004 22:57:19 -0000 1.6 --- common.php 30 Aug 2005 10:21:39 -0000 1.7 *************** *** 7,11 **** '<li><ol><p><strong>'. '<u><ul><span><pre>'; ! $tmp = str_replace ('--', '', $var); $tmp = htmlentities($tmp); $tmp = strip_tags ($tmp, $allowed); --- 7,11 ---- '<li><ol><p><strong>'. '<u><ul><span><pre>'; ! //$tmp = str_replace ('--', '', $var); $tmp = htmlentities($tmp); $tmp = strip_tags ($tmp, $allowed); |
|
From: José M. M. <ri...@us...> - 2005-08-28 20:02:50
|
Update of /cvsroot/openbash-org/openbash-org/pages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32210 Added Files: admin_quotes.php Log Message: Inicio de lo que sería el admin_quotes.php. Por algún extraño motivo las quotes no aparecen. ¿Ideas? --- NEW FILE: admin_quotes.php --- <? /* vim: set sts=2 ts=8 sw=2 noexpandtab: */ $quote = new Quote(); $view = new View(); $pending = $quote->get_quotes_by_pending(); // Preliminar, sólo quiero que me muestre las quotes pendientes // Habrá que hacer un formulario (¿en Quote, en admin?) // para la aprobación. foreach ($pending as $pending_quote) { $view->view_quote($pending_quote); } ?> |
|
From: José M. M. <ri...@us...> - 2005-08-28 20:01:43
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31936 Modified Files: Quote.php Log Message: Puestos algunos valores por defecto en la los límites de los SELECT de la base de datos en los parámetros que se pasan a las funciones. Quizá habría que poner esto en la configuración. De momento he puesto 50. Index: Quote.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/Quote.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Quote.php 25 May 2005 07:22:41 -0000 1.22 --- Quote.php 28 Aug 2005 20:01:35 -0000 1.23 *************** *** 80,84 **** } ! function get_quotes_by_id($order, $start, $end) { $sql = "SELECT id FROM quote WHERE deleted=0 AND pending=0 ORDER BY id $order LIMIT $start,$end"; --- 80,84 ---- } ! function get_quotes_by_id($order, $start = 0, $end = 50) { $sql = "SELECT id FROM quote WHERE deleted=0 AND pending=0 ORDER BY id $order LIMIT $start,$end"; *************** *** 98,105 **** } ! 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); --- 98,103 ---- } ! function get_quotes_by_pending($start = 0, $end = 50) { $sql = "SELECT id FROM quote WHERE deleted=0 AND pending=1 ORDER BY id LIMIT $start,$end"; $ids = $this->bd->Execute($sql); *************** *** 118,122 **** } ! function get_quotes_by_top($top) { $sql = "SELECT id FROM quote WHERE deleted=0 AND pending=0 ORDER BY points DESC LIMIT $top"; --- 116,120 ---- } ! function get_quotes_by_top($top = 50) { $sql = "SELECT id FROM quote WHERE deleted=0 AND pending=0 ORDER BY points DESC LIMIT $top"; |
|
From: José M. M. <ri...@us...> - 2005-08-28 19:25:57
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24691/modules Modified Files: Validate.php Log Message: Si usamos el MD5 en la DB para los usuarios, usamos también el MD5 en el .php de validación, medias tintas no que no funciona. A no ser que metamos parte con JavaScript, en cuyo caso me meto la lengua en el culo. Pero no es el caso. Así que de momento no me meto la lengua en el culo. Index: Validate.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/Validate.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Validate.php 1 Apr 2005 07:46:59 -0000 1.6 --- Validate.php 28 Aug 2005 19:25:20 -0000 1.7 *************** *** 14,19 **** $this->bd->Debug = True; ! //$sql = "SELECT * FROM users WHERE login LIKE \"$login\" AND passwd LIKE MD5(\"$passwd\")"; ! $sql = "SELECT login FROM users WHERE login='$login' AND passwd='$passwd'"; $res = $this->bd->_Execute($sql); --- 14,19 ---- $this->bd->Debug = True; ! $sql = "SELECT * FROM users WHERE login LIKE \"$login\" AND passwd LIKE MD5(\"$passwd\")"; ! //$sql = "SELECT login FROM users WHERE login='$login' AND passwd='$passwd'"; $res = $this->bd->_Execute($sql); |
|
From: Javier B. <jb...@us...> - 2005-05-25 07:22:51
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30191/modules Modified Files: Quote.php Log Message: retocado TODO Index: Quote.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/Quote.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Quote.php 31 Mar 2005 11:25:57 -0000 1.21 --- Quote.php 25 May 2005 07:22:41 -0000 1.22 *************** *** 247,251 **** $from = "From: webmaster@$_SERVER[SERVER_NAME]\nReply-To: $author\nX-Mailer: OpenBash MSG Alert System"; ! mail($rcpt, $subject, $body, $from); } } --- 247,251 ---- $from = "From: webmaster@$_SERVER[SERVER_NAME]\nReply-To: $author\nX-Mailer: OpenBash MSG Alert System"; ! mail($rcpt, $subject, html_entity_decode($body), $from); } } *************** *** 254,257 **** --- 254,258 ---- { include ('config.php'); + $quote = html_entity_decode($quote); $rcpt = $moderator_email; $subject = "[ OpenBash ] new quote inserted by $author"; *************** *** 262,268 **** by: $author ($ip) ! * Please visit the admin page to validate: http://$_SERVER[SERVER_NAME]/$_SERVER[SCRIPT_NAME]?page=admin"; $from = "From: webmaster@$_SERVER[SERVER_NAME]\nReply-To: $author\nX-Mailer: OpenBash MSG Alert System"; ! mail($rcpt, $subject, $body, $from); } } --- 263,271 ---- by: $author ($ip) ! * Please visit the admin page to check the validity of the quote: ! ! http://$_SERVER[SERVER_NAME]/$_SERVER[SCRIPT_NAME]?page=admin"; $from = "From: webmaster@$_SERVER[SERVER_NAME]\nReply-To: $author\nX-Mailer: OpenBash MSG Alert System"; ! mail($rcpt, $subject, html_entity_decode($body), $from); } } |
|
From: Javier B. <jb...@us...> - 2005-05-25 07:22:51
|
Update of /cvsroot/openbash-org/openbash-org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30191 Modified Files: TODO config.php Log Message: retocado TODO Index: config.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/config.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** config.php 31 Mar 2005 11:25:57 -0000 1.20 --- config.php 25 May 2005 07:22:40 -0000 1.21 *************** *** 18,22 **** # they will receive an email for every pending quote ! $moderator_email = 'ch...@sl...,co...@va...'; $summaries = 50; # number of quotes shown on a single page --- 18,22 ---- # they will receive an email for every pending quote ! $moderator_email = 'hn...@es...,ch...@sl...,co...@va...'; $summaries = 50; # number of quotes shown on a single page Index: TODO =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/TODO,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TODO 17 Dec 2004 11:58:07 -0000 1.4 --- TODO 25 May 2005 07:22:40 -0000 1.5 *************** *** 13,15 **** · quote moderation · some configuration ! --- 13,16 ---- · quote moderation · some configuration ! · javascript quote delete/aprove confirmation ! |
|
From: Javier B. <jb...@us...> - 2005-04-01 07:47:08
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30527/modules Modified Files: Validate.php Log Message: cambiado private por var en Validate.php para que sea PHP4 compliant... Index: Validate.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/Validate.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Validate.php 26 Dec 2004 22:57:19 -0000 1.5 --- Validate.php 1 Apr 2005 07:46:59 -0000 1.6 *************** *** 3,7 **** class Validate { ! private $bd; function check_form($login, $passwd) --- 3,8 ---- class Validate { ! //private $bd; ! var $bd; function check_form($login, $passwd) |
|
From: Javier B. <jb...@us...> - 2005-03-31 11:26:26
|
Update of /cvsroot/openbash-org/openbash-org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11940 Modified Files: config.php Log Message: Ya se pueden listar las quotes pendientes y aprobarlas, aunque de manera algo rudimentaria. Index: config.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/config.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** config.php 3 Mar 2005 21:06:54 -0000 1.19 --- config.php 31 Mar 2005 11:25:57 -0000 1.20 *************** *** 6,21 **** $dbuser = 'openbash'; # a user with full privileges to access the database $dbpass = '02jdf9234y9'; # the user's password database ! $dbname = 'openbash'; # the database name ! $dbtype = 'mysql'; # type of database: mysql, pgsql, etc ! $lang = 'spanish'; ! $style = 'classic.css'; $admin_pass = ''; ! $moderator_email = 'co...@va...'; # put here the mail ! # address of moderators, ! # they will receive an email ! # for every pending quote $summaries = 50; # number of quotes shown on a single page --- 6,23 ---- $dbuser = 'openbash'; # a user with full privileges to access the database $dbpass = '02jdf9234y9'; # the user's password database ! $dbname = 'openbash'; # the database name ! $dbtype = 'mysql'; # type of database: mysql, pgsql, etc ! $lang = 'spanish'; # language displayed ! $style = 'classic.css'; # stylesheet used $admin_pass = ''; ! # moderator_email: ! # put here the mail address of moderators, ! # they will receive an email for every pending quote ! ! $moderator_email = 'ch...@sl...,co...@va...'; ! $summaries = 50; # number of quotes shown on a single page *************** *** 24,33 **** */ ! include ('adodb.inc.php'); $ADODB_CACHE_DIR = 'cache/'; # we prefer associative arrays ! $ADODB_COUNTRECS = false; # we do not want RecordCount() emulation ! $ADODB_LANG = 'es'; ! $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; # directory to store sql ! # results to speed up queries $ADODB_EXPIRE_CACHE = 3600; --- 26,34 ---- */ ! include ('adodb/adodb.inc.php'); $ADODB_CACHE_DIR = 'cache/'; # we prefer associative arrays ! $ADODB_COUNTRECS = false; # we do not want RecordCount() emulation as it is slow ! $ADODB_LANG = 'es'; # adodb language ! $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; # directory to store sql results to speed up queries $ADODB_EXPIRE_CACHE = 3600; |
|
From: Javier B. <jb...@us...> - 2005-03-31 11:26:23
|
Update of /cvsroot/openbash-org/openbash-org/pages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11940/pages Modified Files: admin.php Log Message: Ya se pueden listar las quotes pendientes y aprobarlas, aunque de manera algo rudimentaria. Index: admin.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/pages/admin.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** admin.php 4 Jan 2005 11:33:41 -0000 1.9 --- admin.php 31 Mar 2005 11:25:57 -0000 1.10 *************** *** 1,3 **** --- 1,4 ---- <?php /* vim: set sts=2 ts=8 sw=2 noexpandtab: */ + include ("modules/Quote.php"); include ("modules/View.php"); include ("modules/Validate.php"); *************** *** 16,20 **** case 'users' : $admin_page = 'users'; break; case 'close' : $admin_page = 'close'; break; ! default : $admin_page = 'quotes';break; } } else { --- 17,21 ---- case 'users' : $admin_page = 'users'; break; case 'close' : $admin_page = 'close'; break; ! default : $admin_page = 'quotes'; break; } } else { |
|
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) |
|
From: José M. M. <ri...@us...> - 2005-03-03 21:07:25
|
Update of /cvsroot/openbash-org/openbash-org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14889 Modified Files: config.php Log Message: - Añadida configuración para seleccionar uno de varios estilos posibles. - A ver si le damos el último empujón ya. Index: config.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/config.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** config.php 26 Dec 2004 22:57:18 -0000 1.18 --- config.php 3 Mar 2005 21:06:54 -0000 1.19 *************** *** 6,19 **** $dbuser = 'openbash'; # a user with full privileges to access the database $dbpass = '02jdf9234y9'; # the user's password database ! $dbname = 'openbash-org'; # the database name ! $dbtype = 'mysql'; # type of database: mysql, pgsql, etc $lang = 'spanish'; $admin_pass = ''; ! $moderator_email = 'co...@va...'; # put here the mail address of moderators, ! # they will receive an email for every pending quote ! $summaries = 50; # number of quotes shown on a single page /* --- 6,22 ---- $dbuser = 'openbash'; # a user with full privileges to access the database $dbpass = '02jdf9234y9'; # the user's password database ! $dbname = 'openbash'; # the database name ! $dbtype = 'mysql'; # type of database: mysql, pgsql, etc $lang = 'spanish'; + $style = 'classic.css'; $admin_pass = ''; ! $moderator_email = 'co...@va...'; # put here the mail ! # address of moderators, ! # they will receive an email ! # for every pending quote ! $summaries = 50; # number of quotes shown on a single page /* *************** *** 21,29 **** */ ! include ('adodb/adodb.inc.php'); ! $ADODB_CACHE_DIR = 'cache/'; # we prefer associative arrays ! $ADODB_COUNTRECS = false; # we do not want RecordCount() emulation $ADODB_LANG = 'es'; ! $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; # directory to store sql results to speed up queries $ADODB_EXPIRE_CACHE = 3600; --- 24,33 ---- */ ! include ('adodb.inc.php'); ! $ADODB_CACHE_DIR = 'cache/'; # we prefer associative arrays ! $ADODB_COUNTRECS = false; # we do not want RecordCount() emulation $ADODB_LANG = 'es'; ! $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; # directory to store sql ! # results to speed up queries $ADODB_EXPIRE_CACHE = 3600; |
|
From: José M. M. <ri...@us...> - 2005-03-03 21:07:04
|
Update of /cvsroot/openbash-org/openbash-org/pages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14889/pages Modified Files: header.php Log Message: - Añadida configuración para seleccionar uno de varios estilos posibles. - A ver si le damos el último empujón ya. Index: header.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/pages/header.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** header.php 18 Nov 2004 12:27:10 -0000 1.14 --- header.php 3 Mar 2005 21:06:54 -0000 1.15 *************** *** 8,12 **** <title><?php echo $title;?></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> ! <link rel="stylesheet" href="css/styles.css" type="text/css" /> </head> <body> --- 8,12 ---- <title><?php echo $title;?></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> ! <link rel="stylesheet" href="css/<?=$style?>" type="text/css" /> </head> <body> |
|
From: José M. M. <ri...@us...> - 2005-03-03 21:07:04
|
Update of /cvsroot/openbash-org/openbash-org/css In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14889/css Added Files: classic.css Removed Files: styles.css Log Message: - Añadida configuración para seleccionar uno de varios estilos posibles. - A ver si le damos el último empujón ya. --- NEW FILE: classic.css --- /* * "suggested" by the original bash.org style */ body { background-color: #ffffff; color: #000000; width: 80%; margin-left: 10%; } a:link { color: #c08000; } a:active { color: #c08000; } a:visited { color: #c08000; } input, textarea { border: 1px solid #333; background-color: #eee; } input:focus, textarea:focus { background-color: #fff; } a.admin { color: black; text-decoration: none; } #title { background-color: #c08000; float: left; font-size: 12px; width: 100%; } .colleft { background-color: #c08000; top: 0%; left:1%; float: left; color: black; text-align: left; padding: 3px; } .colright { top: 0%; right:1%; float: right; font-family: Arial, serif; color: black; text-align: right; padding: 4px; } #subtitle { background-color: #f0f0f0; float: right; text-align: right; font-size: 10px; width: 100%; } #footer { bottom: 0%; background-color: #c08000; font-family: arial, helvetica, sans-serif; font-size: smaller; text-align: right; } span.time { float: right; font-size: 10px; font-family: Courier New, monospace; position: relative; } .error { font-weight: bold; color: #900 } .smalltext {font-family: arial, helvetica, sans-serif;font-size: 10px;background-color: #f0f0f0;color: #000000} .seltext {font-family: arial, helvetica, sans-serif;font-size: 10px;background-color: #ffffff;color: #000000} select {color: #000000; background-color: #ffffff;} .qt { font-family: courier new, lucida console, fixed; font-size: 10pt; margin-top: 0px; } .qa { font-family: default; font-size: 8pt; text-decoration: none; } input.button { background-color: #c08000; color: #000000; } p.quote { font-family: courier new, lucida console, fixed; font-size: smaller; margin-bottom: 0px; } .bodytext { font-family: arial, helvetica, sans-serif; line-height: 21px; font-size: smaller; color: #000000; } .footertext { font-family: arial, helvetica, sans-serif; font-size: smaller; } .toplinks { font-family: arial, helvetica, sans-serif; color: #000000; font-size: smaller; } .topnum {font-family: arial, helvetica, sans-serif; color: #000000;} div.general { width: 100%; height: 100%; } .general_left { width: 50%; height: 100%; float: left; } .general_right { width: 50%; height: 100%; float: right; } --- styles.css DELETED --- |
|
From: Javier B. <jb...@us...> - 2005-01-27 16:53:10
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24765/modules Modified Files: Quote.php Log Message: cambiada Quote.php para volver a ofrecer soporte PHP4 Index: Quote.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/Quote.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Quote.php 4 Jan 2005 11:33:41 -0000 1.19 --- Quote.php 27 Jan 2005 16:52:54 -0000 1.20 *************** *** 8,15 **** class Quote { ! private $bd; ! private $expire_cache; ! function __construct() { include ('config.php'); --- 8,15 ---- class Quote { ! var $bd; ! var $expire_cache; ! function Quote() { include ('config.php'); *************** *** 21,25 **** } ! function __destruct() { $this->bd->Close(); } function insert_quote($quote, $author, $channel, $network, $ip) --- 21,25 ---- } ! //function __destruct() { $this->bd->Close(); } function insert_quote($quote, $author, $channel, $network, $ip) *************** *** 52,56 **** } else { $this->mail_pending_quote($author, $quote, $ip); ! $url = '?page=quote&action=single&quote='.$bd->Insert_ID(); $view->view_inserted_quote($url); } --- 52,56 ---- } else { $this->mail_pending_quote($author, $quote, $ip); ! $url = '?page=quote&action=single&quote='.$this->bd->Insert_ID(); $view->view_inserted_quote($url); } *************** *** 66,70 **** * return 1: valid / return 2: pending */ ! if ($quote->fields['pending'] == 1) return (1); return ($quote->fields); } --- 66,70 ---- * return 1: valid / return 2: pending */ ! if ($quote->fields['pending'] == 1) return (2); return ($quote->fields); } *************** *** 187,190 **** --- 187,191 ---- function mail_revision_quote($id) { + include ('config.php'); $sql = "SELECT quote FROM quote WHERE id='$id'"; $quote = $this->bd->CacheExecute($sql); *************** *** 206,209 **** --- 207,211 ---- function mail_pending_quote($author, $quote, $ip) { + include ('config.php'); $rcpt = $moderator_email; $subject = "[ OpenBash ] new quote inserted by $author"; |
|
From: Javier B. <jb...@us...> - 2005-01-27 16:53:04
|
Update of /cvsroot/openbash-org/openbash-org/pages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24765/pages Modified Files: quote.php Log Message: cambiada Quote.php para volver a ofrecer soporte PHP4 Index: quote.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/pages/quote.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** quote.php 4 Jan 2005 11:33:41 -0000 1.10 --- quote.php 27 Jan 2005 16:52:54 -0000 1.11 *************** *** 41,46 **** case 'insert': $ip = get_ipaddr(); $quote->insert_quote($_POST['quote'], $_POST['author'], $_POST['channel'], $_POST['network'], $ip); break; ! case 'single': $data = $quote->get_quote($_GET['quote']); ! $view->view_quote($data); break; case 'score' : --- 41,48 ---- case 'insert': $ip = get_ipaddr(); $quote->insert_quote($_POST['quote'], $_POST['author'], $_POST['channel'], $_POST['network'], $ip); break; ! case 'single': if (isset($_GET['quote'])) {$_GET['id'] = $_GET['quote']; } ! $data = $quote->get_quote($_GET); ! if ($data == 2) { $view->view_pending_quote(); } ! else { $view->view_quote($data); } break; case 'score' : |
|
From: Javier B. <jb...@us...> - 2005-01-04 11:33:51
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25501/modules Modified Files: Quote.php View.php Log Message: -sistema de auth funcionando correctamente -cambios en Quote.php, View.php y quote.php para no llamar a view dentro de quote Index: View.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/View.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** View.php 26 Dec 2004 22:57:19 -0000 1.19 --- View.php 4 Jan 2005 11:33:41 -0000 1.20 *************** *** 35,51 **** } ! function view_quote($id, $points, $quote, $author, $channel, $network, $ip) { global $quote_language;?> <p class="quote"> ! <a href="?page=quote&action=single&quote=<?=$id?>" title="<?=$quote_language['permalink']?>"><b>#<?=$id?></b></a> ! <a href="?page=quote&action=score&rox=<?=$id?>" class="qa">+</a> (<?=$points?>) ! <a href="?page=quote&action=score&sux=<?=$id?>" class="qa">-</a> ! <a href="?page=quote&action=score&rev=<?=$id?>" class="qa">[X]</a> <!-- ¿Queremos JavaScript? <a href="?page=quote&action=score&rev=<?=$id?>" onClick="return confirm('Flag quote for review?');" class="qa">[X]</a> --> </p> ! <p class="qt"><?=$quote?></p><?php } --- 35,51 ---- } ! function view_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=quote&action=score&rev=<?=$data['id']?>" class="qa">[X]</a> <!-- ¿Queremos JavaScript? <a href="?page=quote&action=score&rev=<?=$id?>" onClick="return confirm('Flag quote for review?');" class="qa">[X]</a> --> </p> ! <p class="qt"><?=$data['quote']?></p><?php } *************** *** 82,89 **** global $quote_language;?> <p><?=$quote_language['updated']?></p> - <!-- - NO JavaScript - <p><a href="javascript:;" onClick="history.back();"><?=$quote_language['back']?></a></p> - --> <p><a href="<?=$_SERVER['HTTP_REFERER']?>"><?=$quote_language['back']?></a></p> <?php --- 82,85 ---- *************** *** 101,104 **** --- 97,101 ---- global $quote_language;?> <p><?=$quote_language['score_twice']?></p> + <p><a href="<?=$_SERVER['HTTP_REFERER']?>"><?=$quote_language['back']?></a></p> <?php Index: Quote.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/Quote.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Quote.php 26 Dec 2004 22:57:18 -0000 1.18 --- Quote.php 4 Jan 2005 11:33:41 -0000 1.19 *************** *** 58,73 **** } ! function get_quote($id) { ! $view = new view(); ! $sql = "SELECT points,quote,author,channel,network,ip,pending FROM quote WHERE id='$id' AND deleted=0"; ! $quote = $this->bd->CacheExecute($this->expire_cache, $sql); if($quote->RecordCount() == 1) { ! switch($quote->fields['pending']) { ! case '0': $view->view_quote($id, $quote->fields['points'], $quote->fields['quote'], $quote->fields['author'], $quote->fields['channel'], $quote->fields['network'], $quote->fields['ip']); break; ! case '1': $view->view_pending_quote(); break; ! } ! } else { $view->view_non_existent_quote(); } ! $quote->Close(); } --- 58,73 ---- } ! function get_quote($data) { ! $sql = "SELECT id,points,quote,author,channel,network,ip,pending FROM quote WHERE id='$data[id]' AND deleted=0"; ! $quote = $this->bd->Execute($sql); if($quote->RecordCount() == 1) { ! /* ! * return 1: valid / return 2: pending ! */ ! if ($quote->fields['pending'] == 1) return (1); ! return ($quote->fields); ! } ! return (0); } *************** *** 75,89 **** { $sql = "SELECT id FROM quote WHERE deleted=0 AND pending=0 ORDER BY id $order LIMIT $start,$end"; ! $ids = $this->bd->CacheExecute($this->expire_cache, $sql); if($ids->RecordCount()) { while (!$ids->EOF) { ! $this->get_quote($ids->fields['id']); ! $ids->MoveNext(); ! } ! $ids->Close(); ! } else { ! $ids->Close(); ! return (0); } } --- 75,91 ---- { $sql = "SELECT id FROM quote WHERE deleted=0 AND pending=0 ORDER BY id $order 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); } *************** *** 94,105 **** if($ids->RecordCount()) { while (!$ids->EOF) { ! $this->get_quote($ids->fields['id']); $ids->MoveNext(); } ! $ids->Close(); ! } else { ! $ids->Close(); ! return (0); ! } } --- 96,109 ---- 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); } *************** *** 110,124 **** default: $sql ="SELECT id FROM quote WHERE deleted=0 AND pending=0 ORDER BY RAND()"; break; } ! $ids = $this->bd->CacheExecute($this->expire_cache, $sql); if($ids->RecordCount()) { ! while (!$ids->EOF) { ! $this->get_quote($ids->fields['id']); $ids->MoveNext(); } ! $ids->Close(); ! } else { ! $ids->Close(); ! return (0); ! } } --- 114,137 ---- default: $sql ="SELECT id FROM quote WHERE deleted=0 AND pending=0 ORDER BY RAND()"; break; } ! ! /* ! * Not sure if random quotes can be cached. ! * If we do, then the random effect will be ! * refreshed only when the cache gets outdated. ! */ ! ! $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); } |
|
From: Javier B. <jb...@us...> - 2005-01-04 11:33:51
|
Update of /cvsroot/openbash-org/openbash-org/pages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25501/pages Modified Files: admin.php admin_close.php quote.php Log Message: -sistema de auth funcionando correctamente -cambios en Quote.php, View.php y quote.php para no llamar a view dentro de quote Index: admin_close.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/pages/admin_close.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** admin_close.php 26 Dec 2004 22:57:19 -0000 1.4 --- admin_close.php 4 Jan 2005 11:33:41 -0000 1.5 *************** *** 4,5 **** --- 4,6 ---- session_destroy(); ?> + <meta http-equiv="Refresh" content="0; url=?page=admin"/> Index: admin.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/pages/admin.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** admin.php 26 Dec 2004 22:57:19 -0000 1.8 --- admin.php 4 Jan 2005 11:33:41 -0000 1.9 *************** *** 11,16 **** include ("pages/admin_header.php"); ! if (isset($_GET['a_opt'])) { ?> ! <h1><?=$admin['title']?></h1><? switch ($_GET['a_opt']) { case 'news' : $admin_page = 'news'; break; --- 11,15 ---- include ("pages/admin_header.php"); ! if (isset($_GET['a_opt'])) { switch ($_GET['a_opt']) { case 'news' : $admin_page = 'news'; break; Index: quote.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/pages/quote.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** quote.php 18 Nov 2004 16:35:51 -0000 1.9 --- quote.php 4 Jan 2005 11:33:41 -0000 1.10 *************** *** 3,8 **** include ("modules/View.php"); include ("modules/Quote.php"); ! $view = new view(); ! $quote = new quote(); if (isset($_GET['action'])) { --- 3,8 ---- include ("modules/View.php"); include ("modules/Quote.php"); ! $view = new View(); ! $quote = new Quote(); if (isset($_GET['action'])) { *************** *** 23,37 **** switch ($_GET['action']) { ! case 'latest': $quote->get_quotes_by_id("DESC", $start, $end); break; case 'browse': break; ! case 'top': $quote->get_quotes_by_top($top); break; case 'add': $view->ask_quote(); break; case 'insert': $ip = get_ipaddr(); $quote->insert_quote($_POST['quote'], $_POST['author'], $_POST['channel'], $_POST['network'], $ip); break; ! case 'single': $quote->get_quote($_GET['quote']); break; case 'score' : /* ! * check _GET and apply ! * the correct values to * update quote's punctuation */ --- 23,50 ---- switch ($_GET['action']) { ! case 'latest': $quotes = $quote->get_quotes_by_id("DESC", $start, $end); ! $len = count($quotes); ! for ($i = 0; $i < $len; $i++) { ! $data = $quote->get_quote($quotes[$i]); ! $view->view_quote($data); ! } ! break; case 'browse': break; ! case 'top': $quotes = $quote->get_quotes_by_top($top); ! $len = count($quotes); ! for ($i = 0; $i < $len; $i++) { ! $data = $quote->get_quote($quotes[$i]); ! $view->view_quote($data); ! } ! break; case 'add': $view->ask_quote(); break; case 'insert': $ip = get_ipaddr(); $quote->insert_quote($_POST['quote'], $_POST['author'], $_POST['channel'], $_POST['network'], $ip); break; ! case 'single': $data = $quote->get_quote($_GET['quote']); ! $view->view_quote($data); ! break; case 'score' : /* ! * check _GET and apply the correct values to * update quote's punctuation */ *************** *** 50,55 **** $quote->set_quote_score($score_id, $score_action); break; ! case 'random1':$quote->get_quotes_by_random(1); break; ! default: $quote->get_quotes_by_random(0); break; //defaults to random quotes } } --- 63,80 ---- $quote->set_quote_score($score_id, $score_action); break; ! case 'random1': $quotes = $quote->get_quotes_by_random(1); ! $len = count($quotes); ! for ($i = 0; $i < $len; $i++) { ! $data = $quote->get_quote($quotes[$i]); ! $view->view_quote($data); ! } ! break; ! default: $quotes = $quote->get_quotes_by_random(0); //defaults to random quotes ! $len = count($quotes); ! for ($i = 0; $i < $len; $i++) { ! $data = $quote->get_quote($quotes[$i]); ! $view->view_quote($data); ! } ! break; } } |
|
From: Javier B. <jb...@us...> - 2004-12-27 10:40:35
|
Update of /cvsroot/openbash-org/openbash-org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11222 Modified Files: index.php Log Message: anyadido ob_start con compresion zlib para aligerar la carga un poco y que trabajen los clientes Index: index.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/index.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** index.php 26 Dec 2004 22:57:18 -0000 1.17 --- index.php 27 Dec 2004 10:40:26 -0000 1.18 *************** *** 1,3 **** --- 1,4 ---- <?php /* vim: set sts=2 ts=8 sw=2 noexpandtab: */ + ob_start("zlib.output_compression"); session_start(); include ('config.php'); *************** *** 20,31 **** case 'admin': $page = 'admin.php'; break; case 'quote': $page = 'quote.php'; break; - /* - * case 'browse': $page = 'browse.php'; break; - * case 'random': $page = 'quote.php'; break; - * case 'random1': $page = 'random1.php';break; - * case 'top100': $page = 'top100.php'; break; - * case 'top200': $page = 'top200.php'; break; - * case 'add': $page = 'add.php'; break; - */ case 'search': $page = 'search.php'; break; default: $page = 'general.php';break; --- 21,24 ---- |
|
From: Javier B. <jb...@us...> - 2004-12-26 22:57:29
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1613/modules Modified Files: Quote.php Validate.php View.php common.php Log Message: cambiado sistema de validacion por uno que funciona xD; arreglada la guarrada del dbconnect en el config.php: cambiado a los constructores; aplicada cache a consultas repetitivas que no van a tener cambios casi nunca; arreglado algun bug que otro; ... Index: Quote.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/Quote.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Quote.php 24 Nov 2004 07:40:05 -0000 1.17 --- Quote.php 26 Dec 2004 22:57:18 -0000 1.18 *************** *** 8,14 **** class Quote { function insert_quote($quote, $author, $channel, $network, $ip) { - include ("config.php"); $view = new view(); $quote = nl2br(variable_clean($quote)); --- 8,28 ---- class Quote { + private $bd; + private $expire_cache; + + function __construct() + { + include ('config.php'); + $dsn = "$dbtype://$dbuser:$dbpass@$dbhost/$dbname"; + + $this->bd = NewADOConnection($dsn); + $this->bd->Debug = False; + $this->expire_cache = $ADODB_EXPIRE_CACHE; + } + + function __destruct() { $this->bd->Close(); } + function insert_quote($quote, $author, $channel, $network, $ip) { $view = new view(); $quote = nl2br(variable_clean($quote)); *************** *** 33,37 **** '$ip')"; ! $ins = $bd->_Execute($sql); if ($ins === false) { $view->view_non_inserted_quote(); --- 47,51 ---- '$ip')"; ! $ins = $this->bd->_Execute($sql); if ($ins === false) { $view->view_non_inserted_quote(); *************** *** 46,53 **** function get_quote($id) { - include ("config.php"); $view = new view(); $sql = "SELECT points,quote,author,channel,network,ip,pending FROM quote WHERE id='$id' AND deleted=0"; ! $quote = $bd->_Execute($sql); if($quote->RecordCount() == 1) { switch($quote->fields['pending']) { --- 60,66 ---- function get_quote($id) { $view = new view(); $sql = "SELECT points,quote,author,channel,network,ip,pending FROM quote WHERE id='$id' AND deleted=0"; ! $quote = $this->bd->CacheExecute($this->expire_cache, $sql); if($quote->RecordCount() == 1) { switch($quote->fields['pending']) { *************** *** 61,67 **** function get_quotes_by_id($order, $start, $end) { - include ("config.php"); $sql = "SELECT id FROM quote WHERE deleted=0 AND pending=0 ORDER BY id $order LIMIT $start,$end"; ! $ids = $bd->_Execute($sql); if($ids->RecordCount()) { while (!$ids->EOF) { --- 74,79 ---- function get_quotes_by_id($order, $start, $end) { $sql = "SELECT id FROM quote WHERE deleted=0 AND pending=0 ORDER BY id $order LIMIT $start,$end"; ! $ids = $this->bd->CacheExecute($this->expire_cache, $sql); if($ids->RecordCount()) { while (!$ids->EOF) { *************** *** 78,84 **** function get_quotes_by_top($top) { - include ("config.php"); $sql = "SELECT id FROM quote WHERE deleted=0 AND pending=0 ORDER BY points DESC LIMIT $top"; ! $ids = $bd->_Execute($sql); if($ids->RecordCount()) { while (!$ids->EOF) { --- 90,95 ---- function get_quotes_by_top($top) { $sql = "SELECT id FROM quote WHERE deleted=0 AND pending=0 ORDER BY points DESC LIMIT $top"; ! $ids = $this->bd->CacheExecute($this->expire_cache, $sql); if($ids->RecordCount()) { while (!$ids->EOF) { *************** *** 95,105 **** function get_quotes_by_random($points) { ! include ("config.php"); ! switch ($points) ! { case 1 : $sql ="SELECT id FROM quote WHERE points > 1 AND deleted=0 AND pending=0 ORDER BY RAND()"; break; default: $sql ="SELECT id FROM quote WHERE deleted=0 AND pending=0 ORDER BY RAND()"; break; } ! $ids = $bd->_Execute($sql); if($ids->RecordCount()) { while (!$ids->EOF) { --- 106,114 ---- function get_quotes_by_random($points) { ! switch ($points) { case 1 : $sql ="SELECT id FROM quote WHERE points > 1 AND deleted=0 AND pending=0 ORDER BY RAND()"; break; default: $sql ="SELECT id FROM quote WHERE deleted=0 AND pending=0 ORDER BY RAND()"; break; } ! $ids = $this->bd->CacheExecute($this->expire_cache, $sql); if($ids->RecordCount()) { while (!$ids->EOF) { *************** *** 116,122 **** function get_aproved_quotes() { - include ("config.php"); $sql = "SELECT COUNT(*) AS aproved FROM quote WHERE pending=0"; ! $aproved = $bd->_Execute($sql); if($aproved->RecordCount()) { return ($aproved->fields['aproved']); } else { return (0); } --- 125,130 ---- function get_aproved_quotes() { $sql = "SELECT COUNT(*) AS aproved FROM quote WHERE pending=0"; ! $aproved = $this->bd->CacheExecute($this->expire_cache, $sql); if($aproved->RecordCount()) { return ($aproved->fields['aproved']); } else { return (0); } *************** *** 125,131 **** function get_pending_quotes() { - include ("config.php"); $sql = "SELECT COUNT(*) AS pending FROM quote WHERE pending=1"; ! $pending = $bd->_Execute($sql); if($pending->RecordCount()) { return ($pending->fields['pending']); } else { return (0); } --- 133,138 ---- function get_pending_quotes() { $sql = "SELECT COUNT(*) AS pending FROM quote WHERE pending=1"; ! $pending = $this->bd->CacheExecute($this->expire_cache, $sql); if($pending->RecordCount()) { return ($pending->fields['pending']); } else { return (0); } *************** *** 134,138 **** function set_quote_score($score_id, $score_action) { - include ("config.php"); $ip = get_ipaddr(); --- 141,144 ---- *************** *** 148,152 **** $sql = "SELECT voter FROM quote WHERE id='$score_id'"; ! $voter = $bd->_Execute($sql); if (strcmp($ip, $voter->fields['voter'])) { switch ($score_action) { --- 154,158 ---- $sql = "SELECT voter FROM quote WHERE id='$score_id'"; ! $voter = $this->bd->_Execute($sql); if (strcmp($ip, $voter->fields['voter'])) { switch ($score_action) { *************** *** 157,161 **** if (isset($sql2)) { $view = new view(); ! $bd->_Execute($sql2); $view->view_updated_quote(); } --- 163,167 ---- if (isset($sql2)) { $view = new view(); ! $this->bd->_Execute($sql2); $view->view_updated_quote(); } *************** *** 168,174 **** function mail_revision_quote($id) { - include ("config.php"); $sql = "SELECT quote FROM quote WHERE id='$id'"; ! $quote = $bd->_Execute($sql); if ($quote->RecordCount()) { $q = $quote->fields['quote']; --- 174,179 ---- function mail_revision_quote($id) { $sql = "SELECT quote FROM quote WHERE id='$id'"; ! $quote = $this->bd->CacheExecute($sql); if ($quote->RecordCount()) { $q = $quote->fields['quote']; *************** *** 188,192 **** function mail_pending_quote($author, $quote, $ip) { - include ("config.php"); $rcpt = $moderator_email; $subject = "[ OpenBash ] new quote inserted by $author"; --- 193,196 ---- Index: Validate.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/Validate.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Validate.php 25 Nov 2004 14:31:45 -0000 1.4 --- Validate.php 26 Dec 2004 22:57:19 -0000 1.5 *************** *** 1,57 **** <?php ! class validate { ! function do_validate() ! { ! $view = new view(); ! if(!isset($_SESSION['logged'])) { /* if there's no session */ ! if (!isset($_POST['form']) || $_POST['form'] != 1) { /* ask for it */ ! $view->ask_login(); ! return (0); ! } else { /* if asked, verify */ ! if(!$this->check_login($_POST['login'], $_POST['passwd'])) { ! $view->ask_login(); ! return (0); ! } ! } ! } else { /* if there's session */ ! if(isset($_POST['form']) && !$this->check_login($_POST['login'], $_POST['passwd'])) { ! $view->ask_login(); ! return (0); ! } ! if(!$this->check_session()) { ! $view->ask_login(); ! return (0); ! } ! } ! return (1); ! } ! function check_login($nick, $pass) { include ('config.php'); ! $nick = variable_clean($nick); ! $pass = variable_clean($pass); ! $con = "SELECT * FROM users WHERE login LIKE \"$nick\" AND passwd LIKE MD5(\"$pass\")"; ! $res = $bd->_Execute($con); ! $res->Close(); ! if (!$res) return (0); ! //if (!strcmp($nick, $res->fields['login']) && !strcmp(md5($pass), md5($res->fields['passwd']))) { ! if ($res->RecordCount() == 1) { $_SESSION['logged'] = 1; return (1); ! } ! else { ! $_SESSION['logged'] = 0; ! return (0); ! } } ! function check_session() { ! if($_SESSION['logged'] == 1) return 1; ! else return 0; } } - ?> --- 1,40 ---- <?php ! class Validate { ! private $bd; ! function check_form($login, $passwd) { include ('config.php'); ! $dsn = "$dbtype://$dbuser:$dbpass@$dbhost/$dbname"; ! ! $this->bd = NewADOConnection($dsn); ! $this->bd->Debug = True; ! ! //$sql = "SELECT * FROM users WHERE login LIKE \"$login\" AND passwd LIKE MD5(\"$passwd\")"; ! $sql = "SELECT login FROM users WHERE login='$login' AND passwd='$passwd'"; ! ! $res = $this->bd->_Execute($sql); ! ! if ($res->RecordCount() > 0) { $_SESSION['logged'] = 1; return (1); ! } else { ! $_SESSION['logged'] = 0; ! return (0); ! } } ! function check_logged() { ! if ($_SESSION['logged'] == 1) { ! return (1); ! } elseif (isset($_POST['check_form'])) { ! if ($this->check_form($_POST['login'], $_POST['passwd']) == 1) { ! return (1); ! } ! } ! return (0); } } Index: View.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/View.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** View.php 24 Nov 2004 07:40:05 -0000 1.18 --- View.php 26 Dec 2004 22:57:19 -0000 1.19 *************** *** 126,130 **** <p><?=$login_language['msg']?></p> <form onsubmit="return autocheck(this)" action="?page=admin" method="post" autocomplete="off"> ! <input type="hidden" name="form" value="1"> <table border="0" width="50%"> <tr class="textoficha"> --- 126,130 ---- <p><?=$login_language['msg']?></p> <form onsubmit="return autocheck(this)" action="?page=admin" method="post" autocomplete="off"> ! <input type="hidden" name="check_form" value="1"> <table border="0" width="50%"> <tr class="textoficha"> Index: common.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/common.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** common.php 24 Nov 2004 07:40:05 -0000 1.5 --- common.php 26 Dec 2004 22:57:19 -0000 1.6 *************** *** 92,94 **** --- 92,111 ---- return $sec + $usec; } + + function uptime () + { + $fd = fopen('/proc/uptime', 'r'); + $ar_buf = split(' ', fgets($fd, 4096)); + fclose($fd); + $sys_ticks = trim($ar_buf[0]); + $min = $sys_ticks / 60; + $hours = $min / 60; + $days = floor($hours / 24); + $hours = floor($hours - ($days * 24)); + $min = floor($min - ($days * 60 * 24) - ($hours * 60)); + if ($days) $result = "$days"; + if ($hours) $result .= ":$hours"; + $result .= ":$min"; + return ($result); + } ?> |
|
From: Javier B. <jb...@us...> - 2004-12-26 22:57:29
|
Update of /cvsroot/openbash-org/openbash-org/pages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1613/pages Modified Files: admin.php admin_close.php footer.php Added Files: admin_logon.php Log Message: cambiado sistema de validacion por uno que funciona xD; arreglada la guarrada del dbconnect en el config.php: cambiado a los constructores; aplicada cache a consultas repetitivas que no van a tener cambios casi nunca; arreglado algun bug que otro; ... --- NEW FILE: admin_logon.php --- <?php $view = new View(); $view->ask_login(); ?> Index: admin_close.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/pages/admin_close.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** admin_close.php 25 Nov 2004 14:31:45 -0000 1.3 --- admin_close.php 26 Dec 2004 22:57:19 -0000 1.4 *************** *** 1,7 **** <?php ! $validate = new validate(); ! if ($validate->do_validate()) { session_destroy(); } ! //$view = new view(); ! //$view->ask_login(); ?> - <!--<meta http-equiv="refresh" content="0;index.php">--> --- 1,5 ---- <?php ! session_start(); ! session_unset(); ! session_destroy(); ?> Index: admin.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/pages/admin.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** admin.php 25 Nov 2004 14:31:45 -0000 1.7 --- admin.php 26 Dec 2004 22:57:19 -0000 1.8 *************** *** 2,28 **** include ("modules/View.php"); include ("modules/Validate.php"); ! $validate = new validate(); ! if ($validate->do_validate()) { /* ! * The user is logged in */ if (isset($_GET['a_opt'])) { ?> <h1><?=$admin['title']?></h1><? switch ($_GET['a_opt']) { - case 'quotes': $admin_page = 'quotes'; break; case 'news' : $admin_page = 'news'; break; case 'users' : $admin_page = 'users'; break; case 'close' : $admin_page = 'close'; break; ! default : $admin_page = 'general';break; } } else { ! $admin_page = 'general'; } ! include ("pages/admin_header.php"); ! include ('pages/admin_'.$admin_page.'.php'); ! } ?> --- 2,29 ---- include ("modules/View.php"); include ("modules/Validate.php"); ! $validate_object = new Validate(); ! if ($validate_object->check_logged() == 1) { /* ! * The user is logged in so we can show the header */ + include ("pages/admin_header.php"); if (isset($_GET['a_opt'])) { ?> <h1><?=$admin['title']?></h1><? switch ($_GET['a_opt']) { case 'news' : $admin_page = 'news'; break; case 'users' : $admin_page = 'users'; break; case 'close' : $admin_page = 'close'; break; ! default : $admin_page = 'quotes';break; } } else { ! $admin_page = 'quotes'; } ! } else { ! $admin_page = 'logon'; ! } + include ('pages/admin_'.$admin_page.'.php'); ?> Index: footer.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/pages/footer.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** footer.php 18 Nov 2004 12:27:10 -0000 1.12 --- footer.php 26 Dec 2004 22:57:19 -0000 1.13 *************** *** 9,20 **** <p style="float:left"> ! <a href="http://validator.w3.org/check/referer"><img ! src="images/valid-xhtml11.png" ! alt="Valid XHTML 1.1!" height="31" width="88" style="border:none" /></a> </p> <p style="float:left"> ! <a href="http://jigsaw.w3.org/css-validator/"><img style="border:0;width:88px;height:31px" ! src="images/vcss.gif" ! alt="Valid CSS!" /></a> </p> <p> --- 9,18 ---- <p style="float:left"> ! <a href="http://validator.w3.org/check/referer"> ! <img src="images/valid-xhtml11l.png" alt="Valid XHTML 1.1!" style="border:none" /></a> </p> <p style="float:left"> ! <a href="http://jigsaw.w3.org/css-validator/"> ! <img style="border:0" src="images/valid-css.png" alt="Valid CSS!" /></a> </p> <p> |
|
From: Javier B. <jb...@us...> - 2004-12-26 22:57:29
|
Update of /cvsroot/openbash-org/openbash-org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1613 Modified Files: config.php index.php Log Message: cambiado sistema de validacion por uno que funciona xD; arreglada la guarrada del dbconnect en el config.php: cambiado a los constructores; aplicada cache a consultas repetitivas que no van a tener cambios casi nunca; arreglado algun bug que otro; ... Index: config.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/config.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** config.php 24 Nov 2004 08:37:06 -0000 1.17 --- config.php 26 Dec 2004 22:57:18 -0000 1.18 *************** *** 3,11 **** $title = 'OpenBash.org'; ! $hostbd = 'localhost'; # host where the database is running ! $userbd = 'openbash'; # a user with full privileges to access the database ! $passbd = '02jdf9234y9'; # the user's password database ! $namedb = 'openbash'; # the database name ! $tipobd = 'mysql'; # type of database: mysql, pgsql, etc $lang = 'spanish'; --- 3,11 ---- $title = 'OpenBash.org'; ! $dbhost = 'localhost'; # host where the database is running ! $dbuser = 'openbash'; # a user with full privileges to access the database ! $dbpass = '02jdf9234y9'; # the user's password database ! $dbname = 'openbash-org'; # the database name ! $dbtype = 'mysql'; # type of database: mysql, pgsql, etc $lang = 'spanish'; *************** *** 17,26 **** $summaries = 50; # number of quotes shown on a single page include ('adodb/adodb.inc.php'); ! $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; # we prefer associative arrays ! $ADODB_CACHE_DIR = 'cache/'; # directory to store sql results to speed up queries ! $bd = &NewADOConnection($tipobd); ! $bd->PConnect($hostbd, $userbd, $passbd, $namedb); ! $bd->Debug = True; ?> --- 17,30 ---- $summaries = 50; # number of quotes shown on a single page + /* + * AdoDB + */ + include ('adodb/adodb.inc.php'); ! $ADODB_CACHE_DIR = 'cache/'; # we prefer associative arrays ! $ADODB_COUNTRECS = false; # we do not want RecordCount() emulation ! $ADODB_LANG = 'es'; ! $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; # directory to store sql results to speed up queries ! $ADODB_EXPIRE_CACHE = 3600; ?> Index: index.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/index.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** index.php 24 Nov 2004 07:40:04 -0000 1.16 --- index.php 26 Dec 2004 22:57:18 -0000 1.17 *************** *** 9,12 **** --- 9,13 ---- if (isset($_SESSION['language'])) { $lang = $_SESSION['language']; } include ("language/${lang}.php"); + /* * Print general header and selected page |
|
From: Javier B. <jb...@us...> - 2004-12-26 22:57:28
|
Update of /cvsroot/openbash-org/openbash-org/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1613/images Added Files: valid-css.png valid-xhtml11l.png Log Message: cambiado sistema de validacion por uno que funciona xD; arreglada la guarrada del dbconnect en el config.php: cambiado a los constructores; aplicada cache a consultas repetitivas que no van a tener cambios casi nunca; arreglado algun bug que otro; ... --- NEW FILE: valid-xhtml11l.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: valid-css.png --- (This appears to be a binary file; contents omitted.) |
|
From: Juan C. D. R. <hn...@us...> - 2004-12-17 11:58:16
|
Update of /cvsroot/openbash-org/openbash-org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17436/openbash-org Modified Files: TODO Log Message: cvs test Index: TODO =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/TODO,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TODO 29 Nov 2004 22:10:20 -0000 1.3 --- TODO 17 Dec 2004 11:58:07 -0000 1.4 *************** *** 1,2 **** --- 1,4 ---- + $Id$ + - close session on ?page=admin&a_opt=close shows admin_header |
|
From: José M. M. <ri...@us...> - 2004-11-29 22:10:32
|
Update of /cvsroot/openbash-org/openbash-org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6499 Modified Files: TODO Log Message: Bug apañado Index: TODO =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/TODO,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TODO 24 Nov 2004 18:31:52 -0000 1.2 --- TODO 29 Nov 2004 22:10:20 -0000 1.3 *************** *** 1,3 **** - - login form on ?page=admin appears twice - close session on ?page=admin&a_opt=close shows admin_header --- 1,2 ---- |
|
From: José M. M. <ri...@us...> - 2004-11-25 14:31:59
|
Update of /cvsroot/openbash-org/openbash-org/pages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7858/pages Modified Files: admin.php admin_close.php Log Message: Arreglado (creo) el bug del formulario de validación doble Index: admin_close.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/pages/admin_close.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** admin_close.php 24 Nov 2004 07:40:05 -0000 1.2 --- admin_close.php 25 Nov 2004 14:31:45 -0000 1.3 *************** *** 1,5 **** <?php $validate = new validate(); ! if ($validate->validate()) { session_destroy(); } //$view = new view(); //$view->ask_login(); --- 1,5 ---- <?php $validate = new validate(); ! if ($validate->do_validate()) { session_destroy(); } //$view = new view(); //$view->ask_login(); Index: admin.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/pages/admin.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** admin.php 24 Nov 2004 07:40:05 -0000 1.6 --- admin.php 25 Nov 2004 14:31:45 -0000 1.7 *************** *** 4,8 **** $validate = new validate(); ! if ($validate->validate()) { /* --- 4,8 ---- $validate = new validate(); ! if ($validate->do_validate()) { /* |