Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: lockelymarkets on April 11, 2007, 09:30:50 PM

Title: Major forum issue- codes appear
Post by: lockelymarkets on April 11, 2007, 09:30:50 PM
Hello
I installed the intergrated chat mod last week, then deleted the files through the package manager shortly afterwards.

I then noticed that the chat was still there, so I went (through my websites cpanel) to find if the file was still there, it wasn't.

So today I reinstalled the chat mod successfully, so I immediately uninstalled it because I thought that would remove it from my forum altogether. It then made the following come up:

Fatal error: Cannot redeclare updatechatstats() (previously declared in /home/a200/public_html/forum/Sources/Load.php(1726) : eval()'d code:696) in /home/a200/public_html/forum/Sources/Load.php(1726) : eval()'d code on line 730

I cannot access any part of my forum directly, as it now comes up with this message. I have opened that file listed in the error message, but I am not sure what to look for or what needs changing.

Any help is greatly appreciated.

Thankyou in advance
LM

P.S- Link to forum: http://aust.rifehost.com/forum/index.php
I am using SMF 1.1.2
Title: Re: Major forum issue- codes appear
Post by: Sarge on April 11, 2007, 09:49:29 PM
What is in lines 690-735 and lines 1720-1730 of Load.php?
Title: Re: Major forum issue- codes appear
Post by: lockelymarkets on April 11, 2007, 09:55:16 PM
Lines 1720-1730:

      template_include($settings['base_theme_dir'] . '/' . $template_name . '.template.php', true);
      $template_name .= ' (' . basename($settings['base_theme_dir']) . ')';
   }
   // Perhaps we'll just use the default template, then...
   elseif (file_exists($settings['default_theme_dir'] . '/' . $template_name . '.template.php'))
   {
      // Make it known that this template uses different directories...
      $settings['default_template'] = true;
      template_include($settings['default_theme_dir'] . '/' . $template_name . '.template.php', true);

And lines 690-735:
!empty($modSettings['permission_enable_by_board']) && $row['permission_mode'] == 1,
            'permission_mode' => empty($modSettings['permission_enable_by_board']) ? (empty($row['permission_mode']) ? 'normal' : ($row['permission_mode'] == 2 ? 'no_polls' : ($row['permission_mode'] == 3 ? 'reply_only' : 'read_only'))) : 'normal',
            'posts_count' => empty($row['countPosts']),
         );

         // Load the membergroups allowed, and check permissions.
         $board_info['groups'] = $row['memberGroups'] == '' ? array() : explode(',', $row['memberGroups']);

         do
         {
            if (!empty($row['ID_MODERATOR']))
               $board_info['moderators'][$row['ID_MODERATOR']] = array(
                  'id' => $row['ID_MODERATOR'],
                  'name' => $row['realName'],
                  'href' => $scripturl . '?action=profile;u=' . $row['ID_MODERATOR'],
                  'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MODERATOR'] . '" title="' . $txt[62] . '">' . $row['realName'] . '</a>'
               );
         }
         while ($row = mysql_fetch_assoc($request));

         if (!empty($modSettings['cache_enable']) && (empty($topic) || $modSettings['cache_enable'] == 3))
         {
            // !!! SLOW?
            if (!empty($topic))
               cache_put_data('topic_board-' . $topic, $board_info, 120);
            cache_put_data('board-' . $board, $board_info, 120);
         }
      }
      else
      {
         // Otherwise the topic is invalid, there are no moderators, etc.
         $board_info = array(
            'moderators' => array(),
            'error' => 'exist'
         );
         $topic = null;
         $board = 0;
      }
      mysql_free_result($request);


Thankyou for your quick response!
Title: Re: Major forum issue- codes appear
Post by: metallica48423 on April 11, 2007, 09:56:11 PM
search Load.php for code blocks beginning with updatechatstats(), and delete the blocks of code.

Keep in mind, that if this code did this with the mod -- so did all of the rest of the code.

I would recommend, if feasible, reuploading fresh copies of all your files (except Settings.php!) from an install package.  This will uninstall any and all mods. 
Title: Re: Major forum issue- codes appear
Post by: lockelymarkets on April 11, 2007, 09:59:38 PM
Would this delete all posts made?

Also, updatechatstats() wasn't found
Title: Re: Major forum issue- codes appear
Post by: Sarge on April 11, 2007, 10:02:40 PM
Quote from: lockelymarkets on April 11, 2007, 09:59:38 PM
Would this delete all posts made?

No. But mods will stop working; you'll have to reinstall them.
Title: Re: Major forum issue- codes appear
Post by: metallica48423 on April 11, 2007, 10:02:53 PM
No, as long as Settings.php remains intact -- i would download a copy of it just in case via FTP.

Uploading new files wouldn't touch your posts :), they're stored in the database

edit: you beat me sarge... i guess i type slower than both you AND xenovanis ;)
Title: Re: Major forum issue- codes appear
Post by: lockelymarkets on April 11, 2007, 10:07:19 PM
So how do I go about doing it? Do I delete everything except Settings.PhP, then reupload SMF, install with the same MYSQL database as before, and replace the new settings.php with the old?

Thanks for all your help!
Title: Re: Major forum issue- codes appear
Post by: Sarge on April 11, 2007, 10:07:54 PM
You might want to check all files in all folders for the string updatechatstats().

Read here for a way to do that:
http://www.simplemachines.org/community/index.php?topic=163781.msg1048442#msg1048442

If you find any files that contain references to updatechatstats(), post that line and the surrounding lines for each file, just like you did with Load.php.

Please use [code] [/code] when quoting code. :)
Title: Re: Major forum issue- codes appear
Post by: metallica48423 on April 11, 2007, 10:09:14 PM
you could do as sarge said, yes.  But i would like to advise as well that if those two codes are duped, it is likely all of the code the mods installed is duped as well. 

In the end it is your decision what you do -- no you don't have to delete them, just overwrite them, except for Settings.php
Title: Re: Major forum issue- codes appear
Post by: Sarge on April 11, 2007, 10:12:28 PM
Quote from: lockelymarkets on April 11, 2007, 10:07:19 PM
So how do I go about doing it? Do I delete everything except Settings.PhP, then reupload SMF, install with the same MYSQL database as before, and replace the new settings.php with the old?

Thanks for all your help!

As metallica48423 said, you don't have to reinstall.

1) Download all of your forum directory (and its files and subdirectories) and save it somewhere in your desktop as a backup copy.
2) (Optional) Delete all forum files in the server.
3) Upload original files from the SMF 1.1.2 distribution.
4) Upload the old Settings.php from the backup copy.
5) Reinstall mods (if any).
Title: Re: Major forum issue- codes appear
Post by: lockelymarkets on April 11, 2007, 10:17:05 PM
How do I download my forum?

(I am using cPanel X to run my website)

Thankyou for your help and patience!
Title: Re: Major forum issue- codes appear
Post by: Sarge on April 11, 2007, 10:20:59 PM
Quote from: lockelymarkets on April 11, 2007, 10:17:05 PM
How do I download my forum?

(I am using cPanel X to run my website)

Thankyou for your help and patience!

Use FTP. I guess that's how you uploaded SMF, right? Same thing for download.
Title: Re: Major forum issue- codes appear
Post by: lockelymarkets on April 11, 2007, 10:21:56 PM
I uploaded SMF using the Fantastico
Title: Re: Major forum issue- codes appear
Post by: Sarge on April 11, 2007, 10:43:44 PM
I don't have any experience with Fantastico, but you should still be able to use FTP.

Use a FTP program for that. A good one is FileZilla (http://filezilla.sourceforge.net/). Enter your FTP username and password and you should be good to go.

FTP user information can be found in cPanel. Go to the FTP Manager page > FTP Accounts.

The username and password are probably the same as the ones you use to log on to cPanel.




An alternative way would be to use cPanel:

1) Go to the Backups page.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg410.imageshack.us%2Fimg410%2F2842%2Fbackupfo0.png&hash=9142cb48ffad7c9f30bc4febbe73eccf9d902def)

2) Click on "Download a home directory Backup".

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg172.imageshack.us%2Fimg172%2F6996%2Fhomedirdb4.png&hash=c836756341f6f319a7196c9e8798b743d8f441bc)

3) Uncompress the downloaded archive somewhere on your desktop.

4) Replace files in your forum's directory (probably forum/) as in the posts above. Make sure you don't change anything else.

5) Recompress your site's home folder as a .tar.gz archive.

6) Upload the archive from the Backups page in cPanel using the "Restore a Home Directory Backup" option:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg266.imageshack.us%2Fimg266%2F6668%2Frestorejr4.png&hash=3c356fddee4020797f0a516acb9e775442529da4)

That should do the job. :)
Title: Re: Major forum issue- codes appear
Post by: metallica48423 on April 11, 2007, 10:45:27 PM
note that winrar can handle tar.gz files.
Title: Re: Major forum issue- codes appear
Post by: lockelymarkets on April 11, 2007, 11:22:08 PM
I got it working! Thankyou so much!