News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Crowns.

Started by KadirX, December 25, 2008, 05:25:47 PM

Previous topic - Next topic

onepiece

Quote from: MMcGrad2 on April 10, 2009, 12:48:01 PMI tried to do what you told me to, although that did not affect anything.  Want to take a look?  I have 'Colorless_link' instead of 'link'.  I have the colored membergroups mod installed:

http://www.z508.com/Sources.zip

Try the attached file.

Quote from: MMcGrad2 on April 10, 2009, 12:48:01 PMWhat if the creator of the mod has been inactive for months and I would only use it for personal use?

Still... I don't use other mods, I code my own.

MMcGrad2

Wow tenma, great!  Works like a charm; I'm going to get my friend to explain the php code so I can do this with donators and make the board index show the crown.  Thanks a lot.

onepiece

Attached the file that would make it for more than 2 groups. The part you have to change is as follows.

$crown_images = array(
1 => 'admin',
2 => 'mod',
3 => 'star',
67 => 'somethingelse',
);


If you need to add more, similarly.

{group_id} => '{image_suffix}',

MMcGrad2

#43
Can you post an updated Users Online snippet?  It only displays one crown image for all mods/admins.  (Remember, this is for multi images next to usernames, so please make it compatible with the snippet you posted above where I can add usergroups.)  Thanks!

onepiece

Sources/Subs-MembersOnline.php

Code (Find) Select
// A lot of useful information for each member.

Code (Replace) Select
global $settings;

$crown_image = '';
$crown_images = array(
1 => 'admin',
2 => 'mod',
3 => 'star',
67 => 'somethingelse',
);

if (isset($crown_images[$row['id_group']]))
$crown_image = '<img src="' . $settings['images_url'] . '/crown'. $crown_images[$row['id_group']] . '.gif" alt="" />';
$link = $crown_image . $link;

// A lot of useful information for each member.

MMcGrad2

Tenma, do you have a paypal which I can send $5.00?

kool aid44

I'm all set with the crowns and all but it doesn't display in 'action=who'

onepiece

#47
Quote from: MMcGrad2 on April 17, 2009, 09:19:44 PM
Tenma, do you have a paypal which I can send $5.00?

Thank you very much, I appreciate it. I cannot accept it though, as this was a free support request. You can Donate it to Simple Machines or may want to save some more and get a Charter Membership to support this great software. Just a "Thanks!" is more than enough for me. ;)

Quote from: kool aid44 on April 18, 2009, 06:10:41 PM
I'm all set with the crowns and all but it doesn't display in 'action=who'

I don't remember saying that it does. This will do it.

Themes/default/Who.template.php

Code (Find) Select
echo '
<span', $member['is_hidden'] ? ' style="font-style: italic;"' : '', '>',


Code (Replace) Select
$crown_groups = array(1, 2, 3);
$crown_image = '<img src="' . $settings['images_url'] . '/crown.gif" alt="test" />';

if (!empty($member['group_id']) && in_array($member['group_id'], $crown_groups))
echo $crown_image;

echo '
<span', $member['is_hidden'] ? ' style="font-style: italic;"' : '', '>',

Oxygenn

Quote from: Tenma on April 04, 2009, 10:34:26 AM
Sources/BoardIndex.php

Code (Find) Select
$context['users_online'][$row['logTime'] . $row['memberName']] = array(

Code (Replace) Select
$crown_groups = array(1, 2);
$crown_image = '<img src="' . $settings['images_url'] . '/crown'. ($row['ID_GROUP'] == 1 ? 'admin' : 'regular') . '.gif" alt="" />';
$link = (in_array($row['ID_GROUP'], $crown_groups) ? $crown_image : '') . $link;

$context['users_online'][$row['logTime'] . $row['memberName']] = array(


Sources/Load.php

Code (Find) Select
// What a monstrous array...

Code (Replace) Select
$crown_groups = array(1, 2);
$crown_image = '<img src="' . $settings['images_url'] . '/crown'. ($profile['ID_GROUP'] == 1 ? 'admin' : 'regular') . '.gif" alt="" />';

// What a monstrous array...


Code (Find) Select
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '">' . $profile['realName'] . '</a>',

Code (Replace) Select
'link' => (in_array($profile['ID_GROUP'], $crown_groups) ? $crown_image : '') . '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '">' . $profile['realName'] . '</a>',

Upload crownadmin.gif for admins and crownregular.gif for all others to the images directory.


How would I add more than 2 different crowns? I need 6..

Oxygenn


Oxygenn


Bulakbol

I am working on this mod but... only for version 2.0 RC1. Charter members get a copy first so, get your badge now  :D

Kidding aside. I'll submit the mod today (Crowns) although I use stars. Wait until approved by fellow customizers. Sample attached.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Oxygenn

You should get it for 1.1.8 since most users use that ._.

Bulakbol

After it is approved, maybe I'll work on the version for 1.1.8.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Oxygenn

You should, cause that's what I'm using ;_;

Bulakbol

SMF version 2.0, aside from feature packed, it is easy to work with. Update now.  :)
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Oxygenn

Quote from: Oxygenn on April 24, 2009, 08:44:20 PM
Quote from: Tenma on April 04, 2009, 10:34:26 AM
Sources/BoardIndex.php

Code (Find) Select
$context['users_online'][$row['logTime'] . $row['memberName']] = array(

Code (Replace) Select
$crown_groups = array(1, 2);
$crown_image = '<img src="' . $settings['images_url'] . '/crown'. ($row['ID_GROUP'] == 1 ? 'admin' : 'regular') . '.gif" alt="" />';
$link = (in_array($row['ID_GROUP'], $crown_groups) ? $crown_image : '') . $link;

$context['users_online'][$row['logTime'] . $row['memberName']] = array(


Sources/Load.php

Code (Find) Select
// What a monstrous array...

Code (Replace) Select
$crown_groups = array(1, 2);
$crown_image = '<img src="' . $settings['images_url'] . '/crown'. ($profile['ID_GROUP'] == 1 ? 'admin' : 'regular') . '.gif" alt="" />';

// What a monstrous array...


Code (Find) Select
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '">' . $profile['realName'] . '</a>',

Code (Replace) Select
'link' => (in_array($profile['ID_GROUP'], $crown_groups) ? $crown_image : '') . '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '">' . $profile['realName'] . '</a>',

Upload crownadmin.gif for admins and crownregular.gif for all others to the images directory.


How would I add more than 2 different crowns? I need 6..

For 1.1.8, anyone?

onepiece

You can adapt the codes I gave for MMcGrad2 easily or just wait for Bulakbol's mod to be approved.

Oxygenn

Maybe something like:

      $crown_groups = array(1, 2, 3);
      $crown_image = '<img src="' . $settings['images_url'] . '/crown'. ($row['ID_GROUP'] == 1 ? 'admin' : 'regular' : 'etc') . '.gif" alt="" />';
      $link = (in_array($row['ID_GROUP'], $crown_groups) ? $crown_image : '' : '') . $link;


Right?

Oxygenn


Advertisement: