Fork me on GitHub

Plugins help  Bottom

  • 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
  • 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!
  • Will do, thanks!


    --
    Zikula Themes
  • 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.
  • 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
  • Mike,

    Use the API pnGetBaseURL. For use in templates there is the equivalent template tag .

    Code

    <!--[pngetbaseurl]-->


    -Mark

    --
    Visit My homepage and Zikula themes.
  • 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
  • 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
  • Would this help:

    Code

    $baseid = pnGetBaseURL() . "index.php?name=News&amp;file=article&amp;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.
  • 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
  • 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 ;)
  • I tried urlencode as well, it is just this part that isn't encoding..
    And it is driving me insane... lol


    --
    Zikula Themes
  • Maybe you should be using XHTML symbols rather than ?(?) and &(&)?

    --
    Under Construction!
  • I posted a possible solution for a digg-it button here



    edited by: come, Nov 19, 2006 - 04:31 PM

This list is based on users active over the last 60 minutes.