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

Recent

Welcome to TinyPortal. Please login or sign up.

March 28, 2024, 08:44:56 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,104
  • Total Topics: 21,212
  • Online today: 199
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 199
  • Total: 200
  • illori

Ranks/ Membes Group Display

Started by SoulPleX, September 20, 2007, 09:29:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

anyoldcard

The images do not show and the area that it covers is huge.

Heres the url for the stars link. Is that extra character spose to be there?

forum/Themes/default/images/4#star.gif


anyoldcard

If I comment the line for the star images will the script crash? I guess I should just try it huh?

anyoldcard

I got it. I removed the stars and closed up the gaps. Thanks for the script.

jacortina

The gaps are to leave space for stars when, say, Newbies don't get any (stacking them right on top of the next one won't look right.

And I forgot about the multiplier (I don't use images for the post-count groups myself). But you could see if this does it:
global $db_prefix, $settings;

$request = db_query("
    SELECT ID_GROUP, groupName, minPosts, onlineColor, stars
    FROM {$db_prefix}membergroups
    WHERE minPosts > -1
    ORDER BY minPosts", __FILE__, __LINE__);

echo '<div style="text-align:center;text-decoration:underline;"><h3>Ranks</h3></div>';

while ($row = mysql_fetch_assoc($request)) {
    if (!empty($row['stars'])) {
        $stars = explode('#', $row['stars']);
        $combine = '';
    for ($i = 0; $i < $stars[0]; $i++)
        $combine .= '<img src="' . $settings['images_url'] . '/' . $stars[1] . '" alt="*" border="0" />';
    }
    echo '  <div style="width:100%;padding-top:3px">';
    echo '      <div style="float:left;width:25%;">';
    echo '          <div style="text-align:right;">';
    echo                $row['minPosts'], '&nbsp;';
    echo '          </div>';
    echo '      </div>';
    echo '      <div style="float:right;width:75%;font-weight:bold;', (!empty($row['onlineColor']) ? ('color:'.$row['onlineColor'].';') : ''), '">';
    echo '          <div style="text-align:left;">';
    echo                $row['groupName'];
    echo                '<br />&nbsp;', $combine;     // Commenting this line out should prevent stars showing and close 'gap'.
    echo '          </div>';
    echo '      </div>';
    echo '  </div>';
    echo '  <div style="clear:both;width:100%;"></div>';
}

mysql_free_result($request);

anyoldcard