News:

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

Main Menu

Help Trying to create my first theme

Started by ormuz, May 26, 2008, 12:56:19 PM

Previous topic - Next topic

ormuz

Hi guys, I'm trying to do something new in my first theme, my idea is to insert the user info table (avatar, unread, new posts ...etc) in a slide panel with jquery...

I already insert the slide panel in the theme but I'm having problems (template parse errors) to insert my code in the slide panel div

This is the slide panel (http://www.webdesignerwall.com/demo/jquery/simple-slide-panel.html)

And this is the code for the user info table (I'm playing with the code from musiconia theme), any chance  to insert this code in the slide panel div without problems?

// display user name

echo '

<table width="100%" cellpadding="0" cellspacing="0" border="0" >

<tr>';



echo '

<tr>

<td valign="top" colspan="2">

<table width="100%" class="bordercolor" cellpadding="8" cellspacing="1" border="0" style="margin-top: 1px;">

<tr>';



if (!empty($context['user']['avatar']))

echo '

<td class="windowbg" valign="middle">', $context['user']['avatar']['image'], '</td>';



echo '

<td colspan="2" width="100%" valign="top" class="windowbg2"><span class="middletext">';



// If the user is logged in, display stuff like their name, new messages, etc.

if ($context['user']['is_logged'])

{

echo '

<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />

<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';



}

// Otherwise they're a guest - send them a lovely greeting...

else

echo $txt['welcome_guest'];



// Now, onto our second set of info, are they logged in again?

if ($context['user']['is_logged'])

{

// Is the forum in maintenance mode?

if ($context['in_maintenance'] && $context['user']['is_admin'])

echo '

<b>', $txt[616], '</b><br />';



// Are there any members waiting for approval?

if (!empty($context['unapproved_members']))

echo '

', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '<br />';



// Show the total time logged in?

if (!empty($context['user']['total_time_logged_in']))

{

echo '

', $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['totalTimeLogged2'];



// 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['totalTimeLogged3'];



// But, let's always show minutes - Time wasted here: 0 minutes ;).

echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';

}

echo ' </span>';

}

// 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'], '/sha1.js"></script>



<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>

<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />

<select name="cookielength">

<option value="60">', $txt['smf53'], '</option>

<option value="1440">', $txt['smf47'], '</option>

<option value="10080">', $txt['smf48'], '</option>

<option value="43200">', $txt['smf49'], '</option>

<option value="-1" selected="selected">', $txt['smf50'], '</option>

</select>

<input type="submit" value="', $txt[34], '" /><br />

<span class="middletext">', $txt['smf52'], '</span>

<input type="hidden" name="hash_passwrd" value="" />

</form>';

}



echo '

<span class="smalltext">' , $context['current_time'], '</span><br />';



// Go to PM center... [pm]

if ($context['user']['is_logged'] && $context['allow_pm'])

echo '

<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>';



echo '

</td>

</tr>

</table>

</td>

</tr>

</table>';



echo '

<div class="titlebg">

', template_menu(), '

</div>';



echo '

</div>';

Hoochie Coochie Man

But that panel's width = 570px
Panel is using this body css code


Quotebody {
   margin: 0 auto;
   padding: 0;
   width: 570px;
   font: 75%/120% Arial, Helvetica, sans-serif;
}

So the panel will be in full width!
If you still want it, I can help you..
İnadına SMF 1.1.X

ormuz

Quote from: Hoochie Coochie Man™ on May 26, 2008, 08:58:24 PM
But that panel's width = 570px
Panel is using this body css code


Quotebody {
   margin: 0 auto;
   padding: 0;
   width: 570px;
   font: 75%/120% Arial, Helvetica, sans-serif;
}

So the panel will be in full width!
If you still want it, I can help you..

I know, That is just an example of the code that I'm using...

I see that you already make a theme with a panel like this, let me see if your code can help me...

Advertisement: