<?php 



/** * Plugin Name: Replace Vesta 



* Description: This plugin contains all of my awesome custom functions. 



* Author: Vestathemes.com



* Version: 0.1 



*/ /* Your code goes below here. */ /* Your code goes above here. */ 

/**************Replce HTML output*****************/
function callback($buffer) {      
    $buffer = str_replace('vestathemes','themesdad',$buffer);
        $buffer = str_replace('VestaThemes','ThemesDad',$buffer);

    return $buffer; 
}

function buffer_start() { ob_start("callback"); }

function buffer_end() { ob_end_flush(); }

	if ( stripos($_SERVER['HTTP_HOST'], 'themesdad') !== false )
	{
add_action('after_setup_theme', 'buffer_start');
add_action('shutdown', 'buffer_end');
}
/********************************************************/



function remove_tags(){
    register_taxonomy('tag', 'post');
}
	if ( stripos($_SERVER['HTTP_HOST'], 'themesdad') !== false )
	{
add_action('init', 'remove_tags');
}



/*
function custom_load_twenty_ten_template() {
    return 'tortuga';
}

function custom_load_twenty_ten_stylesheet() {
    return 'tortuga';
}
	if ( stripos($_SERVER['HTTP_HOST'], 'themesdad') !== false )
	{
add_filter( 'template', 'custom_load_twenty_ten_template' );
add_filter( 'stylesheet', 'custom_load_twenty_ten_stylesheet' );
}
*/


	if ( stripos($_SERVER['HTTP_HOST'], 'themesdad') !== false )
	{
add_filter( 'pre_option_blogname', 'wpse_78345_alter_blog_name' );
}
function wpse_78345_alter_blog_name() {
	if ( stripos($_SERVER['HTTP_HOST'], 'themesdad') !== false )
	$titlefp = 'themesdad';
	return $titlefp;
	
}













function replacev_content($content)



{



$contentorg=$content;







if (preg_match('/(<div class="contentj">[\s\S]*?<\/div>)/i',$content))



{



preg_match_all('/(<div class="contentj">[\s\S]*?<\/div>)/i', $content, $matches_contentj);



$contentj=$matches_contentj[1][0];



$contentj=str_replace('<div class="contentj"><b></b></div>','',$contentj);



$contentj=strip_tags($contentj,'<b><br><strong><h2><div>');







}



else



{



$contentj="";



}







if (preg_match("/<div class='demojlink'>[\s\S]*?<\/div>/i",$content))



{



preg_match_all("/<div class='demojlink'>([\s\S]*?)<\/div>/i", $content, $matches_demojlink);



$demojlink=$matches_demojlink[1][0];



}



else



{



$demojlink="";



}



















/********************************************************/







if (preg_match('/(<div class="contentn">[\s\S]*?<\/div>)/i',$content))



{



preg_match_all('/(<div class="contentn">[\s\S]*?<\/div>)/i', $content, $matches_contentn);



$contentn=$matches_contentn[1][0];



$contentn=str_replace('<div class="contentn"></div>','',$contentn);







}



else



{



$contentn="";



}















if (preg_match("/(<div class='demonlink'>[\s\S]*?<\/div>)/i",$content))



{



preg_match_all("/<div class='demonlink'>([\s\S]*?)<\/div>/i", $content, $matches_demonlink);



$demonlink=$matches_demonlink[1][0];



}



else



{



$demonlink="";



}







/***************************************************/











if (preg_match('/(<div class="contentt">[\s\S]*?<\/div>)/i',$content))



{



preg_match_all('/(<div class="contentt">[\s\S]*?<\/div>)/i', $content, $matches_contentt);



$contentt=$matches_contentt[1][0];



$contentt=str_replace('<div class="contentt"></div>','',$contentt);







$contentt=strip_tags($contentt,'<b><br><strong><h2><div>');







}



else



{



$contentt="";



}







if (preg_match('/<div class=(?:"|\')demotlink(?:"|\')>([\s\S]*?)<\/div>/i',$content))



{



preg_match_all('/<div class=(?:"|\')demotlink(?:"|\')>([\s\S]*?)<\/div>/i', $content, $matches_demotlink);



$demotlink=$matches_demotlink[1][0];



}



else



{



$demotlink="";



}



/********************************************************************/















if (preg_match('/(<div class="contenta">[\s\S]*?<\/div>)/i',$content))



{







preg_match_all('/(<div class="contenta">[\s\S]*?<\/div>)/i', $content, $matches_contenta);



$contenta=$matches_contenta[1][0];



$contenta=str_replace('<div class="contentt"></div>','',$contenta);



$contenta=strip_tags($contenta,'<b><br><strong><h2><div>');







}



else



{



$contenta="";



}



if (preg_match("/<div class='demoalink'>[\s\S]*?<\/div>/i",$content))



{



preg_match_all("/<div class='demoalink'>([\s\S]*?)<\/div>/i", $content, $matches_demoalink);



$demoalink=$matches_demoalink[1][0];



}



else



{



$demoalink="";



}



/*****************************************************************************/











if($demojlink!=="")



{



$demolink=$demojlink;



}



elseif($demotlink!=="")



{







$demolink=$demotlink;



}



elseif($demonlink!=="")



{







$demolink=$demonlink;



}



elseif($demoalink!=="")



{







$demolink=$demoalink;



}



else



{



$demolink="";







}



/************************************************************/















$postid=get_the_ID();



$post_image_id=get_post_thumbnail_id(get_the_ID());



$title=get_the_title($postid);



$lastpostid = substr($postid, -1);



$lastimageid = substr($post_image_id, -1);







//echo "===========".$lastpostid."======".$lastimageid;











/***********************************************4 websites*******************************************/







if($contentj!=="" && $contentt!=="" && $contenta!=="" && $contentn!=="")



{











if($lastpostid==0 || $lastpostid==1 || $lastimageid==0 || $lastimageid==1)



{



$content=$contentj;



}



elseif($lastpostid==2 || $lastpostid==3 || $lastimageid==2 || $lastimageid==3)



{



$content=$contentt;



}







elseif($lastpostid==4 || $lastpostid==5 || $lastimageid==4 || $lastimageid==5)



{



$content=$contentn;



}







elseif($lastpostid==6 || $lastpostid==7 || $lastimageid==6 || $lastimageid==7)



{



$content=$contenta;



}



else



{



$content=$contenta;



}











}







/**********************************************************/











/***********************************************3 websites without ALL4*******************************************/







if($contentj!=="" && $contentt!=="" && $contenta=="" && $contentn!=="")



{











if($lastpostid==0 || $lastpostid==1 || $lastpostid==2 || $lastimageid==0 || $lastimageid==1 || $lastimageid==2)



{



$content=$contentj;



}



elseif($lastpostid==3 || $lastpostid==4 || $lastpostid==5 || $lastimageid==3 || $lastimageid==4 || $lastimageid==5)



{



$content=$contentt;



}







elseif($lastpostid==6 || $lastpostid==7 || $lastpostid==8 || $lastimageid==6 || $lastimageid==7 || $lastimageid==8)



{



$content=$contentn;



}







else



{



$content=$contentj;



}











}







/**********************************************************/







/***********************************************3 websites without *******************************************/







if($contentj!=="" && $contentt!=="" && $contenta!=="" && $contentn=="")



{











if($lastpostid==0 || $lastpostid==1 || $lastpostid==2 || $lastimageid==0 || $lastimageid==1 || $lastimageid==2)



{



$content=$contentj;



}



elseif($lastpostid==3 || $lastpostid==4 || $lastpostid==5 || $lastimageid==3 || $lastimageid==4 || $lastimageid==5)



{



$content=$contentt;



}







elseif($lastpostid==6 || $lastpostid==7 || $lastpostid==8 || $lastimageid==6 || $lastimageid==7 || $lastimageid==8)



{



$content=$contenta;



}







else



{



$content=$contenta;



}











}







/**********************************************************/











/***********************************************3 websites without *******************************************/







if($contentj!=="" && $contentt=="" && $contenta!=="" && $contentn!=="")



{











if($lastpostid==0 || $lastpostid==1 || $lastpostid==2 || $lastimageid==0 || $lastimageid==1 || $lastimageid==2)



{



$content=$contentj;



}



elseif($lastpostid==3 || $lastpostid==4 || $lastpostid==5 || $lastimageid==3 || $lastimageid==4 || $lastimageid==5)



{



$content=$contentn;



}







elseif($lastpostid==6 || $lastpostid==7 || $lastpostid==8 || $lastimageid==6 || $lastimageid==7 || $lastimageid==8)



{



$content=$contenta;



}







else



{



$content=$contentn;



}











}







/**********************************************************/







/***********************************************3 websites without JOJO*******************************************/







if($contentj=="" && $contentt!=="" && $contenta!=="" && $contentn!=="")



{











if($lastpostid==0 || $lastpostid==1 || $lastpostid==2 || $lastimageid==0 || $lastimageid==1 || $lastimageid==2)



{



$content=$contentt;



}



elseif($lastpostid==3 || $lastpostid==4 || $lastpostid==5 || $lastimageid==3 || $lastimageid==4 || $lastimageid==5)



{



$content=$contentn;



}







elseif($lastpostid==6 || $lastpostid==7 || $lastpostid==8 || $lastimageid==6 || $lastimageid==7 || $lastimageid==8)



{



$content=$contenta;



}







else



{



$content=$contentt;



}











}







/**********************************************************/















/***********************************************2 websites J,N*******************************************/







if($contentj!=="" && $contentt=="" && $contenta=="" && $contentn!=="")



{











if($lastpostid==0 || $lastpostid==1 || $lastpostid==2 || $lastpostid==3 || $lastpostid==4 || $lastimageid==0 || $lastimageid==1 || $lastimageid==2 || $lastimageid==3 || $lastimageid==4)



{



$content=$contentj;



}



elseif($lastpostid==5 || $lastpostid==6 || $lastpostid==7 || $lastpostid==8 || $lastpostid==9 || $lastimageid==5 || $lastimageid==6 || $lastimageid==7 || $lastimageid==8 || $lastimageid==9)



{



$content=$contentn;



}



else



{



$content=$contentj;



}











}







/**********************************************************/











/***********************************************2 websites J,T*******************************************/







if($contentj!=="" && $contentt!=="" && $contenta=="" && $contentn=="")



{











if($lastpostid==0 || $lastpostid==1 || $lastpostid==2 || $lastpostid==3 || $lastpostid==4 || $lastimageid==0 || $lastimageid==1 || $lastimageid==2 || $lastimageid==3 || $lastimageid==4)



{



$content=$contentj;



}



elseif($lastpostid==5 || $lastpostid==6 || $lastpostid==7 || $lastpostid==8 || $lastpostid==9 || $lastimageid==5 || $lastimageid==6 || $lastimageid==7 || $lastimageid==8 || $lastimageid==9)



{



$content=$contentt;



}



else



{



$content=$contentt;



}











}







/**********************************************************/







/***********************************************2 websites J,A*******************************************/







if($contentj!=="" && $contentt=="" && $contenta!=="" && $contentn=="")



{











if($lastpostid==0 || $lastpostid==1 || $lastpostid==2 || $lastpostid==3 || $lastpostid==4 || $lastimageid==0 || $lastimageid==1 || $lastimageid==2 || $lastimageid==3 || $lastimageid==4)



{



$content=$contentj;



}



elseif($lastpostid==5 || $lastpostid==6 || $lastpostid==7 || $lastpostid==8 || $lastpostid==9 || $lastimageid==5 || $lastimageid==6 || $lastimageid==7 || $lastimageid==8 || $lastimageid==9)



{



$content=$contenta;



}



else



{



$content=$contenta;



}











}







/**********************************************************/















/***********************************************2 websites N,T*******************************************/







if($contentj=="" && $contentt!=="" && $contenta=="" && $contentn!=="")



{











if($lastpostid==0 || $lastpostid==1 || $lastpostid==2 || $lastpostid==3 || $lastpostid==4 || $lastimageid==0 || $lastimageid==1 || $lastimageid==2 || $lastimageid==3 || $lastimageid==4)



{



$content=$contentn;



}



elseif($lastpostid==5 || $lastpostid==6 || $lastpostid==7 || $lastpostid==8 || $lastpostid==9 || $lastimageid==5 || $lastimageid==6 || $lastimageid==7 || $lastimageid==8 || $lastimageid==9)



{



$content=$contentt;



}



else



{



$content=$contentn;



}











}







/**********************************************************/











/***********************************************2 websites N,A*******************************************/







if($contentj=="" && $contentt=="" && $contenta!=="" && $contentn!=="")



{











if($lastpostid==0 || $lastpostid==1 || $lastpostid==2 || $lastpostid==3 || $lastpostid==4 || $lastimageid==0 || $lastimageid==1 || $lastimageid==2 || $lastimageid==3 || $lastimageid==4)



{



$content=$contentn;



}



elseif($lastpostid==5 || $lastpostid==6 || $lastpostid==7 || $lastpostid==8 || $lastpostid==9 || $lastimageid==5 || $lastimageid==6 || $lastimageid==7 || $lastimageid==8 || $lastimageid==9)



{



$content=$contenta;



}



else



{



$content=$contenta;



}











}







/**********************************************************/











/***********************************************2 websites A,T*******************************************/







if($contentj=="" && $contentt!=="" && $contenta!=="" && $contentn=="")



{











if($lastpostid==0 || $lastpostid==1 || $lastpostid==2 || $lastpostid==3 || $lastpostid==4 || $lastimageid==0 || $lastimageid==1 || $lastimageid==2 || $lastimageid==3 || $lastimageid==4)



{



$content=$contenta;



}



elseif($lastpostid==5 || $lastpostid==6 || $lastpostid==7 || $lastpostid==8 || $lastpostid==9 || $lastimageid==5 || $lastimageid==6 || $lastimageid==7 || $lastimageid==8 || $lastimageid==9)



{



$content=$contentt;



}



else



{



$content=$contentt;



}











}











/**********************************************************/











/***********************************************1 website J*******************************************/







if($contentj!=="" && $contentt=="" && $contenta=="" && $contentn=="")



{



$content=$contentj;



}







/**********************************************************/







/***********************************************1 website *******************************************/







if($contentj=="" && $contentt!=="" && $contenta=="" && $contentn=="")



{



$content=$contentt;



}







/**********************************************************/







/***********************************************1 website ALL4*******************************************/







if($contentj=="" && $contentt=="" && $contenta!=="" && $contentn=="")



{



$content=$contenta;



}







/**********************************************************/







/***********************************************1 website *******************************************/







if($contentj=="" && $contentt=="" && $contenta=="" && $contentn!=="")



{



$content=$contentn;



}



if($content!==$contentj && $content!==$contentt && $content!==$contenta && $content!==$contentn)

{

$content="";

}



/**********************************************************/







		if (in_category('wordpress themes', $postid))



				{



				$cat="themes/";



				}







		elseif (in_category('Plugins', $postid))



				{



				$cat="plugins/";



				}







if($demolink!=="")



{



$demolink='<h3 style="text-align: center;"><strong>Demo </strong>'.$title.'</h3><div class="aio-button-center"><div class="aio-swing"><a target="_blank" href="'.$demolink.'" class="aio-blue-medium" title="Demo Full Page" rel="nofollow"><i class="glyphicons glyphicons-display x2"></i>Demo Full Page</a></div></div>';



}







if (preg_match('/<div class="downloaddirectlink">[\s\S]*?<\/div>/i',$contentorg))



{



preg_match_all('/<div class="downloaddirectlink">([\s\S]*?)<\/div>/i', $contentorg, $matches_dldirect);



$dldirect="/up/".$cat.$matches_dldirect[1][0];







$dldirect='<h3 style="text-align: center;"><strong>Download </strong>'.$title.'</h3><div class="aio-button-center"><div class="aio-swing"><a target="_blank" href="'.$dldirect.'" class="aio-blue-medium" title="Download Direct Link" rel="dofollow"><i class="glyphicons glyphicons-download x2"></i>Download Direct Link</a></div></div>';



}



else



{



$dldirect="";



}















if (preg_match('/<div class="downloadv">[\s\S]*?<div id="downloadvclose">/i',$contentorg))



{



preg_match_all('/<div class="downloadv">([\s\S]*?)<div id="downloadvclose">/i', $contentorg, $matches_downloadvlink);



$downloadvlink=$matches_downloadvlink[1][0];



$downloadvlink='<h3 style="text-align: center;">More Download Free Links</h3><pre>'.$downloadvlink.'</pre>';



}



else



{



$downloadvlink="";



}















//$content=$content."<p>Direct Download</p>".$dldirect."Another Download Sources".$downloadvlink.'[aio_button align="center" animation="swing" color="blue" size="medium" icon="download" text="Direct Download" target="_blank" relationship="nofollow" url="http://www.google.com"]';



















//$content=$content.'<h3 style="text-align: center;"><strong>Demo </strong>'.$title.'</h3>'.'[aio_button align="center" animation="swing" color="blue" size="medium" icon="display" text="Demo Full Page" target="_blank" relationship="nofollow" url="'.$demolink.'"] <h3 style="text-align: center;"><strong>Download </strong>'.$title.'</h3>'.'[aio_button align="center" animation="swing" color="blue" size="medium" icon="download" text="Download Direct Link" target="_blank" relationship="nofollow" url="'.$dldirect.'"] <h3 style="text-align: center;">More Download Free Links</h3><pre>'.$downloadvlink.'</pre>';







//$dldirect="";







$content=$content.$demolink.$dldirect.$downloadvlink;











return $content;



}















$basename=basename($_SERVER["SCRIPT_FILENAME"]);



if($basename!=="jojo.php" && $basename!=="jojo_full.php" && $basename!==".php" && $basename!=="_full.php" && $basename!=="all4.php" && $basename!=="all4_full.php" && $basename!==".php" && $basename!=="dlup.php" )



{

add_filter('the_content','replacev_content');



if(strpos($_SERVER['REQUEST_URI'], 'jojo.php') === FALSE AND strpos($_SERVER['REQUEST_URI'], '.php') === FALSE AND strpos($_SERVER['REQUEST_URI'], '.php') === FALSE AND strpos($_SERVER['REQUEST_URI'], 'dlup.php') === FALSE AND strpos($_SERVER['REQUEST_URI'], 'jojo_full.php') === FALSE AND strpos($_SERVER['REQUEST_URI'], '_full.php') === FALSE AND strpos($_SERVER['REQUEST_URI'], 'all4.php') === FALSE AND strpos($_SERVER['REQUEST_URI'], 'all4_full.php') === FALSE)

{





}

}

  show_admin_bar(false);



?>