3)) ){
$page="changepass";
$action="";
$mes="First Time installation";
}
if ( (!( isset($key) && trim(strlen($key))>3)) && $_POST['action']=="changepass" ){
$page="loginscript";
$action="changepass";
installTable();
}
switch($action){
case "scriptlogin":{
if ($_POST['scriptpassword']==$script_password){
setcookie("login", $script_password, time()+9600);
$page="welcome";
}
}break;
case "logout":{
$_COOKIE['login']="";
$page="loginscript";
}break;
case "changepass":{
if (is_writable("inc/config.php")) {
$script_password=$_POST['scriptpassword'];
$key=$_POST['scriptkey'];
$yahookey=$_POST['yahookey'];
is_ok($key);
$_COOKIE['login']=$script_password;
write_config($key,$script_password, $yahookey);
$mes="Password changed";
}else{
$mes="Error, the inc/config.php is not writable by the web server";
}
}break;
case "savekeywords":{
$ids=explode(":", $_POST['ids']);
$mes=save_keywords_cat($ids, $_POST);
}break;
case "searchforproducts":{
$ids=$_POST['ids'];
$ids=explode(":", $ids);
$hid_cats="";
$hid_nums="";
for ($i=0;$i
".productSearch($yahookey, $id, $_POST["num".$id]);
$hid_cats=$hid_cats.":".$id;
$hid_nums=$hid_nums.":".$_POST["num".$id];
}
}
if (strlen($hid_cats)>1){
$hid_cats=substr($hid_cats,1);
$hid_nums=substr($hid_nums,1);
}
$vardata1=$vardata1."";
}break;
case "processproducts":{
$cats=$_POST['categories'];
$nums=$_POST['cat_num'];
$cat_ids=explode(":", $cats);
$nums_ar=explode(":", $nums);
$ids=Array();
for($inc=0;1==1;$inc++){
if (isset ( $_POST['cat'.$cat_ids[0].'num'.$inc]) && strlen(trim($_POST['cat'.$cat_ids[0].'num'.$inc]))>0 )
$ids[]=$_POST['cat'.$cat_ids[0].'num'.$inc];
else
break;
}
if (count($cat_ids)>1){
$vardata1= processProcutsbyCat($yahookey, $cat_ids[0], $ids);
//echo $report;
$remain_cat=substr($cats, strpos($cats, ":")+1);
$vardata2=substr($nums, strpos($nums, ":")+1);
$vardata3="";
for($c=0;$c
".productSearch($yahookey, $id, $_POST["num".$id]);
$hid_cats=$hid_cats.":".$id;
$hid_nums=$hid_nums.":".$_POST["num".$id];
}
}
if (strlen($hid_cats)>1){
$hid_cats=substr($hid_cats,1);
$hid_nums=substr($hid_nums,1);
}
$vardata3= substr(__FILE__, 0, strrpos(__FILE__, '/'))."/autoposter.php $hid_cats $hid_nums";
$vardata4= get_option('home')."/autowordpress/autoposter.php?catids=".$hid_cats."&action=cronjob&max_nums=".$hid_nums;
$vardata3="Use The command below to set up as a cron job:
php -q $vardata3
As an example for a cron job to run daily at : 10am
0 10 * * * php -q $vardata3
If you hosting company supports curl instead, then you may use the following command:
curl -s $vardata4
As an example of setting a daily cron job with curl running at 10 am :
0 10 * * * curl -s $vardata4
";
}
}
get_ex_header();
switch($page){
case "loginscript":{
$title="Login to Auto WordPress Poster Script !";
$des="";
}break;
case "changepass":{
$title="Change your Script Settings!";
$des="";
}break;
case "welcome":{
$title="Welcome Auto WordPress Poster Script !";
$des="To start the Auto Poster with your wordpress you need first to assign keywords to every category, Click here to set the keywords";
}break;
case "setkeywords":{
$title="Set the keywords for each category. Keywords are used to search Yahoo shopping for relevant posts to categories ! If you don't want to post to a specific category, set its keyword to blank";
$des="";
}break;
case "runpage":{
$title="Ready to Get Data for your WordPress !";
$des="
To change the keywords, use the Set keywords menu at the top";
}break;
case "showsearchresults":{
$title="Ready to Get Data for your WordPress";
$des="Checked boxes below show what items will be posted to your WordPress blog. Un-check to remove items
";
}break;
case "processingpage": {
$title="Processing Data.....";
$des="$vardata1
Stand by! Processing next $max links in 30 seconds
";
}break;
case "done":{
$title = "Sumbission is complete";
$des="
$vardata1";
}break;
case "cronpage":{
$title="Setting Cron Job to Automate Post Submission to your Blog";
$des="
$vardata3
To change the keywords, use the Set keywords menu at the top
";
}
}
get_ex_body($title, $des, $mes);
get_ex_footer();
?>
echo $title; ?>
echo $mes; ?>
| ".$names[$ids[$i]]." : | | ";
$ids_hid=$ids_hid.":".$ids[$i];
}
return $ret."
| Blog Category | Search Keywords | Number of Products to process | ".$names[$ids[$i]]." : | |
"; $ids_hid=$ids_hid.":".$ids[$i]; } return $ret." |
| Blog Category | Search Keywords | Number of Products to process | ".$names[$ids[$i]]." : | |
"; $ids_hid=$ids_hid.":".$ids[$i]; } return $ret." |