TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,913
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 460
  • Total: 460

[Block] Additional Stats

Started by Lord Anubis, March 31, 2008, 05:44:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lurkalot

ooh, I've been using this mod since April, but I noticed it throws any blocks below it slightly wider on the left hand side.

Also, noticed that if I move it up under my user block it breaks the frames out of the right hand side of all my R/H blocks.

Didn't notice any of this until I tried to move the stats block, last night.  Any ideas? 

I'm also using the scrolling arcade block, just in case this makes a difference.

Here's a couple of screen grabs to show you what I mean,

Blocks below the additional stats, slightly wider on the left, as marked.



The image below, showing the frames broken down the right hand side.  Seems to do this if I move the stats up under the user block.  If I move it down again the frames return to normal.



Checked both problems in firefox and first problem is is still there, but the second problem with the fames is ok, but viewed in IE7 both problems show.  Viewing in firefox with IE Tab addon also shows both the problems.

What I've done so far is to

1: turn the blocks off one by one in various combinations, and the problem is still there.

2: I then turned off the additional stats block, and the alignment returned to normal.  See below.



3:  I turned on the original stats block (the one that comes with tinyportal), and the alignment is still OK.  See below.



Any help would be appreciated.

lurkalot

Looks like I've killed this thread. :(

Has anyone got any ideas as to why its throwing my blocks out if line?

IchBin

Take the end of the block code:
echo '</div>';
         }
echo '</div>

</div>';


Replace with this:
         }
echo '</div>

</div>';


See if that helps.

lurkalot

Thanks Ichbin, Ill give it a go. ;)

lurkalot

#44
I don't seem to have that code at the end.  ??? 

I'm using the third one down on the first page.  This is the one I'm using,


global $context, $settings, $options, $scripturl, $txt, $user_info, $modSettings;

    $bullet = '<img src="'.$settings['images_url'].'/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet2 = '<img src="'.$settings['images_url'].'/TPdivider2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet3 = '<img src="'.$settings['images_url'].'/TPdivider3.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet4 = '<img src="'.$settings['images_url'].'/tpgoto.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet5 = '<img src="'.$settings['images_url'].'/tpmodule2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
echo'

<div class="smalltext" style="font-family: verdana, arial, sans-serif;">';

       if(isset($context['TPortal']['userbox']['stats']))
   // members stats
            echo '
                 <img src="'.$settings['images_url'].'/icons/members.gif" style="margin: 0;" align="bottom" alt="" />
                 <a href="'.$scripturl.'?action=mlist"><b>'.$txt[19].'</b></a>
                 <br />'.$bullet.$txt[488].': ' , isset($modSettings['memberCount']) ? $modSettings['memberCount'] : $modSettings['totalMembers'] , '
                 <br />'.$bullet.$txt['tp-latest']. ': <a href="', $scripturl, '?action=profile;u=', $modSettings['latestMember'], '"><b>', $modSettings['latestRealName'], '</b></a>';
       if(isset($context['TPortal']['userbox']['stats_all']))

global $db_prefix,$modSettings;
$today = strtotime("24 hours ago");
date('j') == 1 ? $thismonth = $today : $thismonth = strtotime(date('F') . ' 1');
date('l') == 'Sunday' ? $thisweek = $today : $thisweek = strtotime('last Sunday');
date('M') == 'January' ? $thisyear = $thismonth : $thisyear = strtotime('January 1');
$query = db_query("SELECT
COUNT(dateRegistered > $thisyear OR NULL) as year,
COUNT(dateRegistered > $thismonth OR NULL) as month,
COUNT(dateRegistered > $thisweek OR NULL) as week,
COUNT(dateRegistered > $today OR NULL) as today
FROM {$db_prefix}members
WHERE is_activated = 1", __FILE__, __LINE__);
$row = mysql_fetch_assoc($query);

settype($row['today'], "integer");
settype($row['week'], "integer");
settype($row['month'], "integer");

echo '<br />',$bullet,'New This Month: ', $row['month'],'<br />';
echo $bullet,'New This Week: ', $row['week'],'<br />';
echo $bullet,'New Today: ', $row['today'];

   // more stats
            echo '
                  <hr /><img src="'.$settings['images_url'].'/icons/info.gif" style="margin: 0;" align="bottom" alt="" />
                 <a href="'.$scripturl.'?action=stats"><b>'.$txt['tp-stats'].'</b></a>
                 <br />'.$bullet.$txt[489].': '.$modSettings['totalMessages']. '
  <br />'.$bullet. $txt[490].': '.$modSettings['totalTopics']. '
  <br />'.$bullet.$txt['tp-mostonline-today'].': '.$modSettings['mostOnlineToday'].'
  <br />'.$bullet.$txt['tp-mostonline'].': '.$modSettings['mostOnline'].'<br />
  ('.timeformat($modSettings['mostDate']).')
  ';

       if(isset($context['TPortal']['userbox']['online'])){
   // add online users
            echo '<hr /><img src="'.$settings['images_url'].'/icons/online.gif" style="margin: 0;" align="bottom" alt="" />
                 <a href="'.$scripturl.'?action=who"><b>'.$txt[158].'</b></a><br />';

            $online = ssi_whosOnline('array');
   echo $bullet.$txt['tp-users'].': '.$online['num_users'];
   echo '<br />'.$bullet.$txt['tp-guests'].': '.$online['guests'];
  // --- Begin FlashChat Integration ---
   echo '<br />',$bullet.$txt['tp-total'].': '.$online['total_users'].'<hr />
<div style="width: 98%; ' , $online['num_users']>14 ? 'height: 23ex;overflow: auto;' : '' ,'">';

      foreach($online['users'] as $user){
echo $bullet2 , $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
echo '<br />';
   }
echo '</div>';
     
         }
echo '</div>';
// add arcade users
echo '<div class="smalltext" style="font-family: verdana, arial, sans-serif;">

           
<hr />
<img src="/arcade.png"><a href="'.$scripturl.'?action=arcade"><b> Users in Arcade</b></a><br />';

 
//added code
  echo' <div style="width: 98%; ' , $online['num_users']>14 ? 'height: 23ex;overflow: auto;' : '' ,'">';
//   Its ok now bullits have flown by stand up again lol
$online = ssi_whosOnline('array');
$arcade_users = array();
foreach($online['users'] as $user)
{
   
   $result = db_query("
      SELECT url
      FROM {$db_prefix}log_online
      WHERE ID_MEMBER = $user[id]",__FILE__, __LINE__);

   $checkit = mysql_fetch_assoc($result);
   $data = @unserialize($checkit['url']);
   if($data['action']=='arcade')
   {
      echo $bullet2 , $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];  echo '<br />';
      $arcade_users[] = $user;
   }
   unset($data);
}

//   No arcade users?
if(empty($arcade_users))
   echo '<br />No members in the arcade';
// end wdmboard_statsonline

echo'</div>
</div>
</div>';

IchBin

Thats because you're using the second code in the first post. Would help if you specify that stuff. Regardless, the code is still there, you just need to look a little higher. :)

lurkalot

Sorry Ichbin

I'm using the third code in the first post.  The one for e-arcade, and no flashchat

Can't find the code you mentioned, only this bit.  I'm no coder, and find this stuff very confusing.   ;)


    echo '<br />';
     }
    echo '</div>';

       }
  echo '</div>';

IchBin

Try removing the very last </div> and see if that helps. If not, I don't know what to tell you. This code looks a little messed up anyway.

Stroopy

When I use the code Lord Anubis posted I get this error twice everytime someone visits the main page in the error log.

http://xxxxx.com/index.php
Apply Filter: Only show the errors with the same message
8: Undefined index: name
File: /home/xxxxx/public_html/Themes/default/TPortal.template.php (main_below sub template - eval?)
Line: 81

The error happens when I have the code posted in a PHP block and have it activated.

JPDeni

The first code in this topic does not use an index called 'name'. In fact, the word 'name' is not in the code at all. If you're not using the first code in the topic, post the code you are using so I can try to debug it.

This website is proudly hosted on Crocweb Cloud Website Hosting.