Plugin to Widget issue (2 posts)

  1. Blayde
    Posted 8 years ago #

    I'm trying to convert a plugin i acquired called Adicons Server, it's enabled and working but i want to widgetify it so i can place it in a proper position in my sidebar rather than at the bottom. The sidebar is dynamic so i can't just paste the php function where i like, it's either top of the sidebar or bottom, i want middle.

    To that end, i got something called custom widgets that takes the function of the plugin calls it in a widget, but my problem is i can't really determine what function to call and if i need any variables (i assume i don't since theyre just images to be clicked)

    I can't contact the original plugin owner since his site is non-existant.

    The code i pasted in my sidebar is:

    <?php AI_Interface::adIconShow(); ?>

    I've tried pasting the function as:

    nothing works.

    If needed i have the plugin files as well.

  2. Roger Theriault
    Posted 8 years ago #

    That's probably the one - not having seen the code.

    Try the statement:

    global $AI_Interface;

    before the method call. I assume there's a global declaration inside the plugin, but if not, add one there.

    (P.S. - Don't forget an if_function_exists(some_plugin_function) and/or if ($AI_Interface) call before, so you don't get errors when/if the plugin is deactivated.)

Topic Closed

This topic has been closed to new replies.

About this Topic