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: 629
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 487
  • Total: 487

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.

JPDeni

Well, the thing is that in order to eliminate them from the script, you have to know what group they're in. The basic admin and global moderator groups are groups 1 and 2, which is why I used those numbers when I didn't want admins and global moderators to be included. And most people only have one group per person.

In order to give me something to work with, what are the numbers for the groups that you want to eliminate? Are these all the primary groups, or are some of them "additional" groups?

kjb0007

I pretty much decided for now to just let it show the staff groups its showing (its no big deal for now), however I have two quick questions regarding the code you posted that shows the names in their group color

1. How do I get rid of all that AA stuff (as seen in the image I attached,
2. When I change the code to make it so where it shows the colors for all membergroups not just staff, my portal wont even load. (when it finally finishes trying to load.. its a big white page and my status bar says done)

Any ideas?

This was my code when I tried to adjust it so that all group colors would show:



global $db_prefix, $scripturl;
$nbsp = "&n"."bsp;";
$count= array();
$poster_number = array();
$query = db_query(
    "SELECT mes.posterName, mes.ID_MEMBER, mem.ID_GROUP, grp.onlineColor
     FROM smf_messages as mes
     LEFT JOIN smf_members as mem
     ON mem.ID_MEMBER = mes.ID_MEMBER
     LEFT JOIN smf_membergroups as grp
     ON grp.ID_GROUP = mem.ID_POST_GROUP
     WHERE mem.ID_GROUP <> 1 AND mem.ID_GROUP <> 2
     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'];
    $poster_color[$row['posterName']] = $row['onlineColor'];
}

asort($count);
$low_count = reset($count);

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

JPDeni

QuoteI pretty much decided for now to just let it show the staff groups its showing (its no big deal for now),
I can fix it if you'll answer my questions.

1) I don't know what all the "AA" stuff is from, so I don't know how to get rid of it.

2) I use a little different syntax in my queries and it might make things work better.


$query = db_query(
    "SELECT mes.posterName, mes.ID_MEMBER, mem.ID_GROUP, grp.onlineColor
     FROM smf_messages as mes, smf_members as mem, smf_membergroups as grp
     WHERE mem.ID_MEMBER = mes.ID_MEMBER
     AND grp.ID_GROUP = mem.ID_POST_GROUP
     AND mem.ID_GROUP <> 1 AND mem.ID_GROUP <> 2
     ORDER BY posterTime DESC
     LIMIT 100", __FILE__, __LINE__);


That sort of thing has worked for me.

I will say that I had to shut down this on my site because it used too many resources.

kjb0007

My site is in the middle of a revamp so I am holding off on the staff groups thing untiul I figure out who will actually still be there. I will let you know when I need help on that again :)

As for the AA stuff,, that is stemming originally from the code you posted here:

http://www.tinyportal.net/index.php?topic=6996.10 (I think..lol - its got the same code for the AA in it anyways.. heck ive used so many of the codes in this topic i have no idea anymore..lol)

Basically what I woild like is the code to have the "link to the profile" feature and I would like the names to also show up in the group colors (for both staff and reg members). :)


JPDeni

This is the code that I have on my site now. I just checked it and it's working fine with no odd letters:


global $db_prefix, $scripturl;
$nbsp = "&n"."bsp;";
$count= array();
$poster_number = array();
$query = db_query(
    "SELECT posterName, {$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__);

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'];
}

asort($count);
$low_count = reset($count);

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

kjb0007

#95
ok the odd letters was stemming from this part of the code but its not in the one you just posted so I will try it.

echo '<a class="normaltext" href="' . $scripturl . '?action=profile;u=' . $poster_number[$value] .
    '" style="font-size:' . $fsize . 'pt; color:' . $poster_color[$value] . '">ÂÃ,·' . $name . 'ÂÃ,·</a> ';
  else
    echo '<a class="normaltext" href="' . $scripturl . '?action=profile;u=' . $poster_number[$value] .
    '" style="font-size:' . $fsize . 'pt;">ÂÃ,·' . $name . 'ÂÃ,·</a> ';
}


The one you posted works good, but it does not show the names in the group colors. What code would i need to add for that?



Thanks for the help :)

JPDeni

The problem with the code came from when the TP forum got moved. That happened in a lot of them. I forgot about that until just now.

Oh, yeah. Colors. I won't be able to test this, because I don't have different colors on my site. It does run without errors, though.


global $db_prefix, $scripturl;

$defaultcolor = "#000000";
$nbsp = "&n"."bsp;";
$count= array();
$poster_number = array();
$query = db_query(
    "SELECT posterName, {$db_prefix}messages.ID_MEMBER, {$db_prefix}members.ID_GROUP
     FROM {$db_prefix}members
       JOIN {$db_prefix}messages
         ON {$db_prefix}members.ID_MEMBER = {$db_prefix}messages.ID_MEMBER
       LEFT JOIN {$db_prefix}membergroups
         ON {$db_prefix}members.ID_GROUP = {$db_prefix}membergroups.ID_GROUP
     WHERE {$db_prefix}members.ID_GROUP <> 1 AND {$db_prefix}members.ID_GROUP <> 2
     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'];
    if (isset($row['onlineColor']))
      $color[$row['posterName']] = $row['onlineColor'];
    else
      $color[$row['posterName']] = $defaultcolor;
}

asort($count);
$low_count = reset($count);

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




This website is proudly hosted on Crocweb Cloud Website Hosting.