Not logged in. · Lost password · Register
Forum: General Help and Support Plugins RSS
How to insert the name of user in page?
Avatar
jossif #1
Member since Apr 2007 · 10 posts
Group memberships: Members
Show profile · Link to this post
Subject: How to insert the name of user in page?
I need to be able to automatically add to a page the name of a user. Similar to what the signature does.

Something along the lines of [[user:@USER]] that will render on the page as [[user:John Smith]]

Is this possible? Is there a plugin for this?

-- Jossi
Avatar
Falkor #2
Member since Apr 2007 · 32 posts
Group memberships: Members
Show profile · Link to this post
I don't know if there is a plugin that does it, but you can very easily write your own.

You'll need to follow the action plugin howto, and "catch" the event IO_WIKIPAGE_WRITE. Then you can
append the text you need to your entry. The data to be saved is in the array $data[0][1].

It shouldn't take you more then 30 mins if you have minimal php experience ;-)


Good luck

//Falkor
chi #3
Member since Jun 2006 · 1851 posts · Location: Munich Germany
Group memberships: Members, Super Mods, Wiki Managers
Show profile · Link to this post
Quote by Falkor:
You'll need to follow the action plugin howto, and "catch" the event IO_WIKIPAGE_WRITE. Then you can
append the text you need to your entry. The data to be saved is in the array $data[0][1].

I doubt that IO_WIKIPAGE_WRITE is the right event to hook in because as I understand it, jossif wants the replace the @USER part dynamically depending on the current logged in user and not only when the wiki page is saved (keep caching in mind).

I think a syntax plugin would be enough. Have a look at the var plugin [1]. I think it would be easy to modify it to fit your needs.

--
chi

[1] http://wiki.splitbrain.org/plugin:var
Please add [SOLVED] to the initial thread subject if you feel your question has been answered.
If my answer doesn't make sense maybe your question didn't either - just visit http://facepalm.org.
Avatar
jossif #4
Member since Apr 2007 · 10 posts
Group memberships: Members
Show profile · Link to this post
Thanks, Chi.

That plugin does it.

- Jossi
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-05-26, 17:35:27 (UTC +02:00)