problem with themes to default

Started by Loffen, July 15, 2011, 02:07:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mindless

#4
I know whats going on - Your moving themes about and neglecting to check if there's $CURUSER checks in place.

function stdhead($title = "", $msgalert = true, $stdhead = false) {
    global $CURUSER, $INSTALLER09, $lang, $free, $_NO_COMPRESS, $querytime, $query_stat, $q, $mc1, $BLOCKS, $CURBLOCK;
    if (!$INSTALLER09['site_online'])
    die("Site is down for maintenance, please check back again later... thanks<br />");
    if ($title == "")
    $title = $INSTALLER09['site_name'] .(isset($_GET['tbv'])?" (".TBVERSION.")":'');
    else
    $title = $INSTALLER09['site_name'].(isset($_GET['tbv'])?" (".TBVERSION.")":''). " :: " . htmlspecialchars($title); 
    if ($CURUSER)
    {
    $INSTALLER09['stylesheet'] = isset($CURUSER['stylesheet']) ? "{$CURUSER['stylesheet']}.css" : $INSTALLER09['stylesheet'];
    $INSTALLER09['categorie_icon'] = isset($CURUSER['categorie_icon']) ? "{$CURUSER['categorie_icon']}" : $INSTALLER09['categorie_icon'];
    }
    /** ZZZZZZZZZZZZZZZZZZZZZZZZZZip it! **/
    if (!isset($_NO_COMPRESS))
    if (!ob_start('ob_gzhandler'))
    ob_start();
    //== Include js files needed only for the page being used by pdq
    $js_incl = '';
    $js_incl .= '<!-- javascript goes here or in footer -->';
    if (!empty($stdhead['js'])) {
    foreach ($stdhead['js'] as $JS)
    $js_incl .= "<script type='text/javascript' src='{$INSTALLER09['baseurl']}/scripts/".$JS.".js'></script>";
    }
    //== Include css files needed only for the page being used by pdq
    $css_incl = '';
    $css_incl .= '<!-- css goes here or in footer -->';
    if (!empty($stdhead['css'])) {
    foreach ($stdhead['css'] as $CSS)
    $css_incl .= "<link type='text/css' rel='stylesheet' href='{$INSTALLER09['baseurl']}/css/".$CSS.".css' />";
    }
    if (isset($INSTALLER09['xhtml_strict'])) { //== Use strict mime type/doctype
    //== Only if browser/user agent supports xhtml
    if (stristr($_SERVER['HTTP_ACCEPT'],'application/xhtml+xml') && ($INSTALLER09['xhtml_strict'] === 1 || $INSTALLER09['xhtml_strict'] == $CURUSER['username'])) {
    header('Content-type:application/xhtml+xml; charset='.$INSTALLER09['char_set']);
    $doctype ='<?xml version="1.0" encoding="'.$INSTALLER09['char_set'].'"?>'.'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" '.'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'.'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'.$INSTALLER09['language'].'">';
    }
    }
    if (!isset($doctype)) {
    header('Content-type:text/html; charset='.$INSTALLER09['char_set']);
    $doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"'.'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'.'<html xmlns="http://www.w3.org/1999/xhtml">';
    }
    $htmlout = $doctype."<head>
    <meta http-equiv='Content-Language' content='en-us' />
    <!-- ####################################################### -->
    <!-- #   This website is powered by installer09 source     # -->
    <!-- #   Download and support at: https://09source.kicks-ass.net # -->
    <!-- ####################################################### -->
    <title>{$title}</title>
      <link rel='shortcut icon' href='favicon.ico' />
      <link rel='stylesheet' href='templates/6/6.css' type='text/css' />
      <script type='text/javascript' src='./scripts/jquery.js'></script>
      <script type='text/javascript' src='./scripts/jquery.lightbox-0.5.min.js'></script>
    <link rel='stylesheet' type='text/css' href='css/jquery.lightbox-0.5.css' media='screen' />
    <script type='text/javascript' src='./scripts/jquery.status.js'></script>
    <script type='text/javascript'>
    /*<![CDATA[*/
    function themes() {
    window.open('take_theme.php','My themes','height=150,width=200,resizable=no,scrollbars=no,toolbar=no,menubar=no');
    }
    /*]]>*/
    </script>
    <script type='text/javascript'>
    /*<![CDATA[*/
    function radio() {
    window.open('radio_popup.php','My Radio','height=700,width=800,resizable=no,scrollbars=no,toolbar=no,menubar=no');
    }
    /*]]>*/
    </script>
    <script type='text/javascript'>
    /*<![CDATA[*/
    $('document').ready(function () {
    $(\"a[rel='lightbox']\").lightBox(); // Select all links that contains lightbox in the attribute rel
    });
    /*]]>*/
    </script>
      <link rel='alternate' type='application/rss+xml' title='Latest Torrents' href='./rss.php?passkey={$CURUSER['passkey']}' />
    <link rel='stylesheet' type='text/css' href='bbcode/markitup/skins/markitup/style.css' />
      <link rel='stylesheet' type='text/css' href='bbcode/markitup/sets/bbcode/style.css' />
    {$js_incl}{$css_incl}
      </head>
    <body>
    <div id='arounder'>
    <div id='top_head'>
    <div id='logo'></div></div>
    <div id='top_heada'>";
    if ($CURUSER) {
    $htmlout .= StatusBar();
    $htmlout .="</div><div id='menu'>";
    $htmlout .= "<ul>";
    if( $CURUSER['class'] > UC_STAFF ){
    $htmlout .= "<li><a href='staffpanel.php'>ADMIN</a></li>";
    }
    $htmlout .= "<li><a href='staff.php'>SUPPORT</a></li>
    <li><a href='faq.php'>FAQ</a></li>
    <li><a href='rules.php'>RULES</a></li>";
    if( $CURUSER['class'] <= UC_VIP ){
    $htmlout .= "<li><a href='uploadapp.php'>UPLOAD APP</a></li>";
    }
    if( $CURUSER['class'] >= UC_UPLOADER )
       {
    $htmlout .= "<li><a href='upload.php'>UPLOAD</a></li>";
    }   
    $htmlout .= "
    <li><a href='browse.php'>BROWSE</a></li>
    <li><a href='usercp.php'>PROFILE</a></li>
    <li><a href='forums.php'>FORUMS</a></li>
    <li><a href='index.php'>HOME</a></li></ul>";   
    $htmlout .= "</div>
    <div class='shadow'></div>
    <div id='site-txt'>
    <table class='mainouter' width='100%' border='0' cellspacing='0' cellpadding='10'>
    <tr><td align='center'>
    <div id='base_globelmessage'>
    <div id='gm_taps'>
    <ul class='gm_taps'>
    <li><b>Current Site Alerts:</b></li>";
    //== Stdhead alerts
    if (curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_REPORTS && $BLOCKS['global_staff_report_on']){
      require(BLOCK_DIR.'global/report.php');
      }

      if (curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_UPLOADAPP && $BLOCKS['global_staff_uploadapp_on']){
      require(BLOCK_DIR.'global/uploadapp.php');
      }

    if (curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_HAPPYHOUR && $BLOCKS['global_happyhour_on']){
    require(BLOCK_DIR.'global/happyhour.php');
    }

      if (curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_STAFF_MESSAGE && $BLOCKS['global_staff_warn_on']){
      require(BLOCK_DIR.'global/staffmessages.php');
      }
       
    if (curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_NEWPM && $BLOCKS['global_message_on']){
    require(BLOCK_DIR.'global/message.php');
    }

      if (curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_DEMOTION && $BLOCKS['global_demotion_on']){
      require(BLOCK_DIR.'global/demotion.php');
      }

    if (curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_FREELEECH && $BLOCKS['global_freeleech_on']){
    require(BLOCK_DIR.'global/freeleech.php');
    }

    if (curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_CRAZYHOUR && $BLOCKS['global_crazyhour_on']){
    require(BLOCK_DIR.'global/crazyhour.php');
    }
     
    if (curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_BUG_MESSAGE && $BLOCKS['global_bug_message_on']){
      require(BLOCK_DIR.'global/bugmessages.php');
      }
   
    $htmlout .="</ul></div></div>";
    }
   
    return $htmlout;
    } // stdhead


Now in future if your going to swap stuff about check the code first to see it was wrapped within $CURUSER - Your Iwall stdhead should be like above - Statusbar, menu and block require_once calls wrapped within :

if($CURUSER){
code to be hidden from not logged in users here
}


You use the Default V2 theme as reference - look at the code look where if ($CURUSER) { begins then match the next } using your editor and you'll see that all require_once for all blocks need to be wrapped from non logged in members because if your not logged in you cant load the class file for it hence the error your seeing, The reference is the Default template so use it.

Loffen

still problem :( i have iwall2 :)

Notice: Undefined index: global_stdhead in /home/xxxxxx/public_html/templates/6/template.php on line 126

Notice: Undefined index: global_stdhead in /home/xxxxxx/public_html/templates/6/template.php on line 130

Notice: Undefined index: global_stdhead in /home/xxxxxx/public_html/templates/6/template.php on line 134

Notice: Undefined index: global_stdhead in /home/xxxxxx/public_html/templates/6/template.php on line 138

Notice: Undefined index: global_stdhead in /home/xxxxxx/public_html/templates/6/template.php on line 142

Notice: Undefined index: global_stdhead in /home/xxxxxx/public_html/templates/6/template.php on line 146

Notice: Undefined index: global_stdhead in /home/xxxxxx/public_html/templates/6/template.php on line 150

Notice: Undefined index: global_stdhead in /home/xxxxxx/public_html/templates/6/template.php on line 154

Mindless

Probably missing that on template.php - can be added to bittorrent.php :

Code (php) Select
require_once CLASS_DIR.'class_blocks_stdhead.php';

Loffen

only default theme work  :(

every themes i get this on login

its all block
Notice: Undefined index: global_stdhead in /home/xxxx/public_html/templates/6/template.php on line 129