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,917
  • Total Topics: 21,308
  • Online today: 728
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 697
  • Total: 697

Poster cloud

Started by JPDeni, August 04, 2006, 05:51:23 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

eitbuzz


MeRcChRiS

how can i make it so that it only shows the active posters of just that day?

JPDeni

Limiting to the posts within the past 24 hours would probably be more effective than to the current calendar day, especially if you have posters from different time zones.

Change the beginning of the code from
global $db_prefix, $scripturl;
$count= array();
$poster_number = array();
$query = db_query(
    "SELECT realName, {$db_prefix}messages.ID_MEMBER, ID_GROUP
     FROM {$db_prefix}members
     JOIN {$db_prefix}messages
     ON {$db_prefix}members.ID_MEMBER = {$db_prefix}messages.ID_MEMBER
     WHERE ID_GROUP <> 1 AND ID_GROUP <> 2
     ORDER BY posterTime DESC
     LIMIT 100", __FILE__, __LINE__);


to

Quoteglobal $db_prefix, $scripturl;
$count= array();
$poster_number = array();
$today = time() - (24 * 60 * 60);
$query = db_query(
    "SELECT realName, {$db_prefix}messages.ID_MEMBER, ID_GROUP
     FROM {$db_prefix}members
     JOIN {$db_prefix}messages
     ON {$db_prefix}members.ID_MEMBER = {$db_prefix}messages.ID_MEMBER
     WHERE ID_GROUP <> 1 AND ID_GROUP <> 2
     AND posterTime > '$today'
     ORDER BY posterTime DESC
     LIMIT 100", __FILE__, __LINE__);

MeRcChRiS

This is what i have so far, and i made another topic to test it, but nothing showed up on Block.


This is what i have so far,
global $db_prefix, $scripturl;
$count= array();
$poster_number = array();
$today = time() - (24 * 60 * 60);
$query = db_query(
    "SELECT realName, {$db_prefix}messages.ID_MEMBER, ID_GROUP
     FROM {$db_prefix}members
     JOIN {$db_prefix}messages
     ON {$db_prefix}members.ID_MEMBER = {$db_prefix}messages.ID_MEMBER
     WHERE ID_GROUP <> 1 AND ID_GROUP <> 2
     AND posterTime > '$today'
     ORDER BY posterTime DESC
     LIMIT 100", __FILE__, __LINE__);

while ($row = mysql_fetch_assoc($query))
{
  if (!isset($count[$row['posterName']]))
    $count[$row['posterName']] = 0;
  ++$count[$row['posterName']];
    $poster_number[$row['posterName']] = $row['ID_MEMBER'];
}

$random = array_rand($count, count($count));
echo '<div style="text-align: center">';
foreach ($random as $value)
{
  $fsize = $count[$value] + 7;
  if ($fsize > 15)
    $fsize = 15;
  elseif ($fsize < 5)
    $fsize = 5;
  $name = str_replace(" ",'ÂÃ,·',$value);
  echo '<a class="normaltext" href="' . $scripturl . '?action=profile;u=' . $poster_number[$value] . '">
          <span style="font-size:' . $fsize . 'pt;">' . $name . '</span></a> ';
}
echo '</div>';

JPDeni

Are there any posts made by anyone other than an admin or moderator? The code excludes admins and global moderators (because someone else asked for that).

Instead of
     WHERE ID_GROUP <> 1 AND ID_GROUP <> 2
     AND posterTime > '$today'

try
     WHERE posterTime > '$today'

MeRcChRiS

oh...im a admin, haha, how do i make it show for everybody? and maybe the peoples names like not all over the place but side by side each other or something.

JPDeni

Quotehow do i make it show for everybody?
Put in the most recent change I posted.

Quoteand maybe the peoples names like not all over the place but side by side each other or something.
You're sort of getting away from the point of the cloud. :)

What do you want, exactly? Give me an example and I'll see if I can get you what you want.

MeRcChRiS

ok i posted again and its not showing anything in it, this is waht i have.
global $db_prefix, $scripturl;
$count= array();
$poster_number = array();
$today = time() - (24 * 60 * 60);
$query = db_query(
    "SELECT realName, {$db_prefix}messages.ID_MEMBER, ID_GROUP
     FROM {$db_prefix}members
     JOIN {$db_prefix}messages
     ON {$db_prefix}members.ID_MEMBER = {$db_prefix}messages.ID_MEMBER
     WHERE posterTime > '$today'
     ORDER BY posterTime DESC
     LIMIT 100", __FILE__, __LINE__);

while ($row = mysql_fetch_assoc($query))
{
  if (!isset($count[$row['posterName']]))
    $count[$row['posterName']] = 0;
  ++$count[$row['posterName']];
    $poster_number[$row['posterName']] = $row['ID_MEMBER'];
}

$random = array_rand($count, count($count));
echo '<div style="text-align: center">';
foreach ($random as $value)
{
  $fsize = $count[$value] + 7;
  if ($fsize > 15)
    $fsize = 15;
  elseif ($fsize < 5)
    $fsize = 5;
  $name = str_replace(" ",'ÂÃ,·',$value);
  echo '<a class="normaltext" href="' . $scripturl . '?action=profile;u=' . $poster_number[$value] . '">
          <span style="font-size:' . $fsize . 'pt;">' . $name . '</span></a> ';
}
echo '</div>';


and for the other thing...


[name] | [name]
[name] | [name]
[name] | [name]

etc...

JPDeni

I've had so many alterations of this script, based on individual requests, that I don't know what it's doing any more. :)

I'll see if I can work it out tomorrow. My brain isn't working tonight.



MeRcChRiS

ok, i noticed this is going off the topic of poster cloud, so i made a new topic. called Active Posters.

This website is proudly hosted on Crocweb Cloud Website Hosting.