News:

Wondering if this will always be free?  See why free is better.

Main Menu

Problem with load.php

Started by n-joy, August 13, 2009, 10:45:34 AM

Previous topic - Next topic

n-joy

Hi!
I tested some shoutboxes, to see wich one I need.
I had to do some manual edits, but I taked a backup of the file I needed to edit.
I didn't like the shoutbox so I deinstalled it with the package manager. And I puted the backup back. But now, I get this error:
QuoteFatal error: Cannot redeclare template_init() (previously declared in /home/njoy/public_html/forum/Sources/Load.php(2091) : eval()'d code:32) in /home/njoy/public_html/forum/Sources/Load.php(2091) : eval()'d code on line 545
I had to edit index.template.php...not load.php

They are botch attached

ExWizzard

i might be wrong but i think you have 2 template_init() functions in index file and you fail to load both

n-joy


ExWizzard

try removing the 2nd template_init function from the index file and then see if it works

// Initialize the template... mainly little settings.
function template_init()
{
   global $context, $settings, $options, $txt;

   /* Use images from default theme when using templates from the default theme?
      if this is 'always', images from the default theme will be used.
      if this is 'defaults', images from the default theme will only be used with default templates.
      if this is 'never' or isn't set at all, images from the default theme will not be used. */
   $settings['use_default_images'] = 'never';

   /* What document type definition is being used? (for font size and other issues.)
      'xhtml' for an XHTML 1.0 document type definition.
      'html' for an HTML 4.01 document type definition. */
   $settings['doctype'] = 'xhtml';

   /* The version this template/theme is for.
      This should probably be the version of SMF it was created for. */
   $settings['theme_version'] = '2.0 RC1';

   /* Set a setting that tells the theme that it can render the tabs. */
   $settings['use_tabs'] = true;

   /* Use plain buttons - as oppossed to text buttons? */
   $settings['use_buttons'] = true;

   /* Show sticky and lock status separate from topic icons? */
   $settings['separate_sticky_lock'] = true;

   /* Does this theme use the strict doctype? */
   $settings['strict_doctype'] = false;

   /* Does this theme use post previews on the message index? */
   $settings['message_index_preview'] = false;
   
   /* Set the following variable to true if this theme requires the optional theme strings file to be loaded. */
   $settings['require_theme_strings'] = false;
}

n-joy

No...I get this error:


Fatal error: Cannot redeclare template_html_above() (previously declared in /home/njoy/public_html/forum/Sources/Load.php(2091) : eval()'d code:71) in /home/njoy/public_html/forum/Sources/Load.php(2091) : eval()'d code on line 616

Norv

It seems the entire file is duplicated. Check it out: from line 470 it simply starts again as it was in the beginning.
I have removed the second half, please see if the remaining one is good. (not sure if you may have edited the other one, so perhaps keeping the second instance of the file may be best).

(rename it to index,template.php)
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

n-joy

#6
It works, but now I get half my theme, half the default theme.
Look:
http://njoy.sitefrost.com/forum

EDIT: I think I Solved it, thank you all!

Norv

Cheers, good to hear you sorted it out!
I will mark the topic as solved then, but please feel free to reopen it in case there actually are more issues on this matter.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Advertisement: