Advertisement:

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

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 4,130
  • Gender: Male
    • i30 Owners Club
Re: BBC [you] tag
« Reply #60 on: August 19, 2012, 09:19:39 AM »

any chance you could help me edit the code so it shows a @ or some other symbol before the username  ;)

Code: [Select]
// BBC [you] tag. ;)
$codes[] = array(
'tag' => 'you',
'type' => 'closed',
'content' => (!$context['user']['is_guest'] ? '@' . $context['user']['name'] : (!empty($txt[28]) ? $txt[28] : $txt['guest'])),
);

Offline thechronic2001

  • Semi-Newbie
  • *
  • Posts: 67
Re: BBC [you] tag
« Reply #61 on: August 19, 2012, 12:52:30 PM »
thanks buddy, it worked a treat  ;)

Offline mgrmgr

  • Semi-Newbie
  • *
  • Posts: 92
  • Gender: Male
Re: BBC [you] tag
« Reply #62 on: August 31, 2012, 02:16:51 AM »
I've got a problem now. I installed it in SMF 1.16 and it worked also in signatures, now in SMF 2.0.2 not working in signatures any longer :(

BTW: I'd love a group permission for using it, I'd prefer to let only staff use it to avoid embarrassment/annoyed users.

Offline mgrmgr

  • Semi-Newbie
  • *
  • Posts: 92
  • Gender: Male
Re: BBC [you] tag
« Reply #63 on: October 12, 2012, 01:30:31 PM »
Well - I found the solution myself and moved the 'you' array before the integration hook call.

The permission for membergroups is solved now with the help of custom-permissions and a small tweak in the replacement line.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 66,512
    • Arantor on GitHub
Re: BBC [you] tag
« Reply #64 on: January 07, 2015, 04:21:09 PM »
Might I suggest the content of the tag be set to:
Code: [Select]
'content' => empty($context['user']['is_guest']) && !empty($context['user']['name']) ? $context['user']['name'] : (!empty($txt[28]) ? $txt[28] : (!empty($txt['guest']) ? $txt['guest'] : 'Guest')),
Reason I say this is because this was being invoked on pages where $context['user'] wasn't being defined (action=dlattach) and in those cases the $txt strings might not be loaded either, hence a fallback for that too that doesn't rely on language files. (I think this would be allowed under the 'no hardcoded text' rule ;D)
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

Offline Diego Andrés

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,030
  • Gender: Male
  • We know, we'll be coming
    • DiegoCortes on GitHub
    • @comeladrillos on Twitter
    • SMF Tricks - Free & Premium Themes
Re: BBC [you] tag
« Reply #65 on: January 07, 2015, 07:21:04 PM »
Thanks, I'll take the suggestion and update the mod.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Offline sangham.net

  • Full Member
  • ***
  • Posts: 497
  • Gender: Male
Re: BBC [you] tag
« Reply #66 on: May 29, 2015, 07:19:18 AM »
Thanks valued Diego Andrés for this nice mod and dear Mr. Arantor for the additional code. Works fine!

metta & mudita
Samana Johann

Offline Diego Andrés

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,030
  • Gender: Male
  • We know, we'll be coming
    • DiegoCortes on GitHub
    • @comeladrillos on Twitter
    • SMF Tricks - Free & Premium Themes
Re: BBC [you] tag
« Reply #67 on: July 16, 2015, 12:10:51 PM »
Mod updated, now is using hooks

SMF Tricks - Free & Premium Responsive Themes for SMF.

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 4,130
  • Gender: Male
    • i30 Owners Club
Re: BBC [you] tag
« Reply #68 on: July 16, 2015, 01:12:08 PM »
It's hiding ;)


Offline Diego Andrés

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,030
  • Gender: Male
  • We know, we'll be coming
    • DiegoCortes on GitHub
    • @comeladrillos on Twitter
    • SMF Tricks - Free & Premium Themes
Re: BBC [you] tag
« Reply #69 on: July 16, 2015, 01:16:55 PM »
Our lovely modsite  ;D
Fixed  :P

SMF Tricks - Free & Premium Responsive Themes for SMF.

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 4,130
  • Gender: Male
    • i30 Owners Club
Re: BBC [you] Tag
« Reply #70 on: July 16, 2015, 01:33:42 PM »
Nice one. If only it would apply the code to topic titles...    *whistles*

Offline landyvlad

  • Jr. Member
  • **
  • Posts: 182
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: BBC [you] Tag
« Reply #71 on: March 16, 2017, 02:43:23 AM »
Yes, before iinstal this - does it work in topic titles yet?
I'm new at this - thanks to everyone for their help !