News:

Wondering if this will always be free?  See why free is better.

Main Menu

Crowns.

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

Previous topic - Next topic

onepiece

With groups for SMF 2.0 version:

Sources/Load.php

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

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

// What a monstrous array...


Code (Find) Select
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '">' . $profile['real_name'] . '</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['profile_of'] . ' ' . $profile['real_name'] . '">' . $profile['real_name'] . '</a>',

Sources/Subs-MembersOnline.php

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

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

// A lot of useful information for each member.

kool aid44

My SMF version is 1.1.8

onepiece

I thought you had SMF 2.0 because of this post.

Quote from: kool aid44 on April 04, 2009, 09:32:43 AM
I also need the SMF version, and where do I upload the image at?

Anyway, here is the one with groups for SMF 1.1 versions.

Sources/BoardIndex.php

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

Code (Replace) Select
$crown_groups = array(1, 2, 3);
$crown_image = '<img src="' . $settings['images_url'] . '/crown.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, 3);
$crown_image = '<img src="' . $settings['images_url'] . '/crown.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>',

kool aid44

Ok thanks
1 more quick question
Going to make this clear as can be

The code you just gave me I used for my administrators
What do I do so my global moderators have a DIFFERENT crown..
Just double up the code or something?

onepiece

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.

kool aid44

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.

Sorry about all the trouble but when I look at this I think you don't understand what i'm saying

Here let me explain it better.

Before the code you gave me for crowns I used for the group administrators
So all administrators on the online list will look like this
kool aid44
in the online list

but all the global moderators look like
Robbie447
with no crown, how do i make it so that global moderators look like
Robbie447
in the online list

onepiece

Have you tried the latest codes I gave and uploaded crowadmin.gif and crownregular.gif images? That should be displaying two different images for admins and global moderators.

kool aid44

Doesn't work
Sorry I'm not good with this stuff, is there a simpler way?
Also I have around 21 membergroups with a crown for them so it's difficult for me.

onepiece

Would attach both of your files here, with the last edits you have?

kool aid44

Only edited boardindex.php because all i want is the online list

onepiece

That's better. May I have it as PHP?

kool aid44


phpMyTony

The above file only contains the words: "Hacking attempt..." :S

MMcGrad2

Tenma, that doesn't add crowns to the username when they post.  How can I add crowns to that?  Let's just add a global moderator crown (gmod.gif) and an admin crown (admin.gif).  Mind teaching me how I can do this?

onepiece

Quote from: phpMyTony on April 04, 2009, 11:13:48 PM
The above file only contains the words: "Hacking attempt..." :S

That's what I'm seeing too. Would download and upload the file again kool aid44?

Quote from: MMcGrad2 on April 05, 2009, 08:25:15 PM
Tenma, that doesn't add crowns to the username when they post.  How can I add crowns to that?  Let's just add a global moderator crown (gmod.gif) and an admin crown (admin.gif).  Mind teaching me how I can do this?

I'm not sure what you mean by "when they post". Which area are you referring to?

MMcGrad2

Quote from: Tenma on April 06, 2009, 06:09:24 AM
Quote from: phpMyTony on April 04, 2009, 11:13:48 PM
The above file only contains the words: "Hacking attempt..." :S

That's what I'm seeing too. Would download and upload the file again kool aid44?

Quote from: MMcGrad2 on April 05, 2009, 08:25:15 PM
Tenma, that doesn't add crowns to the username when they post.  How can I add crowns to that?  Let's just add a global moderator crown (gmod.gif) and an admin crown (admin.gif).  Mind teaching me how I can do this?

I'm not sure what you mean by "when they post". Which area are you referring to?
Well, see how your posts have your name written and then your titles?  I want to make a crown appear before your name.

onepiece

Making the Load.php edit I gave above should be doing it. Anyway, this would be better.

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' : 'mod') . '.gif" alt="" />';

// What a monstrous array...


Code (Find) Select
'<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member']

Code (Replace) Select
(in_array($profile['id_group'], $crown_groups) ? $crown_image : '') . '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member']

Then make sure you upload crownadmin.gif and crownmod.gif images to the images directory of your theme.

MMcGrad2

#37
Tenma, I believe loading the crowns would be template level.  Post.template.php and Index.template.php etc.  Tenma, think you could make this 2.0 RC1 compatible?

http://custom.simplemachines.org/mods/index.php?mod=943

onepiece

They can be at template level, but attaching them in source file is a lot practical. It affects all themes and does not require many changes. If you applied the codes correctly, it should be working as intended. See the attachment I have. Cake is the crownadmin.gif image and the blue crown is crownmod.gif image in Themes/{my_theme}/images directory.

I can make that mod compatible with SMF 2.0 RC1 too, but I won't. You have to request that from the author of the mod.

MMcGrad2

I 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

What if the creator of the mod has been inactive for months and I would only use it for personal use?

Advertisement: