DyasonHat Forums » Ajax Category Dropdown

[closed]

Ajax Cat Dropdown php code on a page

(10 posts)
  1. Anonymous

    Hello Dyasonhat
    Firstly you must know that this your Ajax Category Dropdown is absolutely fabulous. I really like the way it reflects the categories chosen from the menu\'s or other parts of the site.

    This should be a simple question... the php code (eg <?php if (classexists(\'dhatajaxcatdropdown\')) { $dacd = new dhatajaxcatdropdown(); if (methodexists($dadc,\'placewidgetdacd\')) { $wdadc->placewidgetdacd(); } } ?> ) is not working on my homepage http://www.travelhorizonstyle.com.au. It causes the following error:

    Fatal error: Call to undefined function classexists() in /home/tra47941/public_html/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()\'d code on line 53

    I have EXE-php plugin installed and the simple <?php echo \'hello\'; ?> works fine, but I\'ve had to remove your php code as all my sidebars did not display after the error.

    Looking forward to your comments.
    Regards, Joan

    Posted 10 months ago #
  2. Anonymous

    Sorry but can you delete the duplicate forum post for me>

    Posted 10 months ago #
  3. DyasonHat
    Key Master

    Hi Joan,

    Simple fix, it should be class_exists and not classexists, same with method_exists.

    Cheers!

    Posted 10 months ago #
  4. Anonymous

    Hi, this plugin sounds perfect for me but I\'m not seeing the download link?

    Posted 10 months ago #
  5. DyasonHat
    Key Master

    Hi,

    The plugin is available from the wordpress.org repository at:

    http://wordpress.org/extend/plugins/ajax-category-dropdown/

    Cheers!
    DyasonHat

    Posted 10 months ago #
  6. Anonymous

    thanks a million DyasonHat, but it\'s still not working. The following code just gives me \"nothing\":

    <p><?php if (class_exists(\'dhatajaxcatdropdown\')) { echo \'class\'; $dacd = new dhatajaxcatdropdown(); if (method_exists($dadc,\'placewidgetdacd\')) { echo \'method\'; $wdadc->placewidgetdacd(); } echo \'no\';} echo \'nothing\'; ?></p>

    Regards,
    Joan

    Posted 10 months ago #
  7. Anonymous

    Note that instead of \\\' it should just be a single apostrophe. J.

    Posted 10 months ago #
  8. Anonymous

    Do I perhaps need to put the whole path in somewhere? J.

    Posted 10 months ago #
  9. DyasonHat
    Key Master

    Hi Joan,

    Sorry I didn\'t look it over all that carefully,

    there are a couple more error in the code:

    dhatajaxcatdropdown --------> dhat_ajax_cat_dropdown
    $wdadc->placewidgetdacd(); -------> $dadc->widget_dacd($args)

    The $args variable needs to be set with some advanced php coding. Basically it needs to be an array with key values of (title, text, emptyshow, countshow, countwhat, sortby, direction).

    My suggestion is that this method is not going to work just for now (I didn\'t realize that I\'d made such significant code changes), but there is an update of the plugin coming that will make it allot easier in about 2 weeks.

    Cheers!

    Posted 10 months ago #
  10. Anonymous

    Thanks DyasonHat - we\'re nearly there. The above code returns \"class no nothing\" so we don\'t seem to have a method called $dadc...

    <?php if (class_exists(\'dhat_ajax_cat_dropdown\')) { echo \'class\'; $dacd = new dhat_ajax_cat_dropdown(); if (method_exists($dadc,\'place_widget_dacd\')) { echo \'method\'; $dadc->widget_dacd($args); } echo \'no\';} echo \'nothing\'; ?>
    Regards, Joan

    Posted 9 months ago #
  11. Anonymous

    Sorry just re-read your message & the method will not work for a couple of weeks, so we\'ll talk then. Thanks again & keep up the good work. Joan

    Posted 9 months ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.