You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
(95) |
Apr
(270) |
May
(111) |
Jun
|
Jul
|
Aug
(64) |
Sep
(130) |
Oct
(319) |
Nov
(17) |
Dec
(191) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(53) |
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
(387) |
Jul
(102) |
Aug
(247) |
Sep
(120) |
Oct
(1) |
Nov
(8) |
Dec
(21) |
| 2007 |
Jan
(38) |
Feb
(36) |
Mar
|
Apr
(32) |
May
(135) |
Jun
(523) |
Jul
(192) |
Aug
(103) |
Sep
(533) |
Oct
(77) |
Nov
(23) |
Dec
(203) |
| 2008 |
Jan
(312) |
Feb
(1193) |
Mar
(404) |
Apr
(67) |
May
(62) |
Jun
(497) |
Jul
(297) |
Aug
(110) |
Sep
(335) |
Oct
(256) |
Nov
(50) |
Dec
(118) |
| 2009 |
Jan
(67) |
Feb
(10) |
Mar
(1) |
Apr
(1) |
May
|
Jun
(10) |
Jul
(61) |
Aug
|
Sep
(16) |
Oct
(45) |
Nov
(12) |
Dec
(14) |
| 2010 |
Jan
(30) |
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
(7) |
Aug
(7) |
Sep
(5) |
Oct
(5) |
Nov
|
Dec
|
| 2011 |
Jan
(7) |
Feb
(3) |
Mar
(89) |
Apr
(11) |
May
(5) |
Jun
|
Jul
(8) |
Aug
(1) |
Sep
(2) |
Oct
|
Nov
(2) |
Dec
(89) |
| 2012 |
Jan
(7) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
(3) |
Oct
(42) |
Nov
(1) |
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
(19) |
Apr
(90) |
May
(38) |
Jun
(235) |
Jul
(38) |
Aug
(10) |
Sep
|
Oct
(29) |
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
(6) |
May
(52) |
Jun
|
Jul
(7) |
Aug
|
Sep
(17) |
Oct
|
Nov
|
Dec
|
|
From: Jon O. <jon...@us...> - 2005-03-18 21:03:27
|
Update of /cvsroot/mxbb/mx_kb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19102/modules/mx_kb Modified Files: db_upgrade.php Log Message: testing the maillist ;) Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/db_upgrade.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** db_upgrade.php 6 Mar 2005 01:12:29 -0000 1.13 --- db_upgrade.php 18 Mar 2005 21:03:12 -0000 1.14 *************** *** 156,159 **** --- 156,161 ---- $sql[] = "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('news_sort', 'Alphabetic')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('news_sort_par', 'ASC')"; + + /* // Now add some new parameters // First get function_id *************** *** 191,194 **** --- 193,197 ---- $sql[] = "UPDATE " . $mx_table_prefix . "function SET function_admin = 'modules/mx_kb/admin/kb_config.php' WHERE function_id = '" . $function_id . "' OR function_file = 'kb.php'"; + */ } |
|
From: Jon O. <jon...@us...> - 2005-03-18 21:02:36
|
Update of /cvsroot/mxbb/mx_act/templates/subSilver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18680/modules/mx_act/templates/subSilver Removed Files: activity_trophy.tpl Log Message: testing the maillist ;) --- activity_trophy.tpl DELETED --- |
|
From: Markus P. <mar...@us...> - 2005-03-18 18:14:47
|
Update of /cvsroot/mxbb/mx_pafiledb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27324 Modified Files: db_install.php Log Message: Bug #55 - little typo error (Test Cagegory). Fixed. Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/db_install.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** db_install.php 6 Mar 2005 01:13:11 -0000 1.11 --- db_install.php 18 Mar 2005 18:14:38 -0000 1.12 *************** *** 236,240 **** "INSERT INTO " . $mx_table_prefix . "pa_cat VALUES (1, 'My Category', '', 0, '', 1, 0, 1, 1, 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)", ! "INSERT INTO " . $mx_table_prefix . "pa_cat VALUES (2, 'Test Cagegory', 'Just a test category', 1, '', 2, 1, 1, 1, 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0)", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_comment_images', '0')", --- 236,240 ---- "INSERT INTO " . $mx_table_prefix . "pa_cat VALUES (1, 'My Category', '', 0, '', 1, 0, 1, 1, 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)", ! "INSERT INTO " . $mx_table_prefix . "pa_cat VALUES (2, 'Test Category', 'Just a test category', 1, '', 2, 1, 1, 1, 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0)", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('allow_comment_images', '0')", |
|
From: <mxb...@li...> - 2005-03-18 12:38:20
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12086/includes Modified Files: mx_admincp.php Log Message: Bug #44 - Main Menu column in Navigation Menu also, removed REPLACE INTO in mx_admincp.php (still 1 instance left though) Index: mx_admincp.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_admincp.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mx_admincp.php 17 Mar 2005 11:30:37 -0000 1.1 --- mx_admincp.php 18 Mar 2005 12:38:09 -0000 1.2 *************** *** 137,141 **** } ! $sqlupdate[] = "REPLACE INTO " . $mx_table_prefix . "parameter VALUES('" . $parameter_id[$i] . "', '" . $function_id . "', '" . $parameter_row['parameter_value'] ."', '" . $parameter_row['parameter_type'] ."', '" . $parameter_row['parameter_default'] ."', '" . $parameter_row['parameter_function'] ."')"; $output_message .= "<br/><b><font color=#000000> Add parameter " . $parameter_name. " for block(s)</font></b><br/>"; --- 137,148 ---- } ! // $sqlupdate[] = "REPLACE INTO " . $mx_table_prefix . "parameter VALUES('" . $parameter_id[$i] . "', '" . $function_id . "', '" . $parameter_row['parameter_value'] ."', '" . $parameter_row['parameter_type'] ."', '" . $parameter_row['parameter_default'] ."', '" . $parameter_row['parameter_function'] ."')"; ! $sqlupdate[] = "DELETE FROM " . $mx_table_prefix . "parameter ! WHERE parameter_id = '" . $parameter_id[$i] . "' ! AND function_id = '" . $function_id . "'"; ! ! $sqlupdate[] = "INSERT INTO " . $mx_table_prefix . "parameter VALUES('" . $parameter_id[$i] . "', '" . $function_id . "', '" . $parameter_row['parameter_value'] ."', '" . $parameter_row['parameter_type'] ."', '" . $parameter_row['parameter_default'] ."', '" . $parameter_row['parameter_function'] ."')"; ! ! $output_message .= "<br/><b><font color=#000000> Add parameter " . $parameter_name. " for block(s)</font></b><br/>"; *************** *** 154,157 **** --- 161,168 ---- $sqlupdate[] = "REPLACE INTO " . $mx_table_prefix . "block_system_parameter VALUES('" . $block_id . "', '" . $parameter_id[$i] . "', '" . $parameter_row['parameter_value'] ."', '" . $parameter_row['parameter_function'] ."')"; + // $sqlupdate[] = "DELETE FROM " . $mx_table_prefix . "block_system_parameter + // WHERE block_id = '" . $parameter_id[$i] . "' + // AND parameter_id = '" . $function_id . "'"; + $output_message .= "<font color=#000000> - for block: " . $block_title . "</font><br/>"; } |
|
From: <mxb...@li...> - 2005-03-18 12:38:20
|
Update of /cvsroot/mxbb/core/templates/subSilver/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12086/templates/subSilver/admin Modified Files: mx_menu_admin_body.tpl Log Message: Bug #44 - Main Menu column in Navigation Menu also, removed REPLACE INTO in mx_admincp.php (still 1 instance left though) Index: mx_menu_admin_body.tpl =================================================================== RCS file: /cvsroot/mxbb/core/templates/subSilver/admin/mx_menu_admin_body.tpl,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mx_menu_admin_body.tpl 11 Feb 2005 22:06:37 -0000 1.7 --- mx_menu_admin_body.tpl 18 Mar 2005 12:38:10 -0000 1.8 *************** *** 6,51 **** <form method="post" action="{S_MENU_ACTION}"><table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center"> <tr> ! <th class="thHead" colspan="7">{L_MENU_PAR_TITLE}</th> </tr> <tr> ! <td class="row1" colspan="4" width="22%"><span class="gen"><b>{L_BLOCK_TITLE}</b></span></td> ! <td class="row2" colspan="3" ><input type="text" size="65" name="block_title" value="{E_BLOCK_TITLE}" class="post" /></td> </tr> - <tr> ! <td class="row1" colspan="4" ><span class="gen">{L_BLOCK_DESC}</span></td> ! <td class="row2" colspan="3" ><input type="text" size="65" name="block_desc" value="{E_BLOCK_DESC}" class="post" /></td> </tr> - <tr> ! <td class="row1" colspan="4" width="50%"><span class="gen">{L_SHOW_TITLE}</span><br /><span class="gensmall">{L_SHOW_TITLE_EXPLAIN}</span></td> <td class="row2" colspan="3" width="50%"><input type="radio" name="show_title" value="1" {S_SHOW_TITLE_YES} /> <span class="gen">{L_YES}</span> <input type="radio" name="show_title" value="0" {S_SHOW_TITLE_NO} /> <span class="gen">{L_NO}</span></td> </tr> <tr> ! <td class="row1" colspan="4" width="22%"><span class="gen">{L_SHOW_STATS}</span></td> ! <td class="row2" colspan="3" width="78%"><input type="radio" name="show_stats" value="1" {S_SHOW_STATS_YES} /> <span class="gen">{L_YES} </span><input type="radio" name="show_stats" value="0" {S_SHOW_STATS_NO} /> <span class="gen">{L_NO}</span></td> </tr> - <tr> ! <td class="row1" colspan="4" width="22%"><span class="gen">{L_SHOW_BLOCK}</span></td> ! <td class="row2" colspan="3" width="78%"><input type="radio" name="show_block" value="1" {S_SHOW_BLOCK_YES} /> <span class="gen">{L_YES} </span><input type="radio" name="show_block" value="0" {S_SHOW_BLOCK_NO} /> <span class="gen">{L_NO}</span></td> </tr> <tr> ! <td class="row1" colspan="4" width="50%"><span class="gen">{L_MENU_DISPLAY_MODE}</span></td> <td class="row2" colspan="3" width="50%">{MENU_DISPLAY_MODE} </td> </tr> <tr> ! <td class="row1" colspan="4" width="50%"><span class="gen">{L_MENU_PAGE_SYNC}</span></td> <td class="row2" colspan="3" width="50%">{MENU_PAGE_SYNC} </td> </tr> <tr> ! <td class="catBottom" colspan="7" align="center">{S_HIDDEN_FIELDS}<input type="hidden" name="mode" value="update" /><input type="submit" name="submit" value="{L_SUBMIT}" class="mainoption" /> <input type="reset" value="{L_RESET}" class="liteoption" /></td> </tr> <!-- BEGIN block_mode --> <tr> ! <td colspan="7" class="cat" align="center" valign="middle"><span class="gen"><a href="{block_mode.U_RETURN}">{L_RETURN}</a></span></td> </tr> <!-- END block_mode --> - <tr> <th class="thHead" colspan="7">{L_MENU_TITLE}</th> --- 6,47 ---- <form method="post" action="{S_MENU_ACTION}"><table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center"> <tr> ! <th class="thHead" colspan="5">{L_MENU_PAR_TITLE}</th> </tr> <tr> ! <td class="row1" colspan="2" width="50%"><span class="gen"><b>{L_BLOCK_TITLE}</b></span></td> ! <td class="row2" colspan="3" width="50%"><input type="text" size="65" name="block_title" value="{E_BLOCK_TITLE}" class="post" /></td> </tr> <tr> ! <td class="row1" colspan="2" width="50%"><span class="gen">{L_BLOCK_DESC}</span></td> ! <td class="row2" colspan="3" width="50%"><input type="text" size="65" name="block_desc" value="{E_BLOCK_DESC}" class="post" /></td> </tr> <tr> ! <td class="row1" colspan="2" width="50%"><span class="gen">{L_SHOW_TITLE}</span><br /><span class="gensmall">{L_SHOW_TITLE_EXPLAIN}</span></td> <td class="row2" colspan="3" width="50%"><input type="radio" name="show_title" value="1" {S_SHOW_TITLE_YES} /> <span class="gen">{L_YES}</span> <input type="radio" name="show_title" value="0" {S_SHOW_TITLE_NO} /> <span class="gen">{L_NO}</span></td> </tr> <tr> ! <td class="row1" colspan="2" width="50%"><span class="gen">{L_SHOW_STATS}</span></td> ! <td class="row2" colspan="3" width="50%"><input type="radio" name="show_stats" value="1" {S_SHOW_STATS_YES} /> <span class="gen">{L_YES} </span><input type="radio" name="show_stats" value="0" {S_SHOW_STATS_NO} /> <span class="gen">{L_NO}</span></td> </tr> <tr> ! <td class="row1" colspan="2" width="50%"><span class="gen">{L_SHOW_BLOCK}</span></td> ! <td class="row2" colspan="3" width="50%"><input type="radio" name="show_block" value="1" {S_SHOW_BLOCK_YES} /> <span class="gen">{L_YES} </span><input type="radio" name="show_block" value="0" {S_SHOW_BLOCK_NO} /> <span class="gen">{L_NO}</span></td> </tr> <tr> ! <td class="row1" colspan="2" width="50%"><span class="gen">{L_MENU_DISPLAY_MODE}</span></td> <td class="row2" colspan="3" width="50%">{MENU_DISPLAY_MODE} </td> </tr> <tr> ! <td class="row1" colspan="2" width="50%"><span class="gen">{L_MENU_PAGE_SYNC}</span></td> <td class="row2" colspan="3" width="50%">{MENU_PAGE_SYNC} </td> </tr> <tr> ! <td class="catBottom" colspan="5" align="center">{S_HIDDEN_FIELDS}<input type="hidden" name="mode" value="update" /><input type="submit" name="submit" value="{L_SUBMIT}" class="mainoption" /> <input type="reset" value="{L_RESET}" class="liteoption" /></td> </tr> <!-- BEGIN block_mode --> <tr> ! <td colspan="5" class="cat" align="center" valign="middle"><span class="gen"><a href="{block_mode.U_RETURN}">{L_RETURN}</a></span></td> </tr> <!-- END block_mode --> <tr> <th class="thHead" colspan="7">{L_MENU_TITLE}</th> *************** *** 69,81 **** <!-- END menurow --> <tr> ! <td colspan="7" class="row2"><input type="text" name="{catrow.S_ADD_MENU_NAME}" /> <input type="submit" class="liteoption" name="{catrow.S_ADD_MENU_SUBMIT}" value="{L_CREATE_MENU}" /></td> </tr> <tr> ! <td colspan="7" height="1" class="spaceRow"><img src="{U_PHPBB_ROOT_PATH}{TEMPLATE_ROOT_PATH}spacer.gif" alt="" width="1" height="1" /></td> </tr> <!-- END catrow --> <tr> ! <td colspan="7" class="catBottom">{L_SHOW_CAT}<input type="text" name="categoryname" /> {S_SHOW_CAT} <input type="submit" class="liteoption" name="addcategory" value="{L_CREATE_CATEGORY}" /></td> </tr> - </table></form> --- 65,76 ---- <!-- END menurow --> <tr> ! <td colspan="5" class="row2"><input type="text" name="{catrow.S_ADD_MENU_NAME}" /> <input type="submit" class="liteoption" name="{catrow.S_ADD_MENU_SUBMIT}" value="{L_CREATE_MENU}" /></td> </tr> <tr> ! <td colspan="5" height="1" class="spaceRow"><img src="{U_PHPBB_ROOT_PATH}{TEMPLATE_ROOT_PATH}spacer.gif" alt="" width="1" height="1" /></td> </tr> <!-- END catrow --> <tr> ! <td colspan="5" class="catBottom">{L_SHOW_CAT}<input type="text" name="categoryname" /> {S_SHOW_CAT} <input type="submit" class="liteoption" name="addcategory" value="{L_CREATE_CATEGORY}" /></td> </tr> </table></form> |
|
From: <mxb...@li...> - 2005-03-17 19:48:53
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8498 Modified Files: mx_functions.php Log Message: Added a few comments to further document usage and inners of class mx_request_vars (defined in mx_functions.php, for now) Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** mx_functions.php 17 Mar 2005 12:45:35 -0000 1.30 --- mx_functions.php 17 Mar 2005 19:48:41 -0000 1.31 *************** *** 1123,1134 **** // Following flags are options for the $type parameter in method _read() // ! define('MX_TYPE_INT' , 1); ! define('MX_TYPE_FLOAT' , 2); ! define('MX_TYPE_NO_HTML' , 4); ! define('MX_TYPE_NO_TAGS' , 8); ! define('MX_TYPE_NO_STRIP' , 16); ! define('MX_TYPE_NO_SQL' , 32); ! define('MX_TYPE_POST_VARS' , 64); ! define('MX_TYPE_GET_VARS' , 128); // --- 1123,1145 ---- // Following flags are options for the $type parameter in method _read() // ! define('MX_TYPE_INT' , 1); // Be sure we get a request var of type INT. ! define('MX_TYPE_FLOAT' , 2); // Be sure we get a request var of type FLOAT. ! define('MX_TYPE_NO_HTML' , 4); // Be sure we get a request var of type STRING (htmlspecialchars). ! define('MX_TYPE_NO_TAGS' , 8); // Be sure we get a request var of type STRING (strip_tags + htmlspecialchars). ! define('MX_TYPE_NO_STRIP' , 16); // By default strings are slash stripped, this flag avoids this. ! define('MX_TYPE_NO_SQL' , 32); // Be sure we get a request var of type STRING, safe for SQL statements (single quotes escaped) ! define('MX_TYPE_POST_VARS' , 64); // Read a POST variable. ! define('MX_TYPE_GET_VARS' , 128); // Read a GET variable. ! ! // ! // Additional notes: ! // ! // More than one can specified by OR'ing the $type argument. Example: ! // For instance, we can use ( MX_TYPE_POST_VARS | MX_TYPE_GET_VARS ), see method request(). ! // or we can use ( MX_TYPE_NO_TAGS | MX_TYPE_NO_SQL ). ! // However, MX_TYPE_NO_HTML and MX_TYPE_NO_TAGS can't be specified at a time (defaults to MX_TYPE_NO_HTML). ! // Also, MX_TYPE_INT and MX_TYPE_FLOAT ignore flags MX_TYPE_NO_* ! // ! // *************** *** 1139,1152 **** // $mx_request_vars = new mx_request_vars(); // $mode = $mx_request_vars->post('mode', MX_TYPE_NO_TAGS, ''); ! // $page_id = $mx_request_vars->post('page', MX_TYPE_INT, 1); // class mx_request_vars { // ! // Properties // // ! // Contructor // //function mx_request_vars() --- 1150,1171 ---- // $mx_request_vars = new mx_request_vars(); // $mode = $mx_request_vars->post('mode', MX_TYPE_NO_TAGS, ''); ! // $page_id = $mx_request_vars->get('page', MX_TYPE_INT, 1); // class mx_request_vars { // ! // Implementation Conventions: ! // Properties and methods prefixed with underscore are intented to be private. ;-) // + // ------------------------------ + // Properties // ! ! // none in this class. ! ! ! // ------------------------------ ! // Constructor // //function mx_request_vars() *************** *** 1155,1160 **** //} // ! // Private Methods (convention: first char in name is underscore) // function _read($var, $type = 0, $dflt = '') --- 1174,1190 ---- //} + + // ------------------------------ + // Private Methods // ! ! // ! // Function: _read() ! // Description: Get the value of the specified request var (post or get) and force the result to be ! // of specified type. It might also transform the result (stripslashes, htmlspecialchars) for security ! // purposes. It all depends on the $type argument. ! // If the specified request var does not exist, then the default ($dflt) value is returned. ! // Note the $type argument behaves as a bit array where more than one option can be specified by OR'ing ! // the passed argument. This is tipical practice in languages like C, but it can also be done with PHP. // function _read($var, $type = 0, $dflt = '') *************** *** 1242,1248 **** } ! // // Public Methods // function post($var, $type = 0, $dflt = '') { --- 1272,1282 ---- } ! // ------------------------------ // Public Methods // + + // + // _read() wrappers to retrieve POST, GET or any REQUEST (both) variable. + // function post($var, $type = 0, $dflt = '') { *************** *** 1253,1259 **** --- 1287,1302 ---- return $this->_read($var, ($type | MX_TYPE_GET_VARS), $dflt); } + function request($var, $type = 0, $dflt = '') + { + return $this->_read($var, ($type | MX_TYPE_POST_VARS | MX_TYPE_GET_VARS), $dflt); + } + + // + // Boolean methods to check for existence of POST, GET or any REQUEST (both) variable. + // function is_post($var) { global $HTTP_POST_VARS; + // Note: _x and _y are used by (at least IE) to return the mouse position at onclick of INPUT TYPE="img" elements. return ( isset($HTTP_POST_VARS[$var]) || ( isset($HTTP_POST_VARS[$var.'_x']) && isset($HTTP_POST_VARS[$var.'_y']) ) ); } |
|
From: <mxb...@li...> - 2005-03-17 12:45:50
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9890/includes Modified Files: mx_functions.php Log Message: Bug #37 - Couldn't get list of Column/blocks Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** mx_functions.php 17 Mar 2005 11:30:36 -0000 1.29 --- mx_functions.php 17 Mar 2005 12:45:35 -0000 1.30 *************** *** 311,315 **** " . MODULE_TABLE . " mdl WHERE blk.function_id = fnc.function_id ! AND mod.module_id = fnc.module_id AND fnc.function_name = 'PafileDB' ORDER BY mdl.module_name ASC, fnc.function_name ASC"; --- 311,315 ---- " . MODULE_TABLE . " mdl WHERE blk.function_id = fnc.function_id ! AND mdl.module_id = fnc.module_id AND fnc.function_name = 'PafileDB' ORDER BY mdl.module_name ASC, fnc.function_name ASC"; |
|
From: <mxb...@li...> - 2005-03-17 12:37:36
|
Update of /cvsroot/mxbb/mx_kb/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8415/modules/mx_kb/includes Modified Files: kb_add.php kb_cat.php kb_edit.php kb_moderator.php kb_rate.php Log Message: Bug #47 - SQL Injection vulnerability in Knowledge Base MOD Index: kb_rate.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_rate.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** kb_rate.php 1 Feb 2005 20:45:44 -0000 1.7 --- kb_rate.php 17 Mar 2005 12:37:24 -0000 1.8 *************** *** 33,37 **** if ( isset( $HTTP_GET_VARS['k'] ) || isset( $HTTP_POST_VARS['k'] ) ) { ! $article_id = ( isset( $HTTP_GET_VARS['k'] ) ) ? $HTTP_GET_VARS['k'] : $HTTP_POST_VARS['k']; } else --- 33,37 ---- if ( isset( $HTTP_GET_VARS['k'] ) || isset( $HTTP_POST_VARS['k'] ) ) { ! $article_id = ( isset( $HTTP_GET_VARS['k'] ) ) ? intval( $HTTP_GET_VARS['k'] ): intval( $HTTP_POST_VARS['k'] ); } else Index: kb_cat.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_cat.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** kb_cat.php 1 Feb 2005 20:45:37 -0000 1.9 --- kb_cat.php 17 Mar 2005 12:37:24 -0000 1.10 *************** *** 29,33 **** $start = ( isset( $HTTP_GET_VARS['start'] ) ) ? intval( $HTTP_GET_VARS['start'] ) : 0; ! $category_id = $HTTP_GET_VARS['cat']; $category = get_kb_cat( $category_id ); $category_name = $category['category_name']; --- 29,34 ---- $start = ( isset( $HTTP_GET_VARS['start'] ) ) ? intval( $HTTP_GET_VARS['start'] ) : 0; ! $category_id = ( isset( $HTTP_GET_VARS['cat'] ) ) ? intval ( $HTTP_GET_VARS['cat']) : intval ( $HTTP_POST_VARS['cat'] ); ! $category = get_kb_cat( $category_id ); $category_name = $category['category_name']; Index: kb_edit.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_edit.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** kb_edit.php 1 Feb 2005 20:45:38 -0000 1.12 --- kb_edit.php 17 Mar 2005 12:37:24 -0000 1.13 *************** *** 25,29 **** } ! $article_id = ( isset( $HTTP_GET_VARS['k'] ) ) ? $HTTP_GET_VARS['k'] : $HTTP_POST_VARS['k']; // main / preview ------------------------------------------------------------------------- // show article form --- 25,30 ---- } ! $article_id = ( isset( $HTTP_GET_VARS['k'] ) ) ? intval ( $HTTP_GET_VARS['k'] ) : intval ( $HTTP_POST_VARS['k'] ); ! // main / preview ------------------------------------------------------------------------- // show article form *************** *** 280,289 **** $article_text = ( !empty( $HTTP_POST_VARS['message'] ) ) ? addslashes( $HTTP_POST_VARS['message'] ) : ''; ! $category = $HTTP_POST_VARS['category_id']; $title = ( !empty( $HTTP_POST_VARS['article_name'] ) ) ? htmlspecialchars( $HTTP_POST_VARS['article_name'] ) : ''; $description = ( !empty( $HTTP_POST_VARS['article_desc'] ) ) ? htmlspecialchars( $HTTP_POST_VARS['article_desc'] ) : ''; $date = time(); ! $author_id = $HTTP_POST_VARS['author_id']; ! $type_id = $HTTP_POST_VARS['type_id']; $bbcode_uid = $HTTP_POST_VARS['bbcode_uid']; --- 281,290 ---- $article_text = ( !empty( $HTTP_POST_VARS['message'] ) ) ? addslashes( $HTTP_POST_VARS['message'] ) : ''; ! $category = intval ( $HTTP_POST_VARS['category_id'] ); $title = ( !empty( $HTTP_POST_VARS['article_name'] ) ) ? htmlspecialchars( $HTTP_POST_VARS['article_name'] ) : ''; $description = ( !empty( $HTTP_POST_VARS['article_desc'] ) ) ? htmlspecialchars( $HTTP_POST_VARS['article_desc'] ) : ''; $date = time(); ! $author_id = intval ( $HTTP_POST_VARS['author_id'] ); ! $type_id = intval ( $HTTP_POST_VARS['type_id'] ); $bbcode_uid = $HTTP_POST_VARS['bbcode_uid']; Index: kb_moderator.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_moderator.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** kb_moderator.php 1 Feb 2005 20:45:44 -0000 1.3 --- kb_moderator.php 17 Mar 2005 12:37:24 -0000 1.4 *************** *** 27,32 **** include( $phpbb_root_path . 'includes/functions_admin.' . $phpEx ); ! $category_id = $HTTP_GET_VARS['cat']; ! $page_id = $HTTP_GET_VARS['page']; $ref_stats = ( isset( $HTTP_GET_VARS['ref'] ) ) ? true : 0; --- 27,34 ---- include( $phpbb_root_path . 'includes/functions_admin.' . $phpEx ); ! $category_id = ( isset( $HTTP_GET_VARS['cat'] ) ) ? intval ( $HTTP_GET_VARS['cat']) : intval ( $HTTP_POST_VARS['cat'] ); ! ! $page_id = ( isset( $HTTP_GET_VARS['page'] ) ) ? intval ( $HTTP_GET_VARS['page']) : intval ( $HTTP_POST_VARS['page'] ); ! $ref_stats = ( isset( $HTTP_GET_VARS['ref'] ) ) ? true : 0; *************** *** 73,77 **** case 'approve': ! $article_id = $HTTP_GET_VARS['a']; $topic_sql = ''; --- 75,79 ---- case 'approve': ! $article_id = intval ( $HTTP_GET_VARS['a'] ); $topic_sql = ''; *************** *** 175,179 **** case 'unapprove': ! $article_id = $HTTP_GET_VARS['a']; $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET approved = 0 --- 177,181 ---- case 'unapprove': ! $article_id = intval ( $HTTP_GET_VARS['a'] ); $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET approved = 0 *************** *** 208,215 **** case 'delete': if ( $HTTP_GET_VARS['c'] == "yes" ) { - $article_id = $HTTP_GET_VARS['a']; - $sql = "SELECT article_category_id, approved, topic_id FROM " . KB_ARTICLES_TABLE . " --- 210,217 ---- case 'delete': + $article_id = intval ( $HTTP_GET_VARS['a'] ); + if ( $HTTP_GET_VARS['c'] == "yes" ) { $sql = "SELECT article_category_id, approved, topic_id FROM " . KB_ARTICLES_TABLE . " *************** *** 369,373 **** $category_id = ( $ref_stats ? 1 : $category_id ); ! $message = $lang['Confirm_art_delete'] . '<br /><br />' . sprintf( $lang['Confirm_art_delete_yes'], '<a href="' . append_sid( this_kb_mxurl( "mode=moderate&action=delete&page=$page_id&cat=$category_id&c=yes&a=" . $HTTP_GET_VARS['a'] ) ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Confirm_art_delete_no'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx?page=$page_id&mode=cat&cat=$category_id" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 371,375 ---- $category_id = ( $ref_stats ? 1 : $category_id ); ! $message = $lang['Confirm_art_delete'] . '<br /><br />' . sprintf( $lang['Confirm_art_delete_yes'], '<a href="' . append_sid( this_kb_mxurl( "mode=moderate&action=delete&page=$page_id&cat=$category_id&c=yes&a=" . $article_id ) ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Confirm_art_delete_no'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx?page=$page_id&mode=cat&cat=$category_id" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } Index: kb_add.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_add.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** kb_add.php 1 Feb 2005 20:45:36 -0000 1.12 --- kb_add.php 17 Mar 2005 12:37:24 -0000 1.13 *************** *** 25,29 **** } ! $category_id = ( isset( $HTTP_GET_VARS['cat'] ) ) ? $HTTP_GET_VARS['cat'] : $HTTP_POST_VARS['cat']; // Start auth check --- 25,29 ---- } ! $category_id = ( isset( $HTTP_GET_VARS['cat'] ) ) ? intval ( $HTTP_GET_VARS['cat'] ) : intval ( $HTTP_POST_VARS['cat'] ); // Start auth check |
|
From: <mxb...@li...> - 2005-03-17 12:37:34
|
Update of /cvsroot/mxbb/mx_kb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8415/modules/mx_kb Modified Files: kb.php Log Message: Bug #47 - SQL Injection vulnerability in Knowledge Base MOD Index: kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** kb.php 1 Feb 2005 20:45:08 -0000 1.12 --- kb.php 17 Mar 2005 12:37:24 -0000 1.13 *************** *** 174,177 **** --- 174,178 ---- { $print_version = ( isset( $HTTP_POST_VARS['print'] ) ) ? $HTTP_POST_VARS['print'] : $HTTP_GET_VARS['print']; + $print_version = htmlspecialchars( $print_version ); } else |
|
From: <mxb...@li...> - 2005-03-17 12:37:33
|
Update of /cvsroot/mxbb/mx_kb/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8415/modules/mx_kb/admin Modified Files: admin_kb_art.php admin_kb_cat.php admin_kb_config.php admin_kb_types.php Log Message: Bug #47 - SQL Injection vulnerability in Knowledge Base MOD Index: admin_kb_cat.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_cat.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** admin_kb_cat.php 1 Feb 2005 20:45:04 -0000 1.6 --- admin_kb_cat.php 17 Mar 2005 12:37:24 -0000 1.7 *************** *** 184,189 **** $cat_desc = $HTTP_POST_VARS['catdesc']; ! $parent = $HTTP_POST_VARS['parent']; ! $comments_forum_id = $HTTP_POST_VARS['forum_id']; if ( $comments_forum_id == 0 ) --- 184,189 ---- $cat_desc = $HTTP_POST_VARS['catdesc']; ! $parent = intval( $HTTP_POST_VARS['parent'] ); ! $comments_forum_id = intval( $HTTP_POST_VARS['forum_id'] ); if ( $comments_forum_id == 0 ) *************** *** 230,234 **** if ( !$HTTP_POST_VARS['submit'] ) { ! $cat_id = $HTTP_GET_VARS['cat']; $sql = "SELECT * FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = " . $cat_id; --- 230,234 ---- if ( !$HTTP_POST_VARS['submit'] ) { ! $cat_id = intval( $HTTP_GET_VARS['cat'] ); $sql = "SELECT * FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = " . $cat_id; *************** *** 349,358 **** else if ( $HTTP_POST_VARS['submit'] ) { ! $cat_id = $HTTP_POST_VARS['catid']; $cat_name = trim( $HTTP_POST_VARS['catname'] ); $cat_desc = $HTTP_POST_VARS['catdesc']; ! $number_articles = $HTTP_POST_VARS['number_articles']; ! $parent = $HTTP_POST_VARS['parent']; ! $comments_forum_id = $HTTP_POST_VARS['forum_id']; $view_level = intval( $HTTP_POST_VARS['auth_view'] ); --- 349,358 ---- else if ( $HTTP_POST_VARS['submit'] ) { ! $cat_id = intval( $HTTP_POST_VARS['catid'] ); $cat_name = trim( $HTTP_POST_VARS['catname'] ); $cat_desc = $HTTP_POST_VARS['catdesc']; ! $number_articles = intval( $HTTP_POST_VARS['number_articles'] ); ! $parent = intval( $HTTP_POST_VARS['parent'] ); ! $comments_forum_id = intval( $HTTP_POST_VARS['forum_id'] ); $view_level = intval( $HTTP_POST_VARS['auth_view'] ); Index: admin_kb_art.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_art.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** admin_kb_art.php 1 Feb 2005 20:44:51 -0000 1.11 --- admin_kb_art.php 17 Mar 2005 12:37:24 -0000 1.12 *************** *** 85,89 **** case 'approve': ! $article_id = $HTTP_GET_VARS['a']; $topic_sql = ''; --- 85,89 ---- case 'approve': ! $article_id = intval( $HTTP_GET_VARS['a'] ); $topic_sql = ''; *************** *** 187,191 **** case 'unapprove': ! $article_id = $HTTP_GET_VARS['a']; $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET approved = 0 --- 187,191 ---- case 'unapprove': ! $article_id = intval( $HTTP_GET_VARS['a'] ); $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET approved = 0 *************** *** 220,227 **** case 'delete': if ( $HTTP_GET_VARS['c'] == "yes" ) { - $article_id = $HTTP_GET_VARS['a']; - $sql = "SELECT article_category_id, approved, topic_id FROM " . KB_ARTICLES_TABLE . " --- 220,227 ---- case 'delete': + $article_id = intval( $HTTP_GET_VARS['a'] ); + if ( $HTTP_GET_VARS['c'] == "yes" ) { $sql = "SELECT article_category_id, approved, topic_id FROM " . KB_ARTICLES_TABLE . " *************** *** 379,383 **** else { ! $message = $lang['Confirm_art_delete'] . '<br /><br />' . sprintf( $lang['Confirm_art_delete_yes'], '<a href="' . append_sid( "admin_kb_art.$phpEx?mode=delete&c=yes&a=" . $HTTP_GET_VARS['a'] ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Confirm_art_delete_no'], '<a href="' . append_sid( "admin_kb_art.$phpEx" ) . '">', '</a>' ); message_die( GENERAL_MESSAGE, $message ); --- 379,383 ---- else { ! $message = $lang['Confirm_art_delete'] . '<br /><br />' . sprintf( $lang['Confirm_art_delete_yes'], '<a href="' . append_sid( "admin_kb_art.$phpEx?mode=delete&c=yes&a=" . $article_id ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Confirm_art_delete_no'], '<a href="' . append_sid( "admin_kb_art.$phpEx" ) . '">', '</a>' ); message_die( GENERAL_MESSAGE, $message ); Index: admin_kb_types.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_types.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** admin_kb_types.php 9 Jan 2005 21:40:38 -0000 1.5 --- admin_kb_types.php 17 Mar 2005 12:37:24 -0000 1.6 *************** *** 127,131 **** if ( !$HTTP_POST_VARS['submit'] ) { ! $type_id = $HTTP_GET_VARS['cat']; $sql = "SELECT * FROM " . KB_TYPES_TABLE . " WHERE id = " . $type_id; --- 127,131 ---- if ( !$HTTP_POST_VARS['submit'] ) { ! $type_id = intval( $HTTP_GET_VARS['cat'] ); $sql = "SELECT * FROM " . KB_TYPES_TABLE . " WHERE id = " . $type_id; *************** *** 158,162 **** else if ( $HTTP_POST_VARS['submit'] ) { ! $type_id = $HTTP_POST_VARS['typeid']; $type_name = trim( $HTTP_POST_VARS['catname'] ); --- 158,162 ---- else if ( $HTTP_POST_VARS['submit'] ) { ! $type_id = intval( $HTTP_POST_VARS['typeid'] ); $type_name = trim( $HTTP_POST_VARS['catname'] ); *************** *** 184,188 **** if ( !$HTTP_POST_VARS['submit'] ) { ! $type_id = $HTTP_GET_VARS['cat']; $sql = "SELECT * --- 184,188 ---- if ( !$HTTP_POST_VARS['submit'] ) { ! $type_id = intval( $HTTP_GET_VARS['cat'] ); $sql = "SELECT * Index: admin_kb_config.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_config.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** admin_kb_config.php 1 Feb 2005 20:45:07 -0000 1.12 --- admin_kb_config.php 17 Mar 2005 12:37:24 -0000 1.13 *************** *** 46,87 **** include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); - - /* - function get_groups( $sel_id ) - { - global $db; - - $sql = "SELECT group_id, group_name - FROM " . GROUPS_TABLE; - - if ( !$result = $db->sql_query( $sql ) ) - { - message_die( GENERAL_ERROR, "Couldn't get list of groups", "", __LINE__, __FILE__, $sql ); - } - - $grouplist = '<select name="mod_group">'; - - while ( $row = $db->sql_fetchrow( $result ) ) - { - if ( $row['group_name'] != '' ) - { - if ( $sel_id == $row['group_id'] ) - { - $status = "selected"; - } - else - { - $status = ''; - } - $grouplist .= '<option value="' . $row['group_id'] . '" ' . $status . '>' . $row['group_name'] . '</option>'; - } - } - - $grouplist .= '</select>'; - - return $grouplist; - } - */ - // Pull all config data --- 46,49 ---- *************** *** 241,254 **** 'S_NEW_NO' => $new_no, - // 'L_APPROVE_NEW_NAME' => $lang['Approve_new_name'], - // 'L_APPROVE_NEW_EXPLAIN' => $lang['Approve_new_explain'], - // 'S_APPROVE_NEW_YES' => $approve_new_yes, - // 'S_APPROVE_NEW_NO' => $approve_new_no, - - // 'L_EDIT_NAME' => $lang['Edit_name'], - // 'L_EDIT_EXPLAIN' => $lang['Edit_explain'], - // 'S_EDIT_YES' => $edit_yes, - // 'S_EDIT_NO' => $edit_no, - 'L_SHOW' => $lang['Show'], 'L_HIDE' => $lang['Hide'], --- 203,206 ---- *************** *** 262,270 **** 'L_PT_BODY' => $pt_body, - // 'L_APPROVE_EDIT_NAME' => $lang['Approve_edit_name'], - // 'L_APPROVE_EDIT_EXPLAIN' => $lang['Approve_edit_explain'], - // 'S_APPROVE_EDIT_YES' => $approve_edit_yes, - // 'S_APPROVE_EDIT_NO' => $approve_edit_no, - 'L_NOTIFY_NAME' => $lang['Notify_name'], 'L_NOTIFY_EXPLAIN' => $lang['Notify_explain'], --- 214,217 ---- *************** *** 284,291 **** 'S_USE_COMMENTS_NO' => $use_comments_no, - // 'L_FORUM_ID' => $lang['Forum_id'], - // 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], - // 'FORUMS' => $forums, - // Added by Haplo 'L_RATINGS_INFO' => $lang['Rating_info'], 'L_COMMENTS_INFO' => $lang['Comment_info'], --- 231,234 ---- *************** *** 296,303 **** 'S_COMMENTS_SHOW_NO' => $comments_show_no, - // 'L_MOD_GROUP' => $lang['Mod_group'], - // 'L_MOD_GROUP_EXPLAIN' => $lang['Mod_group_explain'], - // 'MOD_GROUP' => $mod_group, - 'L_BUMP_POST' => $lang['Bump_post'], 'L_BUMP_POST_EXPLAIN' => $lang['Bump_post_explain'], --- 239,242 ---- *************** *** 325,333 **** 'S_USE_RATINGS_NO' => $use_ratings_no, - // 'L_ALLOW_ANONYMOS_RATING' => $lang['Allow_anonymos_rating'], - // 'L_ALLOW_ANONYMOS_RATING_EXPLAIN' => $lang['Allow_anonymos_rating_explain'], - // 'S_ALLOW_ANONYMOS_RATING_YES' => $allow_anonymos_rating_yes, - // 'S_ALLOW_ANONYMOS_RATING_NO' => $allow_anonymos_rating_no, - 'L_VOTES_CHECK_IP' => $lang['Votes_check_ip'], 'L_VOTES_CHECK_IP_EXPLAIN' => $lang['Votes_check_ip_explain'], --- 264,267 ---- |
Update of /cvsroot/mxbb/mx_calsnails In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1680/modules/mx_calsnails Modified Files: CalSnails_Lite.pak calendar.php db_install.php db_upgrade.php mx_calendar_events.php mx_calendar_query.php Log Message: added includes/mx_admincp.php minor fixes Index: mx_calendar_events.php =================================================================== RCS file: /cvsroot/mxbb/mx_calsnails/mx_calendar_events.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mx_calendar_events.php 1 Feb 2005 20:41:56 -0000 1.6 --- mx_calendar_events.php 17 Mar 2005 12:04:26 -0000 1.7 *************** *** 209,213 **** while ( $row = $db->sql_fetchrow( $result ) ) { ! $id = stripslashes( $row['id'] ); $ini_date = my_dateformat( $row['stamp'], $block_datefmt, 1 ); $end_date = my_dateformat( $row['eventspan'], $block_datefmt, 1 ); --- 209,213 ---- while ( $row = $db->sql_fetchrow( $result ) ) { ! $id = stripslashes( $row['event_id'] ); $ini_date = my_dateformat( $row['stamp'], $block_datefmt, 1 ); $end_date = my_dateformat( $row['eventspan'], $block_datefmt, 1 ); Index: mx_calendar_query.php =================================================================== RCS file: /cvsroot/mxbb/mx_calsnails/mx_calendar_query.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mx_calendar_query.php 9 Jan 2005 21:31:28 -0000 1.5 --- mx_calendar_query.php 17 Mar 2005 12:04:26 -0000 1.6 *************** *** 93,97 **** } $template->assign_block_vars( 'event_row', array( 'ROW_CLASS' => ( $check % 2 == 0 ) ? 'row1' : 'row2', ! 'EVENT_ID' => stripslashes( $row['id'] ), 'SUBJECT' => stripslashes( $row['subject'] ), 'DATE' => my_dateformat( $row['stamp'], $block_datefmt ), --- 93,97 ---- } $template->assign_block_vars( 'event_row', array( 'ROW_CLASS' => ( $check % 2 == 0 ) ? 'row1' : 'row2', ! 'EVENT_ID' => stripslashes( $row['event_id'] ), 'SUBJECT' => stripslashes( $row['subject'] ), 'DATE' => my_dateformat( $row['stamp'], $block_datefmt ), Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_calsnails/db_upgrade.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** db_upgrade.php 6 Mar 2005 01:11:51 -0000 1.6 --- db_upgrade.php 17 Mar 2005 12:04:26 -0000 1.7 *************** *** 67,70 **** --- 67,71 ---- $upgrade_106 = 0; $upgrade_107 = 0; + $upgrade_108 = 0; // validate before 1.07 if ( !$result = $db->sql_query( "SELECT block_id from " . CALLITE_EVENTS_TABLE ) ) *************** *** 72,76 **** $upgrade_107 = 1; } ! $message = "<b>Upgrading!</b><br/><br/>"; --- 73,81 ---- $upgrade_107 = 1; } ! // validate before 1.08 ! if ( !$result = $db->sql_query( "SELECT event_id from " . CALLITE_EVENTS_TABLE ) ) ! { ! $upgrade_108 = 1; ! } $message = "<b>Upgrading!</b><br/><br/>"; *************** *** 79,82 **** --- 84,89 ---- $message .= "<b>Upgrading to v. 1.07...</b><br/><br/>"; $sql[] = "ALTER TABLE " . CALLITE_EVENTS_TABLE . " ADD block_id mediumint(8) unsigned NOT NULL default '0' "; + + /* // Now add some new parameters for the main LITE block // First get function_id *************** *** 160,163 **** --- 167,178 ---- $sql[] = "REPLACE INTO " . $mx_table_prefix . "block_system_parameter VALUES('" . $block_id . "', '" . $parameter_id1 . "', '0', NULL)"; } + */ + } + + if ( $upgrade_108 == 1 ) + { + $message .= "<b>Upgrading to v. 1.08...</b><br/><br/>"; + $sql[] = "ALTER TABLE " . CALLITE_EVENTS_TABLE . " CHANGE id event_id int(11) DEFAULT '0' NOT NULL auto_increment "; + } else Index: calendar.php =================================================================== RCS file: /cvsroot/mxbb/mx_calsnails/calendar.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** calendar.php 6 Mar 2005 01:11:51 -0000 1.13 --- calendar.php 17 Mar 2005 12:04:26 -0000 1.14 *************** *** 487,494 **** if ( $value == 'yes' ) { ! $sql = "UPDATE " . CALLITE_EVENTS_TABLE . " SET valid = 'yes' WHERE id = '$thisid'"; }elseif ( $value == 'del' ) { ! $sql = "DELETE FROM " . CALLITE_EVENTS_TABLE . " WHERE id = '$thisid'"; } if ( $sql ) --- 487,494 ---- if ( $value == 'yes' ) { ! $sql = "UPDATE " . CALLITE_EVENTS_TABLE . " SET valid = 'yes' WHERE event_id = '$thisid'"; }elseif ( $value == 'del' ) { ! $sql = "DELETE FROM " . CALLITE_EVENTS_TABLE . " WHERE event_id = '$thisid'"; } if ( $sql ) *************** *** 546,550 **** while ( $row = $db->sql_fetchrow( $query ) ) { ! $options = "<select name=id[" . $row['id'] . "]> <option value='hold' SELECTED>Hold</option> <option value='yes'>Accept</option> --- 546,550 ---- while ( $row = $db->sql_fetchrow( $query ) ) { ! $options = "<select name=id[" . $row['event_id'] . "]> <option value='hold' SELECTED>Hold</option> <option value='yes'>Accept</option> *************** *** 598,602 **** message_die( GENERAL_ERROR, $lang['Cal_must_sel_event'], '', __LINE__, __FILE__, $sql ); } ! $sql = "SELECT id, user_id FROM " . CALLITE_EVENTS_TABLE . " WHERE id = '$id'"; if ( $caluser < 5 ) { --- 598,602 ---- message_die( GENERAL_ERROR, $lang['Cal_must_sel_event'], '', __LINE__, __FILE__, $sql ); } ! $sql = "SELECT event_id, user_id FROM " . CALLITE_EVENTS_TABLE . " WHERE event_id = '$id'"; if ( $caluser < 5 ) { *************** *** 608,614 **** } $row = $db->sql_fetchrow( $query ); ! if ( $row['id'] != '' ) { ! $sql = "DELETE FROM " . CALLITE_EVENTS_TABLE . " WHERE id = '$id'"; if ( !( $query = $db->sql_query( $sql ) ) ) { --- 608,614 ---- } $row = $db->sql_fetchrow( $query ); ! if ( $row['event_id'] != '' ) { ! $sql = "DELETE FROM " . CALLITE_EVENTS_TABLE . " WHERE event_id = '$id'"; if ( !( $query = $db->sql_query( $sql ) ) ) { *************** *** 659,663 **** SUBSTRING(stamp FROM 1 FOR 4) AS theyear, SUBSTRING(eventspan FROM 1 FOR 4) AS theendyear ! FROM " . CALLITE_EVENTS_TABLE . " WHERE id = '$id'"; if ( !( $query = $db->sql_query( $sql ) ) ) { --- 659,663 ---- SUBSTRING(stamp FROM 1 FOR 4) AS theyear, SUBSTRING(eventspan FROM 1 FOR 4) AS theendyear ! FROM " . CALLITE_EVENTS_TABLE . " WHERE event_id = '$id'"; if ( !( $query = $db->sql_query( $sql ) ) ) { *************** *** 672,676 **** $zdesc = preg_replace( "/\:(([a-z0-9]:)?)" . $bbcode_uid . "/si", "", $zdesc ); ! $hidden_form_fields = "<input type=hidden name=id value='" . $row['id'] . "'> <input type=hidden name=bbcode_uid value='" . $row['bbcode_uid'] . "'> <input type=hidden name=modify value='Modify'>"; --- 672,676 ---- $zdesc = preg_replace( "/\:(([a-z0-9]:)?)" . $bbcode_uid . "/si", "", $zdesc ); ! $hidden_form_fields = "<input type=hidden name=id value='" . $row['event_id'] . "'> <input type=hidden name=bbcode_uid value='" . $row['bbcode_uid'] . "'> <input type=hidden name=modify value='Modify'>"; *************** *** 1020,1024 **** { ereg_replace( "<br />", "", $event_desc ); ! $sql = "UPDATE " . CALLITE_EVENTS_TABLE . " SET stamp='$year-$month-$day $time', subject='$subject', description='$event_desc', eventspan='$endyear-$endmonth-$endday', bbcode_uid='$bbcode_uid', block_id='$block_id' WHERE id = '$id'"; } else --- 1020,1024 ---- { ereg_replace( "<br />", "", $event_desc ); ! $sql = "UPDATE " . CALLITE_EVENTS_TABLE . " SET stamp='$year-$month-$day $time', subject='$subject', description='$event_desc', eventspan='$endyear-$endmonth-$endday', bbcode_uid='$bbcode_uid', block_id='$block_id' WHERE event_id = '$id'"; } else *************** *** 1071,1075 **** if ( $id ) { ! $sql .= "id = '$id'"; } else --- 1071,1075 ---- if ( $id ) { ! $sql .= "event_id = '$id'"; } else *************** *** 1102,1108 **** if ( $cal_config['allow_old'] || strtotime( $row['stamp'] ) >= $today ) { ! $edit_img = '<a href="' . this_mxurl( 'action=Modify_marked&id=' . $row['id'] ) . '"><img src="' . PHPBB_URL . $images['icon_edit'] . '" alt="' . $lang['Edit_delete_post'] . '" title="' . $lang['Edit_delete_post'] . '" border="0" /></a>'; } ! $delpost_img = '<a href="' . this_mxurl( 'action=Delete_marked&id=' . $row['id'] ) . '"><img src="' . PHPBB_URL . $images['icon_delpost'] . '" alt="' . $lang['Delete_post'] . '" title="' . $lang['Delete_post'] . '" border="0" /></a>'; } else --- 1102,1108 ---- if ( $cal_config['allow_old'] || strtotime( $row['stamp'] ) >= $today ) { ! $edit_img = '<a href="' . this_mxurl( 'action=Modify_marked&id=' . $row['event_id'] ) . '"><img src="' . PHPBB_URL . $images['icon_edit'] . '" alt="' . $lang['Edit_delete_post'] . '" title="' . $lang['Edit_delete_post'] . '" border="0" /></a>'; } ! $delpost_img = '<a href="' . this_mxurl( 'action=Delete_marked&id=' . $row['event_id'] ) . '"><img src="' . PHPBB_URL . $images['icon_delpost'] . '" alt="' . $lang['Delete_post'] . '" title="' . $lang['Delete_post'] . '" border="0" /></a>'; } else *************** *** 1372,1379 **** } // End UKRag.net function ! $url = append_sid( this_mxurl( 'id=' . $results['id'] . '&mode=display&day=' . $thisday . '&month=' . $today_month . '&year=' . $today_year ) ); // Need to keep the size down $event_list .= "<span class=gensmall><acronym title='" . stripslashes( $results['username'] ) . ": $full_subject'> ! $pt <a href='$url' id='cal_id" . $results['id'] . "' onMouseOver=\"swc('cal_id" . $results['id'] . "',1)\" onMouseOut=\"swc('cal_id" . $results['id'] . "',0)\"> $subject</a></acronym><br></span>\n"; } --- 1372,1379 ---- } // End UKRag.net function ! $url = append_sid( this_mxurl( 'id=' . $results['event_id'] . '&mode=display&day=' . $thisday . '&month=' . $today_month . '&year=' . $today_year ) ); // Need to keep the size down $event_list .= "<span class=gensmall><acronym title='" . stripslashes( $results['username'] ) . ": $full_subject'> ! $pt <a href='$url' id='cal_id" . $results['event_id'] . "' onMouseOver=\"swc('cal_id" . $results['event_id'] . "',1)\" onMouseOut=\"swc('cal_id" . $results['event_id'] . "',0)\"> $subject</a></acronym><br></span>\n"; } Index: CalSnails_Lite.pak =================================================================== RCS file: /cvsroot/mxbb/mx_calsnails/CalSnails_Lite.pak,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CalSnails_Lite.pak 15 Jan 2005 23:43:15 -0000 1.4 --- CalSnails_Lite.pak 17 Mar 2005 12:04:26 -0000 1.5 *************** *** 39,42 **** --- 39,44 ---- New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:42=+:44=+:CalSnails Mini=+:Calendar Lite (mini function)=+:mx_calendar_mini.php=+: + parameter=+:45=+:110=+:target_block=+:Function=+:0=+:get_list_formatted("calsnails","{parameter_value}","{parameter_id}[]") + option=+:0=+:0=+:0=+:endoflist=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - CalSnails Mini=+:Demo block=+:44=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_calsnails/db_install.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** db_install.php 6 Mar 2005 01:11:51 -0000 1.12 --- db_install.php 17 Mar 2005 12:04:26 -0000 1.13 *************** *** 53,57 **** // Table: Calendar Lite Events "CREATE TABLE " . CALLITE_EVENTS_TABLE . " ( ! id int(11) DEFAULT '0' NOT NULL auto_increment, username varchar(255), stamp datetime, --- 53,57 ---- // Table: Calendar Lite Events "CREATE TABLE " . CALLITE_EVENTS_TABLE . " ( ! event_id int(11) DEFAULT '0' NOT NULL auto_increment, username varchar(255), stamp datetime, |
|
From: <mxb...@li...> - 2005-03-17 11:30:49
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28480/includes Modified Files: mx_functions.php page_header.php Added Files: mx_admincp.php Log Message: added includes/mx_admincp.php for admincp functions only minor fixes Index: page_header.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/page_header.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** page_header.php 14 Mar 2005 20:56:22 -0000 1.16 --- page_header.php 17 Mar 2005 11:30:37 -0000 1.17 *************** *** 485,501 **** } } // Do NOT set basedir when in EDIT mode if ( !( isset( $HTTP_POST_VARS['portalpage'] ) || isset( $HTTP_GET_VARS['portalpage'] ) ) ) { $template->assign_block_vars( 'switch_set_base', array() ); } // Determine if user have gecko/opera browser ! $useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT; ! // $is_gecko = ( strstr($useragent,'Gecko') || strstr($useragent,'Opera') ) ; ! $is_gecko = ( strstr($useragent,'Gecko') ) ; ! if ( $is_gecko ) ! { $template->assign_block_vars('switch_gecko', array()); ! } // @header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0'); --- 485,506 ---- } } + // Do NOT set basedir when in EDIT mode + if ( !( isset( $HTTP_POST_VARS['portalpage'] ) || isset( $HTTP_GET_VARS['portalpage'] ) ) ) { $template->assign_block_vars( 'switch_set_base', array() ); } + // Determine if user have gecko/opera browser ! ! $useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT; ! ! $is_gecko = ( strstr($useragent,'Gecko') ); ! ! if ( $is_gecko ) ! { $template->assign_block_vars('switch_gecko', array()); ! } // @header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0'); --- NEW FILE: mx_admincp.php --- |
|
From: <mxb...@li...> - 2005-03-17 11:30:49
|
Update of /cvsroot/mxbb/core/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28480/admin Modified Files: admin_mx_block.php admin_mx_menu.php admin_mx_page.php pagestart.php Log Message: added includes/mx_admincp.php for admincp functions only minor fixes Index: pagestart.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/pagestart.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pagestart.php 1 Feb 2005 20:40:43 -0000 1.7 --- pagestart.php 17 Mar 2005 11:30:34 -0000 1.8 *************** *** 22,26 **** * MX Notes: * This file is borrowed from phpBB, with some modifications ! * Also, the BLOCK_EDIT switch makes this file accessible when editing blocks in portal mode */ --- 22,26 ---- * MX Notes: * This file is borrowed from phpBB, with some modifications ! * Also, the BLOCK_EDIT switch makes this file accessible when editing blocks in portal mode */ *************** *** 33,37 **** include_once( $mx_root_path . 'extension.inc' ); ! include_once( $mx_root_path . 'common.' . $phpEx ); // HERE include_once( $phpbb_root_path . 'includes/functions_admin.' . $phpEx ); include_once( $phpbb_root_path . 'includes/functions_post.' . $phpEx ); --- 33,39 ---- include_once( $mx_root_path . 'extension.inc' ); ! include_once( $mx_root_path . 'common.' . $phpEx ); ! ! include_once( $mx_root_path . 'includes/mx_admincp.' . $phpEx ); include_once( $phpbb_root_path . 'includes/functions_admin.' . $phpEx ); include_once( $phpbb_root_path . 'includes/functions_post.' . $phpEx ); *************** *** 45,49 **** // Security - used for block_edits ! $block_id = intval( $HTTP_POST_VARS['block_id'] ); $block_config = read_block_config( $block_id, false ); --- 47,52 ---- // Security - used for block_edits ! ! $block_id = $mx_request_vars->post('block_id', MX_TYPE_INT, '0'); $block_config = read_block_config( $block_id, false ); Index: admin_mx_page.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_page.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** admin_mx_page.php 6 Mar 2005 01:10:13 -0000 1.18 --- admin_mx_page.php 17 Mar 2005 11:30:34 -0000 1.19 *************** *** 50,54 **** { $page_id = ( isset( $HTTP_POST_VARS['page_id'] ) ) ? $HTTP_POST_VARS['page_id'] : $HTTP_GET_VARS['page_id']; ! $page_id = htmlspecialchars( $page_id ); } else --- 50,54 ---- { $page_id = ( isset( $HTTP_POST_VARS['page_id'] ) ) ? $HTTP_POST_VARS['page_id'] : $HTTP_GET_VARS['page_id']; ! $page_id = intval( $page_id ); } else Index: admin_mx_menu.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_menu.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** admin_mx_menu.php 9 Mar 2005 22:46:32 -0000 1.20 --- admin_mx_menu.php 17 Mar 2005 11:30:34 -0000 1.21 *************** *** 1303,1307 **** $template->pparse( "admin_menu" ); ! if ( defined( 'BLOCK_EDIT' ) ) { include( $mx_root_path . 'includes/page_tail.' . $phpEx ); --- 1303,1307 ---- $template->pparse( "admin_menu" ); ! if ( !empty( $portalpage ) ) { include( $mx_root_path . 'includes/page_tail.' . $phpEx ); Index: admin_mx_block.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_block.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** admin_mx_block.php 6 Mar 2005 01:10:11 -0000 1.22 --- admin_mx_block.php 17 Mar 2005 11:30:34 -0000 1.23 *************** *** 574,578 **** function block_setting( $block_id ) { ! global $template, $lang, $db, $board_config, $theme, $HTTP_GET_VARS, $HTTP_POST_VARS, $phpEx, $mx_root_path, $s_hidden_fields, $userdata, $portalpage; // Generate Layout for each block parameter --- 574,578 ---- function block_setting( $block_id ) { ! global $template, $lang, $db, $board_config, $theme, $HTTP_GET_VARS, $HTTP_POST_VARS, $phpEx, $mx_root_path, $s_hidden_fields, $userdata, $portalpage, $starttime; // Generate Layout for each block parameter *************** *** 612,617 **** } - - $template->set_filenames( array( "edit_block" => "admin/mx_block_setting_body.tpl" ) ); --- 612,615 ---- *************** *** 771,774 **** --- 769,773 ---- include( './page_header_admin.' . $phpEx ); } + $template->pparse( "edit_block" ); |
|
From: <mxb...@li...> - 2005-03-17 11:30:48
|
Update of /cvsroot/mxbb/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28480 Modified Files: common.php index.php mx_dynamic.php mx_includex.php mx_search.php Log Message: added includes/mx_admincp.php for admincp functions only minor fixes Index: common.php =================================================================== RCS file: /cvsroot/mxbb/core/common.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** common.php 16 Mar 2005 00:18:43 -0000 1.27 --- common.php 17 Mar 2005 11:30:35 -0000 1.28 *************** *** 204,208 **** include_once( $phpbb_root_path . 'includes/db.' . $phpEx ); include_once( $phpbb_root_path . 'includes/functions_selects.' . $phpEx ); - include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); include_once( $phpbb_root_path . 'includes/bbcode.' . $phpEx ); --- 204,207 ---- *************** *** 230,233 **** --- 229,236 ---- define( 'PORTAL_VERSION', $portal_config['portal_version'] ); + // instatiate the mx_request_vars class + + $mx_request_vars = new mx_request_vars(); + // Obtain and encode users IP *************** *** 236,239 **** --- 239,243 ---- // even bother complaining ... go scream and shout at the idiots out there who feel // "clever" is doing harm rather than good ... karma is a great thing ... :) + $client_ip = ( !empty( $HTTP_SERVER_VARS['REMOTE_ADDR'] ) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty( $HTTP_ENV_VARS['REMOTE_ADDR'] ) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : $REMOTE_ADDR ); $user_ip = encode_ip( $client_ip ); *************** *** 254,280 **** $board_config[$row['config_name']] = $row['config_value']; } - // ++ MX System - /* - if ($language) - { - $board_config['default_lang'] = $language; - setcookie('default_lang',$language , (time()+21600), $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); - } - else if (isset($HTTP_COOKIE_VARS['default_lang']) ) - { - $board_config['default_lang']=$HTTP_COOKIE_VARS['default_lang']; - } - if ($style) - { - $board_config['default_style'] = $style; - setcookie('default_style',$style , (time()+21600), $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); - } - else if (isset($HTTP_COOKIE_VARS['default_style']) ) - { - $board_config['default_style']=$HTTP_COOKIE_VARS['default_style']; - } - */ - // -- MX System if ( file_exists( $phpbb_root_path . 'attach_mod' ) ) { --- 258,262 ---- |
|
From: <mxb...@li...> - 2005-03-17 00:42:55
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6374 Modified Files: mx_functions.php Log Message: Sorry, fixed a typo in the new mx_request_vars class. I forgot the $this keyword. lol Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** mx_functions.php 17 Mar 2005 00:07:44 -0000 1.27 --- mx_functions.php 17 Mar 2005 00:42:42 -0000 1.28 *************** *** 1428,1436 **** function post($var, $type = 0, $dflt = '') { ! return _read($var, ($type | MX_TYPE_POST_VARS), $dflt); } function get($var, $type = 0, $dflt = '') { ! return _read($var, ($type | MX_TYPE_GET_VARS), $dflt); } function is_post($var) --- 1428,1436 ---- function post($var, $type = 0, $dflt = '') { ! return $this->_read($var, ($type | MX_TYPE_POST_VARS), $dflt); } function get($var, $type = 0, $dflt = '') { ! return $this->_read($var, ($type | MX_TYPE_GET_VARS), $dflt); } function is_post($var) *************** *** 1446,1450 **** function is_request($var) { ! return ( is_get($var) || is_post($var) ); } --- 1446,1450 ---- function is_request($var) { ! return ( $this->is_get($var) || $this->is_post($var) ); } |
|
From: <mxb...@li...> - 2005-03-17 00:07:55
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31490 Modified Files: mx_functions.php Log Message: Created class mx_request_vars in mx_functions.php Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** mx_functions.php 16 Mar 2005 00:16:27 -0000 1.26 --- mx_functions.php 17 Mar 2005 00:07:44 -0000 1.27 *************** *** 46,49 **** --- 46,54 ---- */ + /** + * Included classes in this file: + * - mx_request_vars + */ + // ****************************************************************** // ****************************************************************** *************** *** 1290,1292 **** --- 1295,1453 ---- } + + // -------------------------------------------------------------------------------- + // Class: mx_request_vars + // Encapsulate several functions related to GET/POST variables. + // + + // + // Following flags are options for the $type parameter in method _read() + // + define('MX_TYPE_INT' , 1); + define('MX_TYPE_FLOAT' , 2); + define('MX_TYPE_NO_HTML' , 4); + define('MX_TYPE_NO_TAGS' , 8); + define('MX_TYPE_NO_STRIP' , 16); + define('MX_TYPE_NO_SQL' , 32); + define('MX_TYPE_POST_VARS' , 64); + define('MX_TYPE_GET_VARS' , 128); + + // + // This class must be instatiated in common.php ;-) + // + // Usage examples: + // + // $mx_request_vars = new mx_request_vars(); + // $mode = $mx_request_vars->post('mode', MX_TYPE_NO_TAGS, ''); + // $page_id = $mx_request_vars->post('page', MX_TYPE_INT, 1); + // + class mx_request_vars + { + // + // Properties + // + + // + // Contructor + // + //function mx_request_vars() + //{ + // Not implemented + //} + + // + // Private Methods (convention: first char in name is underscore) + // + function _read($var, $type = 0, $dflt = '') + { + global $HTTP_POST_VARS, $HTTP_GET_VARS; + + if( ($type & (MX_TYPE_POST_VARS|MX_TYPE_GET_VARS)) == 0 ) + { + $type |= (MX_TYPE_POST_VARS|MX_TYPE_GET_VARS); + } + if( ($type & MX_TYPE_POST_VARS) && isset($HTTP_POST_VARS[$var]) || + ($type & MX_TYPE_GET_VARS) && isset($HTTP_GET_VARS[$var]) ) + { + $val = ( ($type & MX_TYPE_POST_VARS) && isset($HTTP_POST_VARS[$var]) ? $HTTP_POST_VARS[$var] : $HTTP_GET_VARS[$var] ); + if( !($type & MX_TYPE_NO_STRIP) ) + { + if( is_array($val) ) + { + foreach( $val as $k => $v ) + { + $val[$k] = trim(stripslashes($v)); + } + } + else + { + $val = trim(stripslashes($val)); + } + } + } + else + { + $val = $dflt; + } + if( $type & MX_TYPE_INT ) // integer + { + return intval($val); + } + if( $type & MX_TYPE_FLOAT ) // float + { + return floatval($val); + } + if( $type & MX_TYPE_NO_HTML ) // no slashes nor html + { + if( is_array($val) ) + { + foreach( $val as $k => $v ) + { + $val[$k] = htmlspecialchars(ltrim(rtrim($v, " \t\n\r\0\x0B\\"))); + } + } + else + { + $val = htmlspecialchars(ltrim(rtrim($val, " \t\n\r\0\x0B\\"))); + } + } + elseif( $type & MX_TYPE_NO_TAGS ) // ie username + { + if( is_array($val) ) + { + foreach( $val as $k => $v ) + { + $val[$k] = htmlspecialchars(strip_tags(ltrim(rtrim($v, " \t\n\r\0\x0B\\")))); + } + } + else + { + $val = htmlspecialchars(strip_tags(ltrim(rtrim($val, " \t\n\r\0\x0B\\")))); + } + } + if( !($type & MX_TYPE_NO_SQL) ) + { + if( is_array($val) ) + { + foreach( $val as $k => $v ) + { + $val[$k] = str_replace(($type & MX_TYPE_NO_STRIP ? "\'" : "'"), "''", $v); + } + } + else + { + $val = str_replace(($type & MX_TYPE_NO_STRIP ? "\'" : "'"), "''", $val); + } + } + return $val; + } + + // + // Public Methods + // + function post($var, $type = 0, $dflt = '') + { + return _read($var, ($type | MX_TYPE_POST_VARS), $dflt); + } + function get($var, $type = 0, $dflt = '') + { + return _read($var, ($type | MX_TYPE_GET_VARS), $dflt); + } + function is_post($var) + { + global $HTTP_POST_VARS; + return ( isset($HTTP_POST_VARS[$var]) || ( isset($HTTP_POST_VARS[$var.'_x']) && isset($HTTP_POST_VARS[$var.'_y']) ) ); + } + function is_get($var) + { + global $HTTP_GET_VARS; + return ( isset($HTTP_GET_VARS[$var]) ); + } + function is_request($var) + { + return ( is_get($var) || is_post($var) ); + } + + } // class mx_request_vars + ?> \ No newline at end of file |
|
From: <mxb...@li...> - 2005-03-16 00:18:52
|
Update of /cvsroot/mxbb/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9861 Modified Files: common.php Log Message: Moved all cloned phpBB function into its own includes script. Index: common.php =================================================================== RCS file: /cvsroot/mxbb/core/common.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** common.php 9 Mar 2005 22:46:33 -0000 1.26 --- common.php 16 Mar 2005 00:18:43 -0000 1.27 *************** *** 209,212 **** --- 209,213 ---- include_once( $mx_root_path . 'includes/mx_constants.' . $phpEx ); include_once( $mx_root_path . 'includes/mx_functions.' . $phpEx ); + include_once( $mx_root_path . 'includes/mx_functions_phpbb.' . $phpEx ); include_once( $mx_root_path . 'includes/mx_auth.' . $phpEx ); include_once( $mx_root_path . 'includes/mx_cache.' . $phpEx ); |
|
From: <mxb...@li...> - 2005-03-16 00:17:39
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9540 Added Files: mx_functions_phpbb.php Log Message: Moved all cloned phpBB function into its own includes script. --- NEW FILE: mx_functions_phpbb.php --- <?php /** ------------------------------------------------------------------------ * subject : mx-portal, CMS & portal * begin : june, 2002 * copyright : (C) 2002-2005 MX-System * email : jon...@ho... * project site : www.mx-system.com * * description : * ------------------------------------------------------------------------- * * $Id: mx_functions_phpbb.php,v 1.1 2005/03/16 00:17:26 markus_petrux Exp $ */ /** * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License', or * ('at your option) any later version. */ /** * Included functions in this file: (validated for phpbb 2.0.10) * - mx_smilies_pass (from bbcode.php) * - mx_decode * - mx_init_userprefs (from functions.php) * - mx_setup_style (from functions.php) * - mx_message_die (from functions.php) * - mx_block_info (another message_die clone, from functions.php) * - mx_generate_smilies (from functions_post.php) * - mx_redirect (from functions_post.php) */ function mx_smilies_pass( $message ) { static $orig, $repl; if ( !isset( $orig ) ) { global $db, $board_config; $orig = $repl = array(); $sql = 'SELECT * FROM ' . SMILIES_TABLE; if ( !$result = $db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, "Couldn't obtain smilies data", "", __LINE__, __FILE__, $sql ); } $smilies = $db->sql_fetchrowset( $result ); if ( count( $smilies ) ) { usort( $smilies, 'smiley_sort' ); } for( $i = 0; $i < count( $smilies ); $i++ ) { $orig[] = "/(?<=.\W|\W.|^\W)" . phpbb_preg_quote( $smilies[$i]['code'], "/" ) . "(?=.\W|\W.|\W$)/"; $repl[] = '<img src="' . PHPBB_URL . $board_config['smilies_path'] . '/' . $smilies[$i]['smile_url'] . '" alt="' . $smilies[$i]['emoticon'] . '" border="0" />'; } } if ( count( $orig ) ) { $message = preg_replace( $orig, $repl, ' ' . $message . ' ' ); $message = substr( $message, 1, -1 ); } return $message; } // Convert the bbcode to html function mx_decode( $bbtext, $bbcode_uid ) { global $board_config; $mytext = stripslashes( $bbtext ); $mytext = bbencode_second_pass( $mytext, $bbcode_uid ); $smilies_path = $board_config['smilies_path']; $board_config['smilies_path'] = PHPBB_URL . $board_config['smilies_path']; $mytext = smilies_pass( $mytext ); $board_config['smilies_path'] = $smilies_path; $mytext = str_replace( "\n", "\n<br />\n", $mytext ); $mytext = make_clickable( $mytext ); return $mytext; } // Old mx_decode function // function mx_decode($message, $bbcode_uid ) { // $message = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $message); // $message = bbencode_second_pass($message, $bbcode_uid) ; // $message = preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message); // $message = make_clickable($message); // $message = mx_smilies_pass($message); // $message = str_replace("\n", "\n<br />\n", $message); // $message = str_replace("\'","'",$message); // return($message); // } // Initialise user settings on page load function mx_init_userprefs( $userdata ) { global $board_config, $theme, $images; global $template, $lang, $phpEx, $mx_root_path, $phpbb_root_path; if ( $userdata['user_id'] != ANONYMOUS ) { if ( !empty( $userdata['user_lang'] ) ) { $board_config['default_lang'] = $userdata['user_lang']; } if ( !empty( $userdata['user_dateformat'] ) ) { $board_config['default_dateformat'] = $userdata['user_dateformat']; } if ( isset( $userdata['user_timezone'] ) ) { $board_config['board_timezone'] = $userdata['user_timezone']; } } if ( !file_exists( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ) ) { $board_config['default_lang'] = 'english'; } if ( file_exists( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ) ) { include( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ); } if ( file_exists( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ) ) { include( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ); } if ( defined( 'IN_ADMIN' ) ) { if ( !file_exists( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ) || !file_exists( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ) ) { $board_config['default_lang'] = 'english'; } include( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ); include( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ); } // Set up style if ( !$board_config['override_user_style'] ) { if ( $userdata['user_id'] != ANONYMOUS && $userdata['user_style'] > 0 ) { if ( $theme = mx_setup_style( $userdata['user_style'] ) ) { return; } } } $theme = mx_setup_style( $board_config['default_style'] ); // Mozilla navigation bar // Default items that should be valid on all pages. // Defined here to correctly assign the Language Variables // and be able to change the variables within code. $nav_links['top'] = array ( 'url' => append_sid( $phpbb_root_path . 'index.' . $phpEx ), 'title' => sprintf( $lang['Forum_Index'], $board_config['sitename'] ) ); $nav_links['search'] = array ( 'url' => append_sid( $phpbb_root_path . 'search.' . $phpEx ), 'title' => $lang['Search'] ); $nav_links['help'] = array ( 'url' => append_sid( $phpbb_root_path . 'faq.' . $phpEx ), 'title' => $lang['FAQ'] ); $nav_links['author'] = array ( 'url' => append_sid( $phpbb_root_path . 'memberlist.' . $phpEx ), 'title' => $lang['Memberlist'] ); return; } function mx_setup_style( $style, $only_template = false ) { global $db, $board_config, $template, $images, $mx_root_path, $phpbb_root_path; $sql = "SELECT * FROM " . THEMES_TABLE . " WHERE themes_id = $style"; if ( !( $result = $db->sql_query( $sql ) ) ) { $style = 1; $sql = "SELECT * FROM " . THEMES_TABLE . " WHERE themes_id = $style"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( CRITICAL_ERROR, 'Could not query database for theme info' ); } } if ( !( $row = $db->sql_fetchrow( $result ) ) ) { mx_message_die( CRITICAL_ERROR, "Could not get theme data for themes_id [$style]" ); } $template_path = 'templates/' ; $template_name = $row['template_name'] ; // MX FIX for uninstalled themes ... use subSilver instead if ( !file_exists( $mx_root_path . $template_path . $template_name . '/mx_login.tpl' ) ) { $template_path = 'templates/' ; $template_name = 'subSilver' ; $style = 1; $sql = "SELECT * FROM " . THEMES_TABLE . " WHERE themes_id = $style"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( CRITICAL_ERROR, 'Could not query database for theme info' ); } if ( !( $row = $db->sql_fetchrow( $result ) ) ) { mx_message_die( CRITICAL_ERROR, "Could not get theme data for themes_id [$style]" ); } $template = new Template( $mx_root_path . $template_path . $template_name, $board_config, $db ); } else { $template = new Template( $mx_root_path . $template_path . $template_name, $board_config, $db ); } if ( $only_template ) { return $row; } // call when only_template is false. define( 'TEMPLATE_ROOT_PATH', $template_path . $template_name . '/' ); if ( $template ) { $current_template_path = $template_path . $template_name; if ( file_exists( $mx_root_path . $template_path . $template_name . '/' . $template_name . '.cfg' ) ) { @include( $mx_root_path . $template_path . $template_name . '/' . $template_name . '.cfg' ); } else { @include( $phpbb_root_path . $template_path . $template_name . '/' . $template_name . '.cfg' ); } if ( !defined( 'TEMPLATE_CONFIG' ) ) { mx_message_die( CRITICAL_ERROR, "Could not open $template_name template config file", '', __LINE__, __FILE__ ); } $img_lang = ( file_exists( $phpbb_root_path . $current_template_path . '/images/lang_' . $board_config['default_lang'] ) ) ? $board_config['default_lang'] : 'english'; while ( list( $key, $value ) = @each( $images ) ) { if ( !is_array( $value ) ) { $images[$key] = str_replace( '{LANG}', 'lang_' . $img_lang, $value ); } } } return $row; } // This is general replacement for die(), allows templated // output in users (or default) language, etc. // $msg_code can be one of these constants: // GENERAL_MESSAGE : Use for any simple text message, eg. results // of an operation, authorisation failures, etc. // GENERAL ERROR : Use for any error which occurs _AFTER_ the // common.php include and session code, ie. most errors in // pages/functions // CRITICAL_MESSAGE : Used when basic config data is available but // a session may not exist, eg. banned users // CRITICAL_ERROR : Used when config data cannot be obtained, eg // no database connection. Should _not_ be used in 99.5% of cases function mx_message_die( $msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '' ) { global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path, $mx_root_path, $nav_links, $gen_simple_header, $images; global $userdata, $user_ip, $session_length, $page_title; global $starttime; $sql_store = $sql; // Get SQL error if we are debugging. Do this as soon as possible to prevent // subsequent queries from overwriting the status of sql_error() if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) ) { $sql_error = $db->sql_error(); $debug_text = ''; if ( $sql_error['message'] != '' ) { $debug_text .= '<br /><br />SQL Error : ' . $sql_error['code'] . ' ' . $sql_error['message']; } if ( $sql_store != '' ) { $debug_text .= "<br /><br />$sql_store"; } if ( $err_line != '' && $err_file != '' ) { $debug_text .= '</br /><br />Line : ' . $err_line . '<br />File : ' . $err_file; } } if ( empty( $userdata ) && ( $msg_code == GENERAL_MESSAGE || $msg_code == GENERAL_ERROR ) ) { $userdata = session_pagestart( $user_ip, PAGE_INDEX ); mx_init_userprefs( $userdata ); } // If the header hasn't been output then do it if ( !defined( 'HEADER_INC' ) && $msg_code != CRITICAL_ERROR ) { if ( empty( $lang ) ) { if ( !empty( $board_config['default_lang'] ) ) { include( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ); } else { include( $mx_root_path . 'language/lang_english/lang_main.' . $phpEx ); } } if ( empty( $template ) ) { $template = new Template( $mx_root_path . 'templates/' . $board_config['board_template'] ); } if ( empty( $theme ) ) { $theme = setup_style( $board_config['default_style'] ); } // Load the Page Header if ( !defined( 'IN_ADMIN' ) ) { include( $mx_root_path . 'includes/page_header.' . $phpEx ); } else { include( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); } } switch ( $msg_code ) { case GENERAL_MESSAGE: if ( $msg_title == '' ) { $msg_title = $lang['Information']; } break; case CRITICAL_MESSAGE: if ( $msg_title == '' ) { $msg_title = $lang['Critical_Information']; } break; case GENERAL_ERROR: if ( $msg_text == '' ) { $msg_text = $lang['An_error_occured']; } if ( $msg_title == '' ) { $msg_title = $lang['General_Error']; } break; case CRITICAL_ERROR: // Critical errors mean we cannot rely on _ANY_ DB information being // available so we're going to dump out a simple echo'd statement include( $mx_root_path . 'language/lang_english/lang_main.' . $phpEx ); if ( $msg_text == '' ) { $msg_text = $lang['A_critical_error']; } if ( $msg_title == '' ) { $msg_title = 'phpBB : <b>' . $lang['Critical_Error'] . '</b>'; } break; } // Add on DEBUG info if we've enabled debug mode and this is an error. This // prevents debug info being output for general messages should DEBUG be // set TRUE by accident (preventing confusion for the end user!) if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) ) { if ( $debug_text != '' ) { $msg_text = $msg_text . '<br /><br /><b><u>DEBUG MODE</u></b>' . $debug_text; } } if ( $msg_code != CRITICAL_ERROR ) { if ( !empty( $lang[$msg_text] ) ) { $msg_text = $lang[$msg_text]; } if ( !defined( 'IN_ADMIN' ) ) { $template->set_filenames( array( 'message_body' => 'message_body.tpl' ) ); } else { $template->set_filenames( array( 'message_body' => 'admin/admin_message_body.tpl' ) ); } $template->assign_vars( array( 'MESSAGE_TITLE' => $msg_title, 'MESSAGE_TEXT' => $msg_text ) ); $template->pparse( 'message_body' ); if ( !defined( 'IN_ADMIN' ) ) { include( $mx_root_path . 'includes/page_tail.' . $phpEx ); } else { include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); } } else { echo "<html>\n<body>\n" . $msg_title . "\n<br /><br />\n" . $msg_text . "</body>\n</html>"; } exit; } function mx_block_info( $msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '' ) { global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path, $mx_root_path, $nav_links, $gen_simple_header; global $userdata, $user_ip, $session_length; global $starttime; $sql_store = $sql; // Get SQL error if we are debugging. Do this as soon as possible to prevent // subsequent queries from overwriting the status of sql_error() if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) ) { $sql_error = $db->sql_error(); $debug_text = ''; if ( $sql_error['message'] != '' ) { $debug_text .= '<br /><br />SQL Error : ' . $sql_error['code'] . ' ' . $sql_error['message']; } if ( $sql_store != '' ) { $debug_text .= "<br /><br />$sql_store"; } if ( $err_line != '' && $err_file != '' ) { $debug_text .= '</br /><br />Line : ' . $err_line . '<br />File : ' . $err_file; } } if ( empty( $userdata ) && ( $msg_code == GENERAL_MESSAGE || $msg_code == GENERAL_ERROR ) ) { $userdata = session_pagestart( $user_ip, PAGE_INDEX ); init_userprefs( $userdata ); } // If the header hasn't been output then do it if ( !defined( 'HEADER_INC' ) && $msg_code != CRITICAL_ERROR ) { if ( empty( $lang ) ) { if ( !empty( $board_config['default_lang'] ) ) { include( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ); } else { include( $mx_root_path . 'language/lang_english/lang_main.' . $phpEx ); } } if ( empty( $template ) ) { $template = new Template( $mx_root_path . 'templates/' . $board_config['board_template'] ); } if ( empty( $theme ) ) { $theme = setup_style( $board_config['default_style'] ); } // Load the Page Header if ( !defined( 'IN_ADMIN' ) ) { include( $mx_root_path . 'includes/page_header.' . $phpEx ); } else { include( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); } } switch ( $msg_code ) { case GENERAL_MESSAGE: if ( $msg_title == '' ) { $msg_title = $lang['Information']; } break; case CRITICAL_MESSAGE: if ( $msg_title == '' ) { $msg_title = $lang['Critical_Information']; } break; case GENERAL_ERROR: if ( $msg_text == '' ) { $msg_text = $lang['An_error_occured']; } if ( $msg_title == '' ) { $msg_title = $lang['General_Error']; } break; case CRITICAL_ERROR: // Critical errors mean we cannot rely on _ANY_ DB information being // available so we're going to dump out a simple echo'd statement include( $mx_root_path . 'language/lang_english/lang_main.' . $phpEx ); if ( $msg_text == '' ) { $msg_text = $lang['A_critical_error']; } if ( $msg_title == '' ) { $msg_title = 'phpBB : <b>' . $lang['Critical_Error'] . '</b>'; } break; } // Add on DEBUG info if we've enabled debug mode and this is an error. This // prevents debug info being output for general messages should DEBUG be // set TRUE by accident (preventing confusion for the end user!) if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) ) { if ( $debug_text != '' ) { $msg_text = $msg_text . '<br /><br /><b><u>DEBUG MODE</u></b>' . $debug_text; } } if ( $msg_code != CRITICAL_ERROR ) { if ( !empty( $lang[$msg_text] ) ) { $msg_text = $lang[$msg_text]; } if ( !defined( 'IN_ADMIN' ) ) { $template->set_filenames( array( 'message_body' => 'message_body.tpl' ) ); } else { $template->set_filenames( array( 'message_body' => 'admin/admin_message_body.tpl' ) ); } $template->assign_vars( array( 'MESSAGE_TITLE' => $msg_title, 'MESSAGE_TEXT' => $msg_text ) ); $template->pparse( 'message_body' ); } else { echo "<html>\n<body>\n" . $msg_title . "\n<br /><br />\n" . $msg_text . "</body>\n</html>"; } } // Fill smiley templates (or just the variables) with smileys // Either in a window or inline function mx_generate_smilies( $mode, $page_id ) { global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $mx_root_path, $phpbb_root_path; global $user_ip, $session_length, $starttime; global $userdata; $inline_columns = 4; $inline_rows = 5; $window_columns = 8; if ( $mode == 'window' ) { $userdata = session_pagestart( $user_ip, $page_id ); mx_init_userprefs( $userdata ); $gen_simple_header = true; // $page_title = $lang['Review_topic'] . " - $topic_title"; $page_title = $lang['Emoticons'] . " - $topic_title"; include( $mx_root_path . 'includes/page_header.' . $phpEx ); $template->set_filenames( array( 'smiliesbody' => 'mx_posting_smilies.tpl' ) ); } $sql = "SELECT emoticon, code, smile_url FROM " . SMILIES_TABLE . " ORDER BY smilies_id"; if ( $result = $db->sql_query( $sql ) ) { $num_smilies = 0; $rowset = array(); while ( $row = $db->sql_fetchrow( $result ) ) { if ( empty( $rowset[$row['smile_url']] ) ) { $rowset[$row['smile_url']]['code'] = str_replace( '\\', '\\\\', str_replace( "'", "\\'", $row['code'] ) ); $rowset[$row['smile_url']]['emoticon'] = $row['emoticon']; $num_smilies++; } } if ( $num_smilies ) { $smilies_count = ( $mode == 'inline' ) ? min( 19, $num_smilies ) : $num_smilies; $smilies_split_row = ( $mode == 'inline' ) ? $inline_columns - 1 : $window_columns - 1; $s_colspan = 0; $row = 0; $col = 0; while ( list( $smile_url, $data ) = @each( $rowset ) ) { if ( !$col ) { $template->assign_block_vars( 'smilies_row', array() ); } $template->assign_block_vars( 'smilies_row.smilies_col', array( 'SMILEY_CODE' => $data['code'], 'SMILEY_IMG' => PHPBB_URL . $board_config['smilies_path'] . '/' . $smile_url, 'SMILEY_DESC' => $data['emoticon'] ) ); $s_colspan = max( $s_colspan, $col + 1 ); if ( $col == $smilies_split_row ) { if ( $mode == 'inline' && $row == $inline_rows - 1 ) { break; } $col = 0; $row++; } else { $col++; } } if ( $mode == 'inline' && $num_smilies > $inline_rows * $inline_columns ) { $template->assign_block_vars( 'switch_smilies_extra', array() ); $template->assign_vars( array( 'L_MORE_SMILIES' => $lang['More_emoticons'], 'U_MORE_SMILIES' => append_sid( PORTAL_URL . "more_smilies.$phpEx?mode=smilies" ) ) ); } $template->assign_vars( array( 'FIELD' => 'block_info', 'L_EMOTICONS' => $lang['Emoticons'], 'L_CLOSE_WINDOW' => $lang['Close_window'], 'S_SMILIES_COLSPAN' => $s_colspan ) ); } } if ( $mode == 'window' ) { $template->pparse( 'smiliesbody' ); include( $mx_root_path . 'includes/page_tail.' . $phpEx ); } } // MX - Redeclarations of functions from function.php function mx_redirect( $url, $redirect_msg = '', $redirect_link = '' ) { global $db, $lang; if ( $redirect_msg == '' ) { $redirect_msg = $lang['Page_Not_Authorised']; } if ( $redirect_link == '' ) { $redirect_link = $lang['Redirect_login']; } if ( !defined( 'HEADER_INC' ) ) { if ( !empty($db) ) { $db->sql_close(); } if ( strstr(urldecode($url), "\n") || strstr(urldecode($url), "\r") ) { message_die(GENERAL_ERROR, 'Tried to redirect to potentially insecure url.'); } // Redirect via an HTML form for PITA webservers if ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) { header('Refresh: 0; URL=' . PORTAL_URL . $url); echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta http-equiv="refresh" content="0; url=' . PORTAL_URL . $url . '"><title>Redirect</title></head><body><div align="center">If your browser does not support meta redirection please click <a href="' . PORTAL_URL . $url . '">HERE</a> to be redirected</div></body></html>'; exit; } // Behave as per HTTP/1.1 spec for others header('Location: ' . PORTAL_URL . $url); exit; } else { $message = $redirect_msg . '<br /><br />' . sprintf($redirect_link, '<a href="' . $url . '">', "</a>") . '<br /><br />'; mx_message_die(GENERAL_MESSAGE, $message); } } // // Pagination routine, generates // page number sequence // Only difference from standard phpbb function is you can use more settings function mx_generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = TRUE, $use_next_symbol = false,$use_previous_symbol = false,$add_preinfo_text = TRUE, $name_id = 'start') { global $lang; $total_pages = ceil($num_items/$per_page); if ( $total_pages == 1 ) { return ''; } $previous_string = $use_next_symbol ? '«' : $lang['Previous']; $next_string = $use_previous_symbol ? '»' : $lang['Next']; $on_page = floor($start_item / $per_page) + 1; $page_string = ''; if ( $total_pages > 10 ) { $init_page_max = ( $total_pages > 3 ) ? 3 : $total_pages; for($i = 1; $i < $init_page_max + 1; $i++) { $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $init_page_max ) { $page_string .= ","; } } if ( $total_pages > 3 ) { if ( $on_page > 1 && $on_page < $total_pages ) { $page_string .= ( $on_page > 5 ) ? ' ... ' : ','; $init_page_min = ( $on_page > 4 ) ? $on_page : 5; $init_page_max = ( $on_page < $total_pages - 4 ) ? $on_page : $total_pages - 4; for($i = $init_page_min - 1; $i < $init_page_max + 2; $i++) { $page_string .= ($i == $on_page) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $init_page_max + 1 ) { $page_string .= ','; } } $page_string .= ( $on_page < $total_pages - 4 ) ? ' ... ' : ', '; } else { $page_string .= ' ... '; } for($i = $total_pages - 2; $i < $total_pages + 1; $i++) { $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if( $i < $total_pages ) { $page_string .= ","; } } } } else { for($i = 1; $i < $total_pages + 1; $i++) { $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $total_pages ) { $page_string .= ','; } } } if ( $add_prevnext_text ) { if ( $on_page > 1 ) { $page_string = ' <a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $on_page - 2 ) * $per_page ) ) . '">' . $previous_string . '</a> ' . $page_string; } if ( $on_page < $total_pages ) { $page_string .= ' <a href="' . append_sid($base_url . "&".$name_id."=" . ( $on_page * $per_page ) ) . '">' . $next_string . '</a>'; } } $pre_text = $add_preinfo_text ? $lang['Goto_page'] : ''; $page_string = $pre_text . ' ' . $page_string; return $page_string; } ?> |
|
From: <mxb...@li...> - 2005-03-16 00:16:38
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9296 Modified Files: mx_functions.php Log Message: Moved all cloned phpBB function into its own includes script. Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** mx_functions.php 6 Mar 2005 01:10:14 -0000 1.25 --- mx_functions.php 16 Mar 2005 00:16:27 -0000 1.26 *************** *** 22,113 **** /** * Included functions in this file: - * - mx_smilies_pass (from bbcode.php - validated for phpbb 2.0.10) - * - mx_decode * - get_info * - get_exists * - get_list * - get_list_formatted * - get_list_static * - get_list_multiple * - get_list_opt - * - read_block_config * - poll_select - * - mx_init_userprefs (from functions.php - validated for phpbb 2.0.10) - * - mx_setup_style (from functions.php - validated for phpbb 2.0.10) - * - mx_message_die (from functions.php - validated for phpbb 2.0.10) - * - mx_block_info * - mx_url - * - mx_generate_smilies (from functions_post.php - validated for phpbb 2.0.10) - * - mx_redirect (from functions_post.php - validated for phpbb 2.0.10) - * - mx_get_groups * - mx_this_url * - post_icons * - mx_add_search_words */ - function mx_smilies_pass( $message ) - { - static $orig, $repl; - - if ( !isset( $orig ) ) - { - global $db, $board_config; - $orig = $repl = array(); - - $sql = 'SELECT * FROM ' . SMILIES_TABLE; - if ( !$result = $db->sql_query( $sql ) ) - { - mx_message_die( GENERAL_ERROR, "Couldn't obtain smilies data", "", __LINE__, __FILE__, $sql ); - } - $smilies = $db->sql_fetchrowset( $result ); - - if ( count( $smilies ) ) - { - usort( $smilies, 'smiley_sort' ); - } - - for( $i = 0; $i < count( $smilies ); $i++ ) - { - $orig[] = "/(?<=.\W|\W.|^\W)" . phpbb_preg_quote( $smilies[$i]['code'], "/" ) . "(?=.\W|\W.|\W$)/"; - $repl[] = '<img src="' . PHPBB_URL . $board_config['smilies_path'] . '/' . $smilies[$i]['smile_url'] . '" alt="' . $smilies[$i]['emoticon'] . '" border="0" />'; - } - } - - if ( count( $orig ) ) - { - $message = preg_replace( $orig, $repl, ' ' . $message . ' ' ); - $message = substr( $message, 1, -1 ); - } - return $message; - } - // Convert the bbcode to html - function mx_decode( $bbtext, $bbcode_uid ) - { - global $board_config; - - $mytext = stripslashes( $bbtext ); - $mytext = bbencode_second_pass( $mytext, $bbcode_uid ); - - $smilies_path = $board_config['smilies_path']; - $board_config['smilies_path'] = PHPBB_URL . $board_config['smilies_path']; - $mytext = smilies_pass( $mytext ); - $board_config['smilies_path'] = $smilies_path; - - $mytext = str_replace( "\n", "\n<br />\n", $mytext ); - $mytext = make_clickable( $mytext ); - - return $mytext; - } - // Old mx_decode function - // function mx_decode($message, $bbcode_uid ) { - // $message = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $message); - // $message = bbencode_second_pass($message, $bbcode_uid) ; - // $message = preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message); - // $message = make_clickable($message); - // $message = mx_smilies_pass($message); - // $message = str_replace("\n", "\n<br />\n", $message); - // $message = str_replace("\'","'",$message); - // return($message); - // } // ****************************************************************** // ****************************************************************** --- 22,49 ---- /** * Included functions in this file: * - get_info + * - get_old_items * - get_exists * - get_list + * - get_mx_select_list * - get_list_formatted * - get_list_static * - get_list_multiple * - get_list_opt * - poll_select * - mx_url * - mx_this_url * - post_icons + * - get_page_id + * - mx_db_remove + * - mx_db_add + * - mx_do_install_upgrade + * - mx_get_groups * - mx_add_search_words + * - mx_remove_search_post + * - qsort_multiarray + * - compose_mx_copy */ // ****************************************************************** // ****************************************************************** *************** *** 572,1076 **** } - - // Initialise user settings on page load - function mx_init_userprefs( $userdata ) - { - global $board_config, $theme, $images; - global $template, $lang, $phpEx, $mx_root_path, $phpbb_root_path; - - if ( $userdata['user_id'] != ANONYMOUS ) - { - if ( !empty( $userdata['user_lang'] ) ) - { - $board_config['default_lang'] = $userdata['user_lang']; - } - - if ( !empty( $userdata['user_dateformat'] ) ) - { - $board_config['default_dateformat'] = $userdata['user_dateformat']; - } - - if ( isset( $userdata['user_timezone'] ) ) - { - $board_config['board_timezone'] = $userdata['user_timezone']; - } - } - - if ( !file_exists( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ) ) - { - $board_config['default_lang'] = 'english'; - } - - if ( file_exists( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ) ) - { - include( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ); - } - - if ( file_exists( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ) ) - { - include( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ); - } - - if ( defined( 'IN_ADMIN' ) ) - { - if ( !file_exists( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ) || !file_exists( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ) ) - { - $board_config['default_lang'] = 'english'; - } - - include( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ); - include( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ); - } - // Set up style - if ( !$board_config['override_user_style'] ) - { - if ( $userdata['user_id'] != ANONYMOUS && $userdata['user_style'] > 0 ) - { - if ( $theme = mx_setup_style( $userdata['user_style'] ) ) - { - return; - } - } - } - - $theme = mx_setup_style( $board_config['default_style'] ); - // Mozilla navigation bar - // Default items that should be valid on all pages. - // Defined here to correctly assign the Language Variables - // and be able to change the variables within code. - $nav_links['top'] = array ( 'url' => append_sid( $phpbb_root_path . 'index.' . $phpEx ), - 'title' => sprintf( $lang['Forum_Index'], $board_config['sitename'] ) - ); - $nav_links['search'] = array ( 'url' => append_sid( $phpbb_root_path . 'search.' . $phpEx ), - 'title' => $lang['Search'] - ); - $nav_links['help'] = array ( 'url' => append_sid( $phpbb_root_path . 'faq.' . $phpEx ), - 'title' => $lang['FAQ'] - ); - $nav_links['author'] = array ( 'url' => append_sid( $phpbb_root_path . 'memberlist.' . $phpEx ), - 'title' => $lang['Memberlist'] - ); - - return; - } - - function mx_setup_style( $style, $only_template = false ) - { - global $db, $board_config, $template, $images, $mx_root_path, $phpbb_root_path; - - $sql = "SELECT * - FROM " . THEMES_TABLE . " - WHERE themes_id = $style"; - if ( !( $result = $db->sql_query( $sql ) ) ) - { - $style = 1; - $sql = "SELECT * - FROM " . THEMES_TABLE . " - WHERE themes_id = $style"; - if ( !( $result = $db->sql_query( $sql ) ) ) - { - mx_message_die( CRITICAL_ERROR, 'Could not query database for theme info' ); - } - } - - if ( !( $row = $db->sql_fetchrow( $result ) ) ) - { - mx_message_die( CRITICAL_ERROR, "Could not get theme data for themes_id [$style]" ); - } - - $template_path = 'templates/' ; - $template_name = $row['template_name'] ; - // MX FIX for uninstalled themes ... use subSilver instead - if ( !file_exists( $mx_root_path . $template_path . $template_name . '/mx_login.tpl' ) ) - { - $template_path = 'templates/' ; - $template_name = 'subSilver' ; - - $style = 1; - $sql = "SELECT * - FROM " . THEMES_TABLE . " - WHERE themes_id = $style"; - if ( !( $result = $db->sql_query( $sql ) ) ) - { - mx_message_die( CRITICAL_ERROR, 'Could not query database for theme info' ); - } - if ( !( $row = $db->sql_fetchrow( $result ) ) ) - { - mx_message_die( CRITICAL_ERROR, "Could not get theme data for themes_id [$style]" ); - } - - $template = new Template( $mx_root_path . $template_path . $template_name, $board_config, $db ); - } - else - { - $template = new Template( $mx_root_path . $template_path . $template_name, $board_config, $db ); - } - - if ( $only_template ) - { - return $row; - } - // call when only_template is false. - define( 'TEMPLATE_ROOT_PATH', $template_path . $template_name . '/' ); - - if ( $template ) - { - $current_template_path = $template_path . $template_name; - - if ( file_exists( $mx_root_path . $template_path . $template_name . '/' . $template_name . '.cfg' ) ) - { - @include( $mx_root_path . $template_path . $template_name . '/' . $template_name . '.cfg' ); - } - else - { - @include( $phpbb_root_path . $template_path . $template_name . '/' . $template_name . '.cfg' ); - } - - if ( !defined( 'TEMPLATE_CONFIG' ) ) - { - mx_message_die( CRITICAL_ERROR, "Could not open $template_name template config file", '', __LINE__, __FILE__ ); - } - - $img_lang = ( file_exists( $phpbb_root_path . $current_template_path . '/images/lang_' . $board_config['default_lang'] ) ) ? $board_config['default_lang'] : 'english'; - while ( list( $key, $value ) = @each( $images ) ) - { - if ( !is_array( $value ) ) - { - $images[$key] = str_replace( '{LANG}', 'lang_' . $img_lang, $value ); - } - } - } - return $row; - } - // This is general replacement for die(), allows templated - // output in users (or default) language, etc. - // $msg_code can be one of these constants: - // GENERAL_MESSAGE : Use for any simple text message, eg. results - // of an operation, authorisation failures, etc. - // GENERAL ERROR : Use for any error which occurs _AFTER_ the - // common.php include and session code, ie. most errors in - // pages/functions - // CRITICAL_MESSAGE : Used when basic config data is available but - // a session may not exist, eg. banned users - // CRITICAL_ERROR : Used when config data cannot be obtained, eg - // no database connection. Should _not_ be used in 99.5% of cases - function mx_message_die( $msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '' ) - { - global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path, $mx_root_path, $nav_links, $gen_simple_header, $images; - global $userdata, $user_ip, $session_length, $page_title; - global $starttime; - - $sql_store = $sql; - // Get SQL error if we are debugging. Do this as soon as possible to prevent - // subsequent queries from overwriting the status of sql_error() - if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) ) - { - $sql_error = $db->sql_error(); - - $debug_text = ''; - - if ( $sql_error['message'] != '' ) - { - $debug_text .= '<br /><br />SQL Error : ' . $sql_error['code'] . ' ' . $sql_error['message']; - } - - if ( $sql_store != '' ) - { - $debug_text .= "<br /><br />$sql_store"; - } - - if ( $err_line != '' && $err_file != '' ) - { - $debug_text .= '</br /><br />Line : ' . $err_line . '<br />File : ' . $err_file; - } - } - - if ( empty( $userdata ) && ( $msg_code == GENERAL_MESSAGE || $msg_code == GENERAL_ERROR ) ) - { - $userdata = session_pagestart( $user_ip, PAGE_INDEX ); - mx_init_userprefs( $userdata ); - } - // If the header hasn't been output then do it - if ( !defined( 'HEADER_INC' ) && $msg_code != CRITICAL_ERROR ) - { - if ( empty( $lang ) ) - { - if ( !empty( $board_config['default_lang'] ) ) - { - include( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ); - } - else - { - include( $mx_root_path . 'language/lang_english/lang_main.' . $phpEx ); - } - } - - if ( empty( $template ) ) - { - $template = new Template( $mx_root_path . 'templates/' . $board_config['board_template'] ); - } - if ( empty( $theme ) ) - { - $theme = setup_style( $board_config['default_style'] ); - } - // Load the Page Header - if ( !defined( 'IN_ADMIN' ) ) - { - include( $mx_root_path . 'includes/page_header.' . $phpEx ); - } - else - { - include( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); - } - } - - switch ( $msg_code ) - { - case GENERAL_MESSAGE: - if ( $msg_title == '' ) - { - $msg_title = $lang['Information']; - } - break; - - case CRITICAL_MESSAGE: - if ( $msg_title == '' ) - { - $msg_title = $lang['Critical_Information']; - } - break; - - case GENERAL_ERROR: - if ( $msg_text == '' ) - { - $msg_text = $lang['An_error_occured']; - } - - if ( $msg_title == '' ) - { - $msg_title = $lang['General_Error']; - } - break; - - case CRITICAL_ERROR: - // Critical errors mean we cannot rely on _ANY_ DB information being - // available so we're going to dump out a simple echo'd statement - include( $mx_root_path . 'language/lang_english/lang_main.' . $phpEx ); - - if ( $msg_text == '' ) - { - $msg_text = $lang['A_critical_error']; - } - - if ( $msg_title == '' ) - { - $msg_title = 'phpBB : <b>' . $lang['Critical_Error'] . '</b>'; - } - break; - } - // Add on DEBUG info if we've enabled debug mode and this is an error. This - // prevents debug info being output for general messages should DEBUG be - // set TRUE by accident (preventing confusion for the end user!) - if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) ) - { - if ( $debug_text != '' ) - { - $msg_text = $msg_text . '<br /><br /><b><u>DEBUG MODE</u></b>' . $debug_text; - } - } - - if ( $msg_code != CRITICAL_ERROR ) - { - if ( !empty( $lang[$msg_text] ) ) - { - $msg_text = $lang[$msg_text]; - } - - if ( !defined( 'IN_ADMIN' ) ) - { - $template->set_filenames( array( 'message_body' => 'message_body.tpl' ) - ); - } - else - { - $template->set_filenames( array( 'message_body' => 'admin/admin_message_body.tpl' ) - ); - } - $template->assign_vars( array( 'MESSAGE_TITLE' => $msg_title, - 'MESSAGE_TEXT' => $msg_text ) - ); - $template->pparse( 'message_body' ); - - if ( !defined( 'IN_ADMIN' ) ) - { - include( $mx_root_path . 'includes/page_tail.' . $phpEx ); - } - else - { - include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); - } - } - else - { - echo "<html>\n<body>\n" . $msg_title . "\n<br /><br />\n" . $msg_text . "</body>\n</html>"; - } - - exit; - } - - function mx_block_info( $msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '' ) - { - global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path, $mx_root_path, $nav_links, $gen_simple_header; - global $userdata, $user_ip, $session_length; - global $starttime; - - $sql_store = $sql; - // Get SQL error if we are debugging. Do this as soon as possible to prevent - // subsequent queries from overwriting the status of sql_error() - if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) ) - { - $sql_error = $db->sql_error(); - - $debug_text = ''; - - if ( $sql_error['message'] != '' ) - { - $debug_text .= '<br /><br />SQL Error : ' . $sql_error['code'] . ' ' . $sql_error['message']; - } - - if ( $sql_store != '' ) - { - $debug_text .= "<br /><br />$sql_store"; - } - - if ( $err_line != '' && $err_file != '' ) - { - $debug_text .= '</br /><br />Line : ' . $err_line . '<br />File : ' . $err_file; - } - } - - if ( empty( $userdata ) && ( $msg_code == GENERAL_MESSAGE || $msg_code == GENERAL_ERROR ) ) - { - $userdata = session_pagestart( $user_ip, PAGE_INDEX ); - init_userprefs( $userdata ); - } - // If the header hasn't been output then do it - if ( !defined( 'HEADER_INC' ) && $msg_code != CRITICAL_ERROR ) - { - if ( empty( $lang ) ) - { - if ( !empty( $board_config['default_lang'] ) ) - { - include( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ); - } - else - { - include( $mx_root_path . 'language/lang_english/lang_main.' . $phpEx ); - } - } - - if ( empty( $template ) ) - { - $template = new Template( $mx_root_path . 'templates/' . $board_config['board_template'] ); - } - if ( empty( $theme ) ) - { - $theme = setup_style( $board_config['default_style'] ); - } - // Load the Page Header - if ( !defined( 'IN_ADMIN' ) ) - { - include( $mx_root_path . 'includes/page_header.' . $phpEx ); - } - else - { - include( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); - } - } - - switch ( $msg_code ) - { - case GENERAL_MESSAGE: - if ( $msg_title == '' ) - { - $msg_title = $lang['Information']; - } - break; - - case CRITICAL_MESSAGE: - if ( $msg_title == '' ) - { - $msg_title = $lang['Critical_Information']; - } - break; - - case GENERAL_ERROR: - if ( $msg_text == '' ) - { - $msg_text = $lang['An_error_occured']; - } - - if ( $msg_title == '' ) - { - $msg_title = $lang['General_Error']; - } - break; - - case CRITICAL_ERROR: - // Critical errors mean we cannot rely on _ANY_ DB information being - // available so we're going to dump out a simple echo'd statement - include( $mx_root_path . 'language/lang_english/lang_main.' . $phpEx ); - - if ( $msg_text == '' ) - { - $msg_text = $lang['A_critical_error']; - } - - if ( $msg_title == '' ) - { - $msg_title = 'phpBB : <b>' . $lang['Critical_Error'] . '</b>'; - } - break; - } - // Add on DEBUG info if we've enabled debug mode and this is an error. This - // prevents debug info being output for general messages should DEBUG be - // set TRUE by accident (preventing confusion for the end user!) - if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) ) - { - if ( $debug_text != '' ) - { - $msg_text = $msg_text . '<br /><br /><b><u>DEBUG MODE</u></b>' . $debug_text; - } - } - - if ( $msg_code != CRITICAL_ERROR ) - { - if ( !empty( $lang[$msg_text] ) ) - { - $msg_text = $lang[$msg_text]; - } - - if ( !defined( 'IN_ADMIN' ) ) - { - $template->set_filenames( array( 'message_body' => 'message_body.tpl' ) - ); - } - else - { - $template->set_filenames( array( 'message_body' => 'admin/admin_message_body.tpl' ) - ); - } - - $template->assign_vars( array( 'MESSAGE_TITLE' => $msg_title, - 'MESSAGE_TEXT' => $msg_text ) - ); - $template->pparse( 'message_body' ); - } - else - { - echo "<html>\n<body>\n" . $msg_title . "\n<br /><br />\n" . $msg_text . "</body>\n</html>"; - } - } - function mx_url() { --- 508,511 ---- *************** *** 1138,1289 **** return ( $url ); } - // Fill smiley templates (or just the variables) with smileys - // Either in a window or inline - function mx_generate_smilies( $mode, $page_id ) - { - global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $mx_root_path, $phpbb_root_path; - global $user_ip, $session_length, $starttime; - global $userdata; - - $inline_columns = 4; - $inline_rows = 5; - $window_columns = 8; - - if ( $mode == 'window' ) - { - $userdata = session_pagestart( $user_ip, $page_id ); - mx_init_userprefs( $userdata ); - - $gen_simple_header = true; - // $page_title = $lang['Review_topic'] . " - $topic_title"; - $page_title = $lang['Emoticons'] . " - $topic_title"; - include( $mx_root_path . 'includes/page_header.' . $phpEx ); - - $template->set_filenames( array( 'smiliesbody' => 'mx_posting_smilies.tpl' ) - ); - } - - $sql = "SELECT emoticon, code, smile_url - FROM " . SMILIES_TABLE . " - ORDER BY smilies_id"; - if ( $result = $db->sql_query( $sql ) ) - { - $num_smilies = 0; - $rowset = array(); - while ( $row = $db->sql_fetchrow( $result ) ) - { - if ( empty( $rowset[$row['smile_url']] ) ) - { - $rowset[$row['smile_url']]['code'] = str_replace( '\\', '\\\\', str_replace( "'", "\\'", $row['code'] ) ); - $rowset[$row['smile_url']]['emoticon'] = $row['emoticon']; - $num_smilies++; - } - } - - if ( $num_smilies ) - { - $smilies_count = ( $mode == 'inline' ) ? min( 19, $num_smilies ) : $num_smilies; - $smilies_split_row = ( $mode == 'inline' ) ? $inline_columns - 1 : $window_columns - 1; - - $s_colspan = 0; - $row = 0; - $col = 0; - - while ( list( $smile_url, $data ) = @each( $rowset ) ) - { - if ( !$col ) - { - $template->assign_block_vars( 'smilies_row', array() ); - } - - $template->assign_block_vars( 'smilies_row.smilies_col', array( 'SMILEY_CODE' => $data['code'], - 'SMILEY_IMG' => PHPBB_URL . $board_config['smilies_path'] . '/' . $smile_url, - 'SMILEY_DESC' => $data['emoticon'] ) - ); - - $s_colspan = max( $s_colspan, $col + 1 ); - - if ( $col == $smilies_split_row ) - { - if ( $mode == 'inline' && $row == $inline_rows - 1 ) - { - break; - } - $col = 0; - $row++; - } - else - { - $col++; - } - } - - if ( $mode == 'inline' && $num_smilies > $inline_rows * $inline_columns ) - { - $template->assign_block_vars( 'switch_smilies_extra', array() ); - - $template->assign_vars( array( 'L_MORE_SMILIES' => $lang['More_emoticons'], - 'U_MORE_SMILIES' => append_sid( PORTAL_URL . "more_smilies.$phpEx?mode=smilies" ) ) - ); - } - - $template->assign_vars( array( 'FIELD' => 'block_info', - 'L_EMOTICONS' => $lang['Emoticons'], - 'L_CLOSE_WINDOW' => $lang['Close_window'], - 'S_SMILIES_COLSPAN' => $s_colspan ) - ); - } - } - - if ( $mode == 'window' ) - { - $template->pparse( 'smiliesbody' ); - - include( $mx_root_path . 'includes/page_tail.' . $phpEx ); - } - } - - // MX - Redeclarations of functions from function.php - function mx_redirect( $url, $redirect_msg = '', $redirect_link = '' ) - { - global $db, $board_config, $template, $lang, $page_id; - - if ( $redirect_msg == '' ) - { - $redirect_msg = $lang['Page_Not_Authorised']; - } - if ( $redirect_link == '' ) - { - $redirect_link = $lang['Redirect_login']; - } - - if ( !defined( 'HEADER_INC' ) ) - { - if ( !empty( $db ) ) - { - $db->sql_close(); - } - - if ( strstr( urldecode( $url ), "\n" ) || strstr( urldecode( $url ), "\r" ) ) - { - message_die( GENERAL_ERROR, 'Tried to redirect to potentially insecure url.' ); - } - // Redirect via an HTML form for PITA webservers - if ( @preg_match( '/Microsoft|WebSTAR|Xitami/', getenv( 'SERVER_SOFTWARE' ) ) ) - { - header( 'Refresh: 0; URL=' . PORTAL_URL . $url ); - echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta http-equiv="refresh" content="0; url=' . $server_protocol . $server_name . $server_port . $script_name . $url . '"><title>Redirect</title></head><body><div align="center">If your browser does not support meta redirection please click <a href="' . $server_protocol . $server_name . $server_port . $script_name . $url . '">HERE</a> to be redirected</div></body></html>'; - exit; - } - // Behave as per HTTP/1.1 spec for others - header( 'Location: ' . PORTAL_URL . $url ); - exit; - } - else - { - $message = $redirect_msg . '<br /><br />' . sprintf( $redirect_link, '<a href="' . $url . '">', "</a>" ) . '<br /><br />'; - mx_message_die( GENERAL_MESSAGE, $message ); - } - } // MX add-on --- 573,576 ---- *************** *** 1971,2075 **** } - // - // Pagination routine, generates - // page number sequence - // Only difference from standard phpbb function is you can use more settings - - function mx_generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = TRUE, $use_next_symbol = false,$use_previous_symbol = false,$add_preinfo_text = TRUE, $name_id = 'start') - { - global $lang; - - $total_pages = ceil($num_items/$per_page); - - if ( $total_pages == 1 ) - { - return ''; - } - - $previous_string = $use_next_symbol ? '«' : $lang['Previous']; - $next_string = $use_previous_symbol ? '»' : $lang['Next']; - - $on_page = floor($start_item / $per_page) + 1; - - $page_string = ''; - if ( $total_pages > 10 ) - { - $init_page_max = ( $total_pages > 3 ) ? 3 : $total_pages; - - for($i = 1; $i < $init_page_max + 1; $i++) - { - $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; - if ( $i < $init_page_max ) - { - $page_string .= ","; - } - } - - if ( $total_pages > 3 ) - { - if ( $on_page > 1 && $on_page < $total_pages ) - { - $page_string .= ( $on_page > 5 ) ? ' ... ' : ','; - - $init_page_min = ( $on_page > 4 ) ? $on_page : 5; - $init_page_max = ( $on_page < $total_pages - 4 ) ? $on_page : $total_pages - 4; - - for($i = $init_page_min - 1; $i < $init_page_max + 2; $i++) - { - $page_string .= ($i == $on_page) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; - if ( $i < $init_page_max + 1 ) - { - $page_string .= ','; - } - } - - $page_string .= ( $on_page < $total_pages - 4 ) ? ' ... ' : ', '; - } - else - { - $page_string .= ' ... '; - } - - for($i = $total_pages - 2; $i < $total_pages + 1; $i++) - { - $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; - if( $i < $total_pages ) - { - $page_string .= ","; - } - } - } - } - else - { - for($i = 1; $i < $total_pages + 1; $i++) - { - $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; - if ( $i < $total_pages ) - { - $page_string .= ','; - } - } - } - - if ( $add_prevnext_text ) - { - if ( $on_page > 1 ) - { - $page_string = ' <a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $on_page - 2 ) * $per_page ) ) . '">' . $previous_string . '</a> ' . $page_string; - } - - if ( $on_page < $total_pages ) - { - $page_string .= ' <a href="' . append_sid($base_url . "&".$name_id."=" . ( $on_page * $per_page ) ) . '">' . $next_string . '</a>'; - } - - } - $pre_text = $add_preinfo_text ? $lang['Goto_page'] : ''; - $page_string = $pre_text . ' ' . $page_string; - - return $page_string; - } - function compose_mx_copy( ) { --- 1258,1261 ---- |
|
From: <mxb...@li...> - 2005-03-14 21:09:45
|
Update of /cvsroot/mxbb/core/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14355 Modified Files: admin_mx_block_auth.php Log Message: Bug #38 - Constant IN_PORTAL already defined Index: admin_mx_block_auth.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_block_auth.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** admin_mx_block_auth.php 6 Mar 2005 01:10:12 -0000 1.2 --- admin_mx_block_auth.php 14 Mar 2005 21:09:34 -0000 1.3 *************** *** 19,23 **** */ ! define( 'IN_PORTAL', 1 ); if ( !empty( $setmodules ) ) --- 19,23 ---- */ ! define('IN_PORTAL', 1); if ( !empty( $setmodules ) ) *************** *** 29,33 **** - define( 'IN_PORTAL', 1 ); $mx_root_path = '../'; require( $mx_root_path . 'admin/pagestart.php' ); // HERE --- 29,32 ---- |
|
From: <mxb...@li...> - 2005-03-14 20:56:33
|
Update of /cvsroot/mxbb/core/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10629/admin Modified Files: page_header_admin.php Log Message: Bug #26 - ob_gzhandler problems with gzip on PHP 4.3.x servers Index: page_header_admin.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/page_header_admin.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** page_header_admin.php 9 Jan 2005 21:55:44 -0000 1.5 --- page_header_admin.php 14 Mar 2005 20:56:21 -0000 1.6 *************** *** 44,48 **** if ( extension_loaded( 'zlib' ) ) { ! // ob_end_clean(); ob_start( 'ob_gzhandler' ); } --- 44,48 ---- if ( extension_loaded( 'zlib' ) ) { ! @ob_end_clean(); ob_start( 'ob_gzhandler' ); } |
|
From: <mxb...@li...> - 2005-03-14 20:56:33
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10629/includes Modified Files: page_header.php Log Message: Bug #26 - ob_gzhandler problems with gzip on PHP 4.3.x servers Index: page_header.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/page_header.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** page_header.php 8 Mar 2005 19:47:41 -0000 1.15 --- page_header.php 14 Mar 2005 20:56:22 -0000 1.16 *************** *** 42,45 **** --- 42,46 ---- if ( extension_loaded( 'zlib' ) ) { + @ob_end_clean(); ob_start( 'ob_gzhandler' ); } |
|
From: <mxb...@li...> - 2005-03-10 19:44:35
|
Update of /cvsroot/mxbb/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11595 Modified Files: config.php Log Message: ok, this might be the first CVS commit archived to the new mailing list. Let's see if everything is correctly set now. =:-o Index: config.php =================================================================== RCS file: /cvsroot/mxbb/core/config.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** config.php 10 Mar 2005 19:27:11 -0000 1.5 --- config.php 10 Mar 2005 19:44:23 -0000 1.6 *************** *** 4,7 **** * $Id$ * ! */ ?> \ No newline at end of file --- 4,7 ---- * $Id$ * ! **/ ?> \ No newline at end of file |