include ("../includedb2.php");
if (isset($_GET['uid'])) {
$uid = makesafe($_GET['uid']);
if ($uid."" == "") {
$uid = "GET";
}
} else if ($_POST['uid']) {
$uid = makesafe($_POST['uid']);
if ($uid."" == "") {
$uid = "POST";
}
} else {
$uid = -1;
}
//
$continue = true;
if (isset($_POST['next'])) {
$q = "select story as m from coverstories where uid = '".$uid."' ";
//echo $q;
$res = mysql_query($q);
$row = mysql_fetch_assoc($res);
$m = $row['m'];
$q = "select story as m from coverlines where nr > ".$m;
//echo $q;
$res = mysql_query($q);
if ($row = mysql_fetch_assoc($res) ) {
$m++;
} else {
$m = 1;
}
$q = "update coverstories set story = ".$m." where uid='".$uid."' ";
mysql_query($q);
$continue = false;
?>
Now press [X] close button at the bottom of the screen.
} else if (isset($_POST['more'])) {
$max = $_POST['max'] + 10;
} else {
$max = 10;
if (isset($_POST['line1'])) {
$continue = false;
$q = "select max(story) as m from coverlines";
$res = mysql_query($q);
$row = mysql_fetch_assoc($res);
$m = $row['m'];
$m++;
$i=1;
while (isset($_POST['line'.$i]) ) {
$line = $_POST['line'.$i];
if ($line."" != "") {
$q = "insert into coverlines (nr,story,content,moment) ";
$q .= " VALUES (".$i.",".$m.",'".$line."',NOW() ) ";
mysql_query($q);
}
$i++;
}
$q = "update coverstories set story = ".$m." where uid='".$uid."' ";
mysql_query($q);
?>
Thanks! Your story will appear with your next scan";
Now press [X] close button at the bottom of the screen.
}
}
?>
|
|