collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 799
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Thanks for having an interest with our portal. If you have any requests for features, have a look at the Feature Requests board.

Author Topic: Help with custom info block  (Read 3205 times)

0 Members and 1 Guest are viewing this topic.

Offline DollarSRV

  • Semi Newbie
  • *
  • Posts: 34
  • Gender: Male
    • DollarSRV
  • SMF Version: 2.0.14
  • SP Version: 2.3.6
  • Elkarte Version: 1.1.4
  • EhPortal Version: None
Help with custom info block
« on: October 27, 2010, 02:42:10 PM »
I have used this code which i found on this forum for the info center all is working except the title bar which you can see in the attachment.

Here is the code used
Code: [Select]
/*  Info Center Block for SMF 2 and Simple Portal  */
/*  This is intended for use with Simple Portal  */
/* There are some extras pulled from the db - more info can be displayed with some minor edits  */


global $txt, $scripturl, $user_info, $user_profile, $context, $modSettings, $sourcedir, $boardurl, $smcFunc, $settings;

/* Adjustable Settings */

/* Choose your rows of info to display */
$show_recent = true;
$show_calendar = true;
$show_stats = true;
$show_online1 = true;
$showMembergroups = true;
$show_PM = false;
$show_login = true;

/*  General settings  */
/* If disabling recent posts, $numPosts should be set to 1 unless forum post count is 0  (so latest post can display) */
$numPosts = 5;
$showColor = true;
$default_icon = 'xx';
$exclude_boards_posts = null;

/*  table style settings may depend on theme but this should work.  adjust if necessary. */
$border = 'bordercolor';
$title = 'titlebg';
$cell = 'windowbg';
$cell2 = 'windowbg2';

/*  Amount of characters to display for recent post titles  */
$recent_length1 = 65;
$recent_length2 = 65;

/*  Visable text  */
$latest = '';
$today = 'Users Online Today:';
$msg_new = '[new]';
$postby = ' <b>by:</b> ';
$no_post_msg = 'There are no posts in the forum.';
$txt[234] =  'View the most recent posts on the forum.';
$txt['smf223'] =  '[More Stats]';
$on = '';
$on_line = 'Users Online';
 $txt[214] = 'Recent Posts';
$txt[645] = 'Forum Stats';
$txt['recent_posts'] = 'Recent Posts';
$txt[158] = 'Users Online';
$txt[95] = 'Posts';
$txt['smf88'] ='in';
$txt[64] ='Topics';
$txt[525] ='by';
$txt[19] ='Members';
$txt[656] ='Latest Member';
$txt[659] ='Latest Post';
$txt['calendar47'] = 'Calendar Events';
$txt['personal_message'] = 'Private Messages';
/*  PM Text  */
$txt['you_have'] = 'You have';
$txt['message_lowercase'] ='message';
$txt['msg_alert_messages'] ='messages';
$txt['click'] ='Click';
$txt['here'] ='here';
$txt['to_view'] ='to view';
$newpm = 'Unread PMs:';

/*  Other variables  - don't bother adjusting these! */
$num_post = 1;
$anum = 1;
$format = 'vertical';
$group_clr = array();
$group_clr[] = array();
$color = 1;
$colorx = 1;
$clrx = false;
$userlink = false;
$poster = array();
$poster[] = array();
$paramters = array();
$context['groups'] = array();
$group = array();
$settings['show_sp1_info'] = true;
$context['show_stats'] = true;
$context['show_who'] = false;
$title2 = "headerpadding '.$title.'";
$cell3 = "'.$cell2.' sectionbody";
if ($show_online1 == true) {$context['show_who'] = true;}
$color = '';   
$counter = false;
if ((int)$numPosts < 0) {$numPosts = 0;}
if((int)$context['user']['unread_messages'] == false)
 {$newpmx = '';}
else
 {$newpmx = '('. $newpm . ' '. $context['user']['unread_messages']. ')';}

/* Query membergroups info... */
   $request = $smcFunc['db_query']('', '
      SELECT mg.id_group, mg.group_name, mg.description, mg.group_type, mg.online_color, mg.hidden,
         mg.stars
      FROM {db_prefix}membergroups AS mg     
      WHERE mg.id_group > 0         
      ORDER BY stars'   );   
   while ($row = $smcFunc['db_fetch_assoc']($request))
   {
$group[$anum] = $row['group_name'];
if ($row['online_color'])
{$group[$anum] = '<span style="color: '.$row['online_color'].';" align="left">'.$row['group_name'].'</span>';}
$num1 = $row['id_group'];
$group_clr[$num1] = $row['online_color'];   
$anum++;
   }
   $smcFunc['db_free_result']($request);
/*  END - Query membergroups info  */

   /*  START - Recent Posts Query*/     
if ($numPosts > 0)
{   
         
   $context['page_title'] = $txt['recent_posts'];

   if (isset($_REQUEST['start']) && $_REQUEST['start'] > 95)
      $_REQUEST['start'] = 95;

   $query_parameters = array();
   if (!empty($_REQUEST['c']) && empty($board))
   {
      $_REQUEST['c'] = explode(',', $_REQUEST['c']);
      foreach ($_REQUEST['c'] as $i => $c)
         $_REQUEST['c'][$i] = (int) $c;

      if (count($_REQUEST['c']) == 1)
      {
         $request = $smcFunc['db_query']('', '
            SELECT name
            FROM {db_prefix}categories
            WHERE id_cat = {int:id_cat}
            LIMIT 1',
            array(
               'id_cat' => $_REQUEST['c'][0],
            )
         );
         list ($name) = $smcFunc['db_fetch_row']($request);
         $smcFunc['db_free_result']($request);

         if (empty($name))
            fatal_lang_error('no_access', false);

         $context['linktree'][] = array(
            'url' => $scripturl . '?action=forum#c' . (int) $_REQUEST['c'],
            'name' => $name
         );
      }

      $request = $smcFunc['db_query']('', '
         SELECT b.id_board, b.num_posts
         FROM {db_prefix}boards AS b
         WHERE b.id_cat IN ({array_int:category_list})
            AND {query_see_board}',
         array(
            'category_list' => $_REQUEST['c'],
         )
      );
      $total_cat_posts = 0;
      $boards = array();
      while ($row = $smcFunc['db_fetch_assoc']($request))
      {
         $boards[] = $row['id_board'];
         $total_cat_posts += $row['num_posts'];
      }
      $smcFunc['db_free_result']($request);

      if (empty($boards))
         fatal_lang_error('error_no_boards_selected');

      $query_this_board = 'b.id_board IN ({array_int:boards})';
      $query_parameters['boards'] = $boards;

      /* If this category has a significant number of posts in it...  */
      if ($total_cat_posts > 100 && $total_cat_posts > $modSettings['totalMessages'] / 15)
      {
         $query_this_board .= '
         AND m.id_msg >= {int:max_id_msg}';
         $query_parameters['max_id_msg'] = max(0, $modSettings['maxMsgID'] - 400 - $_REQUEST['start'] * 7);
      }

      $context['page_index'] = constructPageIndex($scripturl . '?action=recent;c=' . implode(',', $_REQUEST['c']), $_REQUEST['start'], min(100, $total_cat_posts), 10, false);
   }
   elseif (!empty($_REQUEST['boards']))
   {
      $_REQUEST['boards'] = explode(',', $_REQUEST['boards']);
      foreach ($_REQUEST['boards'] as $i => $b)
         $_REQUEST['boards'][$i] = (int) $b;

      $request = $smcFunc['db_query']('', '
         SELECT b.id_board, b.num_posts
         FROM {db_prefix}boards AS b
         WHERE b.id_board IN ({array_int:board_list})
            AND {query_see_board}
         LIMIT {int:limit}',
         array(
            'board_list' => $_REQUEST['boards'],
            'limit' => count($_REQUEST['boards']),
         )
      );
      $total_posts = 0;
      $boards = array();
      while ($row = $smcFunc['db_fetch_assoc']($request))
      {
         $boards[] = $row['id_board'];
         $total_posts += $row['num_posts'];
      }
      $smcFunc['db_free_result']($request);

      if (empty($boards))
         fatal_lang_error('error_no_boards_selected');

      $query_this_board = 'b.id_board IN ({array_int:boards})';
      $query_parameters['boards'] = $boards;

      /* If these boards have a significant number of posts in them... */
      if ($total_posts > 100 && $total_posts > $modSettings['totalMessages'] / 12)
      {
         $query_this_board .= '
         AND m.id_msg >= {int:max_id_msg}';
         $query_parameters['max_id_msg'] = max(0, $modSettings['maxMsgID'] - 500 - $_REQUEST['start'] * 9);
      }

      $context['page_index'] = constructPageIndex($scripturl . '?action=recent;boards=' . implode(',', $_REQUEST['boards']), $_REQUEST['start'], min(100, $total_posts), 10, false);
   }
   elseif (!empty($board))
   {
      $request = $smcFunc['db_query']('', '
         SELECT num_posts
         FROM {db_prefix}boards
         WHERE id_board = {int:current_board}
         LIMIT 1',
         array(
            'current_board' => $board,
         )
      );
      list ($total_posts) = $smcFunc['db_fetch_row']($request);
      $smcFunc['db_free_result']($request);

      $query_this_board = 'b.id_board = {int:board}';
      $query_parameters['board'] = $board;

      /* If this board has a significant number of posts in it... */
      if ($total_posts > 80 && $total_posts > $modSettings['totalMessages'] / 10)
      {
         $query_this_board .= '
         AND m.id_msg >= {int:max_id_msg}';
         $query_parameters['max_id_msg'] = max(0, $modSettings['maxMsgID'] - 600 - $_REQUEST['start'] * 10);
      }

      $context['page_index'] = constructPageIndex($scripturl . '?action=recent;board=' . $board . '.%d', $_REQUEST['start'], min(100, $total_posts), 10, true);
   }
   else
   {
      $query_this_board = '{query_wanna_see_board}' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
         AND b.id_board != {int:recycle_board}' : ''). '
         AND m.id_msg >= {int:max_id_msg}';
      $query_parameters['max_id_msg'] = max(0, $modSettings['maxMsgID'] - 100 - $_REQUEST['start'] * 6);
      $query_parameters['recycle_board'] = $modSettings['recycle_board'];

      /* Ignore recycle bin */
      $context['page_index'] = constructPageIndex($scripturl . '?action=recent', $_REQUEST['start'], min(100, $modSettings['totalMessages']), 10, false);
   }

   $context['linktree'][] = array(
      'url' => $scripturl . '?action=recent' . (empty($board) ? (empty($_REQUEST['c']) ? '' : ';c=' . (int) $_REQUEST['c']) : ';board=' . $board . '.0'),
      'name' => $context['page_title']
   );

   /* Find the most recent messages they can view... */
   $request = $smcFunc['db_query']('', '
      SELECT m.id_msg
      FROM {db_prefix}messages AS m
         INNER JOIN {db_prefix}boards AS b ON (b.id_board = m.id_board)
      WHERE ' . $query_this_board . '
         AND m.approved = {int:is_approved}
      ORDER BY m.id_msg DESC
      LIMIT {int:offset}, {int:limit}',
      array_merge($query_parameters, array(
         'is_approved' => 1,
         'offset' => $_REQUEST['start'],
         'limit' => $numPosts,
      ))
   );
   $messages = array();
   while ($row = $smcFunc['db_fetch_assoc']($request))
      $messages[] = $row['id_msg'];
   $smcFunc['db_free_result']($request);

   /* Nothing is happening here... or, at least, nothing you can see... */
   if (empty($messages))
   {
      $context['posts'] = array();
                echo 'No posts in the forum, set post count to 0 in block code.';
                return;
   }   

   /* Get all the most recent posts */
   $request = $smcFunc['db_query']('', '
      SELECT
         m.id_msg, m.subject, m.smileys_enabled, m.poster_time, m.body, m.id_topic, t.id_board, b.id_cat,
         b.name AS bname, c.name AS cname, t.num_replies, m.id_member, m2.id_member AS id_first_member,
         IFNULL(mem2.real_name, m2.poster_name) AS first_poster_name, t.id_first_msg,
         IFNULL(mem.real_name, m.poster_name) AS poster_name, t.id_last_msg
      FROM {db_prefix}messages AS m                       
         INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic)
         INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)                       
         INNER JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)
         INNER JOIN {db_prefix}messages AS m2 ON (m2.id_msg = t.id_first_msg)
         LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
                        LEFT JOIN {db_prefix}members AS mem2 ON (mem2.id_member = m2.id_member)                       
      WHERE m.id_msg IN ({array_int:message_list})
      ORDER BY m.id_msg DESC
      LIMIT ' . count($messages),
      array(
         'message_list' => $messages,
      )
   );
   $counter = $_REQUEST['start'] + 1;
   $context['posts'] = array();
   $board_ids = array('own' => array(), 'any' => array());
   while ($row = $smcFunc['db_fetch_assoc']($request))
   {
      /* Censor everything */
      censorText($row['body']);
      censorText($row['subject']);

      /* BBC-atize the message */
      $row['body'] = parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']);

      /* Build the array... */
      $context['posts'][$row['id_msg']] = array(
         'counter' => $counter++,
         'category' => array(
            'id' => $row['id_cat'],
            'name' => $row['cname'],
            'href' => $scripturl . '?action=forum#c' . $row['id_cat'],
            'link' => '<a href="' . $scripturl . '?action=forum#c' . $row['id_cat'] . '">' . $row['cname'] . '</a>'
         ),
         'board' => array(
            'id' => $row['id_board'],
            'name' => $row['bname'],
            'href' => $scripturl . '?board=' . $row['id_board'] . '.0',
            'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['bname'] . '</a>'

And the attachment
Cheap Web Hosting & Domain Registration

=========================

Special Offer For SMF Users - Get 10% off any web hosting plan with code SMFUSER

=========================

Offline DollarSRV

  • Semi Newbie
  • *
  • Posts: 34
  • Gender: Male
    • DollarSRV
  • SMF Version: 2.0.14
  • SP Version: 2.3.6
  • Elkarte Version: 1.1.4
  • EhPortal Version: None
Re: Help with custom info block
« Reply #1 on: October 27, 2010, 02:45:53 PM »
2nd part

Code: [Select]
         ),
         'topic' => $row['id_topic'],
         'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#msg' . $row['id_msg'],
         'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#msg' . $row['id_msg'] . '" rel="nofollow">' . $row['subject'] . '</a>',
         'start' => $row['num_replies'],
         'subject' => $row['subject'],
         'time' => timeformat($row['poster_time']),
         'timestamp' => forum_time(true, $row['poster_time']),
         'first_poster' => array(
            'id' => $row['id_first_member'],
            'name' => $row['first_poster_name'],
            'href' => empty($row['id_first_member']) ? '' : $scripturl . '?action=profile;u=' . $row['id_first_member'],
            'link' => empty($row['id_first_member']) ? $row['first_poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_first_member'] . '"><i>' . $row['first_poster_name'] . '</i></a>'
         ),
         'poster' => array(
            'id' => $row['id_member'],
            'name' => $row['poster_name'],
                                'href' => empty($row['id_member']) ? '' : $scripturl . '?action=profile;u=' . $row['id_member'],                 
            'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '"><i>' . $row['poster_name'] . '</i></a>'
         ),
                        'short_link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#msg' . $row['id_msg'] . '">' . shorten_subject($row['subject'], $recent_length1) . '</a>',
'shorter_link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#msg' . $row['id_msg'] . '">' . shorten_subject($row['subject'], $recent_length2) . '</a>',
         'message' => $row['body'],
         'can_reply' => false,
         'can_mark_notify' => false,
         'can_delete' => false,
         'delete_possible' => ($row['id_first_msg'] != $row['id_msg'] || $row['id_last_msg'] == $row['id_msg']) && (empty($modSettings['edit_disable_time']) || $row['poster_time'] + $modSettings['edit_disable_time'] * 60 >= time()),
      );

      if ($user_info['id'] == $row['id_first_member'])
         $board_ids['own'][$row['id_board']][] = $row['id_msg'];
      $board_ids['any'][$row['id_board']][] = $row['id_msg'];
   }
   $smcFunc['db_free_result']($request);

   $posts = $context['posts'];   
   if  (empty($posts))
{$no_posts = true;}
else
{
$no_posts = false;
foreach ($posts as $post)
      {
if ($showColor == true)
{
/*  START - Membergroup color for poster  (colors already put in array) */
$user_id = $post['poster']['id'];
$queryx = $smcFunc['db_query']('', '
         SELECT id_group, id_member
         FROM {db_prefix}members
         WHERE id_member = {int:users_id}
         ORDER BY id_member
                        LIMIT 1',
array(
            'users_id' => $user_id,
         )
      );
      while ($rowx = $smcFunc['db_fetch_assoc']($queryx))
         {
                            if ($rowx['id_group'] == true)
                                {$colorx = ((int)$rowx['id_group']); $color = $group_clr[$colorx];}
                           else {$colorx=false;$color=false;}
                        }
      $smcFunc['db_free_result']($queryx);
/*  END - Membergroup color query  */
}

$clrx = '';
if (($color == true) && ($showColor == true))
{$clrx = 'style="color: '.$color.';"';}

$poster[$num_post] = array (
'href' => $post['href'],
'subject' => $post['subject'],
'link' => $post['link'],
'short_link' => $post['short_link'],
'shorter_link' => $post['shorter_link'],
'color_link' => '<a href="' . $scripturl . '?action=profile;u=' . $post['poster']['id'] . '"><span '.$clrx.'><i>' . $post['poster']['name'] . '</i></span></a>',
'time' => $post['time'],
'poster_link' => $post['poster']['link'],
'board_link' => $post['board']['link']
);

$num_post++;
      }
   }   
    }
/*  END - Recent Posts Query */

/*  Display the Info Center  */
echo '<div id="info_center2" style="width: 100%; height: 100%; overflow: hidden;">     
         <table border="0" width="100%" cellspacing="1" cellpadding="4" class="'.$border.'">';

/*  "Recent Posts" bar  */
if ($show_recent == true)
{   
         echo '
            <tr>
               <td class="'.$title.'" style=" font-size: 8pt;" colspan="2">', $txt[214], '</td>
            </tr>
            <tr>
               <td class="'.$cell.'" width="20" valign="middle" align="center">
                  <a href="', $scripturl, '?action=recent"><img src="', $boardurl, '/Themes/default/images/post/xx.gif" alt="', $txt[214], '" /></a>
               </td>
               <td class="'.$cell2.'">';
$num = 1;
if ($numPosts > 0)
{
echo '<b><a href="', $scripturl, '?action=recent">', $txt[214], '</a></b>';
echo '<table width="100%">';                 
while (($num <= $numPosts) && ($num <= $num_post))
{
$userlink = false;
if ($poster[$num]['color_link'] == true)
{$userlink = $poster[$num]['color_link'];}
else {$userlink = $poster[$num]['poster_link'];}

if ($userlink)
{
echo   '<tr><td valign="top" class="smalltext">',$latest, $poster[$num]['shorter_link'],' ', $postby, $userlink, '</td><td valign="top" align="right" class="smalltext"><span style="text-align:right;">', $on, ' (', $poster[$num]['time'], ')</span></td></tr>';
}
$num++;
}   
echo '</table>';           
      }
elseif ($numPosts < 1)
{
echo '<b><a href="', $scripturl, '?action=recent">', $txt[214], '</a></b><br /><br /><div class="smalltext">',$no_post_msg,'<br /></div>';
}
      echo '
               </td>
            </tr>';
}
   /* View the Calendar Bar  */
   if ($show_calendar == true)
   {
      echo '
            <tr>
               <td class="'.$title.'"  style=" font-size: 8pt;" colspan="2">', $context['calendar_only_today'] ? $txt['calendar47b'] : $txt['calendar47'], '</td>
            </tr><tr>
               <td class="'.$cell.'" width="20" valign="middle" align="center">
                  <a href="', $scripturl, '?action=calendar"><img src="', $boardurl, '/Themes/default/images/icons/calendar.gif" alt="', $txt['calendar24'], '" /></a>
               </td>
               <td class="'.$cell2.'" width="100%">
                  <span class="smalltext">';

      /*  Holidays like "Christmas", "New Years", etc  */
      if (!empty($context['calendar_holidays']))
            echo '
                     <span style="color: #', $modSettings['cal_holidaycolor'], ';">', $txt['calendar5'], ' ', implode(', ', $context['calendar_holidays']), '</span><br />';

      /* Display People's Birthdays  */
      if (!empty($context['calendar_birthdays']))
      {
            echo '
                     <span style="color: #', $modSettings['cal_bdaycolor'], ';">', $context['calendar_only_today'] ? $txt['calendar3'] : $txt['calendar3b'], '</span> ';
      /* Each member in calendar_birthdays has:
            id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?) */

  foreach ($context['calendar_birthdays'] as $member)
            echo '
                     <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<b>' : '', $member['name'], $member['is_today'] ? '</b>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '<br />' : ', ';
      }
      /*  Display Events  */
      if (!empty($context['calendar_events']))
      {
         echo '
                     <span style="color: #', $modSettings['cal_eventcolor'], ';">', $context['calendar_only_today'] ? $txt['calendar4'] : $txt['calendar4b'], '</span> ';
/* Each event in calendar_events should have:
    title, href, is_last, can_edit (are they allowed?), modify_href, and is_today. */
         foreach ($context['calendar_events'] as $event)
            echo '
                     ', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" style="color: #FF0000;">*</a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<b>' . $event['title'] . '</b>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br />' : ', ';

/*  Display Help text  */
         if ($context['calendar_can_edit'])
            echo '
                     (<a href="', $scripturl, '?action=helpadmin;help=calendar_how_edit" onclick="return reqWin(this.href);">', $txt['calendar_how_edit'], '</a>)';
      }
      echo '
                  </span>
               </td>
            </tr>';
   }

/*  Display YaBB style information  */   
if ($show_stats == true)
{   
      echo '
            <tr>
               <td class="'.$title.'"  style=" font-size: 8pt;" colspan="2">', $txt[645], '</td>
            </tr>
            <tr>
               <td class="'.$cell.'" width="20" valign="middle" align="center">
                  <a href="', $scripturl, '?action=stats"><img src="', $boardurl, '/Themes/default/images/icons/info.gif" alt="', $txt[645], '" /></a>
               </td>
               <td class="'.$cell2.'" width="100%">
                  <span class="middletext">
                     ', $context['common_stats']['total_posts'], ' ', $txt[95], ' ', $txt['smf88'], ' ', $context['common_stats']['total_topics'], ' ', $txt[64], ' ', $txt[525], ' ', $context['common_stats']['total_members'], ' ', $txt[19], '. ', $txt[656], ': <b><i> ', $context['common_stats']['latest_member']['link'], '</i></b>
                     <br /> ' . $txt[659] . ': <b>"' . $poster[1]['short_link'] . '"</b>  ( ' . $poster[1]['time'] . ' )<br />
                     <a href="', $scripturl, '?action=recent">', $txt[234], '</a>', $context['show_stats'] ? '<br />
                     <a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
                  </span>';
echo '<br /></td></tr>';   
}

/*  Display Users Online  */
if ($show_online1 == true)
{
   echo '
            <tr>
               <td class="'.$title.'"  style=" font-size: 8pt;" colspan="2">', $txt[158], '</td>
            </tr>';

echo '<tr>
               <td rowspan="2" class="'.$cell.'" width="20" valign="middle" align="center">
                  ', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', '<img src="', $boardurl, '/Themes/default/images/icons/online.gif" alt="', $txt[158], '" />', $context['show_who'] ? '</a>' : '', '
               </td>
               <td class="'.$cell2.'" width="100%">';
/*  Get some users online Info from the ssi */
$parameters = '';
$id = '';
$return_parameters = false;
   $block_parameters = array(
      'online_today' => 'check'
   );

   if ($return_parameters)
      return $block_parameters;

   $online_today = !empty($parameters['online_today']);

   $stats = ssi_whosOnline('array');
echo '<a href="',$boardurl,'/index.php?action=who">';
echo $txt['guests']. ': '. $stats['guests'].', '. $txt['hidden']. ': '. $stats['hidden']. ', '. $txt['users']. ': '. $stats['num_users'], '</a>';
echo '<br />'.$on_line.':<br />';
   if (!empty($stats['users']))
   {
      echo ', '. allowedTo('who_view') && !empty($modSettings['who_enabled']) ? '<a href="' . $scripturl . '?action=who">' : ''. $txt[158]. allowedTo('who_view') && !empty($modSettings['who_enabled']) ?  '' : '</a>'. ': ';
$comma = '';
      foreach ($stats['users'] as $user)
{
echo $comma, sp_embed_image($user['name'] == 'H' ? 'tux' : 'user'). ' '. $user['hidden'] ? '<em>' . $user['link'] . '</em>' : $user['link'];
if ($comma == false) {$comma = ', ';}
}
      }
   else
   {
      echo $txt['error_sp_no_online'].' ';
   }
/*  Display the list of groups  */
if ($showMembergroups == true)
{   
echo '<br /><div style="font-size:0.8em">[' . implode(']  [', $group) . ']</div>';
}
   echo '</td>
            </tr>
            <tr>
               <td class="'.$cell2.'" width="100%">
                  <span class="middletext">
                     ', $txt['most_online_today'], ': <b>', $modSettings['mostOnlineToday'], '</b>.
                     ', $txt['most_online_ever'], ': ', $modSettings['mostOnline'], ' (' , timeformat($modSettings['mostDate']), ')
                  </span>
               </td>
            </tr>';
}
/* If they are logged in... show a personal message bar. */
   if ($context['user']['is_logged'] && ($show_PM == true))
   {
echo '
            <tr>
               <td class="'.$title.'" style=" font-size: 8pt;" colspan="2">', $txt['personal_message'], '</td>
            </tr>
            <tr>
               <td class="'.$cell.'" width="20" valign="middle" align="center">
                  <a href="', $scripturl, '?action=pm"><img src="', $boardurl, '/Themes/default/images/message_sm.gif" alt="', $txt['personal_message'], '" /></a>
               </td>
               <td class="'.$cell2.'">';
      echo '<b><a href="', $scripturl, '?action=pm">', $txt['personal_message'], '</a></b>
                  <div class="smalltext">
                     ', $txt['you_have'], ' ', $context['user']['messages'], ' ', $context['user']['messages'] == 1 ? $txt['message_lowercase'] : $txt['msg_alert_messages'], ' ', $newpmx, '.... ', $txt['click'], ' <a href="', $scripturl, '?action=pm"><i>', $txt['here'], '</i></a> ', $txt['to_view'], '
                  </div></td></tr>';
                   
}
/*  Show the login input if user is guest and enabled  */
if (($context['user']['is_guest']) && $show_login == true)
{
echo '
            <tr>
               <td class="'.$title.'" style=" font-size: 8pt;" colspan="2">', $txt['login'], '</td></tr><tr>
               <td class="'.$cell.'" width="20" valign="middle" align="center">
                  <a href="', $scripturl, '?action=login"><img src="', $boardurl, '/Themes/default/images/icons/login.gif" alt="" title="Login" /></a>
               </td>
                         
               <td class="'.$cell2.'"><a href="', $scripturl, '?action=reminder" class="smalltext">', $txt['forgot_your_password'], '</a>               
                  <form id="infocenter_login" action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '">
                     <ul class="horizlist clearfix">
                        <li>
                           <label for="user">', $txt['username'], ':<br />
                           <input type="text" name="user" id="user" size="15" /></label>
                        </li>
                        <li>
                           <label for="passwrd">', $txt['password'], ':<br />
                           <input type="password" name="passwrd" id="passwrd" size="15" /></label>
                        </li>
                        <li>
                           <label for="cookielength">', $txt['mins_logged_in'], ':<br />
                           <input type="text" name="cookielength" id="cookielength" size="4" maxlength="4" value="', $modSettings['cookieTime'], '" /></label>
                        </li>
                        <li>
                           <label for="cookieneverexp">', $txt['always_logged_in'], ':<br />
                           <input type="checkbox" name="cookieneverexp" id="cookieneverexp" checked="checked" class="check" /></label>
                        </li>
                        <li>
                           <input type="submit" value="', $txt['login'], '" />
                        </li>
                     </ul>
                  </form>
               </td></tr>';
}
   echo '
         </table>     
   </div>';
return;
/*  END -  Info Center Block for SMF 2.0 and Simple Portal */
Cheap Web Hosting & Domain Registration

=========================

Special Offer For SMF Users - Get 10% off any web hosting plan with code SMFUSER

=========================

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Help with custom info block
« Reply #2 on: October 27, 2010, 02:52:03 PM »
You are putting this in a bottom block?
 
A link to the forum would reveal more than a picture of it.
 
 
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline DollarSRV

  • Semi Newbie
  • *
  • Posts: 34
  • Gender: Male
    • DollarSRV
  • SMF Version: 2.0.14
  • SP Version: 2.3.6
  • Elkarte Version: 1.1.4
  • EhPortal Version: None
Re: Help with custom info block
« Reply #3 on: October 27, 2010, 04:09:35 PM »
Yes its in a bottem block its strange though when you view as a guest it seems ok but not when logged in. And im not sure if it could be because its a custom them & templates that might be causing problems..


link to site http://www.gamingmayhem.co.uk/index.php?action=forum

Anyway you will need to log in with this user to see my problem

User name = Doogle
Password = 54321
Cheap Web Hosting & Domain Registration

=========================

Special Offer For SMF Users - Get 10% off any web hosting plan with code SMFUSER

=========================

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Help with custom info block
« Reply #4 on: October 28, 2010, 07:15:03 AM »
First, you have an HTML error on the page.
The "unclosed div" bug has gotten you.
 
Please apply the fix given here:
http://simpleportal.net/index.php?issue=376.0
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Deezel

  • Jr. Member
  • **
  • Posts: 54
  • Gender: Male
  • It Is What It Is
    • Owner/Admin
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Help with custom info block
« Reply #5 on: October 29, 2010, 09:20:44 AM »
Sorry for jumping in on someone elses thread, but....
I am having the exact same problem and tried replacing those lines with no change.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Help with custom info block
« Reply #6 on: October 29, 2010, 09:46:05 AM »
Second -- you need to fix a problem in your boardindex.template.php
You commented out the call to template_info_center();
 
But that left you with the posting icons in a float-left div.
 
The mark-read button and any succeediing text (your block header, for example) will try to wrap around it.  That's where your problem comes in. After the mark-read button, you want to stop any further text from trying to wrap around the floating div -- you want new things to start on a new line.
 
In BoardIndex.template.php, instead of
Code: [Select]
/*  template_info_center();  */You should probably have
Code: [Select]
/*  template_info_center();  */
echo '<span class="clear" ></span>';
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?