Tutorials (show blog, toggle sort order) ...";
$retvalalt = "";
/*** mysql hostname ***/
$hostname = 'localhost';
/*** mysql username ***/
$username = 'username';
/*** mysql ***/
$password = 'password';
$dbname = 'rjmprogr_wordpress';
if (isset($_GET['dbname'])) $dbname = $_GET['dbname'];
$tname = 'wp_posts';
$link = mysql_connect($hostname, $username, $password);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db($dbname);
//
if ($index == "slideshow") {
$res = mysql_query("SELECT ID, post_date, " . $ptg . " DATE_FORMAT(post_date,'%Y%m%d') As pdate, IfNull(post_excerpt, '') As post_excerpt, 'zzz' as bpost_title FROM " . $tname . " WHERE post_status='publish' " . $and . " and post_title not like '%Show Tags of this Webpage%' and post_title not like '%Show Most Popular Words%' and (substr(IfNull(post_excerpt, ''),1,1) < '0' or substr(IfNull(post_excerpt, ''),1,1) > '9') ORDER BY bpost_title, post_date DESC");
} else {
$res = mysql_query("SELECT ID, post_date, " . $ptg . " DATE_FORMAT(post_date,'%Y%m%d') As pdate, IfNull(post_excerpt, '') As post_excerpt, replace(post_title, ' ', LPAD(post_excerpt,13,'*')) as bpost_title FROM " . $tname . " WHERE post_status='publish' " . $and . " and post_title not like '%Show Tags of this Webpage%' and post_title not like '%Show Most Popular Words%' and substr(IfNull(post_excerpt, ''),1,1) >= '0' and substr(IfNull(post_excerpt, ''),1,1) <= '9' UNION SELECT ID, post_date, " . $ptg . " DATE_FORMAT(post_date,'%Y%m%d') As pdate, IfNull(post_excerpt, '') As post_excerpt, 'zzz' as bpost_title FROM " . $tname . " WHERE post_status='publish' " . $and . " and post_title not like '%Show Tags of this Webpage%' and post_title not like '%Show Most Popular Words%' and (substr(IfNull(post_excerpt, ''),1,1) < '0' or substr(IfNull(post_excerpt, ''),1,1) > '9') ORDER BY bpost_title, post_date DESC");
}
if ($res == 0) {
echo("Error " . mysql_errno() . ": " . mysql_error() . "");
} else if (mysql_num_rows($res) == 0) {
echo("Query executed successfully");
} else {
$j = 1;
$bval = ' ';
$lastr0 = "";
$lastr1 = "";
$ulist = ";";
while (($r_array = mysql_fetch_row($res))) {
$lastr0 = $r_array[0];
$lastr1 = $r_array[2];
if ($retvalp != "") {
$thisintr = explode(" ", str_replace("_", " ", str_replace(" ", "++", $r_array[2])));
if ($thisintr[0] == $prevint) $retvalp = str_replace("@$@", $r_array[0], $retvalp);
$retval = str_replace("$@$", $retvalp, $retval);
}
$teis = explode("s Wally", $r_array[2]);
if (sizeof($teis) == 2) {
$preteis = explode("Where", $teis[0]);
$retval .= str_replace("&", "&", "\n");
} else {
$retval .= str_replace("&", "&", "\n");
}
if (($j % 19) == 0) {
$retval .= "\n";
$bval .= ' ';
}
$j++;
$prevxid = $r_array[0];
}
}
if ($retvalp != "") {
$thisintr = explode(" ", str_replace("_", " ", str_replace(" ", "++", $lastr1)));
if ($thisintr[0] == $prevint) $retvalp = str_replace("@$@", $lastr0, $retvalp);
$retval = str_replace("$@$", $retvalp, $retval);
}
$retval = str_replace("$@$", "", $retval);
$retval = str_replace("@$@", "", $retval);
$res = mysql_query("SELECT ID, post_date, " . $ptg . " DATE_FORMAT(post_date,'%Y%m%d') As pdate, IfNull(post_excerpt, '') As post_excerpt FROM " . $tname . " WHERE post_status='publish' " . $and . " and post_title not like '%Show Tags of this Webpage%' and post_title not like '%Show Most Popular Words%' ORDER BY post_title");
if ($res == 0) {
echo("Error " . mysql_errno() . ": " . mysql_error() . "");
} else if (mysql_num_rows($res) == 0) {
echo("Query executed successfully");
} else {
$j = 1;
$bval = ' ';
$ulist = ';';
while (($r_array = mysql_fetch_row($res))) {
$teis = explode("s Wally", $r_array[2]);
if (sizeof($teis) == 2) {
$preteis = explode("Where", $teis[0]);
$retvalalt .= str_replace("&", "&", "");
} else {
$retvalalt .= str_replace("&", "&", "");
}
if (($j % 19) == 0) {
$retvalalt .= "";
$bval .= ' ';
}
$j++;
}
}
mysql_close($link);
$newhtml = $retval;
if (file_exists(str_replace("/PHP", "/", dirname(__FILE__)) . "/" . "Welcome" . str_replace("index","",$index) . ".html")) {
if (!file_exists(str_replace("/PHP", "/", dirname(__FILE__)) . "/" . "Welcome" . str_replace("index","",$index) . ".html_original")) {
copy(str_replace("/PHP", "/", dirname(__FILE__)) . "/" . "Welcome" . str_replace("index","",$index) . ".html",str_replace("/PHP", "/", dirname(__FILE__)) . "/" . "Welcome" . str_replace("index","",$index) . ".html_original");
}
$whtml = str_replace("