8");
if ($res == 0) {
echo("Error " . mysql_errno() . ": " . mysql_error() . "");
} else if (mysql_num_rows($res) == 0) {
echo("Query executed successfully");
} else {
while (($r_array = mysql_fetch_row($res))) {
$retval .= ($delim . $r_array[0]);
$delim = ",";
}
}
if ($retval != "") {
file_put_contents("software_posts_list.php", $retval);
}
$res = mysql_query("SELECT " . $tname . ".option_value FROM " . $tname . " WHERE " . $tname . ".option_name='sticky_posts'");
if ($res == 0) {
echo("Error " . mysql_errno() . ": " . mysql_error() . "");
} else if (mysql_num_rows($res) == 0) {
echo("Query executed successfully");
} else {
while (($r_array = mysql_fetch_row($res))) {
$retval = $r_array[0];
}
}
if ($retval != "") {
file_put_contents("sticky_posts_list.php", $retval);
// a:2:{i:0;i:316;i:1;i:7666;}
$colbits = explode(":", $retval);
if (sizeof($colbits) >= 7) {
$was = str_replace(";", "", str_replace("}", "", $colbits[6]));
if (file_exists("software_posts_list.php")) {
$slistcont = @file_get_contents("software_posts_list.php");
$slist = explode(",", $slistcont);
$isnow = $was;
while ($isnow == $was) {
$isnow = $slist[rand(0, (sizeof($slist) - 1))];
}
$newval = str_replace(";i:" . $was . ";", ";i:" . $isnow . ";", $retval);
mysql_query("UPDATE " . $tname . " SET " . $tname . ".option_value='" . $newval . "' WHERE " . $tname . ".option_name='sticky_posts'");
file_put_contents("sticky_posts_list_new.php", $newval);
}
}
}
mysql_close($link);
?>