Difference between revisions of "FreekiWiki talk:Site support"

From FreekiWiki
Jump to navigation Jump to search
(use an extension)
 
Line 6: Line 6:
  
 
Yea, didn't know how to deal with that.  Maybe I'll try using straight html(??) [[User:Shawn|Shawn]]
 
Yea, didn't know how to deal with that.  Maybe I'll try using straight html(??) [[User:Shawn|Shawn]]
 +
 +
: The friendly, safe way is to make an extension (html tags are limited to a specific set, for security reasons, and adding <form> to that set would be unsafe.) Extensions are documented [http://meta.wikimedia.org/wiki/Extending_wiki_markup here].  For this, you can just set $output = '{paypal form html}' in the render function.  Then set the first argument to $wgParser->setHook() to be, for example, "fgpaypalform", include the extension in LocalSettings.php, put <nowiki><fgpaypalform></fgpaypalform></nowiki> in the page, and you should see the paypal form (you may need to flush the page cache - add ?action=purge to the url).  (You may also need to change the name of the parser function, and thus the second argument to setHook()).  I know, it seems like rather a lot of ballyhoo, but it's the safe, standard way - and anything else would be more hacking.  If you try this and it doesn't work, pls let me know.
 +
:-- [[User:Baxrob|rob]] 21:01, 4 December 2006 (PST)

Latest revision as of 21:01, 4 December 2006

There's more to creating a Paypal link than https://www.paypal.com/cgi-bin/webscr -- There's a little form thingy that has to happen. RfS 14:04, 21 September 2006 (PDT)

Looking at the source of the main page at http://freegeek.org/ it seems that there's a form that sends the appropriate stuff needed. How is this accomplished in the mediawiki framework?

RfS 17:06, 21 September 2006 (PDT)

Yea, didn't know how to deal with that. Maybe I'll try using straight html(??) Shawn

The friendly, safe way is to make an extension (html tags are limited to a specific set, for security reasons, and adding <form> to that set would be unsafe.) Extensions are documented here. For this, you can just set $output = '{paypal form html}' in the render function. Then set the first argument to $wgParser->setHook() to be, for example, "fgpaypalform", include the extension in LocalSettings.php, put <fgpaypalform></fgpaypalform> in the page, and you should see the paypal form (you may need to flush the page cache - add ?action=purge to the url). (You may also need to change the name of the parser function, and thus the second argument to setHook()). I know, it seems like rather a lot of ballyhoo, but it's the safe, standard way - and anything else would be more hacking. If you try this and it doesn't work, pls let me know.
-- rob 21:01, 4 December 2006 (PST)