News:

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

Main Menu

BBC [you] Tag

Started by Diego Andrés, June 01, 2008, 12:26:50 PM

Previous topic - Next topic

ccbtimewiz

Quote from: pinoypetfinder on October 02, 2008, 08:36:09 AM
installed on our forum with no problem! thanks!

btw, is it possible to make the name unclickable? i mean, just plain text and not a link to the user profile?

Yes there is. Open ./Sources/Subs.php

Find:
'content' => $context['user']['is_guest'] ? $txt[28] : '<a href="'.$scripturl.'?action=profile;u='.$context['user']['id'].'">'.$context['user']['name'].'</a>',

Replace with:
'content' => $context['user']['is_guest'] ? $txt[28] : $context['user']['name'],

pinoypetfinder

#21
awesome! thank you! :D


edit : removed my other message about the +F text prob.  everything's working well now. thanks very much :)

pinoypetfinder

hi again, some of my members are asking me if it's possible to just change the font color of the username that will appear when the [ you ] code is used.

will putting a code like this work?
'content' => $context['user']['is_guest'] ? $txt[28] : '<font color="color here">'.$context['user']['name'].'</font>',

ccbtimewiz

Better to do this:

'content' => $context['user']['is_guest'] ? $txt[28] : '<span style="color: red;">'.$context['user']['name'].'</span>',

SpectroPro

No need to update, I just installed this on 2.0b4 and it works perfectly!!!   I use it in my news where I say welcome [you] to .......    People LOVE IT!!!!!

Thanks!!!!!

Greg
Stats:  SMF v. 2b4  -  Mambo v4.65  -  Bridge v2.0b1

http://www.therealityrocks.com    http://forum.therealityrocks.com/trr
- Greg

pinoypetfinder

Quote from: ccbtimewiz on October 03, 2008, 03:07:03 PM
Better to do this:

'content' => $context['user']['is_guest'] ? $txt[28] : '<span style="color: red;">'.$context['user']['name'].'</span>',

thank you!
our members love it too! hehe

SpectroPro

Been having a blast with this on my site.. LOL  I post things like:  Hey [you], I just want you to know, you are the most important person on this site..

LOL

then that post gets tons of replies saying thanks!  hehe  Eventually, someone says, wait, he said me, not you..  and on and on...it's hillarious!!!!   I told them eventually, that I made a change that lets me personalize messages like a mass mailer would do...  They all thought it was funny as hell!!!!!


I did find one problem though...  In my error log.  Getting errors on the guests...  Here is what comes from the log:

8: Undefined offset: 28
File: /home/spectro/public_html/forum/trr/Sources/Subs.php
Line: 1675


That line is:

'content' => $context['user']['is_guest'] ? $txt[28] : '<a href="'.$scripturl.'?action=profile;u='.$context['user']['id'].'">'.$context['user']['name'].'</a>',

Any ideas?  I have 17 pages of these errors...  Most likely because my news welcomes [you] to the site...
Stats:  SMF v. 2b4  -  Mambo v4.65  -  Bridge v2.0b1

http://www.therealityrocks.com    http://forum.therealityrocks.com/trr
- Greg

ccbtimewiz

Replace that line with this:

'content' => $context['user']['is_guest'] ? 'Guest' : '<a href="'.$scripturl.'?action=profile;u='.$context['user']['id'].'">'.$context['user']['name'].'</a>',

Trinny

mm no. The mod works fine on 2.0, with the exception of guests. They don't see anything.

So if I post

[you] are not as cool as I am

any registered user will see their name, the guest sees only "are not as cool as I am" and if you make said code replacement ^^ EVERYONE sees "Guest is not as cool as I am"

SpectroPro

With the mod for guests...  my users (members) still see their name...so not sure what is up on your site...  That's odd

-Greg
Stats:  SMF v. 2b4  -  Mambo v4.65  -  Bridge v2.0b1

http://www.therealityrocks.com    http://forum.therealityrocks.com/trr
- Greg

Sabre™

hmm..  how'd you do that? lol
Mine see "Guest"  when not logged in
Share the secret! lol
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


SpectroPro

Quote from: Sabre™ on October 09, 2008, 08:02:59 PM
hmm..  how'd you do that? lol
Mine see "Guest"  when not logged in
Share the secret! lol

I think we are misunderstanding each other...

As I am reading his post, once he made the above change in the code, to eliminate the error in the log for guests, his normal members no longer see their name.  They see GUEST. 

I am saying, if that is the case, I don't know why, cause on my 2b4, guests see guest, and members see their own names, just as they should, and no errors in the log.   

It wasn't magic..  I just made that change...

- Greg
Stats:  SMF v. 2b4  -  Mambo v4.65  -  Bridge v2.0b1

http://www.therealityrocks.com    http://forum.therealityrocks.com/trr
- Greg

Sabre™

Oh yep, I misunderstood your post, I thought when your members werent logged, it could still reveal their name.
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


ccbtimewiz

Perhaps this then:

'content' => !$context['user']['is_logged'] ? 'Guest' : '<a href="'.$scripturl.'?action=profile;u='.$context['user']['id'].'">'.$context['user']['name'].'</a>',

Trinny

Quote from: ccbtimewiz on October 09, 2008, 08:45:42 PM
Perhaps this then:

'content' => !$context['user']['is_logged'] ? 'Guest' : '<a href="'.$scripturl.'?action=profile;u='.$context['user']['id'].'">'.$context['user']['name'].'</a>',
Absolutely flawless.

With this minor change, the mod functions on smf 2.0b4 with zero errors. Nice one. Thanks.

ccbtimewiz

Mod updated. Fixed 2.0 bug with $txt[28] string.

Made modification install on both versions with these changes.

Jade Elizabeth

Quote from: ccbtimewiz on November 20, 2008, 05:55:46 PM
Mod updated. Fixed 2.0 bug with $txt[28] string.

Made modification install on both versions with these changes.

The correct string is "guest_title" :)


Was gonna tell you last night but I had to run... I hope you didnt hard code text..
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

ccbtimewiz

Actually the correct string is $txt['guest'], and thats what I used. :)

Actually both those strings exist in index.english.php. o.o;

Jade Elizabeth

Nao told me to use guest_title :)
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

baijianpeng

I tested this Mod today on my SMF v1.1.7 Chinese version (utf-8 language files).

Apparently this Mod can't work properly if the user has a Chinese name.

See attached screenshot. The name should be 白建鹏, but showing up as 白建? . In addition, I had enter some text after that name code, but they all lost after this question mark.

However, if the user has an English name, such as Tom or Mike, this Mod will work correctly.

Hope the author will fix this soon.

Thanks.
JoomlaGate: The way to the World of Joomla!

http://www.joomlagate.com

Advertisement: