function fetch($tplfile, $cache_id = null, $compile_id = null, $display = false)
 {
     if ($this->tplbase == 'base') {
         $tpldir = wp_base() . '/templates';
     } else {
         if ($this->tplbase == 'theme') {
             $tplpath = get_custom_path('templates/' . $tplfile);
             $tpldir = dirname($tplpath);
             $tplfile = basename($tplpath);
         } else {
             $tpldir = wp_base() . '/' . $this->tplbase . '/templates';
         }
     }
     $this->template_dir = $tpldir;
     if (!$compile_id) {
         if ($this->tplbase == 'theme') {
             $compile_id = wp_prefix() . $GLOBALS['xoopsConfig']['theme_set'] . '_';
         } else {
             $compile_id = wp_prefix() . $this->tplbase . '_';
         }
     }
     return parent::fetch($tplfile, $cache_id, $compile_id, $display);
 }
     $_wpTpl->display('profile-IErightclick.html');
     include 'admin-footer.php';
     break;
 default:
     init_param('GET', 'standalone', 'integer', 0);
     $GLOBALS['standalone'] = get_param('standalone');
     $GLOBALS['title'] = 'Edit Profile';
     include_once 'admin-header.php';
     require_once XOOPS_ROOT_PATH . '/class/template.php';
     init_param('GET', 'updated', 'string', '');
     $userObject =& $userHandler->get($GLOBALS['user_ID']);
     include XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
     $_form = new XoopsThemeForm(_LANG_WPF_SUBT_EDIT, 'profile', $_this_file);
     $_form->addElement(new XoopsFormLabel(_LANG_WPF_SUBT_USERID, $userObject->getVar('ID', 'e')));
     $_form->addElement(new XoopsFormLabel(_LANG_WPF_SUBT_LEVEL, $userObject->getVar('user_level', 'e')));
     $_form->addElement(new XoopsFormLabel(_LANG_WPF_SUBT_POSTS, $userObject->getNumPosts(wp_prefix())));
     $_form->addElement(new XoopsFormLabel(_LANG_WPF_SUBT_LOGIN, $userObject->getVar('user_login', 'e')));
     $_form->addElement(new XoopsFormText(_LANG_WPF_SUBT_FIRST, 'newuser_firstname', 50, 150, $userObject->getVar('user_firstname', 'e')));
     $_form->addElement(new XoopsFormText(_LANG_WPF_SUBT_LAST, 'newuser_lastname', 50, 150, $userObject->getVar('user_lastname', 'e')));
     $_form->addElement(new XoopsFormTextArea(_LANG_WPF_SUBT_DESC, 'user_description', $userObject->getVar('user_description', 'e'), 5, 60));
     $_form->addElement(new XoopsFormText(_LANG_WPF_SUBT_NICK, 'newuser_nickname', 50, 150, $userObject->getVar('user_nickname', 'e')), true);
     $_form->addElement(new XoopsFormText(_LANG_WPF_SUBT_MAIL, 'newuser_email', 50, 150, $userObject->getVar('user_email', 'e')), true);
     $_form->addElement(new XoopsFormText(_LANG_WPF_SUBT_URL, 'newuser_url', 50, 150, $userObject->getVar('user_url', 'e')));
     $_form->addElement(new XoopsFormText(_LANG_WPF_SUBT_ICQ, 'newuser_icq', 50, 150, $userObject->getVar('user_icq', 'e') ? $userObject->getVar('user_icq', 'e') : ''));
     $_form->addElement(new XoopsFormText(_LANG_WPF_SUBT_AIM, 'newuser_aim', 50, 150, $userObject->getVar('user_aim', 'e')));
     $_form->addElement(new XoopsFormText(_LANG_WPF_SUBT_MSN, 'newuser_msn', 50, 150, $userObject->getVar('user_msn', 'e')));
     $_form->addElement(new XoopsFormText(_LANG_WPF_SUBT_YAHOO, 'newuser_yim', 50, 150, $userObject->getVar('user_yim', 'e')));
     $_form_idmode = new XoopsFormSelect(_LANG_WPF_SUBT_IDENTITY, 'newuser_idmode', $userObject->getVar('user_idmode', 'e'));
     $_form_idmode->addOption('nickname', $userObject->getVar('user_nickname'));
     $_form_idmode->addOption('login', $userObject->getVar('user_login'));
     $_form_idmode->addOption('firstname', $userObject->getVar('user_firstname'));
         $link_category = $linkRecord->getVar('link_category');
         $category_options = $linkCategoryHandler->getOptionArray();
         include 'include/link-manager-form.php';
     }
     include 'admin-footer.php';
     break;
 case _LANG_WLM_SHOW_BUTTONTEXT:
     init_param('POST', 'cat_id', 'string', 'All', true);
     init_param('POST', 'order_by', 'string', 'link_name', true);
     $_SESSION[wp_prefix() . 'links_show_cat_id'] = intval($cat_id);
     $_SESSION[wp_prefix() . 'links_show_order'] = $order_by;
     //break; fall through
 //break; fall through
 default:
     $links_show_cat_id = init_param('SESSION', wp_prefix() . 'links_show_cat_id', 'integer', '');
     $links_show_order = init_param('SESSION', wp_prefix() . 'links_show_order', 'string', '');
     if (!empty($links_show_cat_id)) {
         $cat_id = intval($links_show_cat_id);
     }
     if (empty($cat_id)) {
         if (empty($links_show_cat_id)) {
             $cat_id = 'All';
         }
     }
     if (!empty($links_show_order)) {
         $order_by = $links_show_order;
     }
     if (empty($order_by)) {
         $order_by = 'link_name';
     }
     $standalone = 0;
$GLOBALS['wpdb']->postmeta[$GLOBALS['wp_id']] = $GLOBALS['table_prefix'][$GLOBALS['wp_id']] . 'postmeta';
// This is the name of the include directory. No "/" allowed.
require 'wp-ver.php';
require_once $GLOBALS['wp_base'][$GLOBALS['wp_id']] . '/wp-includes/functions.php';
require_once wp_base() . '/class/wp_classes.php';
if (empty($GLOBALS['wpPostHandler'][wp_prefix()])) {
    $GLOBALS['wpPostHandler'][wp_prefix()] =& new WordPressPostHandler($GLOBALS['xoopsDB'], wp_prefix(), wp_mod());
    $GLOBALS['wpPost2CatHandler'][wp_prefix()] =& new WordPressPost2CatHandler($GLOBALS['xoopsDB'], wp_prefix(), wp_mod());
    $GLOBALS['wpPostMetaHandler'][wp_prefix()] =& new WordPressPostMetaHandler($GLOBALS['xoopsDB'], wp_prefix(), wp_mod());
    $GLOBALS['wpCommentHandler'][wp_prefix()] =& new WordPressCommentHandler($GLOBALS['xoopsDB'], wp_prefix(), wp_mod());
    $GLOBALS['wpUserHandler'][wp_prefix()] =& new WordPressUserHandler($GLOBALS['xoopsDB'], wp_prefix(), wp_mod());
    $GLOBALS['wpCategoryHandler'][wp_prefix()] =& new WordPressCategoryHandler($GLOBALS['xoopsDB'], wp_prefix(), wp_mod());
    $GLOBALS['wpLinkHandler'][wp_prefix()] =& new WordPressLinkHandler($GLOBALS['xoopsDB'], wp_prefix(), wp_mod());
    $GLOBALS['wpLinkCategoryHandler'][wp_prefix()] =& new WordPressLinkCategoryHandler($GLOBALS['xoopsDB'], wp_prefix(), wp_mod());
    $GLOBALS['wpOptionGroup2OptionHandler'][wp_prefix()] =& new WordPressOptionGroup2OptionHandler($GLOBALS['xoopsDB'], wp_prefix(), wp_mod());
    $GLOBALS['wpOptionHandler'][wp_prefix()] =& new WordPressOptionHandler($GLOBALS['xoopsDB'], wp_prefix(), wp_mod());
}
require_once wp_base() . '/wp-includes/wp-tickets.php';
require_once wp_base() . '/wp-includes/functions-formatting.php';
require_once wp_base() . '/wp-includes/functions-filter.php';
require_once wp_base() . '/wp-includes/kses.php';
if (get_settings('hack_file')) {
    include_once wp_base() . '/my-hacks.php';
}
require 'wp-config-extra.php';
require_once wp_base() . '/wp-includes/template-functions.php';
require_once wp_base() . '/wp-includes/class-xmlrpc.php';
require_once wp_base() . '/wp-includes/class-xmlrpcs.php';
require_once wp_base() . '/wp-includes/links.php';
if (empty($GLOBALS['cache_categories'][wp_id()]) || count($GLOBALS['cache_categories'][wp_id()]) == 0) {
    $GLOBALS['cache_categories'][wp_id()] = array();
         }
         break;
 }
 // switch end
 /*				 * ***********************************************************************
  * getting comments (for each post/page indiviually so we can assign them)
  * ************************************************************************ */
 switch ($post['type']) {
     case 'post':
         $ctype = 'news';
         break;
     case 'page':
         $ctype = 'pages';
         break;
 }
 $comments = wp_query_full_array("\n\t\t\t\t\t\t\tSELECT comment_post_ID, comment_author, comment_author_email, comment_author_url,comment_date, comment_content, comment_approved\n\t\t\t\t\t\t\tFROM " . wp_prefix('comments', $wp_prefix) . "\n\t\t\t\t\t\t\tWHERE comment_approved = 1 AND comment_post_ID = " . $post['id'], $wpdbconnection);
 $commentcount = '';
 $commentexists_count = '';
 if ($comments) {
     $postinfo .= '<ul>';
     foreach ($comments as $comment) {
         $comment['comment_author'] = $_zp_UTF8->convert($comment['comment_author']);
         $comment['comment_author_email'] = $comment['comment_author_email'];
         $comment['comment_author_url'] = $comment['comment_author_url'];
         $comment['comment_date'] = $comment['comment_date'];
         $comment['comment_content'] = nl2br($_zp_UTF8->convert($comment['comment_content']));
         if (getcheckboxState('convertlinefeeds')) {
             $comment['comment_content'] = nl2br($comment['comment_content']);
         }
         $comment_approved = sanitize_numeric($comment['comment_approved']);
         if ($comment_approved == 1) {
     break;
 case 'viewprofile':
     init_param('GET', 'user', 'integer', NO_DEFAULT_PARAM, true);
     $userObject =& $userHandler->get(get_param('user'));
     if (!$userObject) {
         redirect_header(wp_siteurl(), 0, _LANG_P_CHEATING_ERROR);
     }
     if (isset($GLOBALS['xoopsUser']) && $GLOBALS['xoopsUser']->getVar('uname') == $userObject->getVar('user_login')) {
         header('Location: ' . $_this_file . '?standalone=1');
     }
     $GLOBALS['standalone'] = 1;
     $GLOBALS['title'] = "View Profile";
     require_once 'admin-header.php';
     $_userinfo =& $userObject->getVarArray();
     $_userinfo['uniqname'] = $userObject->get_uniqname();
     $_userinfo['numposts'] = $userObject->getNumPosts(wp_prefix());
     $_userinfo['user_email'] = make_clickable($_userinfo['user_email']);
     $_userinfo['user_url'] = make_clickable($_userinfo['user_url']);
     $_userinfo['user_icq'] = $_userinfo['user_icq'] > 0 ? make_clickable($_userinfo['user_icq']) : '';
     $_wpTpl =& new WordPresTpl('wp-admin');
     $_wpTpl->assign('user_ID', $GLOBALS['user_ID']);
     $_wpTpl->assign('userinfo', $_userinfo);
     $_wpTpl->display('profile-viewprofile.html');
     include 'admin-footer.php';
     break;
 case 'IErightclick':
     $GLOBALS['standalone'] = 1;
     $GLOBALS['title'] = 'IE Right Click Register';
     require_once 'admin-header.php';
     require_once XOOPS_ROOT_PATH . '/class/template.php';
     $_regedit = "REGEDIT4\r\n[HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\MenuExt\\Post To &WP : " . get_settings('blogname') . "]\r\n@=\"" . wp_siteurl() . "/wp-admin/bookmarklet.jp.php\"\r\n\"contexts\"=hex:31\"";