TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,996
  • Total Topics: 21,327
  • Online today: 386
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 300
  • Total: 300

Entire site broke ... urgent, please help!

Started by mrbean17, March 28, 2007, 02:08:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mrbean17

www.importantworkstuff.com

I can't log in to fix the arcade block ... I can't do anything. I know what I broke, I know how to fix it, but I can't log into the admin section!!!

PLEASE HELP!

tick

Have you tried putting in the url to directly go to your admin panel   http://Your site here/index.php?action=admin

mrbean17

Yep ... takes me back to the error ... can't do anything ...

Lesmond

I have seen this before, something to do with duplicated code, try looking in load.php see if you can find the  duplicated code

Fatal error: Cannot redeclare games1()

mrbean17

Quote from: Lesmondâ„¢ on March 28, 2007, 02:19:27 PM
I have seen this before, something to do with duplicated code, try looking in load.php see if you can find the  duplicated code

Fatal error: Cannot redeclare games1()

Didn't find that string in index.php ... what in here can I remove to get the page to load up again? Can I do anything?

mrbean17

#5
Oh wait, you said load.php ...

I see nothing in this page about that error or anything related to arcade/games.

The error on my page:

Fatal error: Cannot redeclare games1() (previously declared in /home/content/m/r/b/mrbean17/html/Forum/Sources/Load.php(1736) : eval()'d code(35) : eval()'d code:150) in /home/content/m/r/b/mrbean17/html/Forum/Sources/Load.php(1736) : eval()'d code(35) : eval()'d code on line 220

Line 150:

// Most database systems have not set UTF-8 as their default input charset.
if (isset($db_character_set) && preg_match('~^\w+$~', $db_character_set) === 1)
db_query("
SET NAMES $db_character_set", __FILE__, __LINE__);


The SET NAMES line is line 150.


Line 220 on load.php:


'strpos' => create_function('$haystack, $needle, $offset = 0', '
global $func;
$haystack_arr = preg_split(\'~(&#' . (empty($modSettings['disableEntityCheck']) ? '\d{1,7}' : '021') . ';|"|&|<|>| |.)~' . ($utf8 ? 'u' : '') . '\', ' . implode('$haystack', $ent_check) . ', -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
$haystack_size = count($haystack_arr);
if (strlen($needle) === 1)
{
$result = array_search($needle, array_slice($haystack_arr, $offset));
return is_int($result) ? $result + $offset : false;
}
else
{
$needle_arr = preg_split(\'~(&#' . (empty($modSettings['disableEntityCheck']) ? '\d{1,7}' : '021') . ';|"|&|<|>| |.)~' . ($utf8 ? 'u' : '') . '\',  ' . implode('$needle', $ent_check) . ', -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
$needle_size = count($needle_arr);

$result = array_search($needle_arr[0], array_slice($haystack_arr, $offset));
while (is_int($result))
{
$offset += $result;
if (array_slice($haystack_arr, $offset, $needle_size) === $needle_arr)
return $offset;
$result = array_search($needle_arr[0], array_slice($haystack_arr, ++$offset));
}
return false;
}'),


The second to last } is line 220 (right before return false;)

IchBin

mrbean, this is the reason you should keep blocks set to OFF in your admin panel. This way, if a block ever disables your site you can still access your admin panel because the blocks are off.

You'll either have to edit your database to turn the block off or do this.
In index.template.php find this:

if($context['TPortal']['leftbar'])

Replace with this:

if(empty($context['TPortal']['leftbar']))


After this you can login to your admin panel and turn the block off. Then just change the code back in your index.template.php file. While you're at it, turn blocks display to OFF in the admin panel so you don't have to worry about this in the future.

mrbean17


IchBin


mrbean17

I did ... error remains, unable to do anything still :(

This was the section of code:


echo ' </td>
<td colspan="2"><img src="'.$settings['images_url'].'/img/topright.jpg" alt="" style="margin: 0;" /></td>
</tr>
<tr>
<td><img src="'.$settings['images_url'].'/img/logo_left.jpg" alt="" style="margin: 0;" /></td>
<td align="right" id="logo" colspan="3">';

         if(empty($context['TPortal']['leftbar']))
             echo '<a href="javascript:void(0);" onclick="shrinkHeaderLeftbar(!current_leftbar); return false;"><img id="upshrinkLeftbar" src="', $settings['images_url'], '/', empty($options['collapse_leftbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="position: absolute; z-index: 6; top: 124px; left: 42px; margin: 2px 2ex 0px 0;" border="0" /></a><img id="upshrinkTempLeftbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" />';
         if($context['TPortal']['rightbar'])
             echo '<a href="javascript:void(0);" onclick="shrinkHeaderRightbar(!current_rightbar); return false;"><img id="upshrinkRightbar" src="', $settings['images_url'], '/', empty($options['collapse_rightbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="position: absolute; z-index: 6; top: 124px; left: 60px; margin: 2px 2ex 0px 0;" border="0" /></a><img id="upshrinkTempRightbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" />';

This website is proudly hosted on Crocweb Cloud Website Hosting.