Forums

WP125 Help Request (7 posts)

  1. rickcecil
    Member
    Posted 2 years ago #

    I'm using the ad to manage 2 ad slots on my site. Typically, an ad will run for 7 days and the next ad will be displayed. I'd like to be able to do the following:

    1) (feature request) Schedule the ads in advance. When I create the ad, select a date when it will be active and have it be inactive until the active date is reached. If 2 ads are scheduled for the same slot at the same time, have the new ads over-ride the old ads. (Or, maybe offer this as an option.)

    2) (support question) Have the ads be inactive by default. Is there a way I can do this now in the code?

    Thanks for the help!
    Rick
    http://www.ruzuku.com/anotherstepforward/

  2. redwallhp
    Member
    Posted 2 years ago #

    #2 kind of goes along with #1. Short of editing the source code, you can't really do it as of yet. Scheduled ads is something that I do intend on adding, when I get around to it. I've been focusing a lot of my attention on my Tweetable plugin at the moment though, as it's being entered in this year's WLTC Plugin Competition. I do intend on adding the functionality though.

  3. rickcecil
    Member
    Posted 2 years ago #

    I'm comfortable mucking with the code, though, I'm not too good at writing, it I can hack at it. Any pointers on what I should look for in the code to change it from active to inactive by default? Thanks!

  4. redwallhp
    Member
    Posted 2 years ago #

    In the function that adds a new ad, just look for the SQL statement. There should be a 1 set for the active field. Change it to a 0 and it should make the ads be inactive by default.

  5. rickcecil
    Member
    Posted 2 years ago #

    I found a Status being set, which looks like it's defining the active/inactive. But, I can't determine where it's being set when an ad is first created.

    The only time it's set, that I can tell, is when an ad expires.

    Thanks for taking the time to respond. Any other pointers?

    Thanks!

  6. redwallhp
    Member
    Posted 2 years ago #

    In adminmenus.php, around lines 130-132 or so:

    if ($post_editedad=='') {
    $updatedb = "INSERT INTO $adtable_name (slot, name, start_date, end_date, clicks, status, target, image_url) VALUES ('$post_adslot', '$post_adname', '$today','$theenddate','$post_countclicks', '1', '$post_adtarget','$post_adimage')";
    $results = $wpdb->query($updatedb);

    Just change the '1' to '0' and you should be all set.

  7. rickcecil
    Member
    Posted 2 years ago #

    Thank you! Appreciate the help. Good luck with your tweetable plugin!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags