TinyPortal 1.0.8 TinyPortal v1.0.8 beta 4 Bloc http://www.tinyportal.net $boarddir/index.php require_once($sourcedir . '/Security.php'); // TinyPortal include require_once($sourcedir . '/TPortal.php'); // Is the forum in maintenance mode? (doesn't apply to administrators.) // TinyPortal TPortal_init(); // Action and board are both empty... BoardIndex! if (empty($board) && empty($topic)) { require_once($sourcedir . '/BoardIndex.php'); return 'BoardIndex'; } // first..if the action is set, but empty, don't go any further if (isset($_REQUEST['action']) && $_REQUEST['action']=='') { require_once($sourcedir . '/BoardIndex.php'); return 'BoardIndex'; } // Action and board are both empty... maybe the portal page? if (empty($board) && empty($topic) && $settings['TPortal_front_type']!='boardindex') { require_once($sourcedir . '/TPortal.php'); return 'TPortal'; } if (empty($board) && empty($topic) && $settings['TPortal_front_type']=='boardindex' && (isset($_GET['cat']) || isset($_GET['page']))) { require_once($sourcedir . '/TPortal.php'); return 'TPortal'; } // Action and board are still both empty...and no portal startpage - BoardIndex! elseif (empty($board) && empty($topic) && $settings['TPortal_front_type']=='boardindex') { require_once($sourcedir . '/BoardIndex.php'); return 'BoardIndex'; } '.xml' => array('News.php', 'ShowXmlFeed'), 'tpadmin' => array('TPortalAdmin.php', 'TPortalAdmin'), 'forum' => array('BoardIndex.php', 'BoardIndex'), 'tpmod' => array('TPmodules.php', 'TPmodules'), $sourcedir/Load.php $settings = $themeData[0]; if (!empty($context['TPortal']['front_type'])){ $settings['TPortal_front_type'] = $context['TPortal']['front_type']; } // Start the linktree off empty.. $context['linktree'] = array(); // Start the linktree off empty..not quite, have to insert forum $context['linktree'] = array(array('url' => $scripturl . '?action=forum', 'name' => 'Forum')); // Build up the linktree. $context['linktree'] = array_merge( $context['linktree'], array(array( 'url' => $scripturl . '#' . $board_info['cat']['id'], 'name' => $board_info['cat']['name'] )), // Build up the linktree (adding TPortal forum index) $context['linktree'] = array_merge( $context['linktree'], array(array( 'url' => $scripturl . '?action=forum#' . $board_info['cat']['id'], 'name' => $board_info['cat']['name'] )), // The theme is the forum's default. else $ID_THEME = $modSettings['theme_guests']; // TinyPortal $newtheme=TP_loadTheme(); if($newtheme!=$ID_THEME && $newtheme>0) $ID_THEME=$newtheme; // end TinyPortal $themedir/index.template.php if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm'))) if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin'))) $current_action = 'search'; if (isset($_GET['dl'])) $current_action = 'dlmanager'; if (isset($_GET['board']) || isset($_GET['topic']) || $context['current_action']=='forum') $current_action = 'forum'; if ($context['current_action']=='tpadmin') $current_action = 'admin'; // Show the [help] button. if($settings['TPortal_front_type']!='boardindex') // Show the [forum] button. echo ($current_action=='forum' || $context['browser']['is_ie4']) ? ' ' : '' , ' '.$txt['tp-forum'].' ' , $current_action=='forum' ? ' ' : ''; // The end of tab section. echo '   '; // TinyPortal if($context['TPortal']['leftbar']) echo '*'; if($context['TPortal']['rightbar']) echo '*'; // TinyPortal end echo ' $boarddir/Themes/babylon/index.template.php *'; '; // TinyPortal if($context['TPortal']['showtop']) echo '* '; if($context['TPortal']['leftbar']) echo '*'; if($context['TPortal']['rightbar']) echo '*'; // TinyPortal end // Show the [home] and [help] buttons. echo ' ', ($settings['use_image_buttons'] ? '' . $txt[103] . '' : $txt[103]), '', $context['menu_separator'], ' ', ($settings['use_image_buttons'] ? '' . $txt[119] . '' : $txt[119]), '', $context['menu_separator']; // Show the [home] and [help] buttons. echo ' ', ($settings['use_image_buttons'] ? '' . $txt[103] . '' : $txt[103]), '', $context['menu_separator']; if($settings['TPortal_front_type']!='boardindex') echo ' ', ($settings['use_image_buttons'] ? 'Forum Index' : 'Forum Index'), '', $context['menu_separator']; echo ' ', ($settings['use_image_buttons'] ? '' . $txt[119] . '' : $txt[119]), '', $context['menu_separator']; $sourcedir/Subs.php $context['allow_admin'] = allowedTo(array('admin_forum', 'manage_boards', 'manage_permissions', 'moderate_forum', 'manage_membergroups', 'manage_bans', 'send_mail', 'edit_news', 'manage_attachments', 'manage_smileys')); // tinyportal // global $sourcedir; require_once($sourcedir.'/TPSubs.php'); TPcheckAdminAreas(); // end // // Admin area 'Members'. // TinyPortal global $sourcedir; require_once($sourcedir.'/TPSubs.php'); TPsetupAdminAreas(); // TinyPortal end function redirectexit($setLocation = '', $refresh = false) function redirectexit($setLocation = '', $refresh = false, $tp_not = false) // Put the session ID in. if (defined('SID') && SID != '') // TinyPortal if ($setLocation == $scripturl && !$tp_not) $setLocation .= '?action=forum'; // end $sourcedir/ManagePermissions.php // This is just a helpful array of permissions guests... cannot have. // TPortal foreach($context['TPortal']['permissonlist'] as $perm ) $permissionList['membergroup'][$perm['title']] = $perm['perms']; // end TinyPortal // All permission groups that will be shown in the left column. $leftPermissionGroups = array( 'general', 'calendar', 'maintenance', 'member_admin', 'general_board', 'topic', 'post', ); // All permission groups that will be shown in the left column. $leftPermissionGroups = array( 'general', 'maintenance', 'member_admin', 'profile', 'general_board', 'topic', 'post', ); $sourcedir/Security.php // Require a user who is logged in. (not a guest.) function is_not_guest($message = '') { global $user_info, $txt, $context; // TinyPortal TPortal_init(); $sourcedir/Errors.php // We don't have $txt yet, but that's okay... if (empty($txt)) die($error); // TinyPortal if(!isset($context['tp_prefix'])) TPortal_init(); // end $themedir/Help.template.php global $context, $settings, $options, $txt, $scripturl; echo '
'; global $context, $settings, $options, $txt, $scripturl; // Tinyportal echo '
    ' , $txt['tp-smfhelp'] , '   ' , $txt['tp-tphelp'] , '  
'; echo '
'; // end Tinyportal $sourcedir/Profile.php // Set the profile layer to be displayed. // TinyPortal $tp_areas = TP_fetchprofile_areas(); foreach($tp_areas as $tp) $sa_allowed[$tp['name']] = array(array('profile_view_any', 'profile_view_own'), array($tp['permission'])); // end TinyPortal // If you have permission to do something with this profile, you'll see one or more actions. // TinyPortal TP_fetchprofile_areas2($memID); $_REQUEST['sa']($memID); if(isset($_GET['tpmodule'])) { global $boarddir, $db_prefix; // prefix of the TP tables $tp_prefix = $db_prefix.'tp_'; $request = db_query("SELECT modulename,autoload_run FROM {$tp_prefix}modules WHERE active=1 and profile = '" . $_GET['sa'] . "'", __FILE__, __LINE__); if(mysql_num_rows($request)>0) { $what=mysql_fetch_assoc($request); mysql_free_result($request); // load the appropiate source file if(file_exists($boarddir .'/tp-files/tp-modules/' . $what['modulename']. '/Sources/'. $what['autoload_run'])) { require_once($boarddir .'/tp-files/tp-modules/' . $what['modulename']. '/Sources/'. $what['autoload_run']); } } $_GET['sa']($memID); } else $_REQUEST['sa']($memID); $boarddir/SSI.php require_once($sourcedir . '/Security.php'); require_once($sourcedir . '/TPortal.php'); $sourcedir/BoardIndex.php 'href' => $scripturl . '#' . $row_board['ID_CAT'], 'href' => $scripturl . '?action=forum#' . $row_board['ID_CAT'], $sourcedir/QueryString.php // Let's do something special for session ids! if (defined('SID') && SID != '') $buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?(?:' . SID . ';)((?:board|topic)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html?' . SID . '\$2\"'", $buffer); else $buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html\$2\"'", $buffer); // Let's do something special for session ids! if (defined('SID') && SID != '') $buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?(?:' . SID . ';)((?:board|topic|page|cat)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html?' . SID . '\$2\"'", $buffer); else $buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?((?:board|topic|page|cat)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html\$2\"'", $buffer); $sourcedir/Subs-Post.php function theme_postbox($msg) function theme_postbox($msg, $from_tp = false) // Load the Post template and language file. loadLanguage('Post'); loadTemplate('Post'); // Load the Post template and language file. loadLanguage('Post'); if(!$from_tp) loadTemplate('Post'); // Go! Supa-sub-template-smash! template_postbox($msg); // Go! Supa-sub-template-smash! if(!$from_tp) template_postbox($msg); else tp_renderbbc($msg); $sourcedir/Admin.php // You have to be able to do at least one of the below to see this page. isAllowedTo(array('admin_forum', 'manage_permissions', 'moderate_forum', 'manage_membergroups', 'manage_bans', 'send_mail', 'edit_news', 'manage_boards', 'manage_smileys', 'manage_attachments')); // You have to be able to do at least one of the below to see this page. $admPerms = TP_addPerms(); isAllowedTo($admPerms); $sourcedir/Post.php // Finally, load the template. // load TP if(!in_array('tp',$context['template_layers'])) { if(!isset($_REQUEST['preview']) || (!isset($_REQUEST['xml']) && isset($_REQUEST['preview']))) $context['template_layers'][] = 'tp'; }