Need Wordpress Plugin Help (wp-o-matic cron problem)

Discussion in 'PHP' started by webbiz100, Apr 5, 2008.

  1. #1
    Hi,
    I need to get the plugin wp-o-matic fixed to work with unix cron job, plugin is set to perform this function but cannot get it to work.

    PM me your rates/details.

    Cheers!
    Andrew
     
    webbiz100, Apr 5, 2008 IP
  2. fajitamaster

    fajitamaster Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I had this problem installing the wp-o-matic script.

    I am a programmer, so I figured I would investigate this problem a bit.

    Apparently somewhere, still to be determined, there is a query that throws the crontab off center. This has to do with time, and is the most common place for errors in programming.

    I made a quick fix and has worked since I initiated it. Simply add this script to the file " cron.php ", which is located in your folder "/wp-content/plugins/wp-o-matic" right below the line


    
    require_once(dirname(__FILE__) . '/../../../wp-config.php');
    
    PHP:
    Add this function below this line:

    
    	function set_crontab_zero_rss_wpomatic() {
    	//connect to db
    	$dbname=DB_NAME;
    	$dbhost=DB_HOST;
    	$dbuser=DB_USER;
    	$dbpass=DB_PASSWORD;
    	$dbh=mysql_connect ($dbhost,$dbuser,$dbpass) or die ('I cannot connect to the database because: ' . mysql_error(). '');
    	mysql_select_db ("$dbname") or die('I cannot select the database because: ' . mysql_error());
    
    	$query = "UPDATE wp_wpo_campaign SET lastactive='0000-00-00 00:00:00'";
    	$result = mysql_query($query);
    	}
    	set_crontab_zero_rss_wpomatic();
    
    
    PHP:
    All it does is it sets the "timer" back to zero, allowing you to still see how many posts are in each topic without having to do a reset.

    Hope this helps those out there that were in the same boat as I was.
     
    fajitamaster, Oct 9, 2008 IP