Tutorials (show blog, toggle sort order) ..."; $retvalalt = ""; /*** mysql hostname ***/ $hostname = 'localhost'; /*** mysql username ***/ $username = 'username'; /*** mysql ***/ $password = 'password'; $dbname = 'wordpress_database_name'; if (isset($_GET['dbname'])) $dbname = $_GET['dbname']; $tname = 'posts_table_name'; $link = mysql_connect($hostname, $username, $password); if (!$link) { die('Could not connect: ' . mysql_error()); } mysql_select_db($dbname); // $res = mysql_query("SELECT ID, post_date, post_title, guid, DATE_FORMAT(post_date,'%Y%m%d') As pdate FROM " . $tname . " WHERE post_status='publish' ORDER BY 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 = ' '; while (($r_array = mysql_fetch_row($res))) { $retval .= "\n"; if (($j % 19) == 0) { $retval .= "\n"; $bval .= ' '; } $j++; } } $res = mysql_query("SELECT ID, post_date, post_title, guid, DATE_FORMAT(post_date,'%Y%m%d') As pdate FROM " . $tname . " WHERE post_status='publish' 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 = ' '; while (($r_array = mysql_fetch_row($res))) { $retvalalt .= ""; if (($j % 19) == 0) { $retvalalt .= ""; $bval .= ' '; } $j++; } } mysql_close($link); $newhtml = $retval; if (file_exists(str_replace("/PHP", "/", dirname(__FILE__)) . "/Welcome.html")) { if (!file_exists(str_replace("/PHP", "/", dirname(__FILE__)) . "/Welcome.html_original")) { copy(str_replace("/PHP", "/", dirname(__FILE__)) . "/Welcome.html",str_replace("/PHP", "/", dirname(__FILE__)) . "/Welcome.html_original"); } $whtml = str_replace("", "~", $earr[4]))); $selarr = explode(">", $earr[3]); $newhtml = $earr[0] . "" . $retval . "", "", $newhtml) == $newhtml) { $newhtml .= $ethis . ""; } else { $newhtml = str_replace("", $ethis . "", $newhtml); } file_put_contents(str_replace("/PHP", "/", dirname(__FILE__)) . "/Welcome.html", $newhtml); //chown(str_replace("/PHP", "/", dirname(__FILE__)) . "/Welcome.html", "normaluser"); if (file_exists(str_replace("/PHP", "/", dirname(__FILE__)) . "/index.html")) { if (!file_exists(str_replace("/PHP", "/", dirname(__FILE__)) . "/index.html_original")) { copy(str_replace("/PHP", "/", dirname(__FILE__)) . "/index.html",str_replace("/PHP", "/", dirname(__FILE__)) . "/index.html_original"); } $whtml = str_replace("", "~", $earr[4]))); $selarr = explode(">", $earr[3]); $newhtml = $earr[0] . "" . $retval . "", "", $newhtml) == $newhtml) { $newhtml .= $ethis . ""; } else { $newhtml = str_replace("", $ethis . "", $newhtml); } file_put_contents(str_replace("/PHP", "/", dirname(__FILE__)) . "/index.html", $newhtml); //chown(str_replace("/PHP", "/", dirname(__FILE__)) . "/index.html", "normaluser"); } else { $newhtml = $retval; } } } else { $newhtml = $retval; } } $ethis = "\n"; if (str_replace("if (val.value.length != 0) {", "", $newhtml) != $newhtml) { $newhtml = str_replace("if (val.value.length != 0) {","if ( val.value.length == 1 && bzgoes == 0 ) { bzgoes = 1; window.open(\"http://www.rjmprogramming.com.au/wordpress\",\"Robert Metcalfe Blog\",\"height=429, left=278, top=360, width=400\"); } else if (val.value.trim() == '') { toggle(); } else if ( val.value.length != 0 ) {", $newhtml); } if (str_replace("var wasstr = '';", "", $newhtml) == $newhtml) { $newhtml = str_replace("function windowopen(myurl,mytarget) {", " var tval = 1;\n var wasstr = '';\n var bval=' '; \n\n var bzgoes=0; \n function windowopen(myurl,mytarget) {", $newhtml); } if (str_replace("", "", $newhtml) == $newhtml) { $newhtml .= $ethis . ""; } else { $newhtml = str_replace("", $ethis . "", $newhtml); } file_put_contents(str_replace("/PHP", "/", dirname(__FILE__)) . "/tutorial_options.html", $newhtml); echo $retval; ?>