Changeset 43 for action.php
- Timestamp:
- Jan 29, 2009, 1:13:27 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
action.php
r40 r43 3 3 include('includes/global.php'); 4 4 5 if (array_key_exists('delete', $_GET) and Licence(1)) { 5 if (array_key_exists('delete', $_GET) and Licence(1)) 6 { 6 7 $QuestID = $_GET['ID']; 7 8 $Database->SQLCommand("DELETE FROM quests WHERE ID = '$QuestID' AND Language <> '0'"); … … 10 11 } 11 12 12 if (array_key_exists('type_translation', $_POST) and Licence(1)) { 13 if (array_key_exists('type_translation', $_POST) and Licence(1)) 14 { 13 15 if (array_key_exists('1', $_POST)) 14 16 $check = 1; … … 67 69 $Database->SQLCommand("INSERT INTO `shoutbox` ( `user` , `text` , `date` , `IP` ) 68 70 VALUES ( '$user', '$text', now(), '".$_SERVER['REMOTE_ADDR']."');"); 69 echo 'Zprďż˝va vloďż˝ena!<br>Budete přesměrováni...';71 echo('Zpráva vložena!<br>Budete přesměrováni...'; 70 72 echo ' 71 <script type="text/javascript" language="JavaScript" charset=" iso-8859-2">73 <script type="text/javascript" language="JavaScript" charset="utf-8"> 72 74 setTimeout("parent.location.href=\'index.php\'",1000) 73 75 </script>'; … … 85 87 86 88 $Line = mysql_fetch_row($Database->SQLCommand("SELECT * FROM quests_vote WHERE IDuser = '$IDuser' AND IDquest = '$questID'")); 87 if ((!$Line) and (Licence(0))) { 89 if ((!$Line) and (Licence(0))) 90 { 88 91 $Line = mysql_fetch_array($Database->SQLCommand("SELECT Vote,CountVote FROM quests WHERE ID = '$questID'")); 89 $CountVote = $Line['CountVote'] +1;90 $OldVote = $Line['Vote'] *$Line['CountVote'];91 $NewVote = ($OldVote +$vote)/$CountVote;92 $CountVote = $Line['CountVote'] + 1; 93 $OldVote = $Line['Vote'] * $Line['CountVote']; 94 $NewVote = ($OldVote + $vote) / $CountVote; 92 95 93 96 $Database->SQLCommand("UPDATE quests SET Vote = '$NewVote', CountVote = '$CountVote' WHERE ID = '$questID'"); 94 97 95 98 $Database->SQLCommand("INSERT INTO `quests_vote` ( `IDquest` , `IDuser` , `vote` ) VALUES ( '$questID', '$IDuser', '$vote');"); 96 echo 'Hlas byl ulo ďžen! Hlasoval jste: '.$vote.'<br /> Nyní je známka překladu '.$NewVote;99 echo 'Hlas byl uložen! Hlasoval jste: '.$vote.'<br /> Nyní je známka překladu '.$NewVote; 97 100 98 101 WriteLog('Uživatel hlasoval: '.$vote.'! Nyní je známka překladu (<a href="form.php?ID='.$questID.'">'.$questID.'</a>): '.$NewVote, 5);
Note:
See TracChangeset
for help on using the changeset viewer.