News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Parse errors, login form top

Started by eddie8, March 16, 2009, 01:55:59 PM

Previous topic - Next topic

eddie8

Board

I have been at this for about 3 days, I see this on other themes

I am trying to place a login form at the top of the page
version 2.0 RC1 (classic theme) when I place this code inside a <td></td>
I get a parse error, any idea whats wrong, am I missing some code?.


// (index.template.php)

// Show a vB style login for quick login?
if ($context['show_quick_login'])
{
echo '
<table cellspacing="0" cellpadding="0" border="0" align="center" width="95%">
<tr><td nowrap="nowrap" align="right">
<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'] . '\');"' : '', '><br />
<input type="text" name="user" size="7" />
<input type="password" name="passwrd" size="7" />
<select name="cookielength">
<option value="60">', $txt['one_hour'], '</option>
<option value="1440">', $txt['one_day'], '</option>
<option value="10080">', $txt['one_week'], '</option>
<option value="43200">', $txt['one_month'], '</option>
<option value="-1" selected="selected">', $txt['forever'], '</option>
</select>
<input type="submit" value="', $txt['login'], '" /><br />
', $txt['quick_login_dec'], '
<input type="hidden" name="hash_passwrd" value="" />
</form>
</td></tr>
</table>';
}

// Don't show a login box, just a break.
else
echo '
<br />';

// End of login code

Thanks
Ed

tyty1234

Can you tell us exactly the error you are getting?
My Activity: Inactive
My Links: tyty1234's SMF Site | SMF Package Parser | SMF Helper | My Mods [5]
Subscribe to my SMF blog for updates
PMs for support will not be accepted, unless requested otherwise.

eddie8

   
I fixed it, its tricky where you can place it.

If anyone using the 2.0 RC1 classic theme and would like a login box
at the top of page, here is how I did it, in index.template.php



Look for
// Show the menu here, according to the menu sub template.
template_menu();

echo '
</td>
</tr>';

// Show a random news item? (or you could pick one from news_lines...)



replace with this

// Show the menu here, according to the menu sub template.
template_menu();

echo '
</td>
</tr>';

// Show a vB style login for quick login? TOP OF PAGE
if ($context['show_quick_login'])
{
echo '
<table cellspacing="0" cellpadding="0" border="0" align="center" width="95%">
<tr><td nowrap="nowrap" align="right">
<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'] . '\');"' : '', '><br />
<input type="text" name="user" size="7" />
<input type="password" name="passwrd" size="7" />
<select name="cookielength">
<option value="60">', $txt['one_hour'], '</option>
<option value="1440">', $txt['one_day'], '</option>
<option value="10080">', $txt['one_week'], '</option>
<option value="43200">', $txt['one_month'], '</option>
<option value="-1" selected="selected">', $txt['forever'], '</option>
</select>
<input type="submit" value="', $txt['login'], '" /><br />
', $txt['quick_login_dec'], '
<input type="hidden" name="hash_passwrd" value="" />
</form>
</td></tr>
</table>';
}

// Don't show a login box, just a break.
else
echo '
<br />';
// Show a random news item? (or you could pick one from news_lines...)


Hope that helps someone
Ed

universalsameera

You my friend is a genius. This is exactly I wanted.  :) I encourage everyone to post their solution like this rather than saying I fixed it it really helps.

Advertisement: