• A lots of errors , on new advert post the post schedule is not setting up the date , also when edited it deletes the schedule and not adding it back (issue in the update event) :

    Fix for add / update new advert :

    if($type != 'empty') {
    $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->prefix}adrotate_schedule WHERE id IN (SELECT schedule FROM {$wpdb->prefix}adrotate_linkmeta WHERE schedule != %d AND schedule > 0 AND ad = %d AND group = 0 AND user = 0);", $schedule_id, $id)); 
    				
    $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->prefix}adrotate_linkmeta WHERE ad = %d ", $id));
    }
    
    $wpdb->insert($wpdb->prefix.'adrotate_schedule', array('name' => 'Schedule for ad '.$id, 'starttime' => $start_date, 'stoptime' => $end_date, 'maxclicks' => $maxclicks, 'maximpressions' => $maxshown));
    			
    $wpdb->insert($wpdb->prefix.'adrotate_linkmeta', array('ad' => $id, 'group' => 0, 'user' => 0, 'schedule' => $wpdb->insert_id));
    
    #remove your $wpdb->update has no use here 
    

    Also on the adrotate-output.php adrotate_group() you can add fix for one single group id to be processed :

    Fix bellow :

    
    if(!is_array($group_ids)&&preg_match('/,/is',$group_ids)){
    		$group_array = explode(",", $group_ids);
    		}
    		else {
    		if(is_array($group_ids)){
    		$group_array = $group_ids;
    		}
    		else {
    		$group_array = array($group_ids);
    		}
    }
    

    It took me 4 fucking hours to fix , i had to learn all your damn coding , plese dont do updates with such big bugs next time .

    • This topic was modified 5 years, 10 months ago by alinrzv.
Viewing 1 replies (of 1 total)
  • Plugin Author Arnan de Gans

    (@adegans)

    The schedule is added when you create the advert. Then when saving the advert you only need to update it. Nothing weird there and as far as I can tell it works fine. Nobody else reports issues with it either.

    The deleting of schedules is to delete other schedules than the one used – Sort of like a trash cleanup. Thus no schedules need to be added at that point.
    Also here, works fine as far as I can tell. No other complains or reports about it from other users.

    I’ll look into the group array thing, that looks odd indeed. Your fix does not fix much, but the preg_match idea is probably the way to go.

    Lastly, this page is for reviews, not to post support stuff or bug reports.
    Please post on the forum next time, or if you think it’s urgent enough, get in touch via email, Facebook messenger or Telegram. All links for that are readily available all over the plugin, my website and readme.

Viewing 1 replies (of 1 total)
  • The topic ‘You f**ed it so bad !!!’ is closed to new replies.