Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: spamanfire on July 12, 2010, 05:57:41 PM

Title: Forum will not load after change of subs.php file
Post by: spamanfire on July 12, 2010, 05:57:41 PM
HI,,our forum was working fine and I wanted to add another button to our menu,,I found info abouit how to do it...I went up to the server and followed the instructions..now the forum will not load.,..help...

I changed some code in the sources /subs.php...can I just upload the file again and take care of it...


Bill
Title: Re: Forum will not load after change of subs.php file
Post by: ɔɔɔɔɔɔuɥoɾ on July 12, 2010, 06:25:08 PM
So which code did you change or add, which line was it on, about?

You can also add your subs.php file, I can check it for possible parse errors
Title: Re: Forum will not load after change of subs.php file
Post by: spamanfire on July 12, 2010, 06:44:14 PM
Ok, I thank you...whatever I need to do to get it running again..

  'home' => array(
            'title' => $txt['home'],
            'href' => $modSettings['sp_portal_mode'] == 3 && empty($context['disable_sp']) ? $modSettings['sp_standalone_url'] : $scripturl,
            'show' => true,
            'sub_buttons' => array(
            ),
            'is_last' => $context['right_to_left'],
            // 'target' => '_blank',
         ),

located down at the bottom of the subs.php file...do
Title: Re: Forum will not load after change of subs.php file
Post by: spamanfire on July 12, 2010, 06:46:59 PM
I added some code but have since removed it,,,right above the        'is last'=> context and        below       sub buttons'=>array(

hopefully this will help...if you need anything else just let me know...Bill
Title: Re: Forum will not load after change of subs.php file
Post by: spamanfire on July 12, 2010, 06:49:29 PM
I can also email you the subs.php file if that will help....
Title: Re: Forum will not load after change of subs.php file
Post by: CapadY on July 12, 2010, 06:56:35 PM
Quote from: spamanfire on July 12, 2010, 06:44:14 PM
Ok, I thank you...whatever I need to do to get it running again..

  'home' => array(
            'title' => $txt['home'],
            'href' => $modSettings['sp_portal_mode'] == 3 && empty($context['disable_sp']) ? $modSettings['sp_standalone_url'] : $scripturl,
            'show' => true,
            'sub_buttons' => array(
            ),
            'is_last' => $context['right_to_left'],
            // 'target' => '_blank',
         ),

located down at the bottom of the subs.php file...do

As far as I can see there is nothing wrong with these code.

Maybe you can better ATTACH your subs.php file for a complete overview of that file. So, not email, just attach with a posting here on the forum.
Title: Re: Forum will not load after change of subs.php file
Post by: ɔɔɔɔɔɔuɥoɾ on July 12, 2010, 06:59:38 PM
  'home' => array(
            'title' => $txt['home'],
            'href' => $modSettings['sp_portal_mode'] == 3 && empty($context['disable_sp']) ? $modSettings['sp_standalone_url'] : $scripturl,
            'show' => true,
            'sub_buttons' => array(
            ),
            'is_last' => $context['right_to_left'],
            // 'target' => '_blank',
         ),

After this, before the next button code array begins, there should be 2 more sets of      "  ),   " before you see any more code.

Anywho, attach the file so it can be checked thoroughly
Title: Re: Forum will not load after change of subs.php file
Post by: spamanfire on July 12, 2010, 07:05:14 PM
Ok, let me know how to attach an attachment..I dont see any attachment button sorry....Bill
Title: Re: Forum will not load after change of subs.php file
Post by: spamanfire on July 12, 2010, 07:07:09 PM
Do I need to do anything else with the file,,,I changed it on the server,,,does smf read the subs.php from there? Do I need to copy it anywhere else?
Title: Re: Forum will not load after change of subs.php file
Post by: ɔɔɔɔɔɔuɥoɾ on July 12, 2010, 07:11:57 PM
Instead of using the "Quick Reply", click reply below here, then click the + button on the left side of "Additional Options..." then you can see where you can add an attachment.
Title: Re: Forum will not load after change of subs.php file
Post by: spamanfire on July 12, 2010, 07:18:26 PM
OK,,THANKS ALOT....
Title: Re: Forum will not load after change of subs.php file
Post by: spamanfire on July 12, 2010, 07:20:35 PM
This is where I got the info for adding a button.....

http://www.simplemachines.org/community/index.php?topic=261880.0
Title: Re: Forum will not load after change of subs.php file
Post by: ɔɔɔɔɔɔuɥoɾ on July 12, 2010, 07:26:39 PM
Your parse error is caused here:

function getLegacyAttachmentFilename($filename, $attachment_id, $dir = null, $new = false)
{
   global $modSettings;

SaveCancelClose;   // Remove special accented characters - ie. s?   $clean_name = strtr($filename, ' ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? , 'SZszYAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy');
   $clean_name


There are several parse errors after that too, probably caused by that one

Let me see what I can do about this.

Checking a clean copy of subs.php it seems to be different, Which SMF version are you using?

Lime Green Color = Where invalid or missing char caused a parse error
Title: Re: Forum will not load after change of subs.php file
Post by: spamanfire on July 12, 2010, 07:39:14 PM
2.0   RC3
Title: Re: Forum will not load after change of subs.php file
Post by: ɔɔɔɔɔɔuɥoɾ on July 12, 2010, 07:39:59 PM
If your using SMF 2 RC3, download and try this attachment.

I relpaced

SaveCancelClose // Remove special accented characters - ie. s? $clean_name = strtr($filename, '???????????????????????????, 'SZszYAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy');
$clean_name = strtr($clean_name, array('? => 'TH', '?' => 'th', '? => 'DH', '?> 'dh', '? => 'ss', '?' => 'OE', '?' => 'oe', '? => 'AE', '?=> 'ae', '?' => 'u'));


With


// Remove special accented characters - ie. sí.
$clean_name = strtr($filename, 'ŠŽšžŸÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöøùúûüýÿ', 'SZszYAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy');
$clean_name = strtr($clean_name, array('Þ' => 'TH', 'þ' => 'th', 'Ð' => 'DH', 'ð' => 'dh', 'ß' => 'ss', 'Œ' => 'OE', 'œ' => 'oe', 'Æ' => 'AE', 'æ' => 'ae', 'µ' => 'u'));


It seems possible that a you or a mod may have changed something here, so If any mods are not working correctly after this, tell me which mod it is and I will see.
Title: Re: Forum will not load after change of subs.php file
Post by: spamanfire on July 12, 2010, 07:42:17 PM
can I just upload it to the server on top of the old one?
Title: Re: Forum will not load after change of subs.php file
Post by: ɔɔɔɔɔɔuɥoɾ on July 12, 2010, 07:48:20 PM
Quote from: spamanfire on July 12, 2010, 07:42:17 PM
can I just upload it to the server on top of the old one?

Backup the old one 1st, I know it makes no sense, since its not working anyway, but you should always have a habit of backing up before making changes.

Then yes, overwrite.
Title: Re: Forum will not load after change of subs.php file
Post by: spamanfire on July 12, 2010, 07:55:14 PM
Your the man.....wow,,,you saved me from getting murdered.......now I can breathe again....thanks alot....Bill ;D ;D ;D ;D ;D
Title: Re: Forum will not load after change of subs.php file
Post by: ɔɔɔɔɔɔuɥoɾ on July 12, 2010, 08:00:13 PM
Quote from: spamanfire on July 12, 2010, 07:55:14 PM
Your the man.....wow,,,you saved me from getting murdered.......now I can breathe again....thanks alot....Bill ;D ;D ;D ;D ;D

Your welcome, glad to help.

Remember to check your error log and check to make sure all your mods are working correctly.
Title: Re: Forum will not load after change of subs.php file
Post by: spamanfire on July 12, 2010, 08:35:50 PM
Ok will do......thanks again....Bill