Hei again.. new problem. I would like to add "updating" stuff for this picture moderating. Like if there show.php?id=(numberofpic) then it opens show.php page, where is possible to moderate(over moderate)... I try, but I dont figure it out. As like I want to add this field, who have moderated this picture.. :(
<?php
#$cur_server_time = date("U");
#$allowed_time = $cur_server_time-172800;
#mysql_query("DELETE FROM DSL_votes where servertime<'$allowed_time' and vote != '10'");
//actions
// approving picture
if($_POST['allow']){
$id=$_GET['id'];
$sqlallow=mysql_query("update photo set active='1', mode='$curUserID' where id='$id'");
$sql_modestats=mysql_query("update myuser set modenud=modenud+1 where ID='$curUserID'");
// adding to moderator point
//võtame pildi omaniku ID:
$v_userID = mysql_query("SELECT userid FROM photo WHERE id='$id' AND active='1'");
$ccc = mysql_fetch_array($v_userID);
$vuserID = $ccc[0];
//saadame pildi omanikule teate:
$mailtext = "Your <a href=\"pictures.php?id=".$id."\"><b>piicture</b></a> is approved!";
$lisanuderi=mysql_query("INSERT INTO DSL_notes ( id , `date` , `notetoid` , `notefromid`
, `text`) VALUES ( NULL , '".date("d.m.Y - H:i")."', '$vuserID', '$curUserID',
'$mailtext')");
//how much pictures have this user
$sqlcp = mysql_query("select count(*) from photo where
userid='$vuserID'");
$mitupilti1 = mysql_fetch_row($sqlcp);
$mitupilti = $mitupilti1[0];
//updating database
mysql_query("UPDATE myuser SET pilte = '$mitupilti' WHERE ID =
'$vuserID'");
mysql_query("where myuser * b_day, b_month, b_year = '$synnip2ev' WHERE
ID = '$vuserID'");
//adding activityt:
$updateakt2 = mysql_query("UPDATE myuser SET aktiivsus = aktiivsus + 0.04 WHERE ID =
'$curUserID'");
}
// picture not approved / by moderator
if($_POST['deny']){
$id=$_GET['id'];
$pohjus=addslashes($_POST['reason']);
if($_POST['reason2']){
$pohjus=$pohjus." (".addslashes($_POST['reason2']).")";
}
if(!empty($pohjus)){
$sqlallow=mysql_query("update photo set active='2', reason='$pohjus',
mode='$curUserID' where id='$id'");
$delsrc=$_GET['src'];
$f="gallery/".$delsrc;
#if(is_file($f)&&unlink($f)){
if(is_file($f)){
mysql_query("DELETE FROM DSL_comments WHERE img_id = '$id' AND img_src =
'$delsrc'") or die("Error: ".mysql_error());
// deleting comments
mysql_query("DELETE FROM DSL_votes WHERE votetoimg = '$id' AND
voteimg_src = '$delsrc'") or die("Error: ".mysql_error());
// deleting rates
//lets take user ID:
$v_userID = mysql_query("SELECT userid FROM photo WHERE id='$id' AND reason='$pohjus'");
$ccc = mysql_fetch_array($v_userID);
$vuserID = $ccc[0];
//send alert to user:
$mailtext = "Your <a href=\"pictures.php\"><b>picture</b></a> is not approved <br>Reason: ".$pohjus;
$lisanuderi=mysql_query("INSERT INTO DSL_notes ( id , `date` , `notetoid` , `notefromid`
, `text`) VALUES ( NULL , '".date("d.m.Y - H:i")."', '$vuserID', '$curUserID',
'$mailtext')");
//how many pictures have user? Et uuendada piltide arvu myuser-is
$sqlcp = mysql_query("select count(*) from photo where
userid='$vuserID'");
$mitupilti1 = mysql_fetch_row($sqlcp);
$mitupilti = $mitupilti1[0];
//update pictures in database:
mysql_query("UPDATE myuser SET pilte = '$mitupilti' WHERE ID =
'$vuserID'");
mysql_query("update myuser set keelanud=keelanud+1 where
ID='$curUserID'");
//adding +1 that moderator have not approved pic
//adding activity:
$updateakt2 = mysql_query("UPDATE myuser SET aktiivsus = aktiivsus +
0.03 WHERE ID = '$curUserID'");
}
}
}
if($_POST['special']){
$id=$_GET['id'];
$eriline=addslashes($_POST['spec_com']);
$sqlallow=mysql_query("update photo set active='1', reason='$eriline', special='1',
mode='$curUserID' where id='$id'");
$sql_modestats=mysql_query("update myuser set lisaeri=lisaeri+1 where ID='$curUserID'");
// adding point to moderator
//lets take picture owner ID:
$eri_userID = mysql_query("SELECT userid FROM photo WHERE special='1' AND
reason='$eriline' AND id='$id'");
$ccc = mysql_fetch_array($eri_userID);
$eriuserID = $ccc[0];
//send alert to user of added to specials:
$mailtext = "Your <a href=\"picture.php?id=".$id."\"><b>picture</b></a> is added to <a href=\"special.php\"><b>specials</b></a>!";
$eri_date = date("d.m.Y - H:i");
$lisanuderi=mysql_query("INSERT INTO DSL_notes ( id , `date` , `notetoid` , `notefromid`
, `text`) VALUES ( NULL , '$eri_date', '$eriuserID', '$curUserID', '$mailtext')");
//adding activity to user:
$updateakt2 = mysql_query("UPDATE myuser SET aktiivsus = aktiivsus + 0.04 WHERE ID =
'$curUserID'");
}
//pictures (are new ones?)
$andmedimg = mysql_query("select * from photo where active='0' order by id LIMIT 1");
$countimg = mysql_num_rows($andmedimg);
if($countimg > 0){
while($DSL_img = mysql_fetch_array($andmedimg)){
$img_id = $DSL_img["id"];
$src = $DSL_img["src"];
$subject = htmlspecialchars(stripslashes($DSL_img["subject"]));
$comment = stripslashes($DSL_img["comment"]);
$user_id = $DSL_img["userid"];
$name_from = $DSL_img["username"];
$date = $DSL_img["date"];
$active = $DSL_img["active"];
$reason = $DSL_img["reason"];
$imgvoters = $DSL_img["numvotes"];
$imgvotes = $DSL_img["allvotes"];
$imgscore = $DSL_img["score"];
$usersex = $DSL_img["usersex"];
$show_username = showusername($user_id, "index");
}
$vanus = floor( ((date("Y")*10000+date("m")*100+date("d")) -
($b_year*10000+$b_month*100+$b_day)) / 10000 );
?>
Nothing to see.<br>
<br>
<?php echo $show_username; ?> (<?php
echo "$b_day $b_month $b_year (<b>$old</b>)";
?>)| added: <?php echo"$date"; ?><br>
<a href="user.php?id=<?php echo"$user_id"; ?>"><img src="gallery/<?php echo"$src";
?>" border="0"></a><br>
<font class=imgsubject><?=$subject?></font><br>
<?=$comment?><br><br>
<TABLE border="0" width="640">
<tr>
<td align="left"><font class="ankeedipealkirjad">User pictures:</font><br><br></td>
</tr>
<TR>
<TD align="left" valign="top" style="padding: 3px;">
<?php
$result = mysql_query($query);
$andmedimg3 = mysql_query("select * from photo where userid = '$user_id' AND
active = '1' order by id desc");
echo '<TABLE>';
$i=0;
while($DSL_img3 = mysql_fetch_row($andmedimg3)){
$img_id3 = $DSL_img3[0];
$img_src3 = $DSL_img3[1];
$img_subjec3t = $DSL_img3[2];
$img_comment23 = $DSL_img3[3];
$img_userid3 = $DSL_img3[4];
$img_date3 = $DSL_img3[5];
$img_active3 = $DSL_img3[6];
$img_reason3 = htmlspecialchars(stripslashes($DSL_im3[12]));
$img_comment3=stripslashes($img_comment23);
$img_subject3=htmlspecialchars(stripslashes($img_subject23));
if ($i == 0){
echo '<TR>';
}
echo"<TD align=center valign=top><a href=\"show.php?
id=".$img_id3."\"><img src=\"thumb/".$img_src3."\" border=0></a></TD>";
if($i>=4){
echo '</TR>';
$i=0;
}else{
$i++;
}
}
echo '</TABLE>';
?> </TD>
</TR>
</TABLE>
<form name="allowf" method="post" action="zshow.php?id=<?=$img_id?>">
<input class="button" type="submit" name="allow" value="picture is ok">
</form>
<br>
<span class="ankeedipealkirjad">Not approving</span><br>
<br>
<form name="denyf" method="post" action="zshow.php?id=<?=$img_id?>&src=<?=$src?>">
<SELECT NAME="reason">
<option value="">Põhjus:</option>
<option value="Täpsusta oma asukohta pildil">Täpsusta oma asukohta
pildil</option>
<option value="Pilt peab olema vertikaalses asendis">Pilt peab olema
vertikaalses asendis</option>
<option value="Halb kvaliteet">Halb kvaliteet</option>
<option value="Liigselt või halvasti töödeldud">Liigselt või halvasti
töödeldud</option>
<option value="Kinnitage autoriõigusi">Kinnitage autoriõigusi</option>
<option value="Korduv pilt">Korduv pilt</option>
<option value="Porno või erootika">Porno või erootika</option>
<option value="Keelatud aineid propageeriv">Keelatud aineid propageeriv</option>
<option value="Otsene reklaam">Otsene reklaam</option>
<option value="Inimene või tema nägu pole pildil piisavalt nähtav">Inimene või
tema nägu pole pildil piisavalt nähtav</option>
<option value="Pead ennast rohkem esile tooma">Pead ennast rohkem esile
tooma</option>
<option value="Võõras pilt">Võõras pilt</option>
<option value="Kasutaja vanus ei sobinud pildiga!">Kasutaja vanus ei sobinud
pildiga !</option>
<option value="Kasutaja sugu ei sobinud pildiga ">Kasutaja sugu ei sobinud
pildiga</option>
<option value="Pilt on vigane, proovi lisada uuesti!">Pilt on vigane, lisa
uuesti</option>
<option value="Pildi all tekst ei tohi olla ainult võõrkeelne!">Pildi all tekst
ei tohi olla ainult võõrkeelne!</option>
<option value="Pildialune tekst/kirjeldus ei vasta
reeglitele">The text under the picture is not ok.</option>
<option value="Pilt ei vasta reeglitele">picture is not OK</option> /// <! -- REASONS --!>
</SELECT>
<br>
<input name="reason2" type="text" size="97" maxlength="100">
<br>
<input class="button" type="submit" name="deny" value="dont approve picture">
</form>
<br><br>
<span class="ankeedipealkirjad">adding to specials</span><br>
<br>
<form name="specialf" method="post" action="zshow.php?id=<?=$img_id?>">
comment: <input class="logout" type="text" size="60" maxlength="150" name="spec_com"
value="">
<input class="button" type="submit" name="special" value="add to specials">
</form>
<?php
}else{
echo"<br><font size='2' color='#33aa33'><b>No new pictures</b></font><br><br>";
}//end of pictures
?>