SimplePortal

Customization => Custom Coding => Topic started by: Sam12345 on June 22, 2011, 07:01:18 AM

Title: Error due to Custom Block
Post by: Sam12345 on June 22, 2011, 07:01:18 AM
Hello all,
I have a custom block that is throwing the following error in the error logs. I was wondering if somebody would be able to help me with identifying the cause.
Thanks

Following is the error
public_html/Sources/PortalBlocks.php(3351) : eval()'d code

Following is the code:

Code: [Select]
global $context, $scripturl, $txt;
echo'
<div id="userbox">
<div id="time-stats">
', $context['current_time'],'<span>', $txt['latest_member'], ': ', $context['common_stats']['latest_member']['link'], '</span>
</div>
<div id="searchbox">
<form action="http://www.indiaeduforum.com/search-results/" id="cse-search-box">
  <div>
<p>
    <input type="hidden" name="cx" value="partner-pub-5216707553827435:3iwq9lt9aba" />
    <input type="hidden" name="cof" value="FORID:11" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
    <input type="text" name="q" size="40" />
    <input type="submit" name="sa" value="Search" />
  </div>
</form>
<script type="text/javascript" src="http://www.google.co.in/cse/brand?form=cse-search-box&lang=en"></script>
</div>
<div id="memb-login">';
if ($context['user']['is_logged'])
{
if(!empty($context['user']['avatar']))
echo '
<div class="memb-avat">'.$context['user']['avatar']['image'].'</div>';

echo '
<ul>';

echo '<li class="memb-name">', $txt['hello_member_ndt'], ' ', $context['user']['name'],',</li>';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo '
<li>', $txt['msg_alert_you_have'], ' <a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt['msg_alert_messages'] : $txt['message_lowercase'], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'],'</li>';

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '<li>[<strong>', $txt['maintenance'], '</strong>]';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '[<a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] , '', $txt['approve'], '</a> ]</li>';

echo '
<li><a href="', $scripturl, '?action=unread">', $txt['view_unread'], '</a> &bull;
<a href="', $scripturl, '?action=unreadreplies">', $txt['view_replies'], '</a> &bull;
<a href="', $scripturl, '?action=profile;area=showposts;u=', $context['user']['id'], '">', $txt['view_own_posts'], '</a></li>';

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
<li>', $txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged5'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged6'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged7'], '</li>';
}
echo '
</ul>';
}

// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo '
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
<div id="log-username">
<input class="log-input" name="user" type="text" onfocus="if(this.value==\'', $txt['username'], '\')value=\'\';" onblur="if(this.value==\'\')value=\'', $txt['username'], '\';" value="', $txt['username'], '" />
</div>
<div id="log-password">
<input class="log-input" name="passwrd" type="password" onfocus="if(this.value==\'', $txt['password'], '\')value=\'\';" onblur="if(this.value==\'\')value=\'', $txt['password'], '\';" value="', $txt['password'], '" />
</div>
<input id="loginbutton" type="submit" value="" name="submit" />
<input type="hidden" name="cookielength" value="-1" />
</form>
<a id="register" href="', $scripturl, '?action=register"></a>';
}

echo '

</div>
</div> ';
SimplePortal 2.3.8 © 2008-2024, SimplePortal