Is it possible to add a "sparkle" effect to certain usernames? Or membergroups?
E.g: (http://i.imgur.com/BOBuTFJ.gif)
In other forum softwares you can place a sparkle gif background behind the username, which gives you a "sparkle" effect. Does it work that way too in SMF? And if so then how and where do I add the gif?
To names, certainly. I've done it myself.
http://www.simplemachines.org/community/index.php?action=search2;search=sparkle
You know I did search before I posted this. There's really nothing in there that answers my question. A lot of people are looking for what I'm looking for, but non of them seem to have found a way to do it.
Can you post a mini tutorial showing how you did it?
Well, I edited Display.template.php to check for a specific username (in this case, the guy is called "Dazzler") and added the following in the section headed "// Show online and offline buttons?"
if ($message['member']['id'] == 60)
{
echo '<span style="color: #ff0000; background: url(http://www.mydomain.com/forum/bgeffects/sparkle.gif) no-repeat;"',
$message['member']['link'],
'</span> ';
}
Ah that's a neat trick! I like that. Hmm If I had a list of images to use would make a cool mod.
Quote from: Shambles on March 21, 2013, 04:00:48 PM
Well, I edited Display.template.php to check for a specific username (in this case, the guy is called "Dazzler") and added the following in the section headed "// Show online and offline buttons?"
if ($message['member']['id'] == 60)
{
echo '<span style="color: #ff0000; background: url(http://www.mydomain.com/forum/bgeffects/sparkle.gif) no-repeat;"',
$message['member']['link'],
'</span> ';
}
I tried that, it worked, but it created a new name area under "Karma", it didn't replace the actual name at the top.
Quote from: vbgamer45 on March 21, 2013, 04:08:05 PM
Ah that's a neat trick! I like that. Hmm If I had a list of images to use would make a cool mod.
1- (http://i.imgur.com/zb9b0tx.gif)
2- (http://i.imgur.com/iB5zlLx.gif)
3- (http://i.imgur.com/EFloJ6q.gif)
4- (http://i.imgur.com/Sv3ky3v.gif)
5- (http://i.imgur.com/WuFMfdQ.gif)
6- (http://i.imgur.com/N6sXWZh.gif)
Any more gifs?
Quote from: Decompiler on March 21, 2013, 08:03:49 PM
I tried that, it worked, but it created a new name area under "Karma", it didn't replace the actual name at the top.
You have to place the span around the displayed name. I just snipped you an example of my code.
Quote from: vbgamer45 on March 21, 2013, 09:33:42 PM
Any more gifs?
The point of the mod shouldn't be to have a bunch of predefined gifs. The forum administrator should be able to upload and set any background to a username. Some people for example would want to have a minecraft themed background behind their username, and so on. Not everyone is going to use it for the "sparkly" effect.
Quote from: Shambles on March 22, 2013, 05:01:19 AM
You have to place the span around the displayed name. I just snipped you an example of my code.
Displayed name? Where do I find that? Can you post a step by step guide on how to do it?
Well, since my earlier post, I amended my system to use this effect in a simpler and more manageable way.
I now use a new custom profile field for each member, which is used to hold the name of a background gif; I've set the profile field as "admin only" so that only admin can see or amend the field.
A very small change to Display.php now checks if a member has anything in the new profile field and wraps the members name with a 'span' to add that background image, if required.
A selection of background images is kept in a separate directory on my forum.
Quote
Displayed name? Where do I find that? Can you post a step by step guide on how to do it?
I'll assume you know nothing about anything I just wrote, so here goes:
Admin > Configuration > Core Features.
Ensure
Advanced Profile Fields is enabled; if not, enable it and hit the "save" button.
Admin > Configuration > Features and Options > Profile Fields.
In the "Custom Profile Fields" section click "New Field" to add a new profile field.
- Give the field a name (I chose "Background GIF")
- Choose the profile section (I chose Look & Layout)
- Set Show On Registration to No
- Untick 'Show On Topic View'
- Set Placement to "Standard with Title"
- Set Field Type to 'text'
- Set Privacy to 'This field is only visible to Admins'
- Tick the Active box.
Hit SAVE.
Edit
Sources/Display.php as follows:
function prepareDisplayContext($reset = false)
{
global $boardurl;
$memberContext[$message['id_member']]['ip'] = $message['poster_ip'];
if (!empty($memberContext[$message['id_member']]['options']['cust_backgr']))
{
$saveme = $memberContext[$message['id_member']]['link'];
$memberContext[$message['id_member']]['link'] =
'<span style="color: #ff0000; background: url(' .
$boardurl . '/bgeffects/' .
$memberContext[$message['id_member']]['options']['cust_backgr'] .
') no-repeat;">' . $saveme .
'</span>';
$memberContext[$message['id_member']]['options']['cust_backgr'] = '';
}
Notes:
- the name you chose for the profile field will affect the index name used in the code. I chose "Background GIF" which gives rise to ['cust_backgr'] in the code. Change to suit.
- I put all my GIFs into a directory called "/bgeffects", which you will see in the above code. Change to suit.
Any questions, just ask.
Thank you, that works. I still have one problem though. The gifs aren't centered, they're way beneath the username, so only the top of the gifs can be seen.
For example when I tried this gif (http://i.imgur.com/EFloJ6q.gif) only the top 2 bars were visible. Is there a way to center the gif on the username?
Quote from: Decompiler on March 23, 2013, 06:48:19 AM
Is there a way to center the gif on the username?
Sort of... Try this:
$memberContext[$message['id_member']]['link'] =
'<span style="color: #ff0000; background: url(' .
$boardurl . '/bgeffects/' .
$memberContext[$message['id_member']]['options']['cust_backgr'] .
') no-repeat;">' . $saveme .
'</span>';
$memberContext[$message['id_member']]['link'] =
'<span style="color: #ff0000; background: url(' .
$boardurl . '/bgeffects/' .
$memberContext[$message['id_member']]['options']['cust_backgr'] .
') no-repeat scroll 0% 100% transparent;">' . $saveme .
'</span>';
That worked [though I changed the position values to 50% 60%].
Thanks for taking the time to help me! :laugh:
not show in username block for tinyportal... how can i make it?
Quote from: qubbah
not show in username block for tinyportal... how can i make it?
Almost 7 years membership, you should know that you won't get much joy asking a new question in an already-solved (and someone else's) thread.
Quote from: Decompiler on March 21, 2013, 08:03:49 PM
Quote from: Shambles on March 21, 2013, 04:00:48 PM
Well, I edited Display.template.php to check for a specific username (in this case, the guy is called "Dazzler") and added the following in the section headed "// Show online and offline buttons?"
if ($message['member']['id'] == 60)
{
echo '<span style="color: #ff0000; background: url(http://www.mydomain.com/forum/bgeffects/sparkle.gif) no-repeat;"',
$message['member']['link'],
'</span> ';
}
I tried that, it worked, but it created a new name area under "Karma", it didn't replace the actual name at the top.
Quote from: vbgamer45 on March 21, 2013, 04:08:05 PM
Ah that's a neat trick! I like that. Hmm If I had a list of images to use would make a cool mod.
1- (http://i.imgur.com/zb9b0tx.gif)
2- (http://i.imgur.com/iB5zlLx.gif)
3- (http://i.imgur.com/EFloJ6q.gif)
4- (http://i.imgur.com/Sv3ky3v.gif)
5- (http://i.imgur.com/WuFMfdQ.gif)
6- (http://i.imgur.com/N6sXWZh.gif)
I think that a name which changes colour will be cool. Like on IPB
Very cool!!! Thanks for the write up!
Quote from: Shambles on March 22, 2013, 05:22:42 PM
Any questions, just ask.
thank you for descriping it step by stepmy question right now is; what to put into the profile field box, within the users account, after all doing that?
just the url of the actuall background gif you want to use for that certain username?
Quote
my question right now is; what to put into the profile field box ...
just the url of the actuall background gif you want to use for that certain username?
Yep.
Quote from: Shambles on March 22, 2013, 05:01:19 AM
Quote from: Decompiler on March 21, 2013, 08:03:49 PM
I tried that, it worked, but it created a new name area under "Karma", it didn't replace the actual name at the top.
You have to place the span around the displayed name. I just snipped you an example of my code.
Hello Sir can you help me with this I tried it but when I enter URL in profile field it doesn't work I am really noob with these kinds of stuff If I send u my display file can u fix the bugs for me