WordPress.org

Ready to get started?Download WordPress

Forums

Simple Ads Manager
Problem with showing Ads in particular categories (9 posts)

  1. BlogYourEarth
    Member
    Posted 2 years ago #

    Hello,

    i have a problem that the "simple ads manager" does not show the particular ads for the choosen category.
    It only shows the default ad (ads places) for the choosen ads zone "right_menu_zone_160x600".

    But I want to show for every category a special ad and organized this for eache category in the ads zone configuration site for the "right_menu_zone_160x600" ads zone I created.

    I inserted the ads zone in the right menu with the ads zone output php function:
    // Ads Zone output
    if(function_exists('drawAdsZone')) drawAdsZone(array('id' => 3), true);

    This are the technical details BlogYourEarth.com

    WordPress Version: 3.3.1
    SAM Version: 1.2.40
    SAM DB Version: 2.0
    PHP Version: 5.2.16
    MySQL Version: 5.1.49-3

    I hope somebody can help me...

    Thanks,

    BlogYourEarth

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

  2. minimus
    Member
    Plugin Author

    Posted 2 years ago #

    Do you create Ads Places for each category?

  3. BlogYourEarth
    Member
    Posted 2 years ago #

    Hi, yes I did.

    First I created four "default ad places" and two "ads places" for "video tape" posts.
    This video tape posts are in the category "8mm Magnetband digitalisieren".
    Ads Places

    Then I created four zones and inserted them in the theme. This works for the default ads places well.

    Then I did the configuration of the zone "Menu DE - 160 x 600" as shown in the next two pictures.

    The first part of the page
    Ads Zone Part 1

    and the second part of the page

    Ads Zone Part 2

    Thanks for your help minimus. I hope I answered all your questions.

    BlogYourEarth

  4. BlogYourEarth
    Member
    Posted 2 years ago #

    Hi,

    I solved the problem for me. I opened the ad.class.php and modified the php a littel bit ;-)

    The modification I did was in the buildZone function. Search for the if clause if(is_singular()) and then replace the code by the following one... (if you know what you do ;-) )

    if(is_singular()) {
    
              $id = $zone['z_singular'];
              if(is_single()) {
                $id = $zone['z_single'];
                if($this->isCustomPostType()) {
                  $id = $zone['z_ct'];
                  foreach($singleCT as $key => $value) {
                    if($key == get_post_type()) $id = $value;
                  }
                }
                	$catspost = unserialize($zone['z_cats']);
    		$categories = get_the_category($post->ID);
            	foreach($catspost as $key => $value)
            	{
              		if($value > 0)
              		{
              			foreach($categories as $category)
    				{
    					$cat_name = $category->slug;
    
    					if( $key == $cat_name)
    					{
    						$id = $value;
    					}
             			}
             		}
                   	}
    
              }
              if(is_page()) $id = $zone['z_page'];
              if(is_attachment()) $id = $zone['z_attachment'];
            }

    If you do not know what you do - maybe the sky will fall on your head...

    This link shows the ad I whant to be displayed by the category "8mm Magnetband digitalisieren"
    Video digitizing

    This link shows the default ad I whant to be displayed if no ad is set to a special category.
    Philips MyRemote – SmartTV

    I hope this helps ;-)

    BlogYourEarth

  5. geniebazaar
    Member
    Posted 2 years ago #

    I have the same issue with my freelance website. Unable to run simple ads plugin. Did you find anything?

  6. kevin heath
    Member
    Posted 2 years ago #

    Hi Blogyourearth,

    thanks for that bit of code. Got my category places now being passed down to the posts within thosse categories.

    cheers again

    kevin

  7. chipchick
    Member
    Posted 1 year ago #

    Thank you! thank you! I was going to crazy why category specific ads weren't showing up in the ad zone widget, and thanks to your code it now works!!!

  8. sooshyboy
    Member
    Posted 1 year ago #

    Hey,

    I am using simple Ads manager on a theme (Vantage) by Appthemes... I have a fairly good understanding of both but i have hit a big problem... I will try to explain without waffling!

    Simple Ads Manager only recognises the wordpress blog categories not the Theme categories (In this case my listings categories (Accountants, Ariels TV, Airconditioning...etc. etc.) so my scenario below wont work! It is frustrating because this was our main way to generate revenue and would prove to be more beneficial for the advertiser!

    My site: http:www.myscunthorpe.com/businessfinder

    Example. A user visits the site, goes to the categories tab on the menu bar and clicks the restaurant category (It is at this point that the user in "buying mode" for a restaurant so it is here where i want the advert to appear in the sidebar for our paid restaurant advertiser). The page is populated with a list of all the restaurants from our database on the left and on the right in the side bar is the advert...(PRETTY STRAIGHT FORWARD SO FAR) This will be the same scenario for florists, builders... and all the other categories etc etc!

    I did post this on the Appthemes Forum and received this reply from a chap their... Just wondering if anyone can help further...

    "About your problem, i understand what you're trying to do but Vantage uses custom taxonomies and not the blog categories so this is way your plugins does not work.
    You can either look for an alternative plugin or ask the author of the plugin if custom taxonomies are supported."

    Thank you in advance for any contribution...

    Paddy

  9. minimus
    Member
    Plugin Author

    Posted 1 year ago #

    @Paddy

    Sorry! I have not this theme to test anything on it. If you need my help send me e-mail to minimus AT simplelib.com

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic