[supporter advertising] still bug with code display


Well, using supporter + advertising last version, on several farm pack themes I still have the display bug :


(test blog for testing buddypress groupblog.)

Before post ads are DEACTIVATED

Only have after post/before and after page.

As you can see the ad code displays directly AFTER the "test" text (post content).

WP 3.0.2 / BP 1.2.6 supporter and advertising last versions

  • Mason
    • DEV MAN’s Sidekick

    Hiya Aphrodite,

    Can you try changing line 9 of index.php from where it says the_excerpt('') to the_content('')

    and let us know how it goes? The advertising plugins look for the_content. When using the_excerpt all content will be displayed as a string without any of the styling, etc.

    Again, let us know. If it works, you'll need to make the same change to your archives.php


  • Aphrodite
    • The Reaper

    of course it works.

    But you understand that this is an issue. I cannot use the before post because of possible options in any theme that use the excerpt, and now the after post seems to return that also.

    Is there any way to introduce another filter to avoid those bug ? that mean any them using the excerpt returns this error.... This excerpt issue is a real and blocking issue !

    I made a search in all index.php files in all 133 pack themes. 71 themes use the excerpt !!!!!!!

  • dronix
    • Design Lord, Child of Thor

    Hey Aphrodite try the attached version, just added a quick hack.

    Mind you that I did not test it myself, but since it worked in my head I thought you could give it a try :smiley:

    Edit Sorry can't get this attachment thing to work, didn't read the instructions on my way here; can't upload zip files. Try adding the following to supporter-advertising.php after line 51

    add_filter( 'the_excerpt', 'supporter_advertising_output', 99999, 1 );

  • Aphrodite
    • The Reaper


    ok but explain me : in your head, what this filter will do ? (just to understand :slight_smile:

    Because the trouble comes each time any theme displays the excerpt. So the fileter should be "if the excerpt then no ads" or finding a way to place the ads with another filter OR finding why the excerpt displays the code and not the ads !

    If that requires to hack wp excerpt function lets go for it !

    The funny thing is that I subscribed here for THAT purpose : centralized ads. Now i use all others plugins and specially THIS one gets me in troubles ! loool


    Nope :slight_frown:

    Changed theme with artclite (another from 133 pack) and this is the result :


    if "excerpt" selected in options.

    Works perfectly if "content" is selected.

    Same problem with, for example, Technical Speech, another 133 theme....

    options selected : after post, before and after page.

    Sure it works perfectly on any theme inside the site. The homepage only is the problem.

    EDIT 2
    OK found the problem.

    The teaser (autoexcerpt) is FILTERED and will NOT display any HTML tags.
    Function.php must be hacked to allow html/scripts in teaser.

    No other way. So the only way for supporter to work on all theme is to add a little functions as mu unvisible plugin that ALOOW html in teaser..... There are some on the net but not aupdated....


  • Aphrodite
    • The Reaper

    well tests non positives.

    And in fact it would not fit anyway. Because for example in technical speech, as in business social, there are several posts showing exerpt, so the ads must not be insterted in post anyway.

    I thing the only way is to exclude ads on homepages with some king of !is_home condition to display a "page" ads and not a "post ads", or filter if the_excerpt is used and dont display ads.

    Anyway to do that ?

    found Ad inserter (http://wordpress.org/extend/plugins/ad-inserter ) that does exactly that and works. Ads are just not shown on home page, which seem the only acceptable compromise to have supporter working fine with ALL thems.

  • Aphrodite
    • The Reaper

    sorry to bump this one but 71 themes broken with supporter that is not an option...

    What to do to NOT display ads on homepage as in ad inserter ? ???? Since putting ads in excerpt is NOT an option, many thmes have column display with excerpt on homepage.

    Thanks :slight_smile:

  • Aphrodite
    • The Reaper


    Stil the same. The added filter "the excerpt" was already tested. But the code still appear, even in "after post" mode.

    The mentioned plugin works but no idea about how it filters or inserts....

    Need to add a is_home condition but no idea on how to perform that.

  • dronix
    • Design Lord, Child of Thor

    ...but there is news : now one of the ads seems to appear, must be the "after something"

    So the ads are now working after using the modified version Richie gave you, but not entirely as it doesn't work on the homepage?

  • Aaron
    • CTO

    Aphrodite, if you want to knock out your issue real quick just put:

    return $content;

    Inside the supporter_advertising_output() function right at the top. That will only display ads when viewing the full post or page.

    Note that this issue is a part of WP, and many many plugins suffer it. Most never notice because their posts are long enough not to suck in the html code into the excerpt.

  • Aphrodite
    • The Reaper

    Hi guys. I will insist on this one.

    This plugin is strategic, essential, fundamental, and so on. This is THE plugin needed on multisites and THE argument to make people subscibe to supporter accounts.

    In fact as I told it is the first reason why I am here. I would not like to hire someone else to rewrite it !

    Please have a look, as I told you the ad inserter plugin mentioned abbove works. Its hook and filter works fine. Why not yours ?

    The solution using !is single does not work on pages, and still have a bug with some theme as technical speech or any other themes using excerpts on single pages/post.

    Thanks :slight_smile:

  • Aaron
    • CTO

    Ok, exactly what is the behavior that you want to see? As I said this is a bug with WP that they refuse to fix, not the plugin. You are one of the rare people that see it though as you have to have really short posts for code to be sucked in.

    And yes you could add a
    if ( !is_single() && !is_page() )
    return $content;

  • Aphrodite
    • The Reaper

    I tried that aaron, unfortunatly it does not work fine on pages.

    Will test it with several themes. But just for understanding, look the test site now with technical speech codes are still here. Will remove tecnical speech from free themes anyway, but just for working purpose. The "featured post display option" returns code not ad image.

    I dont understand the problem. Not a bug surely, but as ad inserter seems to have found a way to solve that issue I thought it was possible.

    The behavior I want ? Nothing special but just display ads were they should !

    Can you elaborate on the fact that I seem to be a rare people who experiment that ? What could be the cause ? Server config ? Particular settings ?

    The most annoying thing is that it works absolutly fine with almost all my premium themes (elegant themes, using the excerpt on homepage !!!!!) but many "free themes" (133 pack) have the issue :slight_frown:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.