News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

SimplePortal

Started by SimplePortal Team, March 10, 2008, 11:16:07 PM

Previous topic - Next topic

bomdsquad

Hi [SiNaN] , ure portal rocks !

(www.nzbands.co.nz)
My site is geared towards events and I want to have a 'Recent Events' block from the calander events, any suggestions on how to do this?

Also, how can I make the html block textarea bigger?

Thanks!

www.initial.net.nz [nofollow]

Manu.G

#1021
Quote from: tuguex on August 12, 2008, 03:46:43 PM

I still don't know create custom tabs  ::)  , i follow the tutorial, but i can't search some essencial "keywords" .
Can you do it for me? ;)

Here is my index.template.php file from default theme  ;)
<?php
// Version: 1.1; Display

function template_main()
{
  global
$context, $settings, $options, $txt, $scripturl, $modSettings;
 
//Display ads on the thread page
 
if (function_exists("show_threadAds"))
  {
     
$ads = show_threadAds();  
     if(!empty(
$ads))
        if(
$ads['type']==0)
           echo
$ads['content'];
        else
           eval(
$ads['content']);
     unset(
$ads);
  }

 
//Display ads on the thread page
 
if (function_exists("show_threadAds"))
  {
     
$ads = show_threadAds();  
     if(!empty(
$ads))
        if(
$ads['type']==0)
           echo
$ads['content'];
        else
           eval(
$ads['content']);
     unset(
$ads);
  }


 
// Show the anchor for the top and for the first message. If the first message is new, say so.
 
echo '
<a name="top"></a>
<a name="msg'
, $context['first_message'], '"></a>', $context['first_new_message'] ? '<a name="new"></a>' : '';

     
// Show the linktree
 
echo '
<div>'
, theme_linktree(), '</div>';

 
// Is this topic also a poll?
 
if ($context['is_poll'])
  {
     echo
'
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="padding-top: 0; margin-bottom: 2ex;">
  <tr>
     <td class="titlebg" colspan="2" valign="middle" style="padding-left: 6px;">
        <img src="'
, $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="bottom" /> ', $txt['smf43'], '
     </td>
  </tr>
  <tr>
     <td width="5%" valign="top" class="windowbg"><b>'
, $txt['smf21'], ':</b></td>
     <td class="windowbg">
        '
, $context['poll']['question'];
     if (!empty(
$context['poll']['expire_time']))
        echo
'
              &nbsp;('
, ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ': ', $context['poll']['expire_time'], ')';

     
// Are they not allowed to vote but allowed to view the options?
     
if ($context['poll']['show_results'] || !$context['allow_vote'])
     {
        echo
'
        <table>
           <tr>
              <td style="padding-top: 2ex;">
                 <table border="0" cellpadding="0" cellspacing="0">'
;

           
// Show each option with its corresponding percentage bar.
       
foreach ($context['poll']['options'] as $option)
           echo
'
                    <tr>
                       <td style="padding-right: 2ex;'
, $option['voted_this'] ? 'font-weight: bold;' : '', '">', $option['option'], '</td>', $context['allow_poll_view'] ? '
                       <td nowrap="nowrap">'
. $option['bar'] . ' ' . $option['votes'] . ' (' . $option['percent'] . '%)</td>' : '', '
                    </tr>'
;

        echo
'
                 </table>
              </td>
              <td valign="bottom" style="padding-left: 15px;">'
;

       
// If they are allowed to revote - show them a link!
       
if ($context['allow_change_vote'])
           echo
'
              <a href="'
, $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], ';sesc=', $context['session_id'], '">', $txt['poll_change_vote'], '</a><br />';

       
// If we're viewing the results... maybe we want to go back and vote?
       
if ($context['poll']['show_results'] && $context['allow_vote'])
           echo
'
                 <a href="'
, $scripturl, '?topic=', $context['current_topic'], '.', $context['start'], '">', $txt['poll_return_vote'], '</a><br />';

       
// If they're allowed to lock the poll, show a link!
       
if ($context['poll']['lock'])
           echo
'
                 <a href="'
, $scripturl, '?action=lockVoting;topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', !$context['poll']['is_locked'] ? $txt['smf30'] : $txt['smf30b'], '</a><br />';

       
// If they're allowed to edit the poll... guess what... show a link!
       
if ($context['poll']['edit'])
           echo
'
                 <a href="'
, $scripturl, '?action=editpoll;topic=', $context['current_topic'], '.', $context['start'], '">', $txt['smf39'], '</a>';

        echo
'
              </td>
           </tr>'
, $context['allow_poll_view'] ? '
           <tr>
              <td colspan="2"><b>'
. $txt['smf24'] . ': ' . $context['poll']['total_votes'] . '</b></td>
           </tr>'
: '', '
        </table><br />'
;
     }
     
// They are allowed to vote! Go to it!
     
else
     {
        echo
'
        <form action="'
, $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '" style="margin: 0px;">
           <table>
              <tr>
                 <td colspan="2">'
;

       
// Show a warning if they are allowed more than one option.
       
if ($context['poll']['allowed_warning'])
           echo
'
                    '
, $context['poll']['allowed_warning'], '
                 </td>
              </tr><tr>
                 <td>'
;

       
// Show each option with its button - a radio likely.
       
foreach ($context['poll']['options'] as $option)
           echo
'
                    '
, $option['vote_button'], ' ', $option['option'], '<br />';

        echo
'
                 </td>
                 <td valign="bottom" style="padding-left: 15px;">'
;

       
// Allowed to view the results? (without voting!)
       
if ($context['allow_poll_view'])
           echo
'
                    <a href="'
, $scripturl, '?topic=', $context['current_topic'], '.', $context['start'], ';viewResults">', $txt['smf29'], '</a><br />';

       
// Show a link for locking the poll as well...
       
if ($context['poll']['lock'])
           echo
'
                    <a href="'
, $scripturl, '?action=lockVoting;topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', (!$context['poll']['is_locked'] ? $txt['smf30'] : $txt['smf30b']), '</a><br />';

       
// Want to edit it? Click right here......
       
if ($context['poll']['edit'])
           echo
'
                    <a href="'
, $scripturl, '?action=editpoll;topic=', $context['current_topic'], '.', $context['start'], '">', $txt['smf39'], '</a>';

           echo
'
                 </td>
              </tr><tr>
                 <td colspan="2"><input type="submit" value="'
, $txt['smf23'], '" /></td>
              </tr>
           </table>
           <input type="hidden" name="sc" value="'
, $context['session_id'], '" />
        </form>'
;
     }

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

 
// Does this topic have some events linked to it?
 
if (!empty($context['linked_calendar_events']))
  {
     echo
'
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="padding-top: 0; margin-bottom: 3ex;">
     <tr>
           <td class="titlebg" valign="middle" align="left" style="padding-left: 6px;">
                 '
, $txt['calendar_linked_events'], '
           </td>
     </tr>
     <tr>
           <td width="5%" valign="top" class="windowbg">
                 <ul>'
;
     foreach (
$context['linked_calendar_events'] as $event)
        echo
'
                       <li>
                          '
, ($event['can_edit'] ? '<a href="' . $event['modify_href'] . '" style="color: red;">*</a> ' : ''), '<b>', $event['title'], '</b>: ', $event['start_date'], ($event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : ''), '
                       </li>'
;
     echo
'
                 </ul>
           </td>
     </tr>
</table>'
;
  }

 
// Build the normal button array.
 
$normal_buttons = array(
     
'reply' => array('test' => 'can_reply', 'text' => 146, 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies']),
     
'notify' => array('test' => 'can_mark_notify', 'text' => 125, 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm('' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '');"', 'url' => $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),
     
'custom' => array(),
     
'send' => array('test' => 'can_send_topic', 'text' => 707, 'image' => 'sendtopic.gif', 'lang' => true, 'url' => $scripturl . '?action=sendtopic;topic=' . $context['current_topic'] . '.0'),
     
'print' => array('text' => 465, 'image' => 'print.gif', 'lang' => true, 'custom' => 'target="_blank"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'),
  );

 
// Special case for the custom one.
 
if ($context['user']['is_logged'] && $settings['show_mark_read'])
     
$normal_buttons['custom'] = array('text' => 'mark_unread', 'image' => 'markunread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']);
  elseif (
$context['can_add_poll'])
     
$normal_buttons['custom'] = array('text' => 'add_poll', 'image' => 'add_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']);
  else
     unset(
$normal_buttons['custom']);

 
// Make Article Button
 
if ($context['can_make_article'])
     
$normal_buttons['article'] = array('text' => 'sp-make_article', 'image' => 'addarticle.gif', 'lang' => true, 'url' => $scripturl . '?sa=addarticle;message=' . $context['topic_first_message'] . ';return=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']);

 
// Show the page index... "Pages: [1]".
 
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr>
     <td class="middletext" valign="bottom" style="padding-bottom: 4px;">'
, $txt[139], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#lastPost"><b>' . $txt['topbottom5'] . '</b></a>' : '', '</td>
     <td align="right" style="padding-right: 1ex;">
        <div class="nav" style="margin-bottom: 2px;"> '
, $context['previous_next'], '</div>
        <table cellpadding="0" cellspacing="0">
           <tr>
              '
, template_button_strip($normal_buttons, 'bottom'), '
           </tr>
        </table>
     </td>
  </tr>
</table>'
;

 
// Show the topic information - icon, subject, etc.
 
echo '
<table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="border-bottom: 0;">
     <tr class="catbg3">
           <td valign="middle" width="2%" style="padding-left: 6px;">
                 <img src="'
, $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" />
           </td>
           <td width="13%"> '
, $txt[29], '</td>
           <td valign="middle" width="85%" style="padding-left: 6px;" id="top_subject">
                 '
, $txt[118], ': ', $context['subject'], ' &nbsp;(', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')
           </td>
     </tr>'
;
  if (!empty(
$settings['display_who_viewing']))
  {
     echo
'
     <tr>
           <td colspan="3" class="smalltext">'
;

     
// Show just numbers...?
     
if ($settings['display_who_viewing'] == 1)
           echo
count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt[19];
     
// Or show the actual people viewing the topic?
     
else
        echo empty(
$context['view_members_list']) ? '0 ' . $txt[19] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');

     
// Now show how many guests are here too.
     
echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
           </td>
     </tr>'
;
  }

  echo
'
</table>'
;

  echo
'
<form action="'
, $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return in_edit_mode == 1 ? modify_save('' . $context['session_id'] . '') : confirm('' . $txt['quickmod_confirm'] . '');">';

 
// These are some cache image buttons we may want.
 
$reply_button = create_button('quote.gif', 145, 'smf240', 'align="middle"');
 
$modify_button = create_button('modify.gif', 66, 17, 'align="middle"');
 
$remove_button = create_button('delete.gif', 121, 31, 'align="middle"');
 
$split_button = create_button('split.gif', 'smf251', 'smf251', 'align="middle"');

// Time to display all the posts
 
echo '
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="bordercolor">'
;

 
//Ad Counter
 
$adcounter =0;
 
//Ad Counter
 
$adcounter =0;
 
// Get all the messages...
 
while ($message = $context['get_message']())
  {
     
$adcounter++;
     
$adcounter++;
     echo
'
  <tr><td style="padding: 1px 1px 0 1px;">'
;

     
// Show the message anchor and a "new" anchor if this message is new.
     
if ($message['id'] != $context['first_message'])
        echo
'
     <a name="msg'
, $message['id'], '"></a>', $message['first_new'] ? '<a name="new"></a>' : '';

     echo
'
     <table width="100%" cellpadding="3" cellspacing="0" border="0">
        <tr><td class="'
, $message['alternate'] == 0 ? 'windowbg' : 'windowbg2', '">';

     
// Show information about the poster of this message.
     
echo '
           <table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
              <tr>
                 <td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
                    <b>'
, $message['member']['link'], '</b>
                    <div class="smalltext">'
;

     
// Show the member's custom title, if they have one.
     
if (isset($message['member']['title']) && $message['member']['title'] != '')
        echo
'
                       '
, $message['member']['title'], '<br />';

     
// Show the member's primary group (like 'Administrator') if they have one.
     
if (isset($message['member']['group']) && $message['member']['group'] != '')
        echo
'
                       '
, $message['member']['group'], '<br />';

     
// Don't show these things for guests.
     
if (!$message['member']['is_guest'])
     {
       
// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
       
if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
           echo
'
                       '
, $message['member']['post_group'], '<br />';
        echo
'
                       '
, $message['member']['group_stars'], '<br />';

       
// Is karma display enabled?  Total or +/-?
       
if ($modSettings['karmaMode'] == '1')
           echo
'
                       <br />
                       '
, $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '<br />';
        elseif (
$modSettings['karmaMode'] == '2')
           echo
'
                       <br />
                       '
, $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '<br />';

       
// Is this user allowed to modify this member's karma?
       
if ($message['member']['karma']['allow'])
           echo
'
                       <a href="'
, $scripturl, '?action=modifykarma;sa=applaud;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.' . $context['start'], ';m=', $message['id'], ';sesc=', $context['session_id'], '">', $modSettings['karmaApplaudLabel'], '</a>
                       <a href="'
, $scripturl, '?action=modifykarma;sa=smite;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';m=', $message['id'], ';sesc=', $context['session_id'], '">', $modSettings['karmaSmiteLabel'], '</a><br />';

       
// Show online and offline buttons?
       
if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
           echo
'
                       '
, $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $message['member']['online']['image_href'] . '" alt="' . $message['member']['online']['text'] . '" border="0" style="margin-top: 2px;" />' : $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $message['member']['online']['text'] . '</span>' : '', '<br /><br />';

       
// Show the member's gender icon?
       
if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '')
           echo
'
                       '
, $txt[231], ': ', $message['member']['gender']['image'], '<br />';

       
// Show how many posts they have made.
//         echo '
//                        ', $txt[26], ': ', $message['member']['posts'], '<br />
//                        <br />';

           // BEGIN SMFShop MOD New Version Code
        // Removed one <br /> from end of post count line.
       
echo '
                       '
, $txt[26], ': ', $message['member']['posts'], '<br />
                       '
;
                       
        echo
'
                       '
, $modSettings['shopCurrencyPrefix'], $message['member']['money'], $modSettings['shopCurrencySuffix'], '<br /><br />
                       <a href="'
, $scripturl, '?action=shop;do=invother2;member=', $message['member']['username'], '">View Inventory</a><br />
                       <a href="'
, $scripturl, '?action=shop;do=sendmoney;member=', $message['member']['username'], '">Send Money to ', $message['member']['name'], '</a><br />';
       
//END SMFShop code

        // Show avatars, images, etc.?
       
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
           echo
'
                       <div style="overflow: auto; width: 100%;">'
, $message['member']['avatar']['image'], '</div><br />';

       
// Show their personal text?
       
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
           echo
'
                       '
, $message['member']['blurb'], '<br />
                       <br />'
;

       
// This shows the popular messaging icons.
       
echo '
                       '
, $message['member']['icq']['link'], '
                       '
, $message['member']['msn']['link'], '
                       '
, $message['member']['aim']['link'], '
                       '
, $message['member']['yim']['link'], '<br />';

       
// Show the profile, website, email address, and personal message buttons.
       
if ($settings['show_profile_buttons'])
        {
           
// Don't show the profile button if you're not allowed to view the profile.
           
if ($message['member']['can_view_profile'])
              echo
'
                       <a href="'
, $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.gif" alt="' . $txt[27] . '" title="' . $txt[27] . '" border="0" />' : $txt[27]), '</a>';

           
// Don't show an icon if they haven't specified a website.
           
if ($message['member']['website']['url'] != '')
              echo
'
                       <a href="'
, $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.gif" alt="' . $txt[515] . '" border="0" />' : $txt[515]), '</a>';

           
// Don't show the email address if they want it hidden.
           
if (empty($message['member']['hide_email']))
              echo
'
                       <a href="mailto:'
, $message['member']['email'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt[69] . '" title="' . $txt[69] . '" border="0" />' : $txt[69]), '</a>';

           
// Since we know this person isn't a guest, you *can* message them.
           
if ($context['can_send_pm'])
              echo
'
                       <a href="'
, $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['label'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '.gif" alt="' . $message['member']['online']['label'] . '" border="0" />' : $message['member']['online']['label'], '</a>';
        }
     }
     
// Otherwise, show the guest's email.
     
elseif (empty($message['member']['hide_email']))
        echo
'
                       <br />
                       <br />
                       <a href="mailto:'
, $message['member']['email'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt[69] . '" title="' . $txt[69] . '" border="0" />' : $txt[69]), '</a>';

     
// Done with the information about the poster... on to the post itself.
     
echo '
                    </div>
                 </td>
                 <td valign="top" width="85%" height="100%">
                    <table width="100%" border="0"><tr>
                       <td valign="middle"><a href="'
, $message['href'], '"><img src="', $message['icon_url'] . '" alt="" border="0" /></a></td>
                       <td valign="middle">
                          <div style="font-weight: bold;" id="subject_'
, $message['id'], '">
                             <a href="'
, $message['href'], '">', $message['subject'], '</a>
                          </div>'
;

     
// If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
     
echo '
                          <div class="smalltext">« <b>'
, !empty($message['counter']) ? $txt[146] . ' #' . $message['counter'] : '', ' ', $txt[30], ':</b> ', $message['time'], ' »</div></td>
                       <td align="'
, !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" height="20" style="font-size: smaller;">';

     
// Can they reply? Have they turned on quick reply?
     
if ($context['can_reply'] && !empty($options['display_quick_reply']))
        echo
'
              <a href="'
, $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';num_replies=', $context['num_replies'], ';sesc=', $context['session_id'], '" onclick="doQuote(', $message['id'], ', '', $context['session_id'], ''); return false;">', $reply_button, '</a>';

     
// So... quick reply is off, but they *can* reply?
     
elseif ($context['can_reply'])
        echo
'
              <a href="'
, $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';num_replies=', $context['num_replies'], ';sesc=', $context['session_id'], '">', $reply_button, '</a>';

     
// Can the user modify the contents of this post?
     
if ($message['can_modify'])
        echo
'
              <a href="'
, $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $modify_button, '</a>';

     
// How about... even... remove it entirely?!
     
if ($message['can_remove'])
        echo
'
              <a href="'
, $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';sesc=', $context['session_id'], '" onclick="return confirm('', $txt[154], '?');">', $remove_button, '</a>';

     
// What about splitting it off the rest of the topic?
     
if ($context['can_split'])
        echo
'
              <a href="'
, $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '">', $split_button, '</a>';

     
// Show a checkbox for quick moderation?
     
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove'])
        echo
'
                          <input type="checkbox" name="msgs[]" value="'
, $message['id'], '" class="check" ', empty($settings['use_tabs']) ? 'onclick="document.getElementById('quickmodSubmit').style.display = '';"' : '', ' />';

     
// Show the post itself, finally!
     
echo '
                       </td>
                    </tr></table>
                    <hr width="100%" size="1" class="hrcolor" />
                    <div class="post"'
, $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', $message['can_modify'] ? '
                    <img src="'
. $settings['images_url'] . '/icons/modify_inline.gif" alt="" align="right" id="modify_button_' . $message['id'] . '" style="cursor: pointer; display: none;" onclick="modify_msg('' . $message['id'] . '', '' . $context['session_id'] . '')" />' : '' , '
                 </td>
              </tr>'
;

     
// Now for the attachments, signature, ip logged, etc...
     
echo '
              <tr>
                 <td valign="bottom" class="smalltext" width="85%">
                    <table width="100%" border="0" style="table-layout: fixed;"><tr>
                       <td colspan="2" class="smalltext" width="100%">'
;

     
// Assuming there are attachments...
     
if (!empty($message['attachment']))
     {
        echo
'
                          <hr width="100%" size="1" class="hrcolor" />
                          <div style="overflow: auto; width: 100%;">'
;
        foreach (
$message['attachment'] as $attachment)
        {
           if (
$attachment['is_image'])
           {
              if (
$attachment['thumbnail']['has_thumb'])
                 echo
'
                          <a href="'
, $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><br />';
              else
                 echo
'
                          <img src="'
. $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />';
           }
           echo
'
                             <a href="'
. $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';
        }

        echo
'
                          </div>'
;
     }

     echo
'
                       </td>
                    </tr><tr>
                       <td valign="bottom" class="smalltext" id="modified_'
, $message['id'], '">';

     
// Show "« Last Edit: Time by Person »" if this post was edited.
     
if ($settings['show_modify'] && !empty($message['modified']['name']))
        echo
'
                          « <i>'
, $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], '</i> »';

     echo
'
                       </td>
                       <td align="'
, !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" class="smalltext">';

     
// Maybe they want to report this post to the moderator(s)?
     
if ($context['can_report_moderator'])
        echo
'
                          <a href="'
, $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['rtm1'], '</a> &nbsp;';
     echo
'
                          <img src="'
, $settings['images_url'], '/ip.gif" alt="" border="0" />';

     
// Show the IP to this user for this post - because you can moderate?
     
if ($context['can_moderate_forum'] && !empty($message['member']['ip']))
        echo
'
                          <a href="'
, $scripturl, '?action=trackip;searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqWin(this.href);" class="help">(?)</a>';
     
// Or, should we show it because this is you?
     
elseif ($message['can_see_ip'])
        echo
'
                          <a href="'
, $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $message['member']['ip'], '</a>';
     
// Okay, are you at least logged in?  Then we can show something about why IPs are logged...
     
elseif (!$context['user']['is_guest'])
        echo
'
                          <a href="'
, $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $txt[511], '</a>';
     
// Otherwise, you see NOTHING!
     
else
        echo
'
                          '
, $txt[511];

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

     
// Show the member's signature?
     
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
        echo
'
                    <hr width="100%" size="1" class="hrcolor" />
                    <div class="signature">'
, $message['member']['signature'], '</div>';

     echo
'
                 </td>
              </tr>
           </table>
        </td></tr>
     </table>
  </td></tr>'
;
if (
function_exists("show_posts"))
{
  if (
$adpost = show_posts($adcounter))
  {
     if(
$modSettings['ads_lookLikePosts'])
     {
        echo
'

  <tr><td style="padding: 1px 1px 0 1px;">
     <table width="100%" cellpadding="3" cellspacing="0" border="0">
        <tr><td class="windowbg3">
           <table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
              <tr>
                 <td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
                    <b>'
, $context['forum_name'], '</b>
                    <div class="smalltext">
                    </div>
                 </td>
                 <td valign="top" width="85%" height="100%">
                    <table width="100%" border="0"><tr>
                       <td valign="middle"><img src="'
, $message['icon_url'] . '" alt="" border="0" /></td>
                       <td valign="middle">
                          <div style="font-weight: bold;" id="subject_'
, $message['id'], '">
                             <a href="'
, $message['href'], '">', $message['subject'], '</a>
                          </div>

That's not your index.template.php, it's the d
Version SMF 2.0.8
SimplePortal 2.3.5

tuguex

Yes :S

Here is the right

<?php
// Version: 1.1.4; index

/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context, $settings, $options, $txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '1.1';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;

/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = true;

/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;

// Color changer
if(!$context['user']['is_guest'] && isset($_POST['options']['theme_color']))
{
include_once($GLOBALS['sourcedir'] . '/Profile.php');
makeThemeChanges($context['user']['id'], $settings['theme_id']);
$options['theme_color'] = $_POST['options']['theme_color'];
}
elseif ($context['user']['is_guest'])
{
if (isset($_POST['options']['theme_color']))
{
 $_SESSION['theme_color'] = $_POST['options']['theme_color'];
 $options['theme_color'] = $_SESSION['theme_color'];
}
elseif (isset($_SESSION['theme_color']))
 $options['theme_color'] = $_SESSION['theme_color'];
}
}



// The main sub template above the content.
function template_main_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
, $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
<meta http-equiv="Content-Type" content="text/html; charset='
, $context['character_set'], '" />
<meta name="description" content="'
, $context['page_title'], '" />', empty($context['robot_no_index']) ? '' : '
<meta name="robots" content="noindex" />'
, '
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script type="text/javascript" src="'
, $settings['default_theme_url'], '/script.js?fin11"></script>
<script type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
, $settings['theme_url'], '";
var smf_images_url = "'
, $settings['images_url'], '";
var smf_scripturl = "'
, $scripturl, '";
var smf_iso_case_folding = '
, $context['server']['iso_case_folding'] ? 'true' : 'false', ';
var smf_charset = "'
, $context['character_set'], '";
// ]]></script>
<title>'
, $context['page_title'], '</title>';

// Any color set by user?
if (isset($options['theme_color']))
$settings['theme_main_color'] = $options['theme_color'];

// If not set, or if not allowed to set
if(!isset($options['theme_color']) || (isset($settings['allow_color_change']) && $settings['allow_color_change'] == 'no'))
{
// Defaults.
$options['theme_color'] = isset($settings['theme_main_color']) ? $settings['theme_main_color'] : 'blue';
$settings['theme_main_color'] = $options['theme_color'];
}

// The ?fin11 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="'
, $settings['theme_url'], '/style_' , $settings['theme_main_color'] , '.css?fin11" />
<link rel="stylesheet" type="text/css" href="'
, $settings['default_theme_url'], '/print.css?fin11" media="print" />
<!--[if IE]>
<style type="text/css">
/* IE hack to emulate the :hover & :focus pseudo-classes
Add the selectors below that required the extra attributes */
.hoverbox { behavior: url("'
, $settings['theme_url'], '/pseudo-hover.htc"); }
</style>
<![endif]-->'
;

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
, $settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
, $scripturl, '?action=help" target="_blank" />
<link rel="search" href="'
. $scripturl . '?action=search" />
<link rel="contents" href="'
, $scripturl, '" />';


// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
, $context['forum_name'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="'
, $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="'
, $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="'
. $scripturl . '?board=' . $context['current_board'] . '.0" />';

// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
$options['collapse_header'] = !empty($_COOKIE['upshrink']);

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
<script type="text/javascript"><!-- // --><![CDATA[
var current_header = '
, empty($options['collapse_header']) ? 'false' : 'true', ';
function shrinkHeader(mode)
{'
;

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "'
, $context['session_id'], '");';
echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");
document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";
current_header = mode;
}
// ]]></script>'
;

// the routine for the info center upshrink
echo '
<script type="text/javascript"><!-- // --><![CDATA[
var current_header_ic = '
, empty($options['collapse_header_ic']) ? 'false' : 'true', ';
function shrinkHeaderIC(mode) {'
;
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "'
, $context['session_id'], '");';
echo '
document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");
document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";
current_header_ic = mode;
}
// ]]></script>
</head>
<body onload="PreloadFlag = true;">'
;
//Display ads on the top of the page
if (function_exists("show_topofpageAds"))
{
$ads = show_topofpageAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}
echo '
<table cellspacing="0" cellpadding="0" align="center" style="border:0 none;width:'
, (isset($settings['page_div_width']) && !empty($settings['page_div_width'])) ? $settings['page_div_width'] : '100%' ,  '">
<tr>
<td class="border_left"></td>
<td class="content">
<div class="topbar">
<table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
<tr>
<td id="header_logo" width="1">'
;
// Show the logo.  It'll be either the default image, or one you set in the Theme Settings.  The stock logo is logo.gif in the images directory for each color.
if (empty($settings['header_logo_url']))
echo '
<a href="'
, $scripturl, '" class="topimg"><img src="', $settings['images_url'] . '/'. $settings['theme_main_color'], '/logo.gif" style="margin: 0px;border: 0 none;height: 89px" ',  (empty($settings['show_name_near_logo'])) ? 'alt="'.$context['forum_name'].'"' : 'alt=""' ,' title="', $context['forum_name'], '" /></a>';
else echo '
<a href="'
, $scripturl, '" title="', $context['forum_name'], '" class="topimg"><img src="', $settings['header_logo_url'], '" style="border: 0 none;vertical-align:middle;margin: 0px;" ',  (empty($settings['show_name_near_logo'])) ? 'alt="'.$context['forum_name'].'"' : 'alt=""' ,' /></a>';
echo '
</td>'
;

// Show the name near the logo, if it's wanted.
if (!empty($settings['show_name_near_logo']))
echo '
<td>
<span class="toptitle">'
, $context['forum_name'], '</span>
</td>'
;

// If set, show the search box or login box in the header.
if ($context['user']['is_guest'])
echo '
<td id="header_right">
<script type="text/javascript" src="'
, $settings['default_theme_url'], '/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 class="login_bg" type="text" name="user" alt="'
,$txt[35],'" title="',$txt[35],'" /><br />
<input class="login_bg" type="password" name="passwrd" maxlength="32" alt="'
, $txt[36], '" title="', $txt[36], '" /><br />
<input type="hidden" name="cookielength" value="-1" />
<input type="submit" class="login_bg_submit" name="login" value="'
, $txt[34], '" />
<input type="hidden" name="hash_passwrd" value="" />
</form>
</td>'
;
echo '
</tr>
</table>
</div>'
;

// Here we got another bar!  This one serves up random news lines, the current time, and those neat little bar peanuts!
echo '
<div style="width: 100%; padding-top: 4px;" id="bg_header_bar">
<table border="0" cellspacing="0" cellpadding="0" style="width: 100%;">
<tr style="vertical-align:middle">'
;

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '

<td class="smalltext" style="vertical-align:middle;padding-left:20px; padding-top:0px; padding-bottom:0px;">
<strong>'
, $txt[102], '</strong>: ', $context['random_news_line'], '
</td>'
;
echo '
<td class="smalltext" style="vertical-align:middle;text-align:right;padding-right:10px; padding-top:0px; padding-bottom:0px;font-weight:bold">
'
, $context['current_time'], '
</td>
</tr>
</table>
</div>'
;

// Show that lovable template menu.
template_menu();

// Start the contect section.
echo '
<div class="content">'
;

// Below the menu ads go here, oh boy!
if (function_exists("show_indexAds")) {
$ads = show_indexAds();
if(!empty($ads)) {
echo '
<div class="memberbardiv" align="center">'
;
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
echo '</div>';
}
unset($ads);
}

// PM box, from Apollo.
if ($context['user']['is_logged'] && $context['allow_pm'] && $context['user']['unread_messages']>=1)
echo '
<div id="pm_new" align="center"><a class="hoverbox" href="'
, $scripturl, '?action=pm">', $txt[660], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt[471] : $txt[153], '.  ', $txt[661], ' ', $txt[662], ' ', $txt[663], '</a></div>';

// We start with the member bar.  Guests only have a thin bar with the guest greeting and color chooser.
// In the settings, you can also set whether guests/users see a login box/search box here, like in Dilber MC.
// Members have the greeting, color changer, avatar, PM links, new post links, and some warnings.
echo '
<div class="memberbardiv">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="20"></td>
<td class="memberbar">'
;

if($context['user']['is_logged'])
echo '
'
, $txt['hello_member_ndt'], ' <strong>', $context['user']['name'] , '</strong>';
else
echo $txt['welcome_guest'];

echo '
</td>
<td class="middletext" align="right" valign="top" style="padding-right:10px; padding-left:10px;">
<a style="float:right" href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="'
, $settings['images_url'], '/', empty($options['collapse_header']) ? 'collapse.gif' : 'expand.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="vertical-align:top" /></a>
</td>
</tr>

<tr id="upshrinkHeader"'
, empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
<td valign="middle" width="1" style="padding-right:10px; padding-left:10px;">'
;

// Complicated stuff!  If you're logged in and have an avatar, show it.  If you're
// logged in and don't have one, show a "No Avatar" avatar based on your color and
// language.  Otherwise, show a "Guest" avatar based on your color and language.
if($context['user']['is_logged'])
echo '
'
,  !empty($context['user']['avatar']) ? $context['user']['avatar']['image'] : '<img src="'. $settings['images_url']. '/'. $context['user']['language']. '/'. $settings['theme_main_color']. '/no_avatar.gif" width="80" height="80" alt="" />';
else echo '
<img src="'
, $settings['images_url'], '/', $context['user']['language'], '/', $settings['theme_main_color'], '/guest_avatar.gif" width="80" height="80" alt="" />';
echo '
</td>
<td class="memberbar">'
;
// If you're logged in, show PM info and links to new posts.
if($context['user']['is_logged'])
echo '
<br />
<span class="middletext">'
, $context['allow_pm'] ? '<strong>' . $txt[152] . ' <a href="' . $scripturl . '?action=pm">' . $context['user']['messages'] . ' ' . ($context['user']['messages'] != 1 ? $txt[153] : $txt[471]) . '</a>' . $txt['newmessages4'] . ' ' . $context['user']['unread_messages'] . ' ' . ($context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1']).'</strong>' : '<br/>', '.<br/><br/>
&raquo; <a href="'
, $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />
&raquo; <a href="'
, $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />
</span>'
;
echo '
</td>
<td class="middletext" style="text-align:right;vertical-align:top;padding-right:10px; padding-left:10px;">
<br />'
;
// Are they logged in?
if ($context['user']['is_logged']) {
// 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 />';
}

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
<strong>'
, $txt[616], '</strong><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 />';

// If searching is allowed, and you can't show the boxes in the header, put it here.
if(!empty($settings['boxes_in_header']) && ($context['allow_search'])) {
echo '
<br />
<form action="'
, $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<a href="'
, $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" alt="" /></a>
<input type="text" name="search" value="" />
<input type="submit" name="submit" value="'
, $txt[182], '" style="vertical-align:top" />
<input type="hidden" name="advanced" value="0" />'
;
// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="'
, $context['current_topic'], '" />';
// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd['
, $context['current_board'], ']" value="', $context['current_board'], '" />';
echo '
</form>'
;
}
}
// If they're guests, and you can't put the boxes in the header, put them here.
elseif (!empty($settings['boxes_in_header'])) {
echo '
<script type="text/javascript" src="'
, $settings['default_theme_url'], '/sha1.js"></script>
<form action="'
, $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" 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" /><br />
<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 />
<input type="hidden" name="hash_passwrd" value="" />
</form>'
;
}
echo '
</td>
</tr>
<tr id="upshrinkHeader2"'
, empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
<td colspan="3" valign="middle" style="padding: 0 10px">'
;

// color selection box
if(isset($settings['allow_color_change']) && $settings['allow_color_change'] == 'box')
echo '
 <div style="float:right">
<form action="'
, $scripturl, '" method="post" class="smalltext">
<select name="options[theme_color]">
<option value="black"'  
,$settings['theme_main_color'] == 'black' ? ' selected="selected"': '', '>',$txt['apollobb_color_black'],'</option>
<option value="blue"'  
,$settings['theme_main_color'] == 'blue' ? ' selected="selected"': '', '>',$txt['apollobb_color_blue'],'</option>
<option value="green"'
,$settings['theme_main_color'] == 'green' ? ' selected="selected"': '', '>',$txt['apollobb_color_green'],'</option>
<option value="purple"'
,$settings['theme_main_color'] == 'purple' ? ' selected="selected"': '', '>',$txt['apollobb_color_purple'],'</option>
<option value="red"'
,$settings['theme_main_color'] == 'red' ? ' selected="selected"': '', '>',$txt['apollobb_color_red'],'</option>
</select>
<input type="submit" name="submit" value="Change" style="width: 11ex;" />
</form>
</div>'
;
if(isset($settings['allow_color_change']) && $settings['allow_color_change'] == 'bars')
echo '
 <div style="float:right;padding-top:5px">
<form action="'
, $scripturl, '" method="post" class="smalltext">
<input style="border:solid 2px #6C7F93;background:#6C7F93;color:#6C7F93;width:20px;height:20px;font-size:1px" type="submit" value="black" name="options[theme_color]"/>
<input style="border:solid 2px #6699CC;background:#6699CC;color:#6699CC;width:20px;height:20px;font-size:1px" type="submit" value="blue" name="options[theme_color]"/>
<input style="border:solid 2px #4DB45D;background:#4DB45D;color:#4DB45D;width:20px;height:20px;font-size:1px" type="submit" value="green" name="options[theme_color]"/>
<input style="border:solid 2px #A185D6;background:#A185D6;color:#A185D6;width:20px;height:20px;font-size:1px" type="submit" value="purple" name="options[theme_color]"/>
<input style="border:solid 2px #E15050;background:#E15050;color:#E15050;width:20px;height:20px;font-size:1px" type="submit" value="red" name="options[theme_color]"/>
</form>
</div>'
;
echo '
</td>
</tr>
</table>
</div>'
;

//Welcome Ads
if (function_exists("show_welcomeAds")) {
$ads = show_welcomeAds();
if(!empty($ads)) {
echo '<div class="memberbardiv" align="center">';
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
echo '</div>';
}
unset($ads);
}

// Extra stuff here.
if(!empty($settings['custom_global_html']))
echo '
<div align="center" style="width: 90%; margin-left: auto; margin-right: auto; margin-top:10px; border: 0px solid;" class="middletext">
'
, $settings['custom_global_html'], '
</div>'
;

//Below the menu ads
if (function_exists("show_towerleftAds") && function_exists("show_towerrightAds")) {

//Tower left Ads
$ads = show_towerleftAds();
if(!empty($ads))
echo '<table><tr><td valign="top">', $ads['type']==0 ? $ads['content'] : eval($ads['content']) ,'</td><td width="100%" valign="top">';
unset($ads);

//Tower Right Ads
$ads = show_towerrightAds();
if(!empty($ads))
echo '<table><tr><td width="100%" valign="top">';
unset($ads);
}

// Congrats, we're done!  Let's go the content!
}

function
template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;

// What?!  Done already?  Fine, let's get to the footer.

//Close table for towerright ads
if (function_exists("show_towerrightAds") && function_exists("show_towerleftAds") && function_exists("show_bottomAds"))
{
$ads = show_towerrightAds();
if(!empty($ads))
echo '</td><td valign="top">', $ads['type']==0 ? $ads['content'] : eval($ads['content']) ,'</td></tr></table>';

unset($ads);
//Close table for towerleft ads
$ads = show_towerleftAds();
if(!empty($ads))
echo '</td></tr></table>';
unset($ads);

//Show ads on the bottom of the page
$ads = show_bottomAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}

// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" class="ajax_in_progress" style="display: none;'
, $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>';

// Now we close out the content, and move on to the footers.
echo '
</div>
<div id="footer">
<span class="smalltext">
Theme by <a href="http://www.hvmdesign.com" title="Theme by High Velocity Media Web Design">HVMDesign</a>
and <a href="http://www.dizzytechnology.com">Dizzy Technology</a>'
;

// Show custom copyright?
if ($settings['custom_copyright']!="")
echo '<br />
'
,$settings['custom_copyright'];

// Show the load time?
if ($context['show_load_time'])
echo '<br />
'
, $txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'];

echo '
<br />
</span>
</div><br />
<div id="bg_footer">

<div id="footer_left" class="smalltext">'
,theme_copyright(),'</div>
<div id="footer_right" class="smalltext">
<a href="http://validator.w3.org/check/referer" title="'
,$txt['valid_xhtml'],'">', $txt['apollobb_footer_xhtml'],'</a> |
<a href="http://jigsaw.w3.org/css-validator/check/referer" title="'
, $txt['valid_css'], '">',$txt['apollobb_footer_css'],'</a> |
<a href="http://www.php.net/" title="'
, $txt['powered_by_php'], '">',$txt['apollobb_footer_php'],'</a> |
<a href="http://www.mysql.com/" title="'
, $txt['powered_by_mysql'], '">',$txt['apollobb_footer_sql'],'</a>
</div>
</div>
</td>
<td class="border_right"></td>
</tr>
</table>'
;

// Don't even worry about this stuff.  Things do screw up without it, at least I think.
// This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'] || $context['browser']['is_firefox'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script type="text/javascript"><!-- // --><![CDATA['
;

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}'
;
elseif ($context['browser']['is_firefox'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].className == "code" && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.overflow = "scroll";
}
}'
;
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}'
;

echo '
// ]]></script>'
;
}

echo '
</body>
</html>'
;
}

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"...

// Has a nice, cool style from Apollo.
function theme_linktree()
{
global $context, $settings, $options, $txt;

echo '
<table width="100%" cellspacing="1" cellpadding="0" border="0" align="center" class="nav" style="width:100%;margin:2px 0">
<tr>
<td class="nav" style="padding-left:4px" align="left">'
;
// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

$navcond = '';

// If we're at the last link, make the link discolored.
if ($link_num == count($context['linktree']) -1)
$navcond = 'nav-current';

// Show the link, including a URL if it should have one.
echo '<strong>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav '.$navcond.'">' . $tree['name'] . '</a>' : $tree['name'], '</strong>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo '&nbsp;&raquo;&nbsp;';
}

echo '
</td>
</tr>
</table><br />'
;
}

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

// Work out where we currently are.
$current_action = 'home';
if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
$current_action = 'admin';
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';

// Open up our <div>.
echo'
<div id="bg_nav_links">'
;
// Show the [home] button.
echo '



<a href="'
, $scripturl, '" ' , $current_action == 'home' ? 'class="nav_important"' : '' , '>' , $txt[103] , '</a>&nbsp;|';
// Show the [Arcade] button.
   echo '
<a href="'
, $scripturl, '?action=arcade" ' , $current_action == 'arcade' ? 'class="nav_important"' : '' , '>
'
, $txt['arcade'] , '</a>&nbsp;|';




echo '
<a href="'
, $scripturl, '?action=help" ' , $current_action == 'help' ? 'class="nav_important"' : '' , '>' , $txt[119] , '</a>&nbsp;|';
// How about the [search] button?
if ($context['allow_search'])
echo '
<a href="'
, $scripturl, '?action=search" ' , $current_action == 'search' ? 'class="nav_important"' : '' , '>' , $txt[182] , '</a>&nbsp;|';
// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo '
<a href="'
, $scripturl, '?action=admin" ' , $current_action == 'admin' ? 'class="nav_important"' : '' , '>' , $txt[2] , '</a>&nbsp;|';
// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo '
<a href="'
, $scripturl, '?action=profile" ' , $current_action == 'profile' ? 'class="nav_important"' : '' , '>' , $txt[79] , '</a>&nbsp;|';
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo '
<a href="'
, $scripturl, '?action=pm" ' , $current_action == 'pm' ? 'class="nav_important"' : '' , '>' , $txt['pm_short'] , ' ('. $context['user']['unread_messages'] . ')' , '</a>&nbsp;|';
// The [calendar]!
if ($context['allow_calendar'])
echo '
<a href="'
, $scripturl, '?action=calendar" ' , $current_action == 'calendar' ? 'class="nav_important"' : '' , '>' , $txt['calendar24'] , '</a>&nbsp;|';
// the [member] list button
if ($context['allow_memberlist'])
echo '
<a href="'
, $scripturl, '?action=mlist" ' , $current_action == 'mlist' ? 'class="nav_important"' : '' , '>' , $txt[331] , '</a>&nbsp;|';

// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo '
<a href="'
, $scripturl, '?action=login" ' , $current_action == 'login' ? 'class="nav_important"' : '' , '>' , $txt[34] , '</a>&nbsp;|';
// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo '
<a href="'
, $scripturl, '?action=register" ' , $current_action == 'register' ? 'class="nav_important"' : '' , '>' , $txt[97] , '</a>';
// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo '
<a href="'
, $scripturl, '?action=logout;sesc=', $context['session_id'], '" ' , $current_action == 'logout' ? 'class="nav_important"' : '' , '>' , $txt[108] , '</a>';
// Dummy place holder, to end things
echo'
</div>'
;

}

// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
global $settings, $buttons, $context, $txt, $scripturl;

// Create the buttons...
foreach ($button_strip as $key => $value)
{
if (isset($value['test']) && empty($context[$value['test']]))
{
unset($button_strip[$key]);
continue;
}
elseif (!isset($buttons[$key]) || $force_reset)
$buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';

$button_strip[$key] = $buttons[$key];
}

if (empty($button_strip))
return '<td>&nbsp;</td>';

echo '
<td class="'
, $direction == 'top' ? 'main' : 'main', 'strip_first', '">&nbsp;</td>
<td class="'
, $direction == 'top' ? 'main' : 'main', 'strip">', implode(' &nbsp;|&nbsp; ', $button_strip) , '</td>
<td class="'
, $direction == 'top' ? 'main' : 'main', 'strip_last' , '">&nbsp;</td>';
}



?>

lngviewbplover

I got the DOT problem fixed, one more small issue nothing major. I had selected the poll block and when you are at the portal there is no latest poll showing. I started a quick poll as a test and it wont show. Could this be due to the theme Im using? Im using black and blue theme.
Thanks

tuguex

SiNaN,
My blocs doesn't work :S
I activate them in SPortal Admin, but they doesn't appear  :-[

[SiNaN]

#1025
bomdsquad:

Create a new php block and add this codes as content:

global $boarddir;

require_once($boarddir . '/SSI.php');

ssi_recentPoll();


Write your codes in notepad, then paste them into that area. I tried 200 lines of code and it worked.

tuguex:

For button:

Find:

// Show the [Arcade] button.

Replace:

echo '
               <a href="', $scripturl, '" ' , $current_action == 'forum' ? 'class="nav_important"' : '' , '>' , $txt['sp-forum'] , '</a>&nbsp;|';
// Show the [Arcade] button.


Find:

'login', 'help', 'pm'

Replace:

'login', 'help', 'pm', 'forum', 'spadmin'

Find:

$current_action = 'search';

Replace:

$current_action = 'search';
if (isset($_GET['board']) || isset($_GET['topic']))
$current_action = 'forum';
if ($context['current_action']=='spadmin')
$current_action = 'admin';


For blocks:

Probably you've translated text strings, but DO NOT translate the string below:

// Positions
$txt['sp-positionLeft'] = 'Left';
$txt['sp-positionMiddleTop'] = 'Middle-Top';
$txt['sp-positionMiddleBottom'] = 'Middle-Bottom';
$txt['sp-positionRight'] = 'Right';


lngviewbplover:

Are you sure that you set the topic ID that contains the poll correctly?
Former SMF Core Developer | My Mods | SimplePortal

tuguex

Quote from: [SiNaN] on August 13, 2008, 08:59:19 AM

For blocks:

Probably you've translated text strings, but DO NOT translate the string below:

// Positions
$txt['sp-positionLeft'] = 'Left';
$txt['sp-positionMiddleTop'] = 'Middle-Top';
$txt['sp-positionMiddleBottom'] = 'Middle-Bottom';
$txt['sp-positionRight'] = 'Right';




You are simple the best !!

Thank you =)

tuguex

SiNaN, i finally create the Forum button  ;D
Thank you for all suport given =D
But the "Forum" button take me to "http://tuggaming.weblusa.org/index.php"  , and i need that he takes me to http://tuggaming.weblusa.org/index.php?action=forum.

[SiNaN]

Sorry, after you make the changes above;

Find:

               <a href="', $scripturl, '" ' , $current_action == 'forum' ? 'class="nav_important"' : '' , '>' , $txt['sp-forum'] , '</a>&nbsp;|';

Replace:

               <a href="', $scripturl, '?action=forum" ' , $current_action == 'forum' ? 'class="nav_important"' : '' , '>' , $txt['sp-forum'] , '</a>&nbsp;|';
Former SMF Core Developer | My Mods | SimplePortal

tuguex

Quote from: [SiNaN] on August 13, 2008, 09:50:54 AM
Sorry, after you make the changes above;

Find:

               <a href="', $scripturl, '" ' , $current_action == 'forum' ? 'class="nav_important"' : '' , '>' , $txt['sp-forum'] , '</a>&nbsp;|';

Replace:

               <a href="', $scripturl, '?action=forum" ' , $current_action == 'forum' ? 'class="nav_important"' : '' , '>' , $txt['sp-forum'] , '</a>&nbsp;|';

It work's !
Thank's for the exelent support =D

tuguex



SiNaN, now is all  100% with the SPortal =) , i only have 1 question:
**********

Is normal "dot" appear in simple portal?

Dot Postes: 263
Dot Karma: 67
Dot Total de Mensagens: 24
Dot Novas mensagens: 0

ccbtimewiz

Quote from: tuguex on August 13, 2008, 01:08:07 PM


SiNaN, now is all  100% with the SPortal =) , i only have 1 question:
**********

Is normal "dot" appear in simple portal?

Dot Postes: 263
Dot Karma: 67
Dot Total de Mensagens: 24
Dot Novas mensagens: 0


That should be an image. Make sure the image path is correct.

tuguex

Quote from: ccbtimewiz on August 13, 2008, 01:18:05 PM
Quote from: tuguex on August 13, 2008, 01:08:07 PM


SiNaN, now is all  100% with the SPortal =) , i only have 1 question:
**********

Is normal "dot" appear in simple portal?

Dot Postes: 263
Dot Karma: 67
Dot Total de Mensagens: 24
Dot Novas mensagens: 0


That should be an image. Make sure the image path is correct.

What you means with "image patch" ?  ::)

Eliana Tamerin

Image path. That means, the URL to your image.

It should be something like http://yourwebsite.com/forum/Themes/YourTheme/images/dot.gif

If that does not exist, you will need to copy the dot.gif from the  /Themes/default/images folder to your custom theme's folder. If it is not in your /Themes/default/images folder, then download the SimplePortal mod package to your computer, unzip the files (DO NOT UPLOAD IT IN THE PACKAGE MANAGER), and extract the dot.gif. Then place the dot.gif in your /Themes/default/images folder via FTP.

How do I use FTP? / What is FTP?
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

tuguex

Quote from: Eliana Tamerin on August 13, 2008, 02:01:12 PM
Image path. That means, the URL to your image.

It should be something like http://yourwebsite.com/forum/Themes/YourTheme/images/dot.gif

If that does not exist, you will need to copy the dot.gif from the  /Themes/default/images folder to your custom theme's folder. If it is not in your /Themes/default/images folder, then download the SimplePortal mod package to your computer, unzip the files (DO NOT UPLOAD IT IN THE PACKAGE MANAGER), and extract the dot.gif. Then place the dot.gif in your /Themes/default/images folder via FTP.

How do I use FTP? / What is FTP?

I just copy the dot.gif from /Themes/default/images and past it on /Themes/my theme/images and now works =)

Thank's

dwd2000

First, sorry for NOT reading all 52 pages for the answer to this question.

I already have several mods and stuff installed.
(Arcade, with several options)
(Links)
(Ad management)
(Gallery)
(Contact)
...and more.


Will I have a lot of errors or changes to make when I install the portal?

I am hoping that it is like a cover page and automatically adds what is already there.
30 years ago I was young and foolish.
Now I'm just young.

DAMMIT JIM...I'M A TWEAKER...NOT A CODER!!!

Dave's Games

[SiNaN]

This a mod like the ones you've installed. But it doesn't make too much changes on your default files, mostly it uses its own files. What you need to do is, just install the mod without getting any error and create your blocks.

To add; we have built-in blocks for SMF Gallery and SMF Arcade mods.
Former SMF Core Developer | My Mods | SimplePortal

Sudhakar Arjunan

Hi, in the simple portal admin main page.

What does this mean - "Article view template active:" ?
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

[SiNaN]

If you activate that, if users will click on a link of article that are shown on index; the article will be shown with a different template.
Former SMF Core Developer | My Mods | SimplePortal

Sudhakar Arjunan

Quote from: [SiNaN] on August 14, 2008, 05:02:05 AM
If you activate that, if users will click on a link of article that are shown on index; the article will be shown with a different template.

Cool Feature. Will check it now Author.
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Advertisement: