News:

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

Main Menu

BBC [you] Tag

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

Previous topic - Next topic

Shambles

Quote from: thechronic2001 on August 18, 2012, 08:02:46 PM

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


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


thechronic2001

thanks buddy, it worked a treat  ;)

mgrmgr

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.

mgrmgr

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.

Arantor

Might I suggest the content of the tag be set to:
'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)

Diego Andrés

Thanks, I'll take the suggestion and update the mod.

SMF Tricks - Free & Premium Responsive Themes for SMF.

sangham.net

Thanks valued Diego Andrés for this nice mod and dear Mr. Arantor for the additional code. Works fine!

metta & mudita
Samana Johann

Diego Andrés

Mod updated, now is using hooks

SMF Tricks - Free & Premium Responsive Themes for SMF.

Shambles


Diego Andrés

Our lovely modsite  ;D
Fixed  :P

SMF Tricks - Free & Premium Responsive Themes for SMF.

Shambles

Nice one. If only it would apply the code to topic titles...    *whistles*

landyvlad

Yes, before iinstal this - does it work in topic titles yet?
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

shadav

how to get this to show up in the bbcode list for 2.0.15?
I tried in subs-editor.php
array(
'image' => 'you',
'code' => 'you',
'before' => '[you]',
'description' => $txt['you']
),

but obviously that didn't work  :laugh:

Diego Andrés

You need to add $txt['you'] somewhere.
Post.english.php or index.english.php


And also add a bbc image to images/bbc/you.gif

SMF Tricks - Free & Premium Responsive Themes for SMF.

Herman's Mixen

Modifaction.language.php  ;)
Met vriendelijke groet, The Burglar!

 House Mixes | Mixcloud | Any Intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Albert Einstein

Former Godfather of our dutch community ;)

shadav

#75
thank you both....don't know what's wrong now lol
so in subs-editor.php I added
array(
'image' => 'you',
'code' => 'you',
'before' => '[you]',
'description' => $txt['bbc_you']
),

i changed the txt just in case

then in modifications.english.php and also in post.english.php i added
$txt['bbc_you'] = 'Insert name of person reading';
I tried either or and both but still same issue, it's showing up like this


[edit] nevermind  :laugh: I forgot to upload the image  ::)
thank you it's working now
[edit again] i'll attach the image if anyone wants to use it

shadav

I tried to install this on to a new site and it did not work...
I grabbed a package from another one of my site and that one worked...
not sure if something was changed by mistake in the updated one here on the site, but it seems to be broken...for 2.0.17

Shades.

Any updates to this mod cause the 2.0 one on the download page doesn't work for 2.0.18?

Also seen reported at https://www.simplemachines.org/community/index.php?topic=577400.msg4086476#msg4086476

The 2.1RC3 download works fine! 8)
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Diego Andrés

Didn't really see that topic before, I'll look into it

SMF Tricks - Free & Premium Responsive Themes for SMF.

Diego Andrés

There's indeed a typo in the 2.0.x mod.

- Fixed typo
- Added bbc icon, thanks to shadav for the code and suggestion

This is only for SMF 2.0.x version of the mod, version for SMF 2.1 will be updated later this year.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Advertisement: