TinyPortal

Development => Resources => Topic started by: SoulPleX on September 20, 2007, 09:29:18 PM

Title: Ranks/ Membes Group Display
Post by: SoulPleX on September 20, 2007, 09:29:18 PM
How can i display to my members what ranks or members post groups are available so they will know how many post they need to move up to the next rank or post group?

Thanks!
Title: Re: Ranks/ Membes Group Display
Post by: tick on September 20, 2007, 09:40:16 PM
Well how are you wanting to display them.  In a block , article, post,     A little more info would be helpfull.  TIck
Title: Re: Ranks/ Membes Group Display
Post by: SoulPleX on September 20, 2007, 11:16:05 PM
On its own page. Maybe something like index.php?action=Ranks would be nice. If not a center block would work.
Title: Re: Ranks/ Membes Group Display
Post by: Phamon on September 27, 2007, 06:23:48 PM
By no means the expert here... but couldnt this simply be done in an article? you could then post a link to it from the sitemap or some other page your members reference for similar information
Title: Re: Ranks/ Membes Group Display
Post by: SoulPleX on September 27, 2007, 09:42:45 PM
Any way is fine with me. i just dont know how to do it. what would be th link to show what are the available post groups?
Title: Re: Ranks/ Membes Group Display
Post by: Phamon on September 27, 2007, 09:52:40 PM
In the admin section on the left menu go to "Membergroups"

should all be there ;)
Title: Re: Ranks/ Membes Group Display
Post by: SoulPleX on September 27, 2007, 11:00:41 PM
yes, but how can i display so my users can see it? was trying to avoid just typing it out in simple txt.
Title: Re: Ranks/ Membes Group Display
Post by: Phamon on September 27, 2007, 11:16:12 PM
with an article you can come up with all sorts of ways to display it, its wysiwyg so pretty easy to get creative. dont have an easy answer for ya here

/shrug thats one of the things I enjoy doing as an admin
Title: Re: Ranks/ Membes Group Display
Post by: anyoldcard on October 30, 2007, 11:58:41 PM
Hope I'm not butting in. Pages in the admin section would be tough to show because of the login but you could always do a page capture and display it. It would save work.
Title: Re: Ranks/ Membes Group Display
Post by: jacortina on October 31, 2007, 03:25:43 PM
This block will show all the post-count based groups, posts needed to get there, group names in the group color (if any), and stars for the group (if any).

In a phpblock (put it on one side):

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)) {
    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'], '<br />&nbsp;';
    echo                (!empty($row['stars']) ? ('<img src="' . $settings['images_url'] . '/' . $row['stars'] . '" alt="*" border="0" />') : '');
    echo '          </div>';
    echo '      </div>';
    echo '  </div>';
    echo '  <div style="clear:both;width:100%;"></div>';
}

mysql_free_result($request);
Title: Re: Ranks/ Membes Group Display
Post by: anyoldcard on October 31, 2007, 04:53:53 PM
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

Title: Re: Ranks/ Membes Group Display
Post by: anyoldcard on October 31, 2007, 04:58:26 PM
If I comment the line for the star images will the script crash? I guess I should just try it huh?
Title: Re: Ranks/ Membes Group Display
Post by: anyoldcard on October 31, 2007, 05:06:17 PM
I got it. I removed the stars and closed up the gaps. Thanks for the script.
Title: Re: Ranks/ Membes Group Display
Post by: jacortina on October 31, 2007, 05:19:34 PM
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);
Title: Re: Ranks/ Membes Group Display
Post by: anyoldcard on October 31, 2007, 06:06:45 PM
Thanks. I'll try it now.