News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Major forum issue- codes appear

Started by lockelymarkets, April 11, 2007, 09:30:50 PM

Previous topic - Next topic

lockelymarkets

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

Sarge

What is in lines 690-735 and lines 1720-1730 of Load.php?

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

lockelymarkets

#2
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!

metallica48423

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. 
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

lockelymarkets

Would this delete all posts made?

Also, updatechatstats() wasn't found

Sarge

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.

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

metallica48423

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 ;)
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

lockelymarkets

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!

Sarge

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. :)

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

metallica48423

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
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Sarge

#10
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).

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

lockelymarkets

How do I download my forum?

(I am using cPanel X to run my website)

Thankyou for your help and patience!

Sarge

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.

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

lockelymarkets

I uploaded SMF using the Fantastico

Sarge

#14
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. 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.



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



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:



That should do the job. :)

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

metallica48423

note that winrar can handle tar.gz files.
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

lockelymarkets

I got it working! Thankyou so much!

Advertisement: