Update of /cvsroot/mxbb/core27x/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23896/core27x/includes Modified Files: mx_auth.php mx_cache.php mx_constants.php mx_form.php mx_functions.php mx_functions_ch.php mx_functions_phpbb.php page_header.php template.php Log Message: updated Index: mx_functions_ch.php =================================================================== RCS file: /cvsroot/mxbb/core27x/includes/mx_functions_ch.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mx_functions_ch.php 6 May 2005 06:47:58 -0000 1.1 --- mx_functions_ch.php 5 Dec 2005 19:25:26 -0000 1.2 *************** *** 20,23 **** --- 20,28 ---- ***************************************************************************/ + if ( !defined( 'IN_PORTAL' ) ) + { + die( "Hacking attempt" ); + } + // // This code is part of common.php in Categories Hierarchy 2.1.0 Index: mx_cache.php =================================================================== RCS file: /cvsroot/mxbb/core27x/includes/mx_cache.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mx_cache.php 26 May 2005 21:54:08 -0000 1.1 --- mx_cache.php 5 Dec 2005 19:25:26 -0000 1.2 *************** *** 20,23 **** --- 20,28 ---- */ + if ( !defined( 'IN_PORTAL' ) ) + { + die( "Hacking attempt" ); + } + // -------------------------------------------------------------------------------- // Class: mx_cache Index: mx_constants.php =================================================================== RCS file: /cvsroot/mxbb/core27x/includes/mx_constants.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mx_constants.php 26 May 2005 21:54:08 -0000 1.2 --- mx_constants.php 5 Dec 2005 19:25:26 -0000 1.3 *************** *** 1,22 **** <?php ! /*************************************************************************** ! * mx_constants.php ! * ------------------- ! * begin : May, 2002 ! * copyright : (C) 2002 MX-System ! * email : su...@mx... ! * ! * $Id$ ! ***************************************************************************/ ! ! /*************************************************************************** ! * ! * 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. ! * ! ***************************************************************************/ if ( !defined('IN_PORTAL') ) --- 1,21 ---- <?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$ ! */ + /** + * 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. + */ if ( !defined('IN_PORTAL') ) *************** *** 27,46 **** // Page numbers for session handling ! define('PAGE_FORUM' , -20); ! define('PAGE_ADS' , -21); ! define('PAGE_WELCOME' , -23); ! define('PAGE_LAST_MSG' , -24); ! define('PAGE_WELCOME_ADMIN', -25); ! define('PAGE_POLL' , -26); ! define('PAGE_URL' , -27); ! define('PAGE_NEWS' , -37); ! define('PAGE_MENU_NAV' , -29); ! define('PAGE_MENU_ADMIN', -31); ! define('PAGE_MODULE_ADMIN', -32); ! define('PAGE_PORTAL_ADMIN', -33); ! define('PAGE_META_ADMIN' , -34); ! define('PAGE_ADS_ADMIN' , -35); ! define('PAGE_ANNOUNCEMENT', -36); define('PAGE_ANNOUNCEMENT_ADMIN' , -35); --- 26,45 ---- // Page numbers for session handling ! define('PAGE_FORUM' , -20); ! define('PAGE_ADS' , -21); ! define('PAGE_WELCOME' , -23); ! define('PAGE_LAST_MSG' , -24); ! define('PAGE_WELCOME_ADMIN' , -25); ! define('PAGE_POLL' , -26); ! define('PAGE_URL' , -27); ! define('PAGE_NEWS' , -37); ! define('PAGE_MENU_NAV' , -29); ! define('PAGE_MENU_ADMIN' , -31); ! define('PAGE_MODULE_ADMIN' , -32); ! define('PAGE_PORTAL_ADMIN' , -33); ! define('PAGE_META_ADMIN' , -34); ! define('PAGE_ADS_ADMIN' , -35); ! define('PAGE_ANNOUNCEMENT' , -36); define('PAGE_ANNOUNCEMENT_ADMIN' , -35); Index: mx_functions_phpbb.php =================================================================== RCS file: /cvsroot/mxbb/core27x/includes/mx_functions_phpbb.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mx_functions_phpbb.php 26 May 2005 21:54:08 -0000 1.1 --- mx_functions_phpbb.php 5 Dec 2005 19:25:26 -0000 1.2 *************** *** 33,36 **** --- 33,41 ---- */ + if ( !defined('IN_PORTAL') ) + { + die("Hacking attempt"); + } + // // Hacking smilies_pass from phpbb/includes/bbcode.php Index: mx_auth.php =================================================================== RCS file: /cvsroot/mxbb/core27x/includes/mx_auth.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mx_auth.php 26 May 2005 21:54:08 -0000 1.1 --- mx_auth.php 5 Dec 2005 19:25:26 -0000 1.2 *************** *** 58,61 **** --- 58,67 ---- | lookup \********************************************************************************/ + + if ( !defined( 'IN_PORTAL' ) ) + { + die( "Hacking attempt" ); + } + function block_auth($type, $module_id, $userdata, $f_access = '', $f_access_group = '') { Index: template.php =================================================================== RCS file: /cvsroot/mxbb/core27x/includes/template.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** template.php 26 May 2005 21:54:08 -0000 1.2 --- template.php 5 Dec 2005 19:25:26 -0000 1.3 *************** *** 1,14 **** <?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 : * ------------------------------------------------------------------------- - * copyright : (C) 2001 The phpBB Group - * email : su...@ph... * * $Id$ --- 1,11 ---- <?php /** ------------------------------------------------------------------------ ! * subject : mxBB-Portal, CMS & portal * begin : june, 2002 ! * copyright : (C) 2002-2005 mxBB-Portal * project site : www.mx-system.com * * description : * ------------------------------------------------------------------------- * * $Id$ *************** *** 22,25 **** --- 19,39 ---- */ + if ( !defined( 'IN_PORTAL' ) ) + { + die( "Hacking attempt" ); + } + + /********************************************************************************\ + | Class: mx_Template + | The mx_Template class extends the native phpBB Template class, in reality only redefining the make_filename method. + | Thus modded phpBB templates (eg eXtreme Styles MOD) will also be available for mxBB. + | + | + | // + | // Usage examples: + | // + | + | Nothing new... + \********************************************************************************/ // *************** *** 35,39 **** * This is required. Reason is constructors have different method names. */ ! function mx_Template( $root = "." ) { parent::Template($root); --- 49,53 ---- * This is required. Reason is constructors have different method names. */ ! function mx_Template($root = '.') { parent::Template($root); *************** *** 47,108 **** * object. */ ! function make_filename( $filename ) { global $module_root_path, $mx_root_path, $phpbb_root_path, $theme; ! $style_path = $theme['template_name'] . '/'; ! ! // Look at MX-Module folder... ! ! if ( file_exists( $module_root_path . 'templates/' . $style_path . $filename ) ) { $filename = $module_root_path . 'templates/' . $style_path . $filename; } ! else if ( file_exists( $module_root_path . 'templates/subSilver/' . $filename ) ) { $filename = $module_root_path . 'templates/subSilver/' . $filename; } ! else if ( file_exists( $module_root_path . 'templates/' . $filename ) ) { $filename = $module_root_path . 'templates/' . $filename; ! } ! ! // Look at MX-Root folder... ! ! else if ( file_exists( $mx_root_path . 'templates/' . $style_path . $filename ) ) { $filename = $mx_root_path . 'templates/' . $style_path . $filename; } ! else if ( file_exists( $mx_root_path . 'templates/subSilver/' . $filename ) ) { $filename = $mx_root_path . 'templates/subSilver/' . $filename; } ! else if ( file_exists( $mx_root_path . 'templates/' . $filename ) ) { $filename = $mx_root_path . 'templates/' . $filename; } ! else if ( file_exists( $mx_root_path . $this->root . '/' . $filename ) ) { $filename = $mx_root_path . $this->root . '/' . $filename; ! } ! // Look at phpBB-Root folder... ! ! else if ( file_exists( $phpbb_root_path . 'templates/' . $style_path . $filename ) ) { $filename = $phpbb_root_path . 'templates/' . $style_path . $filename; } ! else if ( file_exists( $phpbb_root_path . 'templates/subSilver/' . $filename ) ) { $filename = $phpbb_root_path . 'templates/subSilver/' . $filename; } ! else if ( file_exists( $phpbb_root_path . $this->root . '/' . $filename ) ) { $filename = $phpbb_root_path . $this->root . '/' . $filename; } ! else if ( file_exists( $this->root . '/' . $filename ) ) ! { // Check if it's an absolute or relative path. ! if ( substr( $filename, 0, 1 ) != '/' ) { $filename = ($rp_filename = phpbb_realpath($this->root . '/' . $filename)) ? $rp_filename : $filename; --- 61,125 ---- * object. */ ! function make_filename($filename) { global $module_root_path, $mx_root_path, $phpbb_root_path, $theme; ! $style_path = $theme['template_name'] . '/'; ! ! // ! // Look at mxBB-Module folder... ! // ! if( file_exists($module_root_path . 'templates/' . $style_path . $filename) ) { $filename = $module_root_path . 'templates/' . $style_path . $filename; } ! else if( file_exists($module_root_path . 'templates/subSilver/' . $filename) ) { $filename = $module_root_path . 'templates/subSilver/' . $filename; } ! else if( file_exists($module_root_path . 'templates/' . $filename) ) { $filename = $module_root_path . 'templates/' . $filename; ! } ! ! // ! // Look at mxBB-Root folder... ! // ! else if( file_exists($mx_root_path . 'templates/' . $style_path . $filename) ) { $filename = $mx_root_path . 'templates/' . $style_path . $filename; } ! else if( file_exists($mx_root_path . 'templates/subSilver/' . $filename) ) { $filename = $mx_root_path . 'templates/subSilver/' . $filename; } ! else if( file_exists($mx_root_path . 'templates/' . $filename) ) { $filename = $mx_root_path . 'templates/' . $filename; } ! else if( file_exists($mx_root_path . $this->root . '/' . $filename) ) { $filename = $mx_root_path . $this->root . '/' . $filename; ! } ! ! // // Look at phpBB-Root folder... ! // ! else if( file_exists($phpbb_root_path . 'templates/' . $style_path . $filename) ) { $filename = $phpbb_root_path . 'templates/' . $style_path . $filename; } ! else if( file_exists($phpbb_root_path . 'templates/subSilver/' . $filename) ) { $filename = $phpbb_root_path . 'templates/subSilver/' . $filename; } ! else if( file_exists($phpbb_root_path . $this->root . '/' . $filename) ) { $filename = $phpbb_root_path . $this->root . '/' . $filename; } ! else if( file_exists($this->root . '/' . $filename) ) ! { // Check if it's an absolute or relative path. ! if( substr($filename, 0, 1) != '/' ) { $filename = ($rp_filename = phpbb_realpath($this->root . '/' . $filename)) ? $rp_filename : $filename; *************** *** 110,116 **** } ! if ( !file_exists( $filename ) ) { ! die( "Template->make_filename(): Error - file $filename does not exist." ); } --- 127,133 ---- } ! if( !file_exists($filename) ) { ! die("Template->make_filename(): Error - file $filename does not exist."); } Index: mx_form.php =================================================================== RCS file: /cvsroot/mxbb/core27x/includes/mx_form.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mx_form.php 6 May 2005 06:47:58 -0000 1.1 --- mx_form.php 5 Dec 2005 19:25:26 -0000 1.2 *************** *** 1,66 **** ! <?php ! /*************************************************************************** ! * mx_form.php ! * ------------------- ! * begin : May, 2002 ! * copyright : (C) 2002 MX-System ! * email : su...@mx... ! * ! * $Id$ ! * ! ***************************************************************************/ /* * Form creator * ! */ ! class form { ! var $items; // array containing the data for the form ! var $arrayname; // name of the form array ! function form($items=array()) ! { ! if (!empty($items)) ! { ! $this->items=$items; ! foreach ($items as $item) ! { ! if ($item[0]=="name") ! { ! $this->arrayname=$item[1]; // getting the table name ! $name=true; ! break; ! } ! } ! if (!isset($name)) die("The form hasn't got name parameter"); ! } ! } ! function drawForm() // drawing the input form ! { ! global $template, $lang; ! ! foreach ($this->items as $item) ! { ! $item_label = ''; ! $item_field = ''; ! ! switch ($item[0]) ! { ! case "text": // text form ! $item_label = $item[1]; ! $item_field = '<input type="text" name="' . $this->arrayname . '['. $item[2] . ']" size="' . $item[3] . '" value="' . $item[4] . '" class="post">'; ! break; ! case "textarea": // textarea ! $item_label = $item[1]; ! $item_field = '<textarea name="' . $this->arrayname . '['. $item[2] . ']" class="post" wrap="on" cols="' . $item[3] . '" rows="' . $item[4] . '">' . $item[5] . '</textarea>'; ! break; ! case "password": // password ! $item_label = $item[1]; ! $item_field = '<input type="password" name="' . $this->arrayname . '['. $item[2] . ']" size="' . $item[3] . '" value="' . $item[4] . '" class="post">'; ! /* case "radio": // radio button $item_label = $item[1]; foreach ($item[3] as $key=>$value) --- 1,75 ---- ! <?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 : ! * ------------------------------------------------------------------------- ! * copyright : (C) 2002 MX-System ! * email : su...@mx... ! * ! * $Id$ ! */ /* * Form creator * ! */ ! if ( !defined( 'IN_PORTAL' ) ) ! { ! die( "Hacking attempt" ); ! } ! class form ! { ! var $items; // array containing the data for the form ! var $arrayname; // name of the form array ! ! function form( $items = array() ) ! { ! if ( !empty( $items ) ) ! { ! $this->items = $items; ! foreach ( $items as $item ) ! { ! if ( $item[0] == "name" ) ! { ! $this->arrayname = $item[1]; // getting the table name ! $name = true; ! break; ! } ! } ! if ( !isset( $name ) ) die( "The form hasn't got name parameter" ); ! } ! } ! function drawForm() // drawing the input form ! { ! global $template, $lang; ! foreach ( $this->items as $item ) ! { ! $item_label = ''; ! $item_field = ''; ! switch ( $item[0] ) ! { ! case "text": // text form ! $item_label = $item[1]; ! $item_field = '<input type="text" name="' . $this->arrayname . '[' . $item[2] . ']" size="' . $item[3] . '" value="' . $item[4] . '" class="post">'; ! break; ! case "textarea": // textarea ! $item_label = $item[1]; ! $item_field = '<textarea name="' . $this->arrayname . '[' . $item[2] . ']" class="post" wrap="on" cols="' . $item[3] . '" rows="' . $item[4] . '">' . $item[5] . '</textarea>'; ! break; ! case "password": // password ! $item_label = $item[1]; ! $item_field = '<input type="password" name="' . $this->arrayname . '[' . $item[2] . ']" size="' . $item[3] . '" value="' . $item[4] . '" class="post">'; ! ! /* case "radio": // radio button $item_label = $item[1]; foreach ($item[3] as $key=>$value) *************** *** 75,219 **** } } ! */ ! break; ! case "checkbox": // checkbox button ! $item_label = $item[1]; ! if (isset($item[3])) ! $item_field = '<input type="checkbox" name="' . $this->arrayname . '[' . $item[2] . ']" value="1" checked>'; ! else ! $item_field = '<input type="checkbox" name="' . $this->arrayname . '[' . $item[2] . ']" value="1"'; ! ! break; ! case "select": ! $item_label = $item[1]; ! $item_field = $item[2]; ! ! break; ! case "file": // file upload field ! $item_label = $item[1]; ! $item_field = '<input type="file" name="' . $item[2] . '" size="'.$item[3].'" class="post">'; ! $item_field .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . $config->MaxUploadSize. '">'; ! $item_field .= '<input type="hidden" name="'. $this->arrayname . '[fileupload]" value="' . $item[2] . '">'; ! break; ! case "hidden": // hidden fields ! $item_label = ''; ! $item_field = '<input type="hidden" name="' . $this->arrayname . '['.$item[1].']" value="' . $item[2]. '">'; ! break; ! case "submit": // defining the label for submit button ! $submit=$item[1]; ! $submitname=$item[2]; ! break; ! case "delete": // delete button ! $item_label = $item[1]; ! $item_field = $item[2]; ! break; ! } ! if ( ! empty( $item_field )) ! { ! $template->assign_block_vars("rows", array( ! 'LABEL' => $item_label, ! 'FIELD' => $item_field, ! )); ! } ! } ! ! $template->pparse("body"); ! } ! ! /* If is there a file upload, it has got some extra parameter (e.g. file_type). * These parameter are put here to the main array ! */ ! function preinsert($pairs=array(),$tabla="") ! { ! global $config; ! ! foreach ($pairs as $key=>$value) { ! if ($key=="fileupload") { // special variable containing the prefix of the name of the uploaded file ! $name=$value."_name"; ! $size=$value."_size"; ! $type=$value."_type"; ! $path=$value; ! global $$name,$$size,$$type,$$path; ! if ($$size>$config->MaxUploadSize) { // checking the size of the uploaded file, you must set $config->MaxUploadSize ! printf("The uploaded file is too big. The maximal size is %d byte. <br>Please repeat the upload!",$config->MaxUploadSize); ! $this->drawform(); ! } else { ! // let's put the values of the uploaded image to the main array ! $pairs[file_name]=$$name; ! $pairs[file_size]=$$size; ! $pairs[file_type]=$$type; ! $pairs[file_path]=$$path; ! if (!empty($tabla)) $this->insert($pairs,$tabla); // if you get table name, insert do everything to you ! else return($pairs); // if there's no table, we return with the finished array ! break; ! } ! } ! } ! } ! function insert($pairs,$table) { // method for inserting record to the database ! global $db; ! $sql="INSERT INTO $table ("; ! $first=true; ! foreach ($pairs as $key=>$value) { ! if ($key!="id" || $key!="title" || $key!="submit") { // everything except record ID,title,submit ! if ($first) { ! $value="\"".$value; ! $first=false; ! }else { ! $key=",".$key; ! $value=",\"".$value; ! } ! $fields.=$key; ! $values.=$value."\""; ! } ! } ! $sql.=$fields.") VALUES(".$values.")"; ! if( !$result = $db->sql_query($sql) ) ! { ! message_die(GENERAL_ERROR, "Couldn't insert into $table ", "", __LINE__, __FILE__, $sql); ! } ! } ! function update($pairs,$table, $key) { // method for updating records in the database ! global $db; ! $sql="UPDATE $table SET "; ! $first=true; ! foreach ($pairs as $key=>$value) { ! if ($key!="id" || $key!="title" || $key!="submit") { // everything except record ID,title,submit ! if ($first) { ! $sql.="$key=\"$value\""; ! $first=false; ! }else { ! $sql.=",$key=\"$value\""; ! } ! } ! } ! $sql.=" WHERE $key = $pairs[$key]"; ! if( !$result = $db->sql_query($sql) ) ! { ! message_die(GENERAL_ERROR, "Couldn't insert into $table ", "", __LINE__, __FILE__, $sql); ! } ! } ! function delete($id,$table, $key) { // method for deleting record from a table ! global $db; ! $sql="DELETE FROM $table WHERE $key =$id"; ! if( !$result = $db->sql_query($sql) ) ! { ! message_die(GENERAL_ERROR, "Couldn't delete $table information", "", __LINE__, __FILE__, $sql); ! } ! } ! } ! ?> --- 84,242 ---- } } ! */ ! break; ! case "checkbox": // checkbox button ! $item_label = $item[1]; ! if ( isset( $item[3] ) ) ! $item_field = '<input type="checkbox" name="' . $this->arrayname . '[' . $item[2] . ']" value="1" checked>'; ! else ! $item_field = '<input type="checkbox" name="' . $this->arrayname . '[' . $item[2] . ']" value="1"'; ! break; ! case "select": ! $item_label = $item[1]; ! $item_field = $item[2]; ! break; ! case "file": // file upload field ! $item_label = $item[1]; ! $item_field = '<input type="file" name="' . $item[2] . '" size="' . $item[3] . '" class="post">'; ! $item_field .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . $config->MaxUploadSize . '">'; ! $item_field .= '<input type="hidden" name="' . $this->arrayname . '[fileupload]" value="' . $item[2] . '">'; ! break; ! case "hidden": // hidden fields ! $item_label = ''; ! $item_field = '<input type="hidden" name="' . $this->arrayname . '[' . $item[1] . ']" value="' . $item[2] . '">'; ! break; ! case "submit": // defining the label for submit button ! $submit = $item[1]; ! $submitname = $item[2]; ! break; ! case "delete": // delete button ! $item_label = $item[1]; ! $item_field = $item[2]; ! break; ! } ! if ( ! empty( $item_field ) ) ! { ! $template->assign_block_vars( "rows", array( 'LABEL' => $item_label, ! 'FIELD' => $item_field, ! ) ); ! } ! } ! ! $template->pparse( "body" ); ! } ! ! /* If is there a file upload, it has got some extra parameter (e.g. file_type). * These parameter are put here to the main array ! */ ! function preinsert( $pairs = array(), $tabla = "" ) ! { ! global $config; ! foreach ( $pairs as $key => $value ) ! { ! if ( $key == "fileupload" ) // special variable containing the prefix of the name of the uploaded file ! { ! $name = $value . "_name"; ! $size = $value . "_size"; ! $type = $value . "_type"; ! $path = $value; ! global $$name, $$size, $$type, $$path; ! if ( $$size > $config->MaxUploadSize ) // checking the size of the uploaded file, you must set $config->MaxUploadSize ! { ! printf( "The uploaded file is too big. The maximal size is %d byte. <br>Please repeat the upload!", $config->MaxUploadSize ); ! $this->drawform(); ! } ! else ! { ! // let's put the values of the uploaded image to the main array ! $pairs[file_name] = $$name; ! $pairs[file_size] = $$size; ! $pairs[file_type] = $$type; ! $pairs[file_path] = $$path; ! if ( !empty( $tabla ) ) $this->insert( $pairs, $tabla ); // if you get table name, insert do everything to you ! else return( $pairs ); // if there's no table, we return with the finished array ! break; ! } ! } ! } ! } ! function insert( $pairs, $table ) // method for inserting record to the database ! { ! global $db; ! $sql = "INSERT INTO $table ("; ! $first = true; ! foreach ( $pairs as $key => $value ) ! { ! if ( $key != "id" || $key != "title" || $key != "submit" ) // everything except record ID,title,submit ! { ! if ( $first ) ! { ! $value = "\"" . $value; ! $first = false; ! } ! else ! { ! $key = "," . $key; ! $value = ",\"" . $value; ! } ! $fields .= $key; ! $values .= $value . "\""; ! } ! } ! $sql .= $fields . ") VALUES(" . $values . ")"; ! if ( !$result = $db->sql_query( $sql ) ) ! { ! message_die( GENERAL_ERROR, "Couldn't insert into $table ", "", __LINE__, __FILE__, $sql ); ! } ! } ! function update( $pairs, $table, $key ) // method for updating records in the database ! { ! global $db; ! $sql = "UPDATE $table SET "; ! $first = true; ! foreach ( $pairs as $key => $value ) ! { ! if ( $key != "id" || $key != "title" || $key != "submit" ) // everything except record ID,title,submit ! { ! if ( $first ) ! { ! $sql .= "$key=\"$value\""; ! $first = false; ! } ! else ! { ! $sql .= ",$key=\"$value\""; ! } ! } ! } ! $sql .= " WHERE $key = $pairs[$key]"; ! if ( !$result = $db->sql_query( $sql ) ) ! { ! message_die( GENERAL_ERROR, "Couldn't insert into $table ", "", __LINE__, __FILE__, $sql ); ! } ! } ! function delete( $id, $table, $key ) // method for deleting record from a table ! { ! global $db; ! $sql = "DELETE FROM $table WHERE $key =$id"; ! if ( !$result = $db->sql_query( $sql ) ) ! { ! message_die( GENERAL_ERROR, "Couldn't delete $table information", "", __LINE__, __FILE__, $sql ); ! } ! } ! } + ?> \ No newline at end of file Index: page_header.php =================================================================== RCS file: /cvsroot/mxbb/core27x/includes/page_header.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** page_header.php 30 Nov 2005 23:50:45 -0000 1.2 --- page_header.php 5 Dec 2005 19:25:26 -0000 1.3 *************** *** 114,118 **** if( !($result = $db->sql_query($sql)) ) { ! message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql); } --- 114,118 ---- if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql); } *************** *** 193,197 **** if ( !$db->sql_query($sql) ) { ! message_die(GENERAL_ERROR, 'Could not update online user record (nr of users)', '', __LINE__, __FILE__, $sql); } --- 193,197 ---- if ( !$db->sql_query($sql) ) { ! mx_message_die(GENERAL_ERROR, 'Could not update online user record (nr of users)', '', __LINE__, __FILE__, $sql); } *************** *** 201,205 **** if ( !$db->sql_query($sql) ) { ! message_die(GENERAL_ERROR, 'Could not update online user record (date)', '', __LINE__, __FILE__, $sql); } } --- 201,205 ---- if ( !$db->sql_query($sql) ) { ! mx_message_die(GENERAL_ERROR, 'Could not update online user record (date)', '', __LINE__, __FILE__, $sql); } } *************** *** 281,285 **** if ( !$db->sql_query($sql) ) { ! message_die(GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, $sql); } --- 281,285 ---- if ( !$db->sql_query($sql) ) { ! mx_message_die(GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, $sql); } Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core27x/includes/mx_functions.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mx_functions.php 26 May 2005 21:54:08 -0000 1.2 --- mx_functions.php 5 Dec 2005 19:25:26 -0000 1.3 *************** *** 20,23 **** --- 20,28 ---- ***************************************************************************/ + if ( !defined('IN_PORTAL') ) + { + die("Hacking attempt"); + } + /********************************************************************************\ | |