Update of /cvsroot/mxbb/core27x/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13016/includes Added Files: mx_constants.php mx_form.php mx_functions.php mx_functions_ch.php page_header.php page_tail.php template.php Log Message: Initital core 2.7.x commit :-) --- NEW FILE: mx_functions_ch.php --- <?php /*************************************************************************** * mx_functions_ch.php * ------------------- * begin : March, 2005 * copyright : (C) 2002 mxBB-Portal * email : su...@mx... * * $Id: mx_functions_ch.php,v 1.1 2005/05/06 06:47:58 jonohlsson 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. * ***************************************************************************/ // // This code is part of common.php in Categories Hierarchy 2.1.0 // $starttime = microtime(); $trc_loc_start = $trc_loc_end = 0; // include basic classes def include($phpbb_root_path . 'includes/class_config.' . $phpEx); include($phpbb_root_path . 'includes/class_groups.' . $phpEx); // get config $config = new config_class(); if ( !$config->read() ) { define('RUN_CH_INSTALL', true); } $board_config = &$config->data; // let's run the upgrade script if ( !defined('IN_LOGIN') && !defined('IN_INSTALL') && (($config->data['mod_cat_hierarchy'] != '2.1.0f') || defined('RUN_CH_INSTALL')) ) { header('Location: '.$phpbb_root_path.'install_cat/install.' . $phpEx . (empty($SID) ? '' : '?' . $SID)); exit; } // user objects include($config->url('includes/class_user')); include($config->url('includes/class_auth')); // instantiate some objects $user = new user(); $censored_words = new words(); $icons = new icons(); $navigation = new navigation(); $themes = ''; $smilies = new smilies(); // People never read achievement messages after after having seen "Succesfull !", tss tss :) if ( file_exists($phpbb_root_path.'install_cat') && !defined('IN_LOGIN') && !defined('IN_INSTALL') ) { message_die(GENERAL_MESSAGE, 'Please ensure the install_cat/ directory is deleted'); } // messages queue $message_queue = ''; @include($config->url('includes/class_message')); $message_queue = !defined('CH_message_queue') ? '' : new message_queue(); ?> --- NEW FILE: page_tail.php --- <?php /*************************************************************************** * page_tail.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: page_tail.php,v 1.1 2005/05/06 06:47:58 jonohlsson 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. * ***************************************************************************/ if ( !defined('IN_PORTAL') ) { die('Hacking attempt'); } // // Show the overall footer. // $admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a href="' . PORTAL_URL . 'admin/index.' . $phpEx . '?sid=' . $userdata['session_id'] . '">' . $lang['Admin_panel'] . '</a><br /><br />' : ''; $template->set_filenames(array( 'overall_footer' => ( empty($gen_simple_header) ) ? 'overall_footer.tpl' : 'simple_footer.tpl') ); $template->assign_vars(array( 'U_PORTAL_ROOT_PATH' => PORTAL_URL, 'U_PHPBB_ROOT_PATH' => PHPBB_URL, 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, 'TRANSLATION_INFO' => ( isset($lang['TRANSLATION_INFO']) ) ? $lang['TRANSLATION_INFO'] : '', 'ADMIN_LINK' => $admin_link) ); // Generate stats $endtime = explode(' ', microtime()); $stime = ( $endtime[1] + $endtime[0] ) - $mx_starttime; $execution_stats = '<center><span class="copyright">' . sprintf($lang['Execution_Stats'], $db->num_queries, round($stime, 4)) . '</span></center>'; // Comment out next 3 lines and stats will be turned off $template->assign_vars(array( 'EXECUTION_STATS' => $execution_stats) ); $template->pparse('overall_footer'); // // Close our DB connection. // $db->sql_close(); // // Compress buffered output if required and send to browser // if ( $do_gzip_compress ) { // // Borrowed from php.net! // $gzip_contents = ob_get_contents(); ob_end_clean(); $gzip_size = strlen($gzip_contents); $gzip_crc = crc32($gzip_contents); $gzip_contents = gzcompress($gzip_contents, 9); $gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4); echo "\x1f\x8b\x08\x00\x00\x00\x00\x00"; echo $gzip_contents; echo pack('V', $gzip_crc); echo pack('V', $gzip_size); } exit; ?> --- NEW FILE: template.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 : * ------------------------------------------------------------------------- * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: template.php,v 1.1 2005/05/06 06:47:58 jonohlsson 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. */ /** * Template class. By Nathan Codding of the phpBB group. * The interface was originally inspired by PHPLib templates, * and the template file formats are quite similar. */ class Template { var $classname = "Template"; // variable that holds all the data we'll be substituting into // the compiled templates. // ... // This will end up being a multi-dimensional array like this: // $this->_tpldata[block.][iteration#][child.][iteration#][child2.][iteration#][variablename] == value // if it's a root-level variable, it'll be like this: // $this->_tpldata[.][0][varname] == value var $_tpldata = array(); // Hash of filenames for each template handle. var $files = array(); // Root template directory. var $root = ""; // this will hash handle names to the compiled code for that handle. var $compiled_code = array(); // This will hold the uncompiled code for that handle. var $uncompiled_code = array(); /** * Constructor. Simply sets the root dir. */ function Template( $root = "." ) { $this->set_rootdir( $root ); } /** * Destroys this template object. Should be called when you're done with it, in order * to clear out the template data so you can load/parse a new template set. */ function destroy() { $this->_tpldata = array(); } /** * Sets the template root directory for this Template object. */ function set_rootdir( $dir ) { if ( !is_dir( $dir ) ) { return false; } $this->root = $dir; return true; } /** * Sets the template filenames for handles. $filename_array * should be a hash of handle => filename pairs. */ function set_filenames( $filename_array ) { if ( !is_array( $filename_array ) ) { return false; } reset( $filename_array ); while ( list( $handle, $filename ) = each( $filename_array ) ) { $this->files[$handle] = $this->make_filename( $filename ); } return true; } /** * Load the file for the handle, compile the file, * and run the compiled code. This will print out * the results of executing the template. */ function pparse( $handle ) { if ( !$this->loadfile( $handle ) ) { die( "Template->pparse(): Couldn't load template file for handle $handle" ); } // actually compile the template now. if ( !isset( $this->compiled_code[$handle] ) || empty( $this->compiled_code[$handle] ) ) { // Actually compile the code now. $this->compiled_code[$handle] = $this->compile( $this->uncompiled_code[$handle] ); } // Run the compiled code. eval( $this->compiled_code[$handle] ); return true; } /** * Inserts the uncompiled code for $handle as the * value of $varname in the root-level. This can be used * to effectively include a template in the middle of another * template. * Note that all desired assignments to the variables in $handle should be done * BEFORE calling this function. */ function assign_var_from_handle( $varname, $handle ) { if ( !$this->loadfile( $handle ) ) { die( "Template->assign_var_from_handle(): Couldn't load template file for handle $handle" ); } // Compile it, with the "no echo statements" option on. $_str = ""; $code = $this->compile( $this->uncompiled_code[$handle], true, '_str' ); // evaluate the variable assignment. eval( $code ); // assign the value of the generated variable to the given varname. $this->assign_var( $varname, $_str ); return true; } /** * Block-level variable assignment. Adds a new block iteration with the given * variable assignments. Note that this should only be called once per block * iteration. */ function assign_block_vars( $blockname, $vararray ) { if ( strstr( $blockname, '.' ) ) { // Nested block. $blocks = explode( '.', $blockname ); $blockcount = sizeof( $blocks ) - 1; $str = '$this->_tpldata'; for ( $i = 0; $i < $blockcount; $i++ ) { $str .= '[\'' . $blocks[$i] . '.\']'; eval( '$lastiteration = sizeof(' . $str . ') - 1;' ); $str .= '[' . $lastiteration . ']'; } // Now we add the block that we're actually assigning to. // We're adding a new iteration to this block with the given // variable assignments. $str .= '[\'' . $blocks[$blockcount] . '.\'][] = $vararray;'; // Now we evaluate this assignment we've built up. eval( $str ); } else { // Top-level block. // Add a new iteration to this block with the variable assignments // we were given. $this->_tpldata[$blockname . '.'][] = $vararray; } return true; } /** * Root-level variable assignment. Adds to current assignments, overriding * any existing variable assignment with the same name. */ function assign_vars( $vararray ) { reset ( $vararray ); while ( list( $key, $val ) = each( $vararray ) ) { $this->_tpldata['.'][0][$key] = $val; } return true; } /** * Root-level variable assignment. Adds to current assignments, overriding * any existing variable assignment with the same name. */ function assign_var( $varname, $varval ) { $this->_tpldata['.'][0][$varname] = $varval; return true; } /** * Generates a full path+filename for the given filename, which can either * be an absolute name, or a name relative to the rootdir for this Template * 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; } } if ( !file_exists( $filename ) ) { die( "Template->make_filename(): Error - file $filename does not exist." ); } return $filename; } /** * If not already done, load the file for the given handle and populate * the uncompiled_code[] hash with its code. Do not compile. */ function loadfile( $handle ) { // If the file for this handle is already loaded and compiled, do nothing. if ( isset( $this->uncompiled_code[$handle] ) && !empty( $this->uncompiled_code[$handle] ) ) { return true; } // If we don't have a file assigned to this handle, die. if ( !isset( $this->files[$handle] ) ) { die( "Template->loadfile(): No file specified for handle $handle" ); } $filename = $this->files[$handle]; $str = implode( "", @file( $filename ) ); if ( empty( $str ) ) { die( "Template->loadfile(): File $filename for handle $handle is empty" ); } $this->uncompiled_code[$handle] = $str; return true; } /** * Compiles the given string of code, and returns * the result in a string. * If "do_not_echo" is true, the returned code will not be directly * executable, but can be used as part of a variable assignment * for use in assign_code_from_handle(). */ function compile( $code, $do_not_echo = false, $retvar = '' ) { // replace \ with \\ and then ' with \'. $code = str_replace( '\\', '\\\\', $code ); $code = str_replace( '\'', '\\\'', $code ); // change template varrefs into PHP varrefs // This one will handle varrefs WITH namespaces $varrefs = array(); preg_match_all( '#\{(([a-z0-9\-_]+?\.)+?)([a-z0-9\-_]+?)\}#is', $code, $varrefs ); $varcount = sizeof( $varrefs[1] ); for ( $i = 0; $i < $varcount; $i++ ) { $namespace = $varrefs[1][$i]; $varname = $varrefs[3][$i]; $new = $this->generate_block_varref( $namespace, $varname ); $code = str_replace( $varrefs[0][$i], $new, $code ); } // This will handle the remaining root-level varrefs $code = preg_replace( '#\{([a-z0-9\-_]*?)\}#is', '\' . ( ( isset($this->_tpldata[\'.\'][0][\'\1\']) ) ? $this->_tpldata[\'.\'][0][\'\1\'] : \'\' ) . \'', $code ); // Break it up into lines. $code_lines = explode( "\n", $code ); $block_nesting_level = 0; $block_names = array(); $block_names[0] = "."; // Second: prepend echo ', append ' . "\n"; to each line. $line_count = sizeof( $code_lines ); for ( $i = 0; $i < $line_count; $i++ ) { $code_lines[$i] = chop( $code_lines[$i] ); if ( preg_match( '#<!-- BEGIN (.*?) -->#', $code_lines[$i], $m ) ) { $n[0] = $m[0]; $n[1] = $m[1]; // Added: dougk_ff7-Keeps templates from bombing if begin is on the same line as end.. I think. :) if ( preg_match( '#<!-- END (.*?) -->#', $code_lines[$i], $n ) ) { $block_nesting_level++; $block_names[$block_nesting_level] = $m[1]; if ( $block_nesting_level < 2 ) { // Block is not nested. $code_lines[$i] = '$_' . $n[1] . '_count = ( isset($this->_tpldata[\'' . $n[1] . '.\']) ) ? sizeof($this->_tpldata[\'' . $n[1] . '.\']) : 0;'; $code_lines[$i] .= "\n" . 'for ($_' . $n[1] . '_i = 0; $_' . $n[1] . '_i < $_' . $n[1] . '_count; $_' . $n[1] . '_i++)'; $code_lines[$i] .= "\n" . '{'; } else { // This block is nested. // Generate a namespace string for this block. $namespace = implode( '.', $block_names ); // strip leading period from root level.. $namespace = substr( $namespace, 2 ); // Get a reference to the data array for this block that depends on the // current indices of all parent blocks. $varref = $this->generate_block_data_ref( $namespace, false ); // Create the for loop code to iterate over this block. $code_lines[$i] = '$_' . $n[1] . '_count = ( isset(' . $varref . ') ) ? sizeof(' . $varref . ') : 0;'; $code_lines[$i] .= "\n" . 'for ($_' . $n[1] . '_i = 0; $_' . $n[1] . '_i < $_' . $n[1] . '_count; $_' . $n[1] . '_i++)'; $code_lines[$i] .= "\n" . '{'; } // We have the end of a block. unset( $block_names[$block_nesting_level] ); $block_nesting_level--; $code_lines[$i] .= '} // END ' . $n[1]; $m[0] = $n[0]; $m[1] = $n[1]; } else { // We have the start of a block. $block_nesting_level++; $block_names[$block_nesting_level] = $m[1]; if ( $block_nesting_level < 2 ) { // Block is not nested. $code_lines[$i] = '$_' . $m[1] . '_count = ( isset($this->_tpldata[\'' . $m[1] . '.\']) ) ? sizeof($this->_tpldata[\'' . $m[1] . '.\']) : 0;'; $code_lines[$i] .= "\n" . 'for ($_' . $m[1] . '_i = 0; $_' . $m[1] . '_i < $_' . $m[1] . '_count; $_' . $m[1] . '_i++)'; $code_lines[$i] .= "\n" . '{'; } else { // This block is nested. // Generate a namespace string for this block. $namespace = implode( '.', $block_names ); // strip leading period from root level.. $namespace = substr( $namespace, 2 ); // Get a reference to the data array for this block that depends on the // current indices of all parent blocks. $varref = $this->generate_block_data_ref( $namespace, false ); // Create the for loop code to iterate over this block. $code_lines[$i] = '$_' . $m[1] . '_count = ( isset(' . $varref . ') ) ? sizeof(' . $varref . ') : 0;'; $code_lines[$i] .= "\n" . 'for ($_' . $m[1] . '_i = 0; $_' . $m[1] . '_i < $_' . $m[1] . '_count; $_' . $m[1] . '_i++)'; $code_lines[$i] .= "\n" . '{'; } } } else if ( preg_match( '#<!-- END (.*?) -->#', $code_lines[$i], $m ) ) { // We have the end of a block. unset( $block_names[$block_nesting_level] ); $block_nesting_level--; $code_lines[$i] = '} // END ' . $m[1]; } else { // We have an ordinary line of code. if ( !$do_not_echo ) { $code_lines[$i] = 'echo \'' . $code_lines[$i] . '\' . "\\n";'; } else { $code_lines[$i] = '$' . $retvar . '.= \'' . $code_lines[$i] . '\' . "\\n";'; } } } // Bring it back into a single string of lines of code. $code = implode( "\n", $code_lines ); return $code ; } /** * Generates a reference to the given variable inside the given (possibly nested) * block namespace. This is a string of the form: * ' . $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . ' * It's ready to be inserted into an "echo" line in one of the templates. * NOTE: expects a trailing "." on the namespace. */ function generate_block_varref( $namespace, $varname ) { // Strip the trailing period. $namespace = substr( $namespace, 0, strlen( $namespace ) - 1 ); // Get a reference to the data block for this namespace. $varref = $this->generate_block_data_ref( $namespace, true ); // Prepend the necessary code to stick this in an echo line. // Append the variable reference. $varref .= '[\'' . $varname . '\']'; $varref = '\' . ( ( isset(' . $varref . ') ) ? ' . $varref . ' : \'\' ) . \''; return $varref; } /** * Generates a reference to the array of data values for the given * (possibly nested) block namespace. This is a string of the form: * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN'] * * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. * NOTE: does not expect a trailing "." on the blockname. */ function generate_block_data_ref( $blockname, $include_last_iterator ) { // Get an array of the blocks involved. $blocks = explode( ".", $blockname ); $blockcount = sizeof( $blocks ) - 1; $varref = '$this->_tpldata'; // Build up the string with everything but the last child. for ( $i = 0; $i < $blockcount; $i++ ) { $varref .= '[\'' . $blocks[$i] . '.\'][$_' . $blocks[$i] . '_i]'; } // Add the block reference for the last child. $varref .= '[\'' . $blocks[$blockcount] . '.\']'; // Add the iterator for the last child if requried. if ( $include_last_iterator ) { $varref .= '[$_' . $blocks[$blockcount] . '_i]'; } return $varref; } } ?> --- NEW FILE: mx_form.php --- <?php /*************************************************************************** * mx_form.php * ------------------- * begin : May, 2002 * copyright : (C) 2002 MX-System * email : su...@mx... * * $Id: mx_form.php,v 1.1 2005/05/06 06:47:58 jonohlsson Exp $ * ***************************************************************************/ /* * 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) { if (isset($item[4]) && $item[4]==$key) { $item_field .= '<input type="radio" name="' . $this->arrayname . '['. $item[2] . ']" value="' . $key . '" checked >' .. $value; } else { $item_field .= '<input type="radio" name="' . $this->arrayname . '['. $item[2] . ']" value="' . $key . '" >'. $value; } } */ 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); } } } ?> --- NEW FILE: page_header.php --- <?php /*************************************************************************** * page_header.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: page_header.php,v 1.1 2005/05/06 06:47:58 jonohlsson 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. * ***************************************************************************/ if ( !defined('IN_PORTAL') ) { die("Hacking attempt"); } define('HEADER_INC', TRUE); /********** NOTE: The following code related to GZIP initialization has been temporaly moved to the new mx_session_start() function, declared in mx_functions.php // // gzip_compression // $do_gzip_compress = FALSE; if ( $board_config['gzip_compress'] ) { $phpver = phpversion(); $useragent = (isset($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) ? $HTTP_SERVER_VARS['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT'); if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) ) { if ( extension_loaded('zlib') ) { ob_end_clean(); ob_start('ob_gzhandler'); } } else if ( $phpver > '4.0' ) { if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') ) { if ( extension_loaded('zlib') ) { $do_gzip_compress = TRUE; ob_start(); ob_implicit_flush(0); header('Content-Encoding: gzip'); } } } } **********/ // // Parse and show the overall header. // $template->set_filenames(array( 'overall_header' => ( empty($page_row['page_header']) ) ? 'overall_header.tpl' : $page_row['page_header'] ) ); // // Generate logged in/logged out status // if ( $userdata['session_logged_in'] ) { $u_login_logout = 'login.'.$phpEx.'?logout=true&sid=' . $userdata['session_id']; $l_login_logout = $lang['Logout'] . ' [ ' . $userdata['username'] . ' ]'; } else { $u_login_logout = 'login.'.$phpEx; $l_login_logout = $lang['Login']; } $s_last_visit = ( $userdata['session_logged_in'] ) ? create_date($board_config['default_dateformat'], $userdata['user_lastvisit'], $board_config['board_timezone']) : ''; // // Get basic (usernames + totals) online // situation // $logged_visible_online = 0; $logged_hidden_online = 0; $guests_online = 0; $online_userlist = ''; $l_online_users = ''; if (defined('SHOW_ONLINE')) { $user_forum_sql = ( !empty($forum_id) ) ? "AND s.session_page = " . intval($forum_id) : ''; $sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s WHERE u.user_id = s.session_user_id AND s.session_time >= ".( time() - 300 ) . " $user_forum_sql ORDER BY u.username ASC, s.session_ip ASC"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql); } $userlist_ary = array(); $userlist_visible = array(); $prev_user_id = 0; $prev_user_ip = $prev_session_ip = ''; while( $row = $db->sql_fetchrow($result) ) { // User is logged in and therefor not a guest if ( $row['session_logged_in'] ) { // Skip multiple sessions for one user if ( $row['user_id'] != $prev_user_id ) { $style_color = ''; if ( $row['user_level'] == ADMIN ) { $row['username'] = '<b>' . $row['username'] . '</b>'; $style_color = 'style="color:#' . $theme['fontcolor3'] . '"'; } else if ( $row['user_level'] == MOD ) { $row['username'] = '<b>' . $row['username'] . '</b>'; $style_color = 'style="color:#' . $theme['fontcolor2'] . '"'; } if ( $row['user_allow_viewonline'] ) { $user_online_link = '<a href="' . append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>'; $logged_visible_online++; } else { $user_online_link = '<a href="' . append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><i>' . $row['username'] . '</i></a>'; $logged_hidden_online++; } if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN ) { $online_userlist .= ( $online_userlist != '' ) ? ', ' . $user_online_link : $user_online_link; } } $prev_user_id = $row['user_id']; } else { // Skip multiple sessions for one user if ( $row['session_ip'] != $prev_session_ip ) { $guests_online++; } } $prev_session_ip = $row['session_ip']; } $db->sql_freeresult($result); if ( empty($online_userlist) ) { $online_userlist = $lang['None']; } $online_userlist = ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Registered_users'] ) . ' ' . $online_userlist; $total_online_users = $logged_visible_online + $logged_hidden_online + $guests_online; if ( $total_online_users > $board_config['record_online_users']) { $board_config['record_online_users'] = $total_online_users; $board_config['record_online_date'] = time(); $sql = "UPDATE " . CONFIG_TABLE . " SET config_value = '$total_online_users' WHERE config_name = 'record_online_users'"; if ( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not update online user record (nr of users)', '', __LINE__, __FILE__, $sql); } $sql = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . $board_config['record_online_date'] . "' WHERE config_name = 'record_online_date'"; if ( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not update online user record (date)', '', __LINE__, __FILE__, $sql); } } if ( $total_online_users == 0 ) { $l_t_user_s = $lang['Online_users_zero_total']; } else if ( $total_online_users == 1 ) { $l_t_user_s = $lang['Online_user_total']; } else { $l_t_user_s = $lang['Online_users_total']; } if ( $logged_visible_online == 0 ) { $l_r_user_s = $lang['Reg_users_zero_total']; } else if ( $logged_visible_online == 1 ) { $l_r_user_s = $lang['Reg_user_total']; } else { $l_r_user_s = $lang['Reg_users_total']; } if ( $logged_hidden_online == 0 ) { $l_h_user_s = $lang['Hidden_users_zero_total']; } else if ( $logged_hidden_online == 1 ) { $l_h_user_s = $lang['Hidden_user_total']; } else { $l_h_user_s = $lang['Hidden_users_total']; } if ( $guests_online == 0 ) { $l_g_user_s = $lang['Guest_users_zero_total']; } else if ( $guests_online == 1 ) { $l_g_user_s = $lang['Guest_user_total']; } else { $l_g_user_s = $lang['Guest_users_total']; } $l_online_users = sprintf($l_t_user_s, $total_online_users); $l_online_users .= sprintf($l_r_user_s, $logged_visible_online); $l_online_users .= sprintf($l_h_user_s, $logged_hidden_online); $l_online_users .= sprintf($l_g_user_s, $guests_online); } // // Obtain number of new private messages // if user is logged in // if ( ($userdata['session_logged_in']) ) { if ( $userdata['user_new_privmsg'] ) { $l_message_new = ( $userdata['user_new_privmsg'] == 1 ) ? $lang['New_pm'] : $lang['New_pms']; $l_privmsgs_text = sprintf($l_message_new, $userdata['user_new_privmsg']); if ( $userdata['user_last_privmsg'] > $userdata['user_lastvisit'] ) { $sql = "UPDATE " . USERS_TABLE . " SET user_last_privmsg = " . $userdata['user_lastvisit'] . " WHERE user_id = " . $userdata['user_id']; if ( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, $sql); } $s_privmsg_new = 1; $icon_pm = $images['pm_new_msg']; } else { $s_privmsg_new = 0; $icon_pm = $images['pm_no_new_msg']; } $mx_priv_msg = $lang['Private_Messages'] . ' (' . $userdata['user_new_privmsg'] . ')'; } else { $l_privmsgs_text = $lang['No_new_pm']; $s_privmsg_new = 0; $icon_pm = $images['pm_no_new_msg']; $mx_priv_msg = $lang['Private_Messages']; } if ( $userdata['user_unread_privmsg'] ) { $l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms']; $l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg']); // $mx_priv_msg = $lang['Private_Messages'] . ' (' . $userdata['user_unread_privmsg'] . ')'; } else { $l_privmsgs_text_unread = $lang['No_unread_pm']; } } else { $icon_pm = $images['pm_no_new_msg']; $l_privmsgs_text = $lang['Login_check_pm']; $l_privmsgs_text_unread = ''; $s_privmsg_new = 0; $mx_priv_msg = $lang['Private_Messages']; } // // Generate HTML required for Mozilla Navigation bar // if (!isset($nav_links)) { $nav_links = array(); } $nav_links_html = ''; $nav_link_proto = '<link rel="%s" href="%s" title="%s" />' . "\n"; while( list($nav_item, $nav_array) = @each($nav_links) ) { if ( !empty($nav_array['url']) ) { $nav_links_html .= sprintf($nav_link_proto, $nav_item, append_sid($nav_array['url']), $nav_array['title']); } else { // We have a nested array, used for items like <link rel='chapter'> that can occur more than once. while( list(,$nested_array) = each($nav_array) ) { $nav_links_html .= sprintf($nav_link_proto, $nav_item, $nested_array['url'], $nested_array['title']); } } } // Format Timezone. We are unable to use array_pop here, because of PHP3 compatibility $l_timezone = explode('.', $board_config['board_timezone']); $l_timezone = (count($l_timezone) > 1 && $l_timezone[count($l_timezone)-1] != 0) ? $lang[sprintf('%.1f', $board_config['board_timezone'])] : $lang[number_format($board_config['board_timezone'])]; // // The following assigns all _common_ variables that may be used at any point // in a template. // $template->assign_vars(array( 'SITENAME' => $board_config['sitename'], 'SITE_DESCRIPTION' => $board_config['site_desc'], 'PAGE_TITLE' => $page_title, 'LAST_VISIT_DATE' => sprintf($lang['You_last_visit'], $s_last_visit), 'CURRENT_TIME' => sprintf($lang['Current_time'], create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])), 'TOTAL_USERS_ONLINE' => $l_online_users, 'LOGGED_IN_USER_LIST' => $online_userlist, 'RECORD_USERS' => sprintf($lang['Record_online_users'], $board_config['record_online_users'], create_date($board_config['default_dateformat'], $board_config['record_online_date'], $board_config['board_timezone'])), 'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text, 'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread, 'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new, 'PRIVMSG_IMG' => $icon_pm, 'L_USERNAME' => $lang['Username'], 'L_PASSWORD' => $lang['Password'], 'L_LOGIN_LOGOUT' => $l_login_logout, 'L_LOGIN' => $lang['Login'], 'L_LOG_ME_IN' => $lang['Log_me_in'], 'L_AUTO_LOGIN' => $lang['Log_me_in'], 'L_INDEX' => $board_config['sitename'], 'L_REGISTER' => $lang['Register'], 'L_PROFILE' => $lang['Profile'], 'L_SEARCH' => $lang['Search'], 'L_PRIVATEMSGS' => $mx_priv_msg, 'L_WHO_IS_ONLINE' => $lang['Who_is_Online'], 'L_MEMBERLIST' => $lang['Memberlist'], 'L_FAQ' => $lang['FAQ'], 'L_USERGROUPS' => $lang['Usergroups'], 'L_SEARCH_NEW' => $lang['Search_new'], 'L_SEARCH_UNANSWERED' => $lang['Search_unanswered'], 'L_SEARCH_SELF' => $lang['Search_your_posts'], 'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#' . $theme['fontcolor3'] . '">', '</span>'), 'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor2'] . '">', '</span>'), 'U_SEARCH_UNANSWERED' => append_sid(PHPBB_URL . 'search.'.$phpEx.'?search_id=unanswered'), 'U_SEARCH_SELF' => append_sid(PHPBB_URL .'search.'.$phpEx.'?search_id=egosearch'), 'U_SEARCH_NEW' => append_sid(PHPBB_URL .'search.'.$phpEx.'?search_id=newposts'), 'U_REGISTER' => append_sid(PHPBB_URL .'profile.'.$phpEx.'?mode=register'), 'U_PROFILE' => append_sid(PHPBB_URL .'profile.'.$phpEx.'?mode=editprofile'), 'U_PRIVATEMSGS' => append_sid(PHPBB_URL .'privmsg.'.$phpEx.'?folder=inbox'), 'U_PRIVATEMSGS_POPUP' => append_sid(PHPBB_URL .'privmsg.'.$phpEx.'?mode=newpm'), 'U_SEARCH' => append_sid(PHPBB_URL .'search.'.$phpEx), 'U_MEMBERLIST' => append_sid(PHPBB_URL .'memberlist.'.$phpEx), 'U_MODCP' => append_sid(PHPBB_URL .'modcp.'.$phpEx), 'U_FAQ' => append_sid(PHPBB_URL .'faq.'.$phpEx), 'U_VIEWONLINE' => append_sid(PHPBB_URL .'viewonline.'.$phpEx), 'U_LOGIN_LOGOUT' => append_sid(PORTAL_URL . $u_login_logout), 'U_GROUP_CP' => append_sid(PHPBB_URL . 'groupcp.'.$phpEx), //+ MX System 'U_PORTAL_ROOT_PATH' => PORTAL_URL, 'U_PHPBB_ROOT_PATH' => PHPBB_URL, 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, 'L_FORUM' => $lang['Forum'], 'L_HOME' => $lang['Home Page'], 'U_INDEX_FORUM' => append_sid(PORTAL_URL . 'index.'.$phpEx . '?page=2'), 'U_INDEX' => append_sid(PORTAL_URL . 'index.'.$phpEx), //- MX System 'S_CONTENT_DIRECTION' => $lang['DIRECTION'], 'S_CONTENT_ENCODING' => $lang['ENCODING'], 'S_CONTENT_DIR_LEFT' => $lang['LEFT'], 'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'], 'S_TIMEZONE' => sprintf($lang['All_times'], $l_timezone), 'S_LOGIN_ACTION' => append_sid(PORTAL_URL . 'login.'.$phpEx), 'T_HEAD_STYLESHEET' => $theme['head_stylesheet'], 'T_BODY_BACKGROUND' => $theme['body_background'], 'T_BODY_BGCOLOR' => '#'.$theme['body_bgcolor'], 'T_BODY_TEXT' => '#'.$theme['body_text'], 'T_BODY_LINK' => '#'.$theme['body_link'], 'T_BODY_VLINK' => '#'.$theme['body_vlink'], 'T_BODY_ALINK' => '#'.$theme['body_alink'], 'T_BODY_HLINK' => '#'.$theme['body_hlink'], 'T_TR_COLOR1' => '#'.$theme['tr_color1'], 'T_TR_COLOR2' => '#'.$theme['tr_color2'], 'T_TR_COLOR3' => '#'.$theme['tr_color3'], 'T_TR_CLASS1' => $theme['tr_class1'], 'T_TR_CLASS2' => $theme['tr_class2'], 'T_TR_CLASS3' => $theme['tr_class3'], 'T_TH_COLOR1' => '#'.$theme['th_color1'], 'T_TH_COLOR2' => '#'.$theme['th_color2'], 'T_TH_COLOR3' => '#'.$theme['th_color3'], 'T_TH_CLASS1' => $theme['th_class1'], 'T_TH_CLASS2' => $theme['th_class2'], 'T_TH_CLASS3' => $theme['th_class3'], 'T_TD_COLOR1' => '#'.$theme['td_color1'], 'T_TD_COLOR2' => '#'.$theme['td_color2'], 'T_TD_COLOR3' => '#'.$theme['td_color3'], 'T_TD_CLASS1' => $theme['td_class1'], 'T_TD_CLASS2' => $theme['td_class2'], 'T_TD_CLASS3' => $theme['td_class3'], 'T_FONTFACE1' => $theme['fontface1'], 'T_FONTFACE2' => $theme['fontface2'], 'T_FONTFACE3' => $theme['fontface3'], 'T_FONTSIZE1' => $theme['fontsize1'], 'T_FONTSIZE2' => $theme['fontsize2'], 'T_FONTSIZE3' => $theme['fontsize3'], 'T_FONTCOLOR1' => '#'.$theme['fontcolor1'], 'T_FONTCOLOR2' => '#'.$theme['fontcolor2'], 'T_FONTCOLOR3' => '#'.$theme['fontcolor3'], 'T_SPAN_CLASS1' => $theme['span_class1'], 'T_SPAN_CLASS2' => $theme['span_class2'], 'T_SPAN_CLASS3' => $theme['span_class3'], 'NAV_LINKS' => $nav_links_html) ); // // Show portal front page info/links? // if ( $page_id != 1 || $portal_config[top_phpbb_links] == 0 ) { $template->assign_block_vars('portal_top_links_off', array()); } // // Login box? // if ( !$userdata['session_logged_in'] ) { $template->assign_block_vars('switch_user_logged_out', array()); } else { $template->assign_block_vars('switch_user_logged_in', array()); if ( !empty($userdata['user_popup_pm']) ) { $template->assign_block_vars('switch_enable_pm_popup', array()); } } // Add no-cache control for cookies if they are set //$c_no_cache = (isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) || isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_data'])) ? 'no-cache="set-cookie", ' : ''; // Work around for "current" Apache 2 + PHP module which seems to not // cope with private cache control setting if (!empty($HTTP_SERVER_VARS['SERVER_SOFTWARE']) && strstr($HTTP_SERVER_VARS['SERVER_SOFTWARE'], 'Apache/2')) { header ('Cache-Control: no-cache, pre-check=0, post-check=0'); } else { header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0'); } header ('Expires: 0'); header ('Pragma: no-cache'); include( $mx_root_path . 'mx_meta.inc' ); $meta_str = '<meta name="title" content="' . $title .'" />' . "\n"; $meta_str .= '<meta name="author" content="' . $author .'" />' . "\n"; $meta_str .= '<meta name="copyright" content="' . $copyright .'" />' . "\n"; $meta_str .= '<meta name="keywords" content="' . $keywords .'" />' . "\n"; $meta_str .= '<meta name="description" lang="' . $langcode .'" content="'. $description .'" />' . "\n"; $meta_str .= '<meta name="category" content="' . $rating .'" />' . "\n"; $meta_str .= '<meta name="robots" content="' . $index . ',' . $follow .'" />' . "\n"; $meta_str .= $header . "\n"; $template->assign_vars(array( 'META' => $meta_str) ); $template->pparse('overall_header'); ?> --- NEW FILE: mx_constants.php --- <?php /*************************************************************************** * mx_constants.php * ------------------- * begin : May, 2002 * copyright : (C) 2002 MX-System * email : su...@mx... * * $Id: mx_constants.php,v 1.1 2005/05/06 06:47:58 jonohlsson 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. * ***************************************************************************/ if ( !defined('IN_PORTAL') ) { die("Hacking attempt"); } // Page numbers for session handling define('PAGE_FORUM' , -20); define('PAGE_ADS' , -21); define('PAGE_CALENDAR' , -22); define('PAGE_WELCOME' , -23); define('PAGE_LAST_MSG' , -24); define('PAGE_WELCOME_ADMIN', -25); define('PAGE_POLL' , -26); define('PAGE_URL' , -27); define('PAGE_WEATHER' , -28); define('PAGE_NEWS' , -37); define('PAGE_MENU_NAV' , -29); define('PAGE_ADS_POST' , -30); define('PAGE_ALBUM' , -39); 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_WEATHER_EDIT', -38); define('PAGE_ANNOUNCEMENT_ADMIN' , -35); // Table names define('ADS_TABLE', $mx_table_prefix.'block_ads'); define('WELCOME_TABLE', $mx_table_prefix.'welcome_msg'); define('WEB_LINKS_TABLE', $mx_table_prefix.'links'); define('PORTAL_TABLE', $mx_table_prefix.'portal'); define('WEATHER_TABLE', $mx_table_prefix.'weather'); define('MENU_NAV_TABLE', $mx_table_prefix.'menu_nav'); define('MENU_CAT_TABLE', $mx_table_prefix.'menu_categories'); define('CALENDAR_TABLE', $mx_table_prefix.'calendar'); define('CALENDAR_CAT_TABLE', $mx_table_prefix.'calendar_categories'); define('MODULE_TABLE', $mx_table_prefix.'module'); define('FUNCTION_TABLE', $mx_table_prefix.'function'); define('PARAMETER_TABLE', $mx_table_prefix.'parameter'); define('PARAMETER_OPTION_TABLE', $mx_table_prefix.'parameter_option'); define('PAGE_TABLE' , $mx_table_prefix.'page'); define('COLUMN_TABLE' , $mx_table_prefix.'column'); define('COLUMN_BLOCK_TABLE', $mx_table_prefix.'column_block'); define('BLOCK_TABLE', $mx_table_prefix.'block'); define('BLOCK_SYSTEM_PARAMETER_TABLE', $mx_table_prefix.'block_system_parameter'); define('BLOCK_USER_PARAMETER_TABLE', $mx_table_prefix.'block_user_parameter'); define('CONFIG_WEATHER_TABLE', $mx_table_prefix.'config_weather'); define('CONFIG_WEATHER_DET_TABLE', $mx_table_prefix.'config_weather_det'); define('DOWNLOAD_LICENSE_TABLE' , $mx_table_prefix.'download_license'); define('DOWNLOAD_CATEGORIES_TABLE', $mx_table_prefix.'download_cat'); define('DOWNLOAD_FILES_TABLE' , $mx_table_prefix.'download_files'); define('DOWNLOAD_VOTES_TABLE' , $mx_table_prefix.'download_votes'); define('AUTH_ANONYMOUS', 99); ?> --- NEW FILE: mx_functions.php --- <?php /*************************************************************************** * mx_functions.php * ------------------- * begin : May, 2002 * copyright : (C) 2002 MX-System * email : su...@mx... * * $Id: mx_functions.php,v 1.1 2005/05/06 06:47:58 jonohlsson 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. * [...1944 lines suppressed...] if ( !$p_result = $db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, "Could not query column list", "", __LINE__, __FILE__, $sql ); } $p_row = $db->sql_fetchrow( $p_result ); $return_key = $p_row['page_id']; if ( !empty( $return_key ) ) { return $return_key; } else { return ''; } } ?> |