News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Tag to show reader's name in message

Started by WhizzB, June 07, 2004, 09:22:25 AM

Previous topic - Next topic

edi67

Quote from: [Unknown] on September 15, 2004, 03:53:22 PM
Yes... there is.  Why else would I have posted my cryptic reply to the "hide" topic?

Instead of '<div style="color: green;">$1</div>'... why not:

'<script language="JavaScript">var spolierid = Math.round(Math.random() * 10000); document.write(\'<a href="#" onclick="document.getElementById(&quot;spolier\' + spolierid + \'&quot;).style.display = &quot;&quot;; this.style.display = &quot;none&quot;; return false;">SPOILER: CLICK TO READ</a><span id="spoiler\' + spolierid + \'">\');</script>$1<script language="JavaScript">document.write(\'</span>\');</script>'

In theory, that shoudl hide it until you click to show.  If javscript is off, it won't be hidden at all.

-[Unknown]

where i must try to put this comand for hide topic?
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Anguz

For new tags without attributes (parameters), like the sarcasm tag mentioned in this topic, you can now use this mod
http://mods.simplemachines.org/index.php?mod=48
Cristián Lávaque http://cristianlavaque.com


EG

#23
I would like to create a bbc tag, so that when used, a line of text is shown first, and then what the person types between the tag.

I think I need to use echo.... but I cant figure it out, keep getting parse errors :-\

Ravenous

I add an OoC(Out of Charakter) tag to my forum. What should i do with this code, that "Out of Charakter" is shown above that message like "Quote"?


Ravenous


[Unknown]

'~\[ooc\](.+?)\[/ooc\]~i' => '<div class="quoteheader">Out of Character:</div><div class="quote">$1</div>',

-[Unknown]

oSa

Quote from: [Unknown] on June 07, 2004, 09:35:45 AM
This is not a built in feature, but you can add it.  The way to add it, however, will be changing in the next version.  For the current version:

Sources/Subs.php, Find:
// [me=Comment]does something[/me]
'/\[me=&quot;(.+?)&quot;\](.+?)\[\/me\](?:<br \/>)?/is',


Add after:
'~\[you( /)?\]~i',

And then find:
// Something "me" is doing.
'<div class="meaction">* $1 $2</div>',


And add right after that:
$context['user']['name'],

In the next version, you'll find this in the same file:
// [me=Comment]does something[/me]
'~\[me=((?:&quot;)?)(.{1,80}?)\\1\](.+?)\[/me\](?:<br />)?~i' => '<div class="meaction">* $2 $3</div>',


And add after it:
'~\[you( />)?\]~i' => $context['user']['name'],

-[Unknown]

How can i add this tag using the custom bb code mod?

Rain501

#28
okie dokie..

1.1 is giving me beef..

in the subs.php file, firstly i tried adding this to the $codes array :


array(
'tag' => 'iframe',
'type' => 'unparsed_content',
'before' => '<iframe src="http://xyz.abc.com/$1.html" scrolling="no" frameBorder="0" height="240" width="104"></iframe>',
'after' => '',
),


which gives me errors...


Warning: main(/home/rain501/public_html/forums/Sources/Subs.php): failed to open stream: No such file or directory in /home/rain501/public_html/forums/index.php on line 48

Fatal error: main(): Failed opening required '/home/rain501/public_html/forums/Sources/Subs.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/rain501/public_html/forums/index.php on line 48


And the same if i tag that out side of the $codes object, above the 'bbc goes above this line' line.

I then tried sticking the full sarcasm tag, copied from above onto the line above the 'stick yer bbc code above this line' line.. ;)

Still the errors :(

Anyone willing to point out where i'm going wrong?

EDIT:

Sorted it by rejigging the Array vars, so its all gravy now :)

Vinspire

This is a build in function in SMF 1.1 RC 2 right ?

topdog2k

Quote from: [Unknown] on June 07, 2004, 09:35:45 AM
This is not a built in feature, but you can add it.  The way to add it, however, will be changing in the next version.  For the current version:

Sources/Subs.php, Find:
// [me=Comment]does something[/me]
'/\[me=&quot;(.+?)&quot;\](.+?)\[\/me\](?:<br \/>)?/is',


Add after:
'~\[you( /)?\]~i',

And then find:
// Something "me" is doing.
'<div class="meaction">* $1 $2</div>',


And add right after that:
$context['user']['name'],

In the next version, you'll find this in the same file:
// [me=Comment]does something[/me]
'~\[me=((?:&quot;)?)(.{1,80}?)\\1\](.+?)\[/me\](?:<br />)?~i' => '<div class="meaction">* $2 $3</div>',


And add after it:
'~\[you( />)?\]~i' => $context['user']['name'],

-[Unknown]

I know this thread is dead but I will ask anyways.  Can the [you] tag be modified so other information about the user can be displayed such as the users ip or email, etc...

Advertisement: