News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

foreach errors

Started by MultiformeIngegno, August 15, 2010, 09:47:13 PM

Previous topic - Next topic

MultiformeIngegno

I'm getting loads of these errors:
index.php?action=dlattach;attach=xxx;type=avatar2
Invalid argument supplied for foreach()
File: /Sources/Load.php
Line: 1806


Where xxx is the id of an avatar (it changes at every error)...

At line 1806 of Load.php I find this:
// No template to load?
if ($template_name === false)
return true;

foreach ($settings['template_dirs'] as $template_dir)
{
if (file_exists($template_dir . '/' . $template_name . '.template.php'))
{
$loaded = true;
template_include($template_dir . '/' . $template_name . '.template.php', true);
$actual_template = $template_name . ' (' . basename($template_dir) . ')';
break;
}
}


The exact line is:
foreach ($settings['template_dirs'] as $template_dir)

Can you help me?
Thanks (I've attached the file)! :)

P.S.: SMF 2.0 RC3
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

MultiformeIngegno

RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Kill Em All

Sorry for the delayed response. What mods do you have installed?

Have you tried replacing the Load.php with a new version from the large upgrade package?


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

Yağız...

I had the same error too, can't remember how I did fix it but try that:

Find in ../index.php:
// Attachments don't require the entire theme to be loaded.
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'dlattach' && (!empty($modSettings['allow_guestAccess']) && $user_info['is_guest']))
detectBrowser();
// Load the current theme.  (note that ?theme=1 will also work, may be used for guest theming.)
else
loadTheme();

Replace with:
// Attachments don't require the entire theme to be loaded.
// if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'dlattach' && (!empty($modSettings['allow_guestAccess']) && $user_info['is_guest']))
// detectBrowser();
// Load the current theme.  (note that ?theme=1 will also work, may be used for guest theming.)
// else
loadTheme();

MultiformeIngegno

Uhm.. and what does your edit do exactly (what happens commenting out that line)?
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Yağız...

It loads using theme on action=dlattach  (avatars, attachments etc.) when viewing them.

Advertisement: