• Hi, thanks for this really helpful plugin.

    One question I have.

    I have an ad that I only want to display on certain pages via the “Show ad only in certain posts/pages” option. The problem is that this option lists all pages along with all posts and I have around 5000 posts so it´s really hard to find the pages within the list.

    I was unable to locate the code that grabs the list of post and pages.
    I was hoping to filter out the posts.

    Could you help direct me to it´s location or perhaps update the plugin to split this option in to two seperate lists.

    Best regards,
    Andri

    http://wordpress.org/extend/plugins/simple-ads-manager/

Viewing 1 replies (of 1 total)
  • Thread Starter andri86

    (@andri86)

    Hi, small update here.

    I was able to locate the code to filter out posts from the list of post/pages where to show the ad.

    Changed line 541 in admin.class.php
    From:
    FIND_IN_SET($postTable.post_type, 'post, page"$custs"')
    To:
    FIND_IN_SET($postTable.post_type, 'page')

    But this “Show ad only in certain posts/pages” option doesn’t seem to work. I’m getting að load of error messages from the SAM log.

    Type:
    Output Error

    Error Message:
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ”, wp_sam_ads.view_authors), TRUE) AND IF(wp_sam_ads.view_type < 2 AND wp_sa’ at line 18

    Error SQL:

    SELECT
                      wp_sam_places.id,
                      wp_sam_places.name,
                      wp_sam_places.description,
                      wp_sam_places.code_before,
                      wp_sam_places.code_after,
                      wp_sam_places.place_size,
                      wp_sam_places.place_custom_width,
                      wp_sam_places.place_custom_height,
                      wp_sam_places.patch_img,
                      wp_sam_places.patch_link,
                      wp_sam_places.patch_code,
                      wp_sam_places.patch_adserver,
                      wp_sam_places.patch_dfp,
                      wp_sam_places.patch_source,
                      wp_sam_places.trash,
                      (SELECT COUNT(*) FROM wp_sam_ads WHERE wp_sam_ads.pid = wp_sam_places.id AND wp_sam_ads.trash IS FALSE) AS ad_count,
                      (SELECT COUNT(*) FROM wp_sam_ads WHERE wp_sam_ads.pid = wp_sam_places.id AND wp_sam_ads.trash IS FALSE AND (IF(wp_sam_ads.ad_users = 0, TRUE, (wp_sam_ads.ad_users_unreg = 1))) AND ((wp_sam_ads.view_type = 1) OR (wp_sam_ads.view_type = 0 AND (wp_sam_ads.view_pages+0 & 2176))) AND (wp_sam_ads.ad_cats = 0)  AND IF(wp_sam_ads.view_type < 2 AND wp_sam_ads.ad_authors = 1 AND IF(wp_sam_ads.view_type = 0, wp_sam_ads.view_pages+0 & 2176, TRUE), FIND_IN_SET

    All help is appreciated, I really need this feature to work.

    Best regards,
    Andri

Viewing 1 replies (of 1 total)
  • The topic ‘Show ad only in certain pages’ is closed to new replies.