TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,245
  • Total Topics: 21,354
  • Online today: 565
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online

Web Site Width [Needing 100%]

Started by Gav-Aus, November 14, 2011, 06:12:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IchBin

Is that still associated with the undefined index - allow_admin error?

lurkalot

Dunno Brad. 

I searched for the fix as you suggested to me, and came across a zip you posted here, http://www.tinyportal.net/index.php?topic=34077.msg272607#msg272607 which I asked Gav to unzip and replace the files it contained.  This seems to have fixed the titles issue.  Can't see the allow_admin error in the log now.  Just a load of these other ones.

IchBin

You'll need to turn off template eval in order to get a more precise error. I don't think there are even 600+ lines in the TPortal.template.php file.

lurkalot

I was afraid you were going to say that, lol..  SMF1 doesn't have that setting built in,   I haven't a clue how to do it now, been nearly a year using SMF2  :-[

Freddy


lurkalot

Thanks, I remeber doing that on my old site. 

For now though, I just uploaded and activated this mod.  http://custom.simplemachines.org/mods/index.php?mod=2054

Errors are  same different now as far as I can see,   ;)


http://austeamracing.com/index.php?page=Drivers List
2: Invalid argument supplied for foreach()
File: /home/auste6/public_html/Themes/nascar08_11/index.template.php
Line: 621

http://austeamracing.com/index.php?page=15
2: Invalid argument supplied for foreach()
File: /home/auste6/public_html/Themes/nascar08_11/index.template.php
Line: 621

http://austeamracing.com/index.php?page=Penalty System
2: Invalid argument supplied for foreach()
File: /home/auste6/public_html/Themes/nascar08_11/index.template.php
Line: 621

http://austeamracing.com/index.php?page=16
2: Invalid argument supplied for foreach()
File: /home/auste6/public_html/Themes/nascar08_11/index.template.php
Line: 621




IchBin

Now just post what is in the code on that line number of the theme.

lurkalot

Brad, I don't have server access, but this is from current theme index line starting 112 to 490, if that's any use.  Might be a theme issue with the built in menu editor perhaps?


// If we're in a board, or a topic for that matter, the index will be the board's index.
   if (!empty($context['current_board']))
      echo '
   <link rel="index" href="' . $scripturl . '?board=' . $context['current_board'] . '.0" />';

      // We'll have to use the cookie to remember the header...
   if ($context['user']['is_guest'])
      $options['collapse_header'] = !empty($_COOKIE['upshrink']);

   // and the fontsise
   if ($context['user']['is_guest'])
      $options['myfontsize'] = !empty($_COOKIE['myfontsize']) ? $_COOKIE['myfontsize'] : '90';

   // set fontsize from user choice


   // My addition

   $dir = $settings['theme_dir'] . "/images/banner_images/";

   if (is_dir($dir)) { 
      $fd = opendir($dir); 
        $images = array();

       while (($part = @readdir($fd)) == true) { 
            clearstatcache();
             if ( eregi("(gif|jpg|png|jpeg)$",$part) ) {
                 $images[] = $part;
             }
         }

    // Be sure to call srand() once per script
       srand ((double) microtime() * 1000000);
       $key = rand (0,sizeof($images)-1);

      if (sizeof($images) > 0) {
         $background_image = "/images/banner_images/" . $images[$key];
      }
      else
       // no images in the my_images directory, so use forum default
          $background_image = "/images/backgrounds/background_picture.jpg";

     } else { 
   // no my_images directory exists, so use forum default
         $background_image = "/images/backgrounds/background_picture.jpg";
     }
   // End of my addition

   echo '
   <style type="text/css">
      #mainframe
      {
         width: ' , !empty($settings['forumwidth']) ? $settings['forumwidth'] : '98%', ';
         font-size: ' , !empty($options['myfontsize']) ? $options['myfontsize'] : '90', '%;
      }
      #topframe
      {
         background: url(' . $settings['theme_url'] , !empty($settings['backgroundpic']) ? $settings['backgroundpic'] : $background_image , ') no-repeat;
      }
   </style>';

// *******************
// if we are in boardindex...
   if(empty($options['showcat']) && !empty($context['categories']))
   {
      // fetch the first category
         $first=true;
         foreach ($context['categories'] as $category)
         {
            if($first)
               $options['showcat']=$category['id'];
            $first=false;
         }
   }

// Output any remaining HTML headers. (from mods, maybe?)
   echo $context['html_headers'], '
<!--[if lt IE 7.]>
<script defer type="text/javascript" src="' , $settings['theme_url'] , '/pngfix.js"></script>
<![endif]-->';

   echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                var myfontsize = ', empty($options['myfontsize']) ? '\'90\'' : '\'' . $options['myfontsize']. '\'' , ';
                function setfontsize(size)
                {';

        // Guests don't have theme options!!
        if ($context['user']['is_guest'])
                echo '
                        document.cookie = "myfontsize=" + size';
        else
                echo '
                        smf_setThemeOption("myfontsize", size , null, "', $context['session_id'], '");';
        echo '
                  document.getElementById("mainframe").style.fontSize = size + "%";
                  document.getElementById("font80").src = smf_images_url + ( size==\'80\' ? "/font80b.gif" : "/font80.gif");
                        document.getElementById("font90").src = smf_images_url + ( size==\'90\' ? "/font90b.gif" : "/font90.gif");
                        document.getElementById("font120").src = smf_images_url + ( size==\'120\' ? "/font120b.gif" : "/font120.gif");
                        document.getElementById("font140").src = smf_images_url + ( size==\'140\' ? "/font140b.gif" : "/font140.gif");
                        document.getElementById("font160").src = smf_images_url + ( size==\'160\' ? "/font160b.gif" : "/font160.gif");
                        myfontsize = size;
                }
          // ]]></script>
     <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                var current_cat = ', empty($options['showcat']) ? '1' : $options['showcat'] , ';

                function showcat(mode)
                {';

        // Guests don't have theme options!!
        if ($context['user']['is_guest'])
                echo '
                        document.cookie = "showcat=" + mode;';
        else
                echo '
                        smf_setThemeOption("showcat", mode, null, "', $context['session_id'], '");';

        echo '
                        document.getElementById("cat" + mode).style.display = "";
                  document.getElementById("cattab" + mode).className =  \'chosen\';

                  if (current_cat != mode)
                  {
                     document.getElementById("cat" + current_cat).style.display = "none";
                     document.getElementById("cattab" + current_cat).className = \'\';
                  }
                  current_cat = mode;
                }
               
        // ]]></script>
        <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                var current_leftbar = ', empty($options['collapse_leftbar']) ? 'false' : 'true', ';

                function shrinkHeaderLeftbar(mode)
                {';

        // Guests don't have theme options!!
        if ($context['user']['is_guest'])
                echo '
                        document.cookie = "upshrink=" + (mode ? 1 : 0);';
        else
                echo '
                        smf_setThemeOption("collapse_leftbar", mode ? 1 : 0, null, "', $context['session_id'], '");';
        echo '
                        document.getElementById("upshrinkLeftbar").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

                        document.getElementById("leftbarHeader").style.display = mode ? "none" : "";

                        current_leftbar = mode;
                }
          // ]]></script>
       <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                var current_rightbar = ', empty($options['collapse_rightbar']) ? 'false' : 'true', ';

                function shrinkHeaderRightbar(mode)
                {';

        // Guests don't have theme options!!
        if ($context['user']['is_guest'])
                echo '
                        document.cookie = "upshrink=" + (mode ? 1 : 0);';
        else
                echo '
                        smf_setThemeOption("collapse_rightbar", mode ? 1 : 0, null, "', $context['session_id'], '");';

        echo '
                        document.getElementById("upshrinkRightbar").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

                        document.getElementById("rightbarHeader").style.display = mode ? "none" : "";

                        current_rightbar = mode;
                }
        // ]]></script>

   <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
      var current_header = ', empty($options['collapse_header']) ? 'false' : 'true', ';

      function shrinkHeader(mode)
      {';

   // Guests don't have theme options!!
   if ($context['user']['is_guest'])
      echo '
         document.cookie = "upshrink=" + (mode ? 1 : 0);';
   else
      echo '
         smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "', $context['session_id'], '");';

   echo '
         document.getElementById("upshrinkHeader").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");
         document.getElementById("myuser").style.display = mode ? "none" : "";
         current_header = mode;
      }
   // ]]></script>';

   // the routine for the info center upshrink
   echo '
      <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
         var current_header_ic = ', empty($options['collapse_header_ic']) ? 'false' : 'true', ';

         function shrinkHeaderIC(mode)
         {';

   if ($context['user']['is_guest'])
      echo '
            document.cookie = "upshrinkIC=" + (mode ? 1 : 0);';
   else
      echo '
            smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "', $context['session_id'], '");';

   echo '
            document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

            document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

            current_header_ic = mode;
         }
      // ]]></script>
</head>
<body>';

   //Display ads on the top of the page
   if (function_exists("show_topofpageAds"))
    {
      $ads = show_topofpageAds();   
      if(!empty($ads))
         if($ads['type']==0)
            echo $ads['content'];
         else
            eval($ads['content']);   
      unset($ads);
    }
   
   // check for some mods if they are indeed loaded :P
   checkmods();
   
   echo '
<div id="mainframe">
   <div id="topframe">
      <div id="fontsize-controls">
         <a href="javascript:void(0);" onclick="setfontsize(\'80\'); return false;"><img id="font80" src="', $settings['images_url'], '/', $options['myfontsize']=='80' ? 'font80b.gif' : 'font80.gif', '" alt=""  /></a>
         <a href="javascript:void(0);" onclick="setfontsize(\'90\'); return false;"><img id="font90" src="', $settings['images_url'], '/', $options['myfontsize']=='90' ? 'font90b.gif' : 'font90.gif', '" alt=""  /></a>
         <a href="javascript:void(0);" onclick="setfontsize(\'120\'); return false;"><img id="font120" src="', $settings['images_url'], '/', $options['myfontsize']=='120' ? 'font120b.gif' : 'font120.gif', '" alt=""  /></a>
         <a href="javascript:void(0);" onclick="setfontsize(\'140\'); return false;"><img id="font140" src="', $settings['images_url'], '/', $options['myfontsize']=='140' ? 'font140b.gif' : 'font140.gif', '" alt=""  /></a>
         <a href="javascript:void(0);" onclick="setfontsize(\'160\'); return false;"><img id="font160" src="', $settings['images_url'], '/', $options['myfontsize']=='160' ? 'font160b.gif' : 'font160.gif', '" alt=""  /></a>&nbsp;&nbsp;';
   if(!empty($settings['use_tp']))
   {
   // TinyPortal
      if($context['TPortal']['leftbar'] || (isset($context['TPortal']['leftpanel']) && $context['TPortal']['leftpanel']==1))
         echo '
            <a href="javascript:void(0);" onclick="shrinkHeaderLeftbar(!current_leftbar); return false;"><img id="upshrinkLeftbar" src="', $settings['images_url'], '/', empty($options['collapse_leftbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '"  border="0" /></a><img id="upshrinkTempLeftbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" />';
      if($context['TPortal']['rightbar'] || (isset($context['TPortal']['rightpanel']) && $context['TPortal']['rightpanel'])==1)
         echo '
            <a href="javascript:void(0);" onclick="shrinkHeaderRightbar(!current_rightbar); return false;"><img id="upshrinkRightbar" src="', $settings['images_url'], '/', empty($options['collapse_rightbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" border="0" /></a><img id="upshrinkTempRightbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" />';
   }
   
   
   echo '
         <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;padding: 0;">
            <input type="text" name="search"  value=""  />
            <input type="submit" name="submit" value="', $txt[182], '"  />
            <input type="hidden" name="advanced" value="0" />';

   // Search within current topic?
   if (!empty($context['current_topic']))
      echo '
            <input type="hidden" name="topic" value="', $context['current_topic'], '" />';

   // If we're on a certain board, limit it to this board ;).
   elseif (!empty($context['current_board']))
      echo '
            <input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
   echo '
         </form>
      </div>
      <a href="' . $scripturl . '"><img style="margin: 20px 0 0 30px;" alt="' . $context['forum_name'] . '" src="' . $settings['images_url'] . '/img/logo.png" /></a>
   ' , !empty($settings['use_oldmenu']) ? template_menu_old() : template_menu();

   //Below the menu ads
   if (function_exists("show_indexAds") && function_exists("show_towerleftAds") && function_exists("show_towerrightAds"))
   {
      $ads = show_indexAds();   
      if(!empty($ads))
         if($ads['type']==0)
            echo $ads['content'];
         else
            eval($ads['content']);
      unset($ads);

      //Tower left Ads
      $ads = show_towerleftAds();
      if(!empty($ads))
         echo '<table><tr><td valign="top">', $ads['type']==0 ? $ads['content'] : eval($ads['content']) ,'</td><td width="100%" valign="top">';

      unset($ads);
      //Tower Right Ads
      $ads = show_towerrightAds();   
      if(!empty($ads))
         echo '<table><tr><td width="100%" valign="top">';
      unset($ads);
   }
   echo '
   </div>';
   
   theme_linktree2();

   echo '   
   <div id="bodyarea2">';

   tpcode();
}


Gav-Aus

Just finished relocating the site to a new host, all has gone well however I need to now wait until the internet has populated since the DNS change :)

Reviewing the issues noted (width is sorted) the same problems are there so I'll now wait until the next version of TP comes out and see if this fixes things.

Cheers
Guys
Gavin
Austeam Founder & Webmaster

Gav-Aus

Hello guys  ;D

Back again "lol"

I may have missed it but was any new files or upgrades down for TP. My second issue is still alive and I'm keen to put this to bed.
Gavin
Austeam Founder & Webmaster

This website is proudly hosted on Crocweb Cloud Website Hosting.