"; $retval = ""; $ourtitle = ""; if (isset($_GET['title'])) { $ourtitle = urldecode($_GET['title']); } else if (isset($_POST['title'])) { $ourtitle = urldecode($_POST['title']); } if ($ourtitle != "") { $hostname = 'localhost'; /*** mysql username ***/ $username = 'username'; /*** mysql ***/ $password = 'password'; $dbname = 'database_name'; 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); $res = mysql_query("SELECT " . $tname . ".post_title, " . $tname . ".guid FROM " . $tname . " WHERE " . $tname . ".post_status = 'publish' " . " AND LOWER(" . $tname . ".post_title) != LOWER('" . $ourtitle . "') " . " AND (" . $tname . ".post_content like CONCAT(CONCAT('%?p='," . $tname . ".guid), '%') " . " OR " . $tname . ".post_content like '%" . str_replace('youllneverfindthis','%',permalinkit($ourtitle)) . "%' " . " OR " . $tname . ".post_content like '%" . str_replace('youllneverfindthis','%',$ourtitle) . "%') UNION SELECT 'Code Download Table' as post_title, " . $tname . ".post_content as guid FROM " . $tname . " WHERE " . $tname . ".post_status = 'publish' " . " AND LOWER(" . $tname . ".post_title) = LOWER('" . $ourtitle . "') " . " AND " . $tname . ".post_content like '%GETME%'"); if ($res == 0) { if (1 == 2) echo("Error " . mysql_errno() . ": " . mysql_error() . ""); } else if (mysql_num_rows($res) == 0) { if (1 == 2) echo("Query executed successfully"); $retval=$delim; $retval = str_replace(" }", " parent.document.getElementById('d" . permalinkit($ourtitle) . "').innerHTML=''; }", $retval); } else { while (($r_array = mysql_fetch_row($res))) { $pdate = $r_array[1]; if ($retval == "") { $retval=$delim; $retval = str_replace(" }", " var theseoptions=''; }", $retval); } $retval = str_replace(" }", " theseoptions=theseoptions.replace('',''); }", $retval); } if ($retval != "") $retval = str_replace(" }", " parent.document.getElementById('d" . permalinkit($ourtitle) . "').innerHTML=theseoptions; }", $retval); } mysql_close($link); if ($retval != "") { echo $retval; } } ?>