" ;
}
$pj_post->post_content = $contt;
$pj_postat = get_option('pj-poststatus','publish');
$pj_post->post_status = $pj_postat;
$pj_costa = get_option ('pj-commentstatus','open');
$pj_post->comment_status = $pj_costa;
$pj_post->ping_status = "open";
$atag = inbetween($parseme,'pj_tags','pj_endtags');
$atag.= get_option('pj-etags','');
$pj_post->tags_input = $atag;
if (pj_exist($pj_post->post_title)) // if duplicate post echo txt else post post
{ if ($output != "off") echo " LETS SKIP THIS ONE, I FOUND ANOTHER POST WITH THE EXACT SAME TITLE. Wordpress cannot handle posts with same titles in certain configurations. ";}
elseif (empty($mytitle))
{ if ($output != "off") echo " LETS SKIP THIS ONE, title was empty, or end of feed reached. ";}
else
{ // PUSH IT INTO THE DATABASE
$ow_insert_id = wp_insert_post($pj_post);
add_post_meta($ow_insert_id, "_portaljumper_fed", "1");
$pjnet = get_option('pj-network');
// include network and feed in the post_meta for later deletion/sorting
add_post_meta($ow_insert_id, "portaljumper_network", $pjnet);
add_post_meta($ow_insert_id, "portaljumper_datafeed", get_option('pj-selected-feed'));
$pj_category= $atag;
if (get_option('pj-standcats') != "on")
$pj_category.= inbetween($parseme,'pj_categories','pj_endcategories');
$pj_category.= get_option('pj-ecats','');
$pj_category = str_replace(">", ",", $pj_category);
$pj_category = str_replace(" ", "_", $pj_category);
$pj_category = preg_replace("/[^a-zA-Z0-9,._-]/", "", $pj_category);
{if ($output != "off") echo " categories found: $pj_category";}
$cattoadd = explode (",",$pj_category);
$cattoaddtemp2 = array("");
foreach($cattoadd as $i => $v)
{
$v=trim($v);$v = str_replace("'", "", $v);
if(empty($v))
{
unset($cattoadd[$i]);
}
$v = substr($v,0,20);
if(!is_numeric($v))
{
pj_create_category($v);
$cattoaddtemp1 = array($v);
$cattoaddtemp2 = array_merge((array)$cattoaddtemp1,(array)$cattoaddtemp2);
}
}
$ok = wp_set_object_terms($ow_insert_id, $cattoaddtemp2, 'category');
unset($pj_post); $pj_post = 0; // reset post array
}
// move timer ahead based on posts per day /
$post_per_day = get_option('pj-ppd');
if ($post_per_day > 0) $gap = 86400 / $post_per_day ;
$timerstart = time() + $gap; update_option('pj_timer',$timerstart);
}
// check end of feed & if there is another feed waiting ! If so, go to next feed first.
$A = (int) get_option('postcounter','0');
$B = (int) get_option('pj_totalfeedlines','9999999');
if ( $A >= $B )
{
$selected_feeds = maybe_unserialize(get_option('pj-feed')); // get serialized feeds
if ($output != "off") ECHO "
END OF FEED REACHED - ATTEMPTING A FEED SWITCH
";
$totalfeed_num = count($selected_feeds); // count them
if ($output != "off") echo "feeds chosen:"; foreach ($selected_feeds as $feed) { if ($output != "off") echo "$feed - ";}
if ($output != "off") echo " total feed count = $totalfeed_num";
$fnum = get_option('pj-selected-feed-counter'); // get current feed number
$fnum = $fnum + 1;
if ($output != "off") echo " attempting switch ";
if ($fnum < $totalfeed_num)
{
update_option('pj-selected-feed-counter',$fnum);
update_option('pj-selected-feed',$selected_feeds[$fnum]);update_option('postcounter','0');
// fetch new post count on new feed
$url = "http://linksalt.com/fmchome/request_postcount.php?network=".get_option('pj-network')."&feed=".get_option('pj-selected-feed');
$exg = curl_init();
curl_setopt($exg,CURLOPT_URL,$url);
curl_setopt($exg,CURLOPT_FRESH_CONNECT,TRUE);
curl_setopt($exg,CURLOPT_RETURNTRANSFER,1);
curl_setopt($exg,CURLOPT_CONNECTTIMEOUT,5);
$post_num = curl_exec($exg);
curl_close($exg);
$post_num = (int)$post_num;
update_option('pj_totalfeedlines',$post_num);
if ($output != "off") echo "Found new feed > Switching to ".get_option('pj-selected-feed')." with $post_num articles.";
}
else
{
$alldone = 1;
}
}
if ( (($A >= $B) && (get_option('pj-mail') == "notsent")) && $alldone)
{
if ($output != "off") echo " I AM ALL DONE - attempting to send notification mail. ";
update_option('pj-mail','sent'); $alldone = 0;
$whopr = get_bloginfo('url');
$recipient = get_option('admin_email');
$message = "
Feed monster reminder
We would like to notify you that feed monster is done loading $feed.
Your site $whopr is now awaiting your response.
The feed that finished processing was:".get_option('pj-selected-feed')."
If you do not intend to use feed-monster to process other feeds you may
want to temporarily turn it off.
An empty feed-monster job will slow your system down a little bit.
Are you a PREMIUM member yet, or are you still underperforming ? Go premium now and start earning some real money, or
remain part of the crowd and be common. You have the choice to change ....
Premium benefits include:
- no links back to the developers
- no link sharing with other people
- access to more power tools
- 31 times more server capacity than freebie mode
- no advertisements in your posts
- product shop builders
- multiple feed selection
- SEO features so all your posts are unique
Don't forget: linksalt.com is the best free complementation to your money-making websites.
";
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= "To: feed-monster user <$recipient>" . "\r\n";
$headers .= 'From: your monster ' . "\r\n";
mail($recipient, 'feed monster is done', $message, $headers);
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////
function _iscurlsupported(){
if (in_array ('curl', get_loaded_extensions())) {
return true;
}
else{
return false;
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
///////// DO NOT PROVIDE ANY OUTPUT ///////////////////////////////////////////////////////////////////
function ticktocksurpressed()
{ ticktock('off');}
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////// shortcodes //////////////////////////////////////////////////////
function pj_shortcode($pjatts)
{
ob_start();
$feed = $pjatts['feed'];
$net = $pjatts['net'];
$count = $pjatts['count'];
$ident = $pjatts['ident'];
$search = $pjatts['search'];
$layout = $pjatts['layout'];
$url = "http://linksalt.com/fmchome/pagemaker.php?count=$count&ident=$ident&net=$net&feed=$feed&s=$search&layout=$layout";
//ECHO "URL IS $url";
$fg = curl_init();
curl_setopt($fg,CURLOPT_URL,$url);
curl_setopt($fg,CURLOPT_FRESH_CONNECT,TRUE);
curl_setopt($fg,CURLOPT_RETURNTRANSFER,1);
curl_setopt($fg,CURLOPT_CONNECTTIMEOUT,5);
$page = curl_exec($fg);
curl_close($fg);
echo $page;
echo "
Constructed with the feed-monster wordpress affiliate tools
";
$list = ob_get_clean();
return $list;
}
///////////////////////////////// add scroll cats widget ////////////////////////////////////////////////////////
if(class_exists('l66_widget_4') != true)
{
class l66_widget_4 extends WP_Widget
{
function l66_widget_4()
{
$widget_ops = array('classname' => 'l66_widget_4', 'description' => 'Instead of a long list of categories, put them inside a scrolling box and save screen-space. Your visitors will thank you too.' );
$this->WP_Widget('l66_widget_4', 'feed-monster category scrollbox', $widget_ops);
}
function form($occurence)
{
$occurence = wp_parse_args( (array) $occurence, array( 'title' => '' ) );
$key = $occurence['title'];
$fromtop = (int)$occurence['high'];
?>
This widget originally ships with feed-monster. More info can be found at our forum.