Unable to load the 'main' template.

Started by tricities, November 29, 2014, 08:47:10 PM

Previous topic - Next topic

tricities

All I want is the new installation and the forum's database backup to be installed so that all users are retained and any of their pictures or avatar or posts.
That's not a wrinkle in my forehead; it's from falling asleep at the computer desk on the corner of the wood.


tricities

Been there.  Just want to hire someone to do this.
That's not a wrinkle in my forehead; it's from falling asleep at the computer desk on the corner of the wood.

Illori


tricities

That's not a wrinkle in my forehead; it's from falling asleep at the computer desk on the corner of the wood.

Arantor

Actually one of your topics on the matter was moved there but for some reason was closed by a moderator.

tricities

Unable to load the 'main' template.

Please see printscreen in an above posting.  I've followed all instructions to no avail.

What are the instructions to fix this?
That's not a wrinkle in my forehead; it's from falling asleep at the computer desk on the corner of the wood.

Arantor

I presume Themes/default/Admin.template.php actually exists?

tricities

Yes, which starts with this and there's one with a ~ after it which starts differently below it under the double line below (which I assume is some sort of backup file)

<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
*/

// This is the administration center home.
function template_admin()
{
   global $context, $settings, $options, $scripturl, $txt, $modSettings;

   // Welcome message for the admin.
   echo '
   <div id="admincenter">
      <div class="cat_bar">
         <h3 class="catbg">';

   if ($context['user']['is_admin'])
      echo '
         <object id="quick_search">
            <form action="', $scripturl, '?action=admin;area=search" method="post" accept-charset="', $context['character_set'], '" class="floatright">


================OLD FILE============================

<?php
// Version: 1.1.1; Admin

// This contains the html for the side bar of the admin center, which is used for all admin pages.
function template_admin_above()
{
   global $context, $settings, $options, $scripturl, $txt;

   // This is the main table - we need it so we can keep the content to the right of it.
   echo '
      <table width="100%" cellpadding="0" cellspacing="0" border="0" style="padding-top: 1ex;"><tr>
         <td width="150" valign="top" style="width: 23ex; padding-right: 10px; padding-bottom: 10px;">
            <table width="100%" cellpadding="4" cellspacing="1" border="0" class="bordercolor">';

   // For every section that appears on the sidebar...
   foreach ($context['admin_areas'] as $section)
   {
      // Show the section header - and pump up the line spacing for readability.
      echo '
               <tr>
                  <td class="catbg">', $section['title'], '</td>
               </tr>
               <tr class="windowbg2">
                  <td class="smalltext" style="line-height: 1.3; padding-bottom: 3ex;">';

      // For every area of this section show a link to that area (bold if it's currently selected.)
      foreach ($section['areas'] as $i => $area)
      {
         // Is this the current area, or just some area?
         if ($i == $context['admin_area'])
            echo '
                     <b>', $area, '</b><br />';
         else
                        echo '
                     ', $area, '<br />';
            }

            echo '
                  </td>
               </tr>';
      }

      // This is where the actual "main content" area for the admin section starts.
      echo '
            </table>
         </td>
         <td valign="top">';

   // If there are any "tabs" setup, this is the place to shown them.
   if (!empty($context['admin_tabs']))
That's not a wrinkle in my forehead; it's from falling asleep at the computer desk on the corner of the wood.

Irisado

This is why the other topic was closed:

Quote from: Irisado on November 30, 2014, 05:27:36 AM
To avoid duplicate topics, if you would like someone to have the login details to your forum and actually do all the work for you, I will move this topic to Help Wanted if you can just say whether you want Free or Paid help.  If you're happy to fix it yourself by following instructions and advice posted as replies, then I will leave the topic here.
Soñando con una playa donde brilla el sol, un arco iris ilumina el cielo, y el mar espejea iridescentemente

tricities

Could I please get some help on fixing the forum's admin area so that we can actually use it?
That's not a wrinkle in my forehead; it's from falling asleep at the computer desk on the corner of the wood.

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

tricities

I PM'd you last night.
Thank you.
Give me an ETA if you can.
That's not a wrinkle in my forehead; it's from falling asleep at the computer desk on the corner of the wood.

tricities

SOLVED

I fixed the forum.  It's now working like it should.

No further help is needed, at least not on this subject.
That's not a wrinkle in my forehead; it's from falling asleep at the computer desk on the corner of the wood.

tricities

To update others:
I'm at a point of trying to get the forum back to normal and have posted several questions/topics to get help; however, I wanted to give insight into what had happened to this forum in case it's of use to someone else.

I don't know if the Trojan did it or if I did it.  It looks to me more like I did it. 

1) Trojan adding hundreds of lines of php coding before the normal <?php code, so I deleted them on files.
2) I then decided to upgrade from a very old version
3) The Admin area would not work because it said it couldn't load the main template.
4) Someone PM'd me to send my FTP info to them for help
5) I chose to reinstall Zblock spamblocker but Zblock's PDF instructions said to add it to all pages I wanted protected.  That started becoming quite a large task so I searched for any support between Simple Machines and Zblock and found I only needed to put in the Zblock coding on the Settings.php file.
6) I went back to about 50 files that I had added it to and erased that line of code.
7) I came across the Admin.php file in the Sources folder (which I had not added Zblock to yet) and noticed it did not start with <?php but started with the commented out notes instead. 
8) I added <?php to the beginning of that file and WHALLA, the admin area was wide open to me.

So if you strip out Trojan coding from your files, get some sleep first and not delete good code like I did which caused a huge struggle and days of work trying to figure this out.

Onward and Upward with many more issues, but we'll get there eventually.

Thanks for any support here that may have opened my eyes on some things.
That's not a wrinkle in my forehead; it's from falling asleep at the computer desk on the corner of the wood.

tricities

How ironic that my number 8 turned into a smiley face at just the right point! LOL!
That's not a wrinkle in my forehead; it's from falling asleep at the computer desk on the corner of the wood.

Kindred

Side note....  You should never, ever, ever be adding  zblock or any other code to settings.php
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

tricities

That's not a wrinkle in my forehead; it's from falling asleep at the computer desk on the corner of the wood.

Kindred

Because settings.php is the settigns file.

Code to be run does does belong in that file.

Index.php or index.template.php is the correct location, depending on what the injected code actually is.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

tricities

Both the main website and the forum use Zblock for many years now.  Fred had the coding installed on the forum before the Trojan attack but Zblock and the forum were both really old versions so no telling which let it in.  But here's where Zblock gives instructions for use on SMF and they have an entire forum committed to just SMF information and help.

http://www.spambotsecurity.com/forum/viewtopic.php?f=41&t=499  It specifically states to use the Settings.php file to install it onto and it's not needed on any other file.

Does this change your mind or is there something you can provide to back up your statement of not using it?
That's not a wrinkle in my forehead; it's from falling asleep at the computer desk on the corner of the wood.

Advertisement: