|
From: Jon O. <jon...@us...> - 2008-01-28 22:21:11
|
Update of /cvsroot/mxbb/core/modules/mx_news/mx_news/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv26348/mx_news/includes Added Files: functions.php functions_admin.php functions_auth.php functions_comment.php functions_mx.php functions_mx_news.php index.htm mx_news_constants.php Log Message: New module. Based on the KB engine and reuse the core comments OO class to make a simple news/comments module, for wuick news. Very handy... --- NEW FILE: functions.php --- <?php /** * * @package mxBB Portal Module - mx_news * @version $Id: functions.php,v 1.1 2008/01/28 22:21:06 jonohlsson Exp $ * @copyright (c) 2002-2006 [Jon Ohlsson, Mohd Basri, wGEric, PHP Arena, pafileDB, CRLin] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if( !defined('IN_PORTAL') ) { die("Hacking attempt"); } /** * mx_news_functions. * * This class is used for general mx_news handling * * @access public * @author Jon Ohlsson * */ class mx_news_functions { /** * This class is used for general mx_news handling * * @param unknown_type $config_name * @param unknown_type $config_value */ function set_config( $config_name, $config_value ) { global $mx_news_cache, $db, $mx_news_config; $sql = "UPDATE " . MX_NEWS_CONFIG_TABLE . " SET config_value = '" . str_replace( "\'", "''", $config_value ) . "' WHERE config_name = '$config_name'"; if ( !$db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, "Failed to update mx_news configuration for $config_name", "", __LINE__, __FILE__, $sql ); } if ( !$db->sql_affectedrows() && !isset( $mx_news_config[$config_name] ) ) { $sql = 'INSERT INTO ' . MX_NEWS_CONFIG_TABLE . " (config_name, config_value) VALUES ('$config_name', '" . str_replace( "\'", "''", $config_value ) . "')"; if ( !$db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, "Failed to update mx_news configuration for $config_name", "", __LINE__, __FILE__, $sql ); } } $mx_news_config[$config_name] = $config_value; $mx_news_cache->put( 'config', $mx_news_config ); } function mx_news_config() { global $db; $sql = "SELECT * FROM " . MX_NEWS_CONFIG_TABLE; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldnt query mx_news configuration', '', __LINE__, __FILE__, $sql ); } while ( $row = $db->sql_fetchrow( $result ) ) { $mx_news_config[$row['config_name']] = trim( $row['config_value'] ); } $db->sql_freeresult( $result ); return ( $mx_news_config ); } /** * Enter description here... * * @param unknown_type $mode * @param unknown_type $page_id */ function generate_smilies( $mode, $page_id ) { global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path; global $user_ip, $session_length, $starttime; global $userdata, $mx_user; global $mx_root_path, $module_root_path, $is_block, $phpEx; $inline_columns = 4; $inline_rows = 5; $window_columns = 8; if ( $mode == 'window' ) { /* $userdata = session_pagestart( $user_ip, $page_id ); init_userprefs( $userdata ); */ $mx_user->init($user_ip, PAGE_INDEX); $gen_simple_header = true; $page_title = $lang['Review_topic'] . " - $topic_title"; include( $mx_root_path . 'includes/page_header.' . $phpEx ); $template->set_filenames( array( 'smiliesbody' => '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_root_path . $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' => mx_append_sid( $phpbb_root_path . "posting.$phpEx?mode=smilies" ) ) ); } $template->assign_vars( array( '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 ); } } // since that I can't use the original function with new template system // I just copy it and chagne it function sql_query_limit( $query, $total, $offset = 0 ) { global $db; $query .= ' LIMIT ' . ( ( !empty( $offset ) ) ? $offset . ', ' . $total : $total ); return $db->sql_query( $query ); } /** * page header. * */ function page_header() { global $mx_news_config, $lang, $userdata, $images, $action; global $mx_news, $HTTP_GET_VARS; global $template, $db, $theme, $gen_simple_header, $starttime, $phpEx, $board_config, $user_ip, $phpbb_root_path; global $admin_level, $level_prior, $tree, $do_gzip_compress; global $mx_root_path, $module_root_path, $is_block, $phpEx, $title; /* // // page header for mx_news // if ( $action == 'category' ) { if ( $mx_news->modules[$mx_news->module_name]->auth_user[$_REQUEST['cat_id']]['auth_post'] || $mx_news->modules[$mx_news->module_name]->auth_user[$_REQUEST['cat_id']]['auth_mod'] ) { $upload_url = mx_append_sid( $mx_news->this_mxurl( "action=user_upload&cat_id={$_REQUEST['cat_id']}" ) ); if ( !$mx_news_config['lock_submit_site'] ) { $template->assign_block_vars( 'ADD_LINK', array() ); } } $mcp_url = mx_append_sid( $mx_news->this_mxurl( "action=mcp&cat_id={$_REQUEST['cat_id']}" ) ); if ( $mx_news->modules[$mx_news->module_name]->auth_user[$_REQUEST['cat_id']]['auth_mod'] ) { $template->assign_block_vars( 'MCP', array() ); } } else { $upload_url = mx_append_sid( $mx_news->this_mxurl( "action=user_upload" ) ); } $template->set_filenames( array( 'mx_news_header' => "link_header.tpl" )); $template->assign_vars( array( 'L_TITLE' => $title, // BEGIN mx_news 'LINKS' => $lang['Links_Title'], 'U_LINK' => mx_append_sid( $mx_news->this_mxurl() ), // END mx_news 'L_SEARCH' => $lang['Link_Search'], 'L_UPLOAD' => $lang['AddLink'], 'L_MCP' => $lang['MCP_title'], 'L_VIEW_ALL' => $lang['Viewall'], 'L_DESCEND_BY_HITS' => $lang['Descend_by_hits'], 'L_DESCEND_BY_JOIN' => $lang['Descend_by_joindate'], 'L_STATS_MOST_POPULAR' => $lang['Link_most_popular'], 'L_STATS_LATEST' => $lang['Link_latest'], 'L_STATS_TOPRATED' => $lang['Link_toprated'], 'U_PASEARCH' => mx_append_sid( $mx_news->this_mxurl( "action=search" ) ), 'U_UPLOAD' => $upload_url, 'U_MCP' => $mcp_url, 'U_VIEW_ALL' => mx_append_sid( $mx_news->this_mxurl( "action=viewall" ) ), 'U_DESCEND_BY_HITS' => mx_append_sid( $mx_news->this_mxurl( "action=viewall&&sort_method=link_hits&sort_order=DESC" ) ), 'U_DESCEND_BY_JOIN' => mx_append_sid( $mx_news->this_mxurl( "action=viewall&sort_method=link_time&sort_order=DESC" ) ), 'U_DESCEND_BY_RATINGS' => mx_append_sid( $mx_news->this_mxurl( "action=viewall&sort_method=rating&sort_order=DESC" ) ), 'U_PORTAL_PAGE' => $page_id )); // // Ratings enabled for any category ? // if ( !empty( $mx_news->modules[$mx_news->module_name]->cat_rowset ) ) { foreach( $mx_news->modules[$mx_news->module_name]->cat_rowset as $cat_id => $cat_row ) { if ( $mx_news->modules[$mx_news->module_name]->ratings[$cat_id]['activated'] ) { $template->assign_block_vars( 'switch_toprated', array() ); break; } } } $template->pparse( 'mx_news_header' ); */ } /** * page footer. * */ function page_footer() { global $lang, $board_config, $userdata, $phpbb_root_path, $mx_root_path, $module_root_path, $is_block, $phpEx, $page_id; global $mx_news_cache, $mx_news; global $phpEx, $template, $do_gzip_compress, $debug, $db, $starttime; // // page footer for mx_news // /* $template->set_filenames( array( 'link_footer' => "link_footer.tpl" ) ); $template->assign_vars( array( 'L_JUMP' => $lang['Jump'], 'JUMPMENU' => $mx_news->modules[$mx_news->module_name]->generate_jumpbox( 0, 0, array( $_GET['cat_id'] => 1, true, true, 'auth_view' ) ), 'S_JUMPBOX_ACTION' => mx_append_sid( $mx_news->this_mxurl() ), 'MX_PAGE' => $page_id, 'S_HIDDEN_VARS' => $s_hidden_vars, 'S_TIMEZONE' => sprintf( $lang['All_times'], $lang[number_format( $board_config['board_timezone'] )] ), ) ); $mx_news->modules[$mx_news->module_name]->_mx_news(); $template->pparse( 'link_footer' ); */ $mx_news_cache->unload(); } } /** * mx_news_notification. * * This class extends general mx_notification class * * // MODE: MX_PM_MODE/MX_MAIL_MODE, $id: get all file/article data for this id * $mx_notification->init($mode, $id); // MODE: MX_PM_MODE/MX_MAIL_MODE * * // MODE: MX_PM_MODE/MX_MAIL_MODE, ACTION: MX_NEW_NOTIFICATION/MX_EDITED_NOTIFICATION/MX_APPROVED_NOTIFICATION/MX_UNAPPROVED_NOTIFICATION * $mx_notification->notify( $mode = MX_PM_MODE, $action = MX_NEW_NOTIFICATION, $to_id, $from_id, $subject, $message, $html_on, $bbcode_on, $smilies_on ) * * @access public * @author Jon Ohlsson */ class mx_news_notification extends mx_notification { /** * Enter description here... * * @param unknown_type $item_id */ function init( $item_id = 0) { global $db, $lang, $module_root_path, $phpbb_root_path, $mx_root_path, $phpEx, $userdata, $mx_news; // ======================================================= // item id is not set, give him/her a nice error message // ======================================================= if (empty($item_id)) { mx_message_die(GENERAL_ERROR, 'Bad Init pars'); } unset($this->langs); // // Build up generic lang keys // $this->langs['item_not_exist'] = $lang['Link_not_exist']; $this->langs['module_title'] = $lang['mx_news_prefix']; $this->langs['notify_subject_new'] = $lang['mx_news_notify_subject_new']; $this->langs['notify_subject_edited'] = $lang['mx_news_notify_subject_edited']; $this->langs['notify_subject_approved'] = $lang['mx_news_notify_subject_approved']; $this->langs['notify_subject_unapproved'] = $lang['mx_news_notify_subject_unapproved']; $this->langs['notify_subject_deleted'] = $lang['mx_news_notify_subject_deleted']; $this->langs['notify_new_body'] = $lang['mx_news_notify_new_body']; $this->langs['notify_edited_body'] = $lang['mx_news_notify_edited_body']; $this->langs['notify_approved_body'] = $lang['mx_news_notify_approved_body']; $this->langs['notify_unapproved_body'] = $lang['mx_news_notify_unapproved_body']; $this->langs['notify_deleted_body'] = $lang['mx_news_notify_deleted_body']; $this->langs['item_title'] = $lang['Link']; $this->langs['author'] = $lang['Submiter']; $this->langs['item_description'] = $lang['Desc']; $this->langs['item_type'] = ''; $this->langs['category'] = $lang['Sitecat']; $this->langs['read_full_item'] = $lang['Read_full_link']; $this->langs['edited_item_info'] = $lang['Edited_Link_info']; /* switch ( SQL_LAYER ) { case 'oracle': $sql = "SELECT f.*, AVG(r.rate_point) AS rating, COUNT(r.votes_link) AS total_votes, u.user_id, u.username FROM " . LINKS_TABLE . " AS f, " . LINK_VOTES_TABLE . " AS r, " . USERS_TABLE . " AS u, " . LINK_CATEGORIES_TABLE . " AS c WHERE f.link_id = r.votes_link(+) AND f.user_id = u.user_id(+) AND c.cat_id = a.link_catid AND f.link_id = '" . $item_id . "' GROUP BY f.link_id "; break; default: $sql = "SELECT f.*, AVG(r.rate_point) AS rating, COUNT(r.votes_link) AS total_votes, u.user_id, u.username FROM " . LINKS_TABLE . " AS f LEFT JOIN " . LINK_CATEGORIES_TABLE . " AS cat ON f.link_catid = cat.cat_id LEFT JOIN " . LINK_VOTES_TABLE . " AS r ON f.link_id = r.votes_link LEFT JOIN " . USERS_TABLE . " AS u ON f.user_id = u.user_id WHERE f.link_id = '" . $item_id . "' GROUP BY f.link_id "; break; } if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldnt Query link info', '', __LINE__, __FILE__, $sql ); } // =================================================== // file doesn't exist' // =================================================== if ( !$item_data = $db->sql_fetchrow( $result ) ) { mx_message_die( GENERAL_MESSAGE, $this->langs['Item_not_exist'] ); } $db->sql_freeresult( $result ); */ unset($this->data); // // File data // $this->data['item_id'] = $item_id; $this->data['item_title'] = $item_data['link_name']; $this->data['item_desc'] = $item_data['link_longdesc']; // // Category data // $this->data['item_category_id'] = $item_data['cat_id']; $this->data['item_category_name'] = $item_data['cat_name']; // // File author // $this->data['item_author_id'] = $item_data['user_id']; $this->data['item_author'] = ( $item_data['user_id'] != ANONYMOUS ) ? $item_data['username'] : $lang['Guest']; // // File editor // $this->data['item_editor_id'] = $userdata['user_id']; $this->data['item_editor'] = ( $userdata['user_id'] != '-1' ) ? $userdata['username'] : $lang['Guest']; $mx_root_path_tmp = $mx_root_path; // Stupid workaround, since phpbb posts need full paths. $mx_root_path = ''; $this->temp_url = PORTAL_URL . $mx_news->this_mxurl("action=" . "main&link_id=" . $this->data['item_id'], false, true); $mx_root_path = $mx_root_path_tmp; } } ?> --- NEW FILE: functions_admin.php --- <?php /** * * @package mxBBmodule_mx_news * @version $Id: functions_admin.php,v 1.1 2008/01/28 22:21:06 jonohlsson Exp $ * @copyright (c) 2002-2006 [wGEric, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } /** * Public mx_news_admin class. * */ class mx_news_admin extends mx_news_public { /** * load admin module * * @param unknown_type $module_name send module name to load it */ function adminmodule( $module_name ) { if ( !class_exists( 'mx_news_' . $module_name ) ) { global $module_root_path, $phpEx; $this->module_name = $module_name; require_once( $module_root_path . 'mx_news/admin/admin_' . $module_name . '.' . $phpEx ); eval( '$this->modules[' . $module_name . '] = new mx_news_' . $module_name . '();' ); if ( method_exists( $this->modules[$module_name], 'init' ) ) { $this->modules[$module_name]->init(); } } } /** * Enter description here... * * @param unknown_type $sel_id * @param unknown_type $use_default_option * @param unknown_type $select_name * @return unknown */ function get_forums( $sel_id = 0, $use_default_option = false, $select_name = 'forum_id' ) { global $db, $lang; $sql = "SELECT forum_id, forum_name FROM " . FORUMS_TABLE; if ( !$result = $db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, "Couldn't get list of forums", "", __LINE__, __FILE__, $sql ); } $forumlist = '<select name="'.$select_name.'">'; if ( $sel_id == 0 ) { $forumlist .= '<option value="0" selected >'.$lang['Select_topic_id'].'</option>'; } if ( $use_default_option ) { $status = $sel_id == "-1" ? "selected" : ""; $forumlist .= '<option value="-1" '.$status.' >::'.$lang['Use_default'].'::</option>'; } while ( $row = $db->sql_fetchrow( $result ) ) { if ( $sel_id == $row['forum_id'] ) { $status = "selected"; } else { $status = ''; } $forumlist .= '<option value="' . $row['forum_id'] . '" ' . $status . '>' . $row['forum_name'] . '</option>'; } $forumlist .= '</select>'; return $forumlist; } } ?> --- NEW FILE: functions_mx_news.php --- <?php /** * * @package mxBB Portal Module - mx_news * @version $Id: functions_mx_news.php,v 1.1 2008/01/28 22:21:06 jonohlsson Exp $ * @copyright (c) 2002-2006 [Jon Ohlsson, Mohd Basri, wGEric, PHP Arena, pafileDB, CRLin] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if( !defined('IN_PORTAL') ) { die("Hacking attempt"); } /** * mx_news class * */ class mx_news extends mx_news_auth { var $comments = array(); var $information = array(); var $notification = array(); var $modified = false; var $error = array(); var $page_title = ''; var $block_id = ''; var $debug = false; // Toggle debug output on/off var $debug_msg = array(); /** * Prepare data * */ function init() { global $db, $userdata, $debug, $mx_news_config, $mx_block; unset( $this->block_id ); unset( $this->comments ); unset( $this->information ); unset( $this->notification ); $this->block_id = $mx_block->block_id; /* $sql = 'SELECT * FROM ' . LINK_CATEGORIES_TABLE . ' ORDER BY cat_order ASC'; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldnt Query categories info', '', __LINE__, __FILE__, $sql ); } $cat_rowset = $db->sql_fetchrowset( $result ); $db->sql_freeresult( $result ); $this->auth( AUTH_ALL, AUTH_LIST_ALL, $userdata, $cat_rowset ); for( $i = 0; $i < count( $cat_rowset ); $i++ ) { if ( $this->auth_user[$cat_rowset[$i]['cat_id']]['auth_view'] ) { $this->cat_rowset[$cat_rowset[$i]['cat_id']] = $cat_rowset[$i]; $this->subcat_rowset[$cat_rowset[$i]['cat_parent']][$cat_rowset[$i]['cat_id']] = $cat_rowset[$i]; $this->total_cat++; // // Comments // Note: some settings are category dependent, but may use default config settings // $this->comments[$cat_rowset[$i]['cat_id']]['activated'] = $cat_rowset[$i]['cat_allow_comments'] == -1 ? ($mx_news_config['use_comments'] == 1 ? true : false ) : ( $cat_rowset[$i]['cat_allow_comments'] == 1 ? true : false ); $this->comments[$cat_rowset[$i]['cat_id']]['internal_comments'] = $cat_rowset[$i]['internal_comments'] == -1 ? ($mx_news_config['internal_comments'] == 1 ? true : false ) : ( $cat_rowset[$i]['internal_comments'] == 1 ? true : false ); // phpBB or internal comments $this->comments[$cat_rowset[$i]['cat_id']]['autogenerate_comments'] = $cat_rowset[$i]['autogenerate_comments'] == -1 ? ($mx_news_config['autogenerate_comments'] == 1 ? true : false ) : ( $cat_rowset[$i]['autogenerate_comments'] == 1 ? true : false ); // autocreate comments when updated $this->comments[$cat_rowset[$i]['cat_id']]['comments_forum_id'] = $cat_rowset[$i]['comments_forum_id'] < 1 ? ( intval($mx_news_config['comments_forum_id']) ) : ( intval($cat_rowset[$i]['comments_forum_id']) ); // phpBB target forum (only used for phpBB comments) if ($this->comments[$cat_rowset[$i]['cat_id']]['activated'] && !$this->comments[$cat_rowset[$i]['cat_id']]['internal_comments'] && intval($this->comments[$cat_rowset[$i]['cat_id']]['comments_forum_id']) < 1) { mx_message_die(GENERAL_ERROR, 'Init Failure, phpBB comments with no target forum_id :(<br> Category: ' . $cat_rowset[$i]['cat_name'] . ' Forum_id: ' . $this->comments[$cat_rowset[$i]['cat_id']]['comments_forum_id']); } // // Ratings // $this->ratings[$cat_rowset[$i]['cat_id']]['activated'] = $cat_rowset[$i]['cat_allow_ratings'] == -1 ? ($mx_news_config['use_ratings'] == 1 ? true : false ) : ( $cat_rowset[$i]['cat_allow_ratings'] == 1 ? true : false ); // // Information // $this->information[$cat_rowset[$i]['cat_id']]['activated'] = $cat_rowset[$i]['show_pretext'] == -1 ? ($mx_news_config['show_pretext'] == 1 ? true : false ) : ( $cat_rowset[$i]['show_pretext'] == 1 ? true : false ); // phpBB or internal ratings // // Notification // $this->notification[$cat_rowset[$i]['cat_id']]['activated'] = $cat_rowset[$i]['notify'] == -1 ? (intval($mx_news_config['notify'])) : ( intval($cat_rowset[$i]['notify']) ); // -1, 0, 1, 2 $this->notification[$cat_rowset[$i]['cat_id']]['notify_group'] = $cat_rowset[$i]['notify_group'] == -1 || $cat_rowset[$i]['notify_group'] == 0 ? (intval($mx_news_config['notify_group'])) : ( intval($cat_rowset[$i]['notify_group']) ); // Group_id } } */ // // Comments // $this->comments[$this->block_id]['activated'] = true; switch($portal_config['portal_backend']) { case 'internal': $this->comments[$this->block_id]['internal_comments'] = true; // phpBB or internal comments $this->comments[$this->block_id]['comments_forum_id'] = 0; // phpBB target forum (only used for phpBB comments) break; default: $this->comments[$this->block_id]['internal_comments'] = ($mx_news_config['internal_comments'] == 1 ? true : false ); // phpBB or internal comments $this->comments[$this->block_id]['comments_forum_id'] = ( intval($mx_news_config['comments_forum_id']) ); // phpBB target forum (only used for phpBB comments) break; } if ($this->comments[$this->block_id]['activated'] && !$this->comments[$this->block_id]['internal_comments'] && intval($this->comments[$this->block_id]['comments_forum_id']) < 1) { mx_message_die(GENERAL_ERROR, 'Init Failure, phpBB comments with no target forum_id :(<br> Block: ' . $this->block_id . ' Forum_id: ' . $this->comments[$block_id]['comments_forum_id']); } // // Notification // $this->notification[$this->block_id]['activated'] = (intval($mx_news_config['notify'])); // -1, 0, 1, 2 $this->notification[$this->block_id]['notify_group'] = (intval($mx_news_config['notify_group'])); // Group_id } /** * Clean up * */ function _mx_news() { if ( $this->modified ) { //$this->sync_all(); } } /** * Add debug message. * * @param unknown_type $debug_msg * @param unknown_type $file * @param unknown_type $line_break */ function debug($debug_msg, $file = '', $line_break = true) { if ($this->debug) { $module_name = !empty($this->module_name) ? $this->module_name . ' :: ' : ''; $file = !empty($file) ? ' (' . $file . ')' : ''; $line_break = $line_break ? '<br>' : ''; $this->debug_msg[] = $line_break . $module_name . $debug_msg . $file ; } } /** * Display debug message. * * @return unknown */ function display_debug() { if ($this->debug) { $debug_message = ''; foreach ($this->debug_msg as $key => $value) { $debug_message .= $value; } return $debug_message; } } /** * Enter description here... * * @param unknown_type $true_false */ function modified( $true_false = false ) { $this->modified = $true_false; } /** * url rewrites. * * @param unknown_type $args * @param unknown_type $force_standalone_mode * @param unknown_type $non_html_amp * @return unknown */ function this_mxurl( $args = '', $force_standalone_mode = false, $non_html_amp = false, $pageId = '' ) { global $mx_root_path, $module_root_path, $page_id, $phpEx, $is_block; $pageId = empty($pageId) ? $page_id : $pageId; if ($_GET['dynamic_block'] != '') { $args = 'dynamic_block='. $_GET['dynamic_block'] . ($args == '' ? '' : '&' ) . $args; } $args .= ($args == '' ? '' : '&' ) . 'modrewrite=no'; if ( !MXBB_MODULE ) { $mxurl = $module_root_path . 'mx_news.' . $phpEx . ( $args == '' ? '' : '?' . $args ); return $mxurl; } if ( $force_standalone_mode || !$is_block ) { $mxurl = $mx_root_path . 'modules/mx_news/mx_news.' . $phpEx . ( $args == '' ? '' : '?' . $args ); } else { $mxurl = $mx_root_path . 'index.' . $phpEx; if ( is_numeric( $pageId ) ) { $mxurl .= '?page=' . $pageId . ( $args == '' ? '' : ( $non_html_amp ? '&' : '&' ) . $args ); } else { $mxurl .= ( $args == '' ? '' : '?' . $args ); } } return $mxurl; } // ============================================= // Admin and mod functions // ============================================= /** * Enter description here... * * @param unknown_type $link_data * @param unknown_type $item_id * @param unknown_type $cid * @param unknown_type $subject * @param unknown_type $message * @param unknown_type $html_on * @param unknown_type $bbcode_on * @param unknown_type $smilies_on */ function update_add_comment($link_data = '', $item_id, $cid, $subject = '', $message = '', $html_on = false, $bbcode_on = true, $smilies_on = false, $allow_wysiwyg = false) { global $template, $mx_news_functions, $lang, $board_config, $phpEx, $mx_news_config, $db, $images, $userdata; global $html_entities_match, $html_entities_replace, $unhtml_specialchars_match, $unhtml_specialchars_replace; global $mx_root_path, $module_root_path, $phpbb_root_path, $is_block, $phpEx, $mx_request_vars; // // Ensure we have article_data defined // /* if (!is_array($link_data) && !empty($item_id) && $item_id > 0) { $sql = "SELECT * FROM " . LINKS_TABLE . " WHERE link_id = '" . $item_id . "'"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldnt select link', '', __LINE__, __FILE__, $sql ); } if ( !$link_data = $db->sql_fetchrow( $result ) ) { mx_message_die( GENERAL_MESSAGE, $lang['Link_not_exsist'] ); } $db->sql_freeresult( $result ); } */ $link_data['link_catid'] = $this->block_id; // // vars (can both be POSTed or send through the function) // $update_comment = $cid > 0 ? true : false; $subject = !empty($subject) ? $subject : $_POST['subject']; $message = !empty($message) ? $message : $_POST['message']; $length = strlen( $message ); // // Instantiate the mx_text class // $mx_text = new mx_text(); $mx_text->init($html_on, $bbcode_on, $smilies_on); $mx_text->allow_all_html_tags = $allow_wysiwyg; // // Encode for db storage // $title = $mx_text->encode_simple($subject); $comments_text = $mx_text->encode($message); $comment_bbcode_uid = $mx_text->bbcode_uid; if ( $length > $mx_news_config['max_comment_chars'] ) { mx_message_die( GENERAL_ERROR, 'Your comment is too long!<br/>The maximum length allowed in characters is ' . $mx_news_config['max_comment_chars'] . '' ); } if ( $update_comment ) { if ( $this->comments[$link_data['link_catid']]['internal_comments'] ) { $sql = "UPDATE " . MX_NEWS_COMMENTS_TABLE . " SET comments_text = '" . str_replace( "\'", "''", $comments_text ) . "', comments_title = '" . str_replace( "\'", "''", $title ) . "', comment_bbcode_uid = '" . $comment_bbcode_uid . "' WHERE comments_id = " . $cid . " AND block_id = ". $item_id; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldnt update comments', '', __LINE__, __FILE__, $sql ); } } else { include( $module_root_path . 'mx_news/includes/functions_comment.' . $phpEx ); $mx_news_comments = new mx_news_comments(); $mx_news_comments->init( $item_id ); $return_data = $mx_news_comments->post( 'update', $cid, $title, $comments_text, $userdata['user_id'], $userdata['username'], 0, '', '', $comment_bbcode_uid); } } else { if ( $this->comments[$link_data['link_catid']]['internal_comments'] ) { $time = time(); $poster_id = intval( $userdata['user_id'] ); $sql = "INSERT INTO " . MX_NEWS_COMMENTS_TABLE . "(block_id, comments_text, comments_title, comments_time, comment_bbcode_uid, poster_id) VALUES('$item_id','" . str_replace( "\'", "''", $comments_text ) . "','" . str_replace( "\'", "''", $title ) . "','$time', '$comment_bbcode_uid','$poster_id')"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldnt insert comments', '', __LINE__, __FILE__, $sql ); } } else { include( $module_root_path . 'mx_news/includes/functions_comment.' . $phpEx ); $mx_news_comments = new mx_news_comments(); $mx_news_comments->init( $item_id ); $return_data = $mx_news_comments->post( 'insert', '', $title, $comments_text, $userdata['user_id'], $userdata['username'], 0, '', '', $comment_bbcode_uid); } } if ( !$this->comments[$link_data['link_catid']]['internal_comments'] ) { /* // // Update the item data itself // if ($file_data['topic_id'] == 0 ) { // // Update item with new topic_id // $sql = "UPDATE " . LINKS_TABLE . " SET topic_id = '" . $return_data['topic_id'] . "' WHERE link_id = ". $item_id; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldnt update item', '', __LINE__, __FILE__, $sql ); } $db->sql_freeresult( $result ); } */ } } /** * Enter description here... * * @param unknown_type $block_id * @param unknown_type $mode_notification */ function update_add_comment_notify( $block_id = false, $mode_notification = 'edit' ) { global $db, $portal_config; if ( in_array( $mode_notification, array( 'add', 'edit', 'do_approve', 'do_unapprove', 'delete' ) ) ) { if (!$block_id) { die('bad update_add_file_notify arg'); } if (is_array( $block_id ) && !empty( $block_id )) { $fileIdsArray = $block_id; } else { $fileIdsArray[] = $block_id; } foreach($fileIdsArray as $fileId) { /* $sql = "SELECT link_catid FROM " . LINKS_TABLE . " WHERE link_id = '" . $fileId . "'"; if ( !$result = $db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, 'Couldn\'t get link info', '', __LINE__, __FILE__, $sql ); } $row = $db->sql_fetchrow( $result ); $catId = $row['link_catid']; */ // // Notification // //if ( $this->notification[$catId]['activated'] > 0 ) // -1, 0, 1, 2 if ( $this->notification[$block_id]['activated'] > 0 ) // -1, 0, 1, 2 { // // Instatiate notification // $mx_news_notification = new mx_news_notification(); $mx_news_notification->init( $block_id ); // // Now send notification // $mx_notification_mode = $this->notification[$block_id]['activated'] == 1 ? MX_PM_MODE : MX_MAIL_MODE; switch ( $mode_notification ) { case 'add': $mx_notification_action = MX_NEW_NOTIFICATION; break; case 'edit': $mx_notification_action = MX_EDITED_NOTIFICATION; break; case 'do_approve': $mx_notification_action = MX_APPROVED_NOTIFICATION; break; case 'do_unapprove': $mx_notification_action = MX_UNAPPROVED_NOTIFICATION; break; case 'delete': $mx_notification_action = MX_DELETED_NOTIFICATION; break; } $html_entities_match = array('#&(?!(\#[0-9]+;))#', '#<#', '#>#', '#"#'); $html_entities_replace = array('&', '<', '>', '"'); echo('a'.$mx_notification_mode.'a'.$mx_notification_action); $mx_news_notification->notify( $mx_notification_mode, $mx_notification_action ); if ( $this->notification[$block_id]['notify_group'] > 0 ) { $mx_news_notification->notify( $mx_notification_mode, $mx_notification_action, - intval($this->notification[$block_id]['notify_group']) ); } } } } } } /** * Public mx_news class * */ class mx_news_public extends mx_news { var $modules = array(); var $module_name = ''; /** * load module * * @param unknown_type $module_name send module name to load it */ function module( $module_name ) { if ( !class_exists( 'mx_news_' . $module_name ) ) { global $module_root_path, $phpEx; $this->module_name = $module_name; require_once( $module_root_path . 'mx_news/modules/mx_news_' . $module_name . '.' . $phpEx ); eval( '$this->modules[' . $module_name . '] = new mx_news_' . $module_name . '();' ); if ( method_exists( $this->modules[$module_name], 'init' ) ) { $this->modules[$module_name]->init(); } } } /** * this will be replaced by the loaded module * * @param unknown_type $module_id * @return unknown */ function main( $module_id = false ) { return false; } /** * go ahead and output the page * * @param unknown_type $page_title send page title * @param unknown_type $tpl_name template file name */ function display( $page_title1, $tpl_name ) { global $page_title, $mx_news_tpl_name; $page_title = $page_title1; $mx_news_tpl_name = $tpl_name; } } ?> --- NEW FILE: functions_mx.php --- <?php /** * * @package mxBBmodule_mx_news * @version $Id: functions_mx.php,v 1.1 2008/01/28 22:21:06 jonohlsson Exp $ * @copyright (c) 2002-2006 [wGEric, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if( !defined('IN_PORTAL') ) { die("Hacking attempt"); } if ( !function_exists( mx_smilies_pass ) ) { /** * Enter description here... * * @param unknown_type $message * @return unknown */ function mx_smilies_pass($message) { global $board_config; $smilies_path = $board_config['smilies_path']; $board_config['smilies_path'] = PHPBB_URL . $board_config['smilies_path']; $message = smilies_pass($message); $board_config['smilies_path'] = $smilies_path; return $message; } } if ( !function_exists( mx_generate_smilies ) ) { /** * Enter description here... * * @param unknown_type $mode * @param unknown_type $page_id */ function mx_generate_smilies($mode, $page_id) { global $board_config, $template, $phpEx; $smilies_path = $board_config['smilies_path']; $board_config['smilies_path'] = PHPBB_URL . $board_config['smilies_path']; generate_smilies($mode, $page_id); $board_config['smilies_path'] = $smilies_path; $template->assign_vars(array( 'U_MORE_SMILIES' => mx_append_sid(PHPBB_URL . "posting.$phpEx?mode=smilies")) ); } } if ( !function_exists( mx_message_die ) ) { /** * Enter description here... * * @param unknown_type $msg_code * @param unknown_type $msg_text * @param unknown_type $msg_title * @param unknown_type $err_line * @param unknown_type $err_file * @param unknown_type $sql */ 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, $nav_links, $gen_simple_header, $images; global $userdata, $user_ip, $session_length; global $starttime; message_die($msg_code, $msg_text, $msg_title, $err_line, $err_file, $sql); } } if ( !function_exists( mx_is_group_member ) ) { /** * Validates if user belongs to group included in group_ids list * Also, adds all usergroups to userdata array * * @param unknown_type $group_ids * @param unknown_type $group_mod_mode * @return unknown */ function mx_is_group_member( $group_ids = '', $group_mod_mode = false ) { global $userdata, $db; if ( $group_ids == '' ) { return false; } $group_ids_array = explode(",", $group_ids); // Try to reuse usergroups result. if ( $group_mod_mode ) { $userdata_key = 'mx_usergroups_mod' . $userdata['user_id']; if ( empty( $userdata[$userdata_key] ) ) { // Check if user is group moderator.. $sql = "SELECT gr.group_id FROM " . GROUPS_TABLE . " gr, " . USER_GROUP_TABLE . " ugr WHERE gr.group_id = ugr.group_id AND gr.group_moderator = '" . $userdata['user_id'] . "' AND ugr.user_pending = '0' "; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not query group rights information", '', '', '', '' ); } $group_row = $db->sql_fetchrowset( $result ); $userdata[$userdata_key_mod] = $group_row; } } else { $userdata_key = 'mx_usergroups' . $userdata['user_id']; if ( empty( $userdata[$userdata_key] ) ) { // Check if user is member of the proper group.. $sql = "SELECT group_id FROM " . USER_GROUP_TABLE . " WHERE user_id='" . $userdata['user_id'] . "' AND user_pending = 0"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not query group rights information", '', '', '', '' ); } $group_row = $db->sql_fetchrowset( $result ); $userdata[$userdata_key] = $group_row; } } for ( $i = 0; $i < count( $userdata[$userdata_key] ); $i++ ) { if ( in_array( $userdata[$userdata_key][$i]['group_id'], $group_ids_array ) ) { $is_member = true; return $is_member; } } return false; } } if ( !function_exists(mx_do_install_upgrade) ) { /** * Generating output. * * @param unknown_type $sql * @param unknown_type $main_install * @return unknown */ function mx_do_install_upgrade( $sql = '', $main_install = false ) { global $table_prefix, $mx_table_prefix, $userdata, $phpEx, $template, $lang, $db, $board_config, $HTTP_POST_VARS; $inst_error = false; $n = 0; $message = "<b>This is the result list of the SQL queries needed for the install/upgrade</b><br /><br />"; while ( $sql[$n] ) { if ( !$result = $db->sql_query( $sql[$n] ) ) { $message .= '<b><font color=#FF0000>[Error or Already added]</font></b> line: ' . ( $n + 1 ) . ' , ' . $sql[$n] . '<br />'; $inst_error = true; } else { $message .= '<b><font color=#0000fF>[Added/Updated]</font></b> line: ' . ( $n + 1 ) . ' , ' . $sql[$n] . '<br />'; } $n++; } $message .= '<br /> If you get some Errors, Already Added or Updated messages, relax, this is normal when updating modules'; if ( $main_install ) { if ( !$inst_error ) { $message .= '-> no db errors :-)<br /><br /><b>Portal installed successfully! </b><hr><br /><br />'; $message .= '1) Now, delete the /install and /contrib folders!!!<br /><br />'; $message .= '2) If you haven\'t already done a db backup, now is the time ;)<br /><br />'; $message .= '3) Then (after step 1), you HAVE to configure MX core and its modules from within the adminCP, simply \'upgrade\' MX portal Core and all modules in use!!!<br /><br />'; $message .= 'Click <a href=../admin/admin_mx_module.php>Here</a> to administer/upgrade the portal/modules. You will be promted for an admin username and pass. The upgrade process provide informative output...'; } else { $message .= '<br /><br /><b>Portal installed successfully (with some warnings)! </b><hr><br /><br />'; $message .= '1) Now, delete the /install and /contrib folders!!!<br /><br />'; $message .= '2) If you haven\'t already done a db backup, now is the time ;)<br /><br />'; $message .= '3) Now (after step 1), you HAVE to configure MX core and its modules from within the adminCP, simply \'upgrade\' MX portal Core and all modules in use!!!<br /><br />'; $message .= 'Click <a href=../admin/admin_mx_module.php>Here</a> to administer/upgrade the portal/modules. You will be promted for an admin username and pass. The upgrade process provide informative output...'; } } return $message; } } ?> --- NEW FILE: functions_comment.php --- <?php /** * * @package mxBBmodule_mx_news * @version $Id: functions_comment.php,v 1.1 2008/01/28 22:21:06 jonohlsson Exp $ * @copyright (c) 2002-2006 [Mohd Basri, PHP Arena, linkdb, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } /** * Enter description here... * */ class mx_news_comments extends mx_comments { /** * Enter description here... * * @param unknown_type $item_data * @param unknown_type $comments_type */ function init( $item_data, $comments_type = 'internal' ) { global $mx_news, $mx_news_config, $db, $images, $mx_block, $board_config; if ( !is_object($mx_news) || empty($mx_news_config) ) { mx_message_die(GENERAL_ERROR, 'Bad global arguments'); } /* if (!is_array($item_data) && !empty($item_data)) { $sql = 'SELECT * FROM ' . LINKS_TABLE . " WHERE link_id = $item_data"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); } $item_data = $db->sql_fetchrow( $result ); } */ $item_data['link_catid'] = $mx_news->modules[$mx_news->module_name]->block_id; $item_data['link_id'] = $mx_news->modules[$mx_news->module_name]->block_id; $item_data['topic_id'] = $mx_news->modules[$mx_news->module_name]->block_id; $this->comments_type = $comments_type == 'internal' ? 'internal' : 'phpbb'; $this->cat_id = $item_data['link_catid']; $this->item_id = $item_data['link_id']; $this->topic_id = $item_data['topic_id']; $this->item_table = LINKS_TABLE; $this->comments_table = MX_NEWS_COMMENTS_TABLE; $this->table_field_id = 'block_id'; // // Auth // $this->forum_id = $mx_news->modules[$mx_news->module_name]->comments[$this->block_id]['comments_forum_id']; $this->auth['auth_view'] = $mx_block->auth_view; $this->auth['auth_post'] = $mx_block->auth_edit; $this->auth['auth_edit'] = $mx_block->auth_edit; $this->auth['auth_delete'] = $mx_block->auth_mod; $this->auth['auth_mod'] = $mx_block->auth_mod; // // Pagination // $this->pagination_action = 'action=news'; $this->pagination_target = 'block_id='; $this->pagination_num = empty($show_num_comments) ? $this->pagination_num : $show_num_comments; $this->u_pagination = $mx_news->this_mxurl( $this->pagination_action . "&" . $this->pagination_target . $this->item_id . '&modrewrite=no' ); // // Configs // $this->allow_wysiwyg = $mx_news_config['allow_wysiwyg']; $this->allow_comment_wysiwyg = $mx_news_config['allow_comment_wysiwyg']; $this->allow_comment_bbcode = $mx_news_config['allow_comment_bbcode']; $this->allow_comment_html = $mx_news_config['allow_comment_html']; $this->allow_comment_smilies = $mx_news_config['allow_comment_smilies']; $this->allow_comment_links = $mx_news_config['allow_comment_links']; $this->allow_comment_images = $mx_news_config['allow_comment_images']; $this->no_comment_image_message = $mx_news_config['no_comment_image_message']; $this->no_comment_link_message = $mx_news_config['no_comment_link_message']; $this->max_comment_subject_chars = $mx_news_config['max_comment_subject_chars']; $this->max_comment_chars = $mx_news_config['max_comment_chars']; $this->formatting_comment_truncate_links = $mx_news_config['formatting_comment_truncate_links']; $this->formatting_comment_image_resize = $mx_news_config['formatting_comment_image_resize']; $this->formatting_comment_wordwrap = $mx_news_config['formatting_comment_wordwrap']; $this->images = array( 'icon_minipost' => $images['mx_news_icon_minipost'], 'comment_post' => $images['mx_news_comment_post'], 'icon_edit' => $images['mx_news_icon_edit'], 'icon_delpost' => $images['mx_news_icon_delpost']); $this->u_post = $mx_news->this_mxurl( 'action=post_news&item_id=' . $this->item_id . '&modrewrite=no'); $this->u_edit = $mx_news->this_mxurl( 'action=post_news&item_id=' . $this->item_id . '&modrewrite=no'); $this->u_delete = $mx_news->this_mxurl( "action=post_news&delete=do&item_id=".$this->item_id . '&modrewrite=no'); } /** * Enter description here... * * @param unknown_type $ranks */ function obtain_ranks( &$ranks ) { global $db, $mx_news_cache; die('d'); if ( $mx_news_cache->exists( 'ranks' ) ) { $ranks = $mx_news_cache->get( 'ranks' ); } else { $sql = "SELECT * FROM " . RANKS_TABLE . " ORDER BY rank_special, rank_min"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not obtain ranks information.", '', __LINE__, __FILE__, $sql ); } $ranks = array(); while ( $row = $db->sql_fetchrow( $result ) ) { $ranks[] = $row; } $db->sql_freeresult( $result ); $mx_news_cache->put( 'ranks', $ranks ); } } } ?> --- NEW FILE: functions_auth.php --- <?php /** * * @package mxBBmodule_mx_kb * @version $Id: functions_auth.php,v 1.1 2008/01/28 22:21:06 jonohlsson Exp $ * @copyright (c) 2002-2006 [wGEric, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } /** * Enter description here... * */ class mx_news_auth { } ?> --- NEW FILE: mx_news_constants.php --- <?php /** * * @package mxBB Portal Module - mx_news * @version $Id: mx_news_constants.php,v 1.1 2008/01/28 22:21:06 jonohlsson Exp $ * @copyright (c) 2002-2006 [Jon Ohlsson, Mohd Basri, wGEric, PHP Arena, pafileDB, CRLin] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } if ( !MXBB_MODULE ) { $server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://'; $server_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['server_name'])); $server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) : ''; $script_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['script_path'])); $script_name = ($script_name == '') ? $script_name : '/' . $script_name; define( 'PORTAL_URL', $server_protocol . $server_name . $server_port . $script_name . '/' ); define( 'PHPBB_URL', PORTAL_URL ); //$kb_config['news_operate_mode'] = false; $mx_table_prefix = $table_prefix; $is_block = false; } define( 'MX_NEWS_ROOT_CAT', 0 ); // // Tables // define( 'MX_NEWS_COMMENTS_TABLE', $mx_table_prefix . 'simplenews_comments' ); define( 'MX_NEWS_CONFIG_TABLE', $mx_table_prefix . 'simplenews_config' ); // // Field Types // define( 'INPUT', 0 ); define( 'TEXTAREA', 1 ); define( 'RADIO', 2 ); define( 'SELECT', 3 ); define( 'SELECT_MULTIPLE', 4 ); define( 'CHECKBOX', 5 ); if ( !MXBB_MODULE || MXBB_27x ) { $mx_news_module_version = "Simple News Manager v. 1.0.0"; $mx_news_module_author = "Jon"; } else { if (is_object($mx_page)) { // ------------------------------------------------------------------------- // Extend User Style with module lang and images // Usage: $mx_user->extend(LANG, IMAGES) // Switches: // - LANG: MX_LANG_MAIN (default), MX_LANG_ADMIN, MX_LANG_ALL, MX_LANG_NONE // - IMAGES: MX_IMAGES (default), MX_IMAGES_NONE // ------------------------------------------------------------------------- $mx_user->extend(); $mx_page->add_copyright( 'mxBB News Module' ); } } ?> --- NEW FILE: index.htm --- <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> </body> </html> |