Could someone write-up a short tutorial on creating a plugin for Xanthia?
I am looking for something that I can pass it variables from the theme and have it return an image with a link built from the variables, sort of like the topic icon but a different image.
--
Zikula Themes
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- internetking created topic »password problem« 25. May
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
- mdee created topic »How to implement returnpage ?« 25. May
- nestormateo responded to »Fillters in Clip« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Plugins help
-
- Rank: Expert
- Registered: Mar 15, 2003
- Last visit: Oct 21, 2009
- Posts: 1221
-
- Rank: Expert
- Registered: Nov 23, 2003
- Last visit: Dec 13, 2009
- Posts: 1487
Have a look at the 'Example' modules plugin for adminlinks, it should give you a very good idea of how to do what you need to do... should be very simple.
--
Under Construction! -
- Rank: Expert
- Registered: Mar 15, 2003
- Last visit: Oct 21, 2009
- Posts: 1221
-
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
Mike,
Also take a look at the smarty documentation on plugins. The only two plugin types you'll likely write are template functions and modifiers.
-Mark
--
Visit My homepage and Zikula themes. -
- Rank: Expert
- Registered: Mar 15, 2003
- Last visit: Oct 21, 2009
- Posts: 1221
Ok thanks to both so far, now I have one more question..
How would I get the sites fully qualified URL from within a plugin?
IE http://www.postnuke.com
--
Zikula Themes -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
Mike,
Use the API pnGetBaseURL. For use in templates there is the equivalent template tag .
Code
<!--[pngetbaseurl]-->
-Mark
--
Visit My homepage and Zikula themes. -
- Rank: Expert
- Registered: Mar 15, 2003
- Last visit: Oct 21, 2009
- Posts: 1221
Thanks Mark!
Working out nicely, I am creating a Digg This Article Plugin for news articles.
If I get it working cleanly then I am also going to do it for SlashDot too.
:)
--
Zikula Themes -
- Rank: Expert
- Registered: Mar 15, 2003
- Last visit: Oct 21, 2009
- Posts: 1221
Ok next newbie question.
I have to urlencode all of the inputs, I have gotten all of them to encode EXCEPT the URL I have to pass, the relevant code is below
Code
$baseid = pnGetBaseURL();
$baseid .= "index.php?name=News&file=article&sid=";
$baseid .= $articleid;
$baseid = rawurlencode($baseid);
--
Zikula Themes -
**unknown user**
- Rank: Softmore
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 418
Would this help:
Code
$baseid = pnGetBaseURL() . "index.php?name=News&file=article&sid=" . $info[sid];
Then, I;m not using Short-URLs, so i wouldn't know what happens what the output will be when using short-urls. -
- Rank: Expert
- Registered: Mar 15, 2003
- Last visit: Oct 21, 2009
- Posts: 1221
I'm not having a problem with the variables for the plugin, the OUTPUT of the plugin needs to be urlencoded so the entire URL can be passed in the URL for the submit.
--
Zikula Themes -
**unknown user**
- Rank: Softmore
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 418
Oh, I thought you were having trouble building the URL..
On this plugin thing for Digg This for WordPress: http://www.seoegghead.com/blog/seo/how-to-get-dugg-digg-for-wordpress-plugin-p113.html
They're using urlencode and not rawurlencode.
I could be wrong though, just trying to help ;) -
- Rank: Expert
- Registered: Mar 15, 2003
- Last visit: Oct 21, 2009
- Posts: 1221
I tried urlencode as well, it is just this part that isn't encoding..
And it is driving me insane... lol
--
Zikula Themes -
- Rank: Expert
- Registered: Nov 23, 2003
- Last visit: Dec 13, 2009
- Posts: 1487
Maybe you should be using XHTML symbols rather than ?(?) and &(&)?
--
Under Construction! -
**unknown user**
- Rank: Softmore
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 111
- Moderated by:
- Support
