Advertisement:

Author Topic: BBC [you] Tag  (Read 36424 times)

Offline ccbtimewiz

  • SMF Hero
  • ******
  • Posts: 5,300
  • Gender: Male
  • OXEN
Re: BBC [you] tag
« Reply #20 on: October 02, 2008, 10:45:43 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:
Code: [Select]
'content' => $context['user']['is_guest'] ? $txt[28] : '<a href="'.$scripturl.'?action=profile;u='.$context['user']['id'].'">'.$context['user']['name'].'</a>',
Replace with:
Code: [Select]
'content' => $context['user']['is_guest'] ? $txt[28] : $context['user']['name'],

Offline pinoypetfinder

  • Jr. Member
  • **
  • Posts: 188
    • Pinoy Pet Finder
Re: BBC [you] tag
« Reply #21 on: October 02, 2008, 06:37:35 PM »
awesome! thank you! :D


edit : removed my other message about the +F text prob.  everything's working well now. thanks very much :)
« Last Edit: October 02, 2008, 06:51:38 PM by pinoypetfinder »

Offline pinoypetfinder

  • Jr. Member
  • **
  • Posts: 188
    • Pinoy Pet Finder
Re: BBC [you] tag
« Reply #22 on: October 03, 2008, 02:02:00 PM »
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?
Code: [Select]
'content' => $context['user']['is_guest'] ? $txt[28] : '<font color="color here">'.$context['user']['name'].'</font>',

Offline ccbtimewiz

  • SMF Hero
  • ******
  • Posts: 5,300
  • Gender: Male
  • OXEN
Re: BBC [you] tag
« Reply #23 on: October 03, 2008, 03:07:03 PM »
Better to do this:

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

Offline SpectroPro

  • Jr. Member
  • **
  • Posts: 376
  • Gender: Male
    • The Reality Rocks Group
Re: BBC [you] tag
« Reply #24 on: October 03, 2008, 06:29:22 PM »
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

Offline pinoypetfinder

  • Jr. Member
  • **
  • Posts: 188
    • Pinoy Pet Finder
Re: BBC [you] tag
« Reply #25 on: October 03, 2008, 09:47:18 PM »
Better to do this:

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

thank you!
our members love it too! hehe

Offline SpectroPro

  • Jr. Member
  • **
  • Posts: 376
  • Gender: Male
    • The Reality Rocks Group
Re: BBC [you] tag
« Reply #26 on: October 05, 2008, 04:44:08 PM »
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:

Code: [Select]
'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

Offline ccbtimewiz

  • SMF Hero
  • ******
  • Posts: 5,300
  • Gender: Male
  • OXEN
Re: BBC [you] tag
« Reply #27 on: October 05, 2008, 07:07:23 PM »
Replace that line with this:

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

Offline Trinny

  • Semi-Newbie
  • *
  • Posts: 69
  • Gender: Female
  • robbing people with a six gun
Re: BBC [you] tag
« Reply #28 on: October 09, 2008, 07:29:07 PM »
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"

Offline SpectroPro

  • Jr. Member
  • **
  • Posts: 376
  • Gender: Male
    • The Reality Rocks Group
Re: BBC [you] tag
« Reply #29 on: October 09, 2008, 07:58:54 PM »
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

Offline Sabre™

  • SMF Hero
  • ******
  • Posts: 2,527
  • Gender: Male
  • IF IT AINT BROKE, I CAN FIX IT TILL IT IS!!
Re: BBC [you] tag
« Reply #30 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
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Offline SpectroPro

  • Jr. Member
  • **
  • Posts: 376
  • Gender: Male
    • The Reality Rocks Group
Re: BBC [you] tag
« Reply #31 on: October 09, 2008, 08:35:33 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

Offline Sabre™

  • SMF Hero
  • ******
  • Posts: 2,527
  • Gender: Male
  • IF IT AINT BROKE, I CAN FIX IT TILL IT IS!!
Re: BBC [you] tag
« Reply #32 on: October 09, 2008, 08:42:51 PM »
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 ;)


Offline ccbtimewiz

  • SMF Hero
  • ******
  • Posts: 5,300
  • Gender: Male
  • OXEN
Re: BBC [you] tag
« Reply #33 on: October 09, 2008, 08:45:42 PM »
Perhaps this then:

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

Offline Trinny

  • Semi-Newbie
  • *
  • Posts: 69
  • Gender: Female
  • robbing people with a six gun
Re: BBC [you] tag
« Reply #34 on: November 03, 2008, 07:29:55 PM »
Perhaps this then:

Code: [Select]
'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.

Offline ccbtimewiz

  • SMF Hero
  • ******
  • Posts: 5,300
  • Gender: Male
  • OXEN
Re: BBC [you] tag
« Reply #35 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.

Offline Jade Elizabeth

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,652
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • jadetrainor on LinkedIn
    • @alundra on Twitter
    • Jades-World
Re: BBC [you] tag
« Reply #36 on: November 21, 2008, 08:41:28 AM »
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.

Offline ccbtimewiz

  • SMF Hero
  • ******
  • Posts: 5,300
  • Gender: Male
  • OXEN
Re: BBC [you] tag
« Reply #37 on: November 21, 2008, 10:51:01 AM »
Actually the correct string is $txt['guest'], and thats what I used. :)

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

Offline Jade Elizabeth

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,652
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • jadetrainor on LinkedIn
    • @alundra on Twitter
    • Jades-World
Re: BBC [you] tag
« Reply #38 on: November 21, 2008, 11:06:25 AM »
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.

Offline baijianpeng

  • Jr. Member
  • **
  • Posts: 180
  • Gender: Male
    • JoomlaGate
Re: BBC [you] tag
« Reply #39 on: December 16, 2008, 03:07:24 AM »
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