|
From: Selven <sel...@us...> - 2007-06-12 05:04:48
|
Update of /cvsroot/mxbb/mx_faq In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv17695 Added Files: db_install.php db_upgrade.php faq.php faq_rules.pak index.htm rules.php Log Message: First Update --- NEW FILE: rules.php --- <?php /*************************************************************************** * rules.php * ------------------- * begin : Monday, Jun 24, 2006 * copyright : (C) 2006 phpBBModders * email : ad...@ph... * * $Id: rules.php,v 1.1 2007/06/12 05:04:40 selven81 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"); } // // Read Block Settings // $title = $mx_block->block_info['block_title']; $b_description = $mx_block->block_info['block_desc']; // Set vars to prevent naughtiness $faq = array(); // // Include the rules settings // include( $module_root_path.'language/lang_'.$board_config['default_lang'].'/lang_rules.'.$phpEx ); // // Pull the array data from the lang pack // $j = 0; $counter = 0; $counter_2 = 0; $faq_block = array(); $faq_block_titles = array(); for($i = 0; $i < count($faq); $i++) { if( $faq[$i][0] != '--' ) { $faq_block[$j][$counter]['id'] = $counter_2; $faq_block[$j][$counter]['question'] = $faq[$i][0]; $faq_block[$j][$counter]['answer'] = $faq[$i][1]; $counter++; $counter_2++; } else { $j = ( $counter != 0 ) ? $j + 1 : 0; $faq_block_titles[$j] = $faq[$i][1]; $counter = 0; } } // // Lets build a page ... // $page_title = $l_title; $template->set_filenames(array( //+MOD: DHTML Collapsible FAQ MOD 'body' => (isset($HTTP_GET_VARS['dhtml']) && $HTTP_GET_VARS['dhtml'] == 'no' ? 'rules_body.tpl' : 'rules_dhtml.tpl')) //-MOD: DHTML Collapsible FAQ MOD ); $template->assign_vars(array( //+MOD: DHTML Collapsible FAQ MOD 'U_CFAQ_JSLIB' => $module_root_path . 'templates/collapsible_faq.js', 'L_CFAQ_NOSCRIPT' => sprintf($lang['dhtml_faq_noscript'], ('<a href="'.append_sid("faq.$phpEx?dhtml=no".(isset($HTTP_GET_VARS['mode']) ? '&mode='.$HTTP_GET_VARS['mode'] : '')).'">'), '</a>'), //-MOD: DHTML Collapsible FAQ MOD 'L_FAQ_TITLE' => $l_title, 'L_BACK_TO_TOP' => $lang['Back_to_top']) ); for($i = 0; $i < count($faq_block); $i++) { if( count($faq_block[$i]) ) { $template->assign_block_vars('faq_block', array( 'BLOCK_TITLE' => $faq_block_titles[$i]) ); $template->assign_block_vars('faq_block_link', array( 'BLOCK_TITLE' => $faq_block_titles[$i]) ); for($j = 0; $j < count($faq_block[$i]); $j++) { $row_color = ( !($j % 2) ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( !($j % 2) ) ? $theme['td_class1'] : $theme['td_class2']; $template->assign_block_vars('faq_block.faq_row', array( 'ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'FAQ_QUESTION' => $faq_block[$i][$j]['question'], 'FAQ_ANSWER' => $faq_block[$i][$j]['answer'], 'U_FAQ_ID' => $faq_block[$i][$j]['id']) ); $template->assign_block_vars('faq_block_link.faq_row_link', array( 'ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'FAQ_LINK' => $faq_block[$i][$j]['question'], 'U_FAQ_LINK' => '#' . $faq_block[$i][$j]['id']) ); } } } $template->pparse('body'); ?> --- NEW FILE: db_upgrade.php --- <?php /** * * @package mxBB Portal Module - mx_navmenu * @version $Id: db_upgrade.php,v 1.1 2007/06/12 05:04:40 selven81 Exp $ * @copyright (c) 2002-2006 [Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ define( 'IN_PORTAL', true ); if ( !defined( 'IN_ADMIN' ) ) { $mx_root_path = './../../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include( $mx_root_path . 'common.' . $phpEx ); // Start session management $mx_user->init($user_ip, PAGE_INDEX); if ( !$userdata['session_logged_in'] ) { die( "Hacking attempt(1)" ); } if ( $userdata['user_level'] != ADMIN ) { die( "Hacking attempt(2)" ); } // End session management } $mx_module_version = '2.0.1'; $mx_module_copy = 'Original mxBB <i>Faq & Rules</i> module by <a href="http://phpms.sourceforge.net" target="_blank">Selven</a>'; $message = "<b>This is a fresh install!</b><br/><br/>"; $sql = array(); $sql[] = "UPDATE " . $mx_table_prefix . "module" . " SET module_version = '" . $mx_module_version . "', module_copy = '" . $mx_module_copy . "' WHERE module_id = '" . $mx_module_id . "'"; $message .= mx_do_install_upgrade( $sql ); echo "<br /><br />"; echo "<table width=\"90%\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" border=\"0\" class=\"forumline\">"; echo "<tr><th class=\"thHead\" align=\"center\">Module Installation/Upgrading/Uninstalling Information - module specific db tables</th></tr>"; echo "<tr><td class=\"row1\" align=\"left\"><span class=\"gen\">" . $message . "</span></td></tr>"; echo "</table><br />"; ?> --- NEW FILE: faq.php --- <?php /*************************************************************************** * faq.php * ------------------- * begin : Sunday, Jul 8, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: faq.php,v 1.1 2007/06/12 05:04:40 selven81 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"); } // // Read Block Settings // $title = $mx_block->block_info['block_title']; $b_description = $mx_block->block_info['block_desc']; $page1 = intval($HTTP_GET_VARS['page']); if ( $page1 > 0 ) { $page = $page1; } else { $page = 1; } // // Load common language // include($module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main_faq_editor.' . $phpEx); // Set vars to prevent naughtiness $faq = array(); // // Load the appropriate faq file // if( isset($HTTP_GET_VARS['mode']) ) { switch( $HTTP_GET_VARS['mode'] ) { case 'forum': $lang_file = 'lang_faq'; $l_title = $lang['FAQ']; break; case 'bbcode': $lang_file = 'lang_bbcode'; $l_title = $lang['BBCode_guide']; break; case 'portal': $lang_file = 'lang_portal_faq'; $l_title = $lang['Mx_Portal_faq']; break; case 'module': $lang_file = 'lang_faq_module'; $l_title = $lang['Mx_Module_faq']; break; default: $lang_file = 'lang_portal_faq'; $l_title = $lang['Mx_Portal_faq']; break; } } else { $lang_file = 'lang_portal_faq'; $l_title = $lang['Mx_Portal_faq']; } if($HTTP_GET_VARS['mode']== 'forum') { include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx); } elseif($HTTP_GET_VARS['mode']== 'bbcode') { include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx); } elseif($HTTP_GET_VARS['mode']== 'module') { include($module_root_path . 'language/' . $lang_file . '.' . $phpEx); } else { include($module_root_path . 'language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx); } // // Pull the array data from the lang pack // $j = 0; $counter = 0; $counter_2 = 0; $faq_block = array(); $faq_block_titles = array(); for($i = 0; $i < count($faq); $i++) { if( $faq[$i][0] != '--' ) { $faq_block[$j][$counter]['id'] = $counter_2; $faq_block[$j][$counter]['question'] = $faq[$i][0]; $faq_block[$j][$counter]['answer'] = $faq[$i][1]; $counter++; $counter_2++; } else { $j = ( $counter != 0 ) ? $j + 1 : 0; $faq_block_titles[$j] = $faq[$i][1]; $counter = 0; } } $template->set_filenames(array( //+MOD: DHTML Collapsible FAQ MOD 'body' => (isset($HTTP_GET_VARS['dhtml']) && $HTTP_GET_VARS['dhtml'] == 'no' ? 'faq_body.tpl' : 'faq_dhtml.tpl')) //-MOD: DHTML Collapsible FAQ MOD ); $template->assign_vars(array( 'U_PORTAL_FAQ' => $mx_root_path ."index.$phpEx?page=$page&mode=portal", 'L_PORTAL_FAQ' => $lang['Mx_Portal_faq'], 'U_MODULE_FAQ' => $mx_root_path ."index.$phpEx?page=$page&mode=module", 'L_MODULE_FAQ' => $lang['Mx_Module_faq'], 'U_FORUM_FAQ' => $mx_root_path ."index.$phpEx?page=$page&mode=forum", 'L_FORUM_FAQ' => $lang['Forum_faq'], 'U_BBCODE_FAQ' => $mx_root_path ."index.$phpEx?page=$page&mode=bbcode", 'L_BBCODE_FAQ' => $lang['BBcode_faq'], //+MOD: DHTML Collapsible FAQ MOD 'U_CFAQ_JSLIB' => $module_root_path . 'templates/collapsible_faq.js', 'L_CFAQ_NOSCRIPT' => sprintf($lang['dhtml_faq_noscript'], ('<a href="'.append_sid("faq.$phpEx?dhtml=no".(isset($HTTP_GET_VARS['mode']) ? '&mode='.$HTTP_GET_VARS['mode'] : '')).'">'), '</a>'), //-MOD: DHTML Collapsible FAQ MOD 'L_FAQ_TITLE' => $l_title, 'L_BACK_TO_TOP' => $lang['Back_to_top']) ); for($i = 0; $i < count($faq_block); $i++) { if( count($faq_block[$i]) ) { $template->assign_block_vars('faq_block', array( 'BLOCK_TITLE' => $faq_block_titles[$i]) ); $template->assign_block_vars('faq_block_link', array( 'BLOCK_TITLE' => $faq_block_titles[$i]) ); for($j = 0; $j < count($faq_block[$i]); $j++) { $row_color = ( !($j % 2) ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( !($j % 2) ) ? $theme['td_class1'] : $theme['td_class2']; $template->assign_block_vars('faq_block.faq_row', array( 'ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'FAQ_QUESTION' => $faq_block[$i][$j]['question'], 'FAQ_ANSWER' => $faq_block[$i][$j]['answer'], 'U_FAQ_ID' => $faq_block[$i][$j]['id']) ); $template->assign_block_vars('faq_block_link.faq_row_link', array( 'ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'FAQ_LINK' => $faq_block[$i][$j]['question'], 'U_FAQ_LINK' => '#' . $faq_block[$i][$j]['id']) ); } } } $template->pparse('body'); ?> --- NEW FILE: db_install.php --- <?php /** * * @package mxBB Portal Module - mx_navmenu * @version $Id: db_install.php,v 1.1 2007/06/12 05:04:40 selven81 Exp $ * @copyright (c) 2002-2006 [Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ define( 'IN_PORTAL', true ); if ( !defined( 'IN_ADMIN' ) ) { $mx_root_path = './../../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include( $mx_root_path . 'common.' . $phpEx ); // Start session management $mx_user->init($user_ip, PAGE_INDEX); if ( !$userdata['session_logged_in'] ) { die( "Hacking attempt(1)" ); } if ( $userdata['user_level'] != ADMIN ) { die( "Hacking attempt(2)" ); } // End session management } $mx_module_version = '2.0.1'; $mx_module_copy = 'Original mxBB <i>Faq & Rules</i> module by <a href="http://phpms.sourceforge.net" target="_blank">Selven</a>'; $message = "<b>This is a fresh install!</b><br/><br/>"; $sql = array(); $sql[] = "UPDATE " . $mx_table_prefix . "module" . " SET module_version = '" . $mx_module_version . "', module_copy = '" . $mx_module_copy . "' WHERE module_id = '" . $mx_module_id . "'"; $message .= mx_do_install_upgrade( $sql ); echo "<br /><br />"; echo "<table width=\"90%\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" border=\"0\" class=\"forumline\">"; echo "<tr><th class=\"thHead\" align=\"center\">Module Installation/Upgrading/Uninstalling Information - module specific db tables</th></tr>"; echo "<tr><td class=\"row1\" align=\"left\"><span class=\"gen\">" . $message . "</span></td></tr>"; echo "</table><br />"; ?> --- NEW FILE: faq_rules.pak --- module=+:52=+:Mx Faq and Rules=+:modules/mx_faq/=+:Faq and Rules Manager=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:52=+:54=+:MX Faq=+:Faq page=+:faq.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - MX Faq=+:Demo block=+:54=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:52=+:55=+:Mx Rules=+:Rules page=+:rules.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - Mx Rules=+:Demo block=+:55=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 function=+:0=+:0=+:0=+:endoflist=+:0=+:0 --- 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> |