Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: kurotenshi on March 20, 2005, 07:31:04 PM

Title: [edit] Tag [/edit]
Post by: kurotenshi on March 20, 2005, 07:31:04 PM
I often use [edit] tag when I was edited to some post. Then my mind pop-up "Hey, let's made this a BBC!"
Ok, then I made it. And here it are, for you all, fancy [edit] tag ;D

Paste this in Sources/Subs.php after line 913
// Edit tag
'~\[edit\](?:<br />)?~i' => isset($disabled['edit']) ? '<div>' : '<div style="font-size: x-small; font-weight: 600;">Editor says:</div><div style="border: 1px solid black; font-size: x-small; font-weight: bold; padding: 2px; background: pink;">',


Then put this code in your Post.template.php after line 648

'edit' => array('code' => 'edit', 'before' => '[edit]', 'after' => '[/edit]', 'description' => 'Post editing'),

Ok, and then you can use [edit] [/edit] in your board.

Preview in action: link dead, removed by Owdy.

Sorry, pink is fine color :P
Title: Re: [edit] Tag [/edit]
Post by: FaSan on March 20, 2005, 08:42:33 PM
Great ! ;)
Title: Re: [edit] Tag [/edit]
Post by: [Unknown] on March 20, 2005, 09:14:38 PM
Background pink?

Anyway, looks fine to me :).

-[Unknown]
Title: Re: [edit] Tag [/edit]
Post by: frost on March 20, 2005, 11:31:59 PM
i like this solution!!


can it be made a feature in  the next issue of SMF? pllleeeeeaaaaasssseeeeeeeee?????  :D :D :D
Title: Re: [edit] Tag [/edit]
Post by: kurotenshi on March 21, 2005, 05:48:23 AM
Quote from: [Unknown] on March 20, 2005, 09:14:38 PM
Background pink?

Yes!! Why not  ;D I just pick a color what isn't in common use... And pink is just that kind color. But anyone could change it, if want...
Title: Re: [edit] Tag [/edit]
Post by: Dannii on April 03, 2005, 08:46:41 AM
Thanks, I should be able to use this for something else similar I want. Can you put the preview back up?
Title: Re: [edit] Tag [/edit]
Post by: Owdy on April 03, 2005, 08:49:12 AM
Quote from: Infrequentia on March 20, 2005, 07:31:04 PM

Preview in action: http://hob-art.dy.fi/smftest/index.php?topic=2.0

Quote
Apologies
Whole HoB-Art server is closed for this weekend. We upgrade ja modify server more secure and functional.
We are sorry about this break!
::)
Title: Re: [edit] Tag [/edit]
Post by: Owdy on April 12, 2005, 11:01:15 AM
I use this in 1.1
// Edit tag
'~\[edit\](?:<br />)?~i' => isset($disabled['edit']) ? '<div>' : '<div style="font-size: x-small; font-weight: 600;">Muokkaus:</div><div style=" font-size: xx-small;  padding: 2px; ">',


This prints end tag
[/edit] 
in post. Any ideas why?

Second quoestion, what if i want only my moderators to see that edit button, how d i do that?
Title: Re: [edit] Tag [/edit]
Post by: [Unknown] on April 12, 2005, 11:05:14 AM
For the code, you want this:

// Edit tag
'~\[edit\](?:<br />)?~i' => isset($disabled['edit']) ? '<div>' : '<div style="font-size: x-small; font-weight: 600;">Muokkaus:</div><div style="font-size: xx-small;  padding: 2px; ">',
'~(?:<br />)?\[/edit/]~i' => '</div>',


-[Unknown]
Title: Re: [edit] Tag [/edit]
Post by: Owdy on April 12, 2005, 11:15:47 AM
That does the same
Title: Re: [edit] Tag [/edit]
Post by: Owdy on April 12, 2005, 01:49:19 PM
fixed:

// Edit tag
'~\[edit\](.+?)\[/edit\]~i' => isset($disabled['edit']) ? '$1' : '<span style="font-size: xx-small; font-weight: 600;font-style:italic ">Muokkaus:</span><br /><span style="font-size: xx-small;font-style:italic ">$1</span>',


How about that button?
Title: Re: [edit] Tag [/edit]
Post by: [Unknown] on April 15, 2005, 10:43:13 AM
Well, you only show it if $user_info['is_moderator']...

-[Unknown]
Title: Re: [edit] Tag [/edit]
Post by: Karmalakas on May 04, 2005, 02:15:20 AM
Here you go

// Edit tag
'~\[edit\](.+?)\[/edit\]~i' => isset($disabled['edit']) ? '$1' : '<div style="font-size: x-small; font-weight: 600;">Editor says:</div><div style="border: 1px solid black; font-size: x-small; font-weight: bold; padding: 2px; background: pink;">$1</div>',


It's like in first post in pink background and doesn't print end tag ;)
Title: Re: [edit] Tag [/edit]
Post by: Owdy on May 04, 2005, 05:33:28 AM
Quote from: CRONUS on May 04, 2005, 02:15:20 AM
Here you go

// Edit tag
'~\[edit\](.+?)\[/edit\]~i' => isset($disabled['edit']) ? '$1' : '<div style="font-size: x-small; font-weight: 600;">Editor says:</div><div style="border: 1px solid black; font-size: x-small; font-weight: bold; padding: 2px; background: pink;">$1</div>',


It's like in first post in pink background and doesn't print end tag ;)

Thanks, allready fixed ;D
http://www.simplemachines.org/community/index.php?topic=31015.msg246300#msg246300
Title: Re: [edit] Tag [/edit]
Post by: Karmalakas on May 04, 2005, 08:13:06 AM
Quote from: Owdy on May 04, 2005, 05:33:28 AM
Thanks, allready fixed ;D
http://www.simplemachines.org/community/index.php?topic=31015.msg246300#msg246300

But that fix doesn't make pink background :) and it doesn't separete at all Edit from the original post
Title: Re: [edit] Tag [/edit]
Post by: Owdy on May 04, 2005, 10:36:03 AM
I really dont want pink background ;) Its just the way i like it.
Title: Re: [edit] Tag [/edit]
Post by: kurotenshi on May 04, 2005, 10:49:57 AM
Quote from: Owdy on May 04, 2005, 10:36:03 AM
I really dont want pink background ;) Its just the way i like it.
You don't wan't pink background!? Why, it's so cute color x)
Btw, I just put some uncommon color to bgcolor, and anyone can change it color whatever they wan't.
Title: Re: [edit] Tag [/edit]
Post by: Karmalakas on June 02, 2005, 03:36:28 AM
Now i have a prob :(

How to make it work with SMF 1.0.3 and Faster Parse Code installed :(