[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: www/sites/games
From: Emil Sedgh <emilsedgh () gmail ! com>
Date: 2011-11-12 14:04:13
Message-ID: 20111112140413.B8AA2AC88B () svn ! kde ! org
[Download RAW message or body]
SVN commit 1263747 by esedgh:
removing comments section, as it never got attention from developers
M +0 -88 game.php
--- trunk/www/sites/games/game.php #1263746:1263747
@@ -148,94 +148,6 @@
$appinfo->show();
?>
</div>
- <div class="section">
- <h1>
- Comments
- </h1>
- <?php
- require_once('recaptchalib.php');
- $conn=mysql_connect('localhost', $db_user, $db_pass);
- mysql_select_db($db_name);
- if (isset($_POST['add']) && $_POST['add']=='add') {
- $privatekey = "6LeDSQEAAAAAAAsTF0YOywTmL2JCE4bc_PguN_HH";
- $resp = recaptcha_check_answer ($privatekey,
- $_SERVER["REMOTE_ADDR"],
- $_POST["recaptcha_challenge_field"],
- $_POST["recaptcha_response_field"]);
- $captcha = $resp->is_valid;
- //$captcha = $_POST['captcha']==$_SESSION['captcha'];
- $user = strip_tags($_POST['name']);
- $game=$_GET['game'];
- $content = strip_tags($_POST['content']);
- $content = str_replace("[b]","<b>",$content);
- $content = str_replace("[/b]","</b>",$content);
- $content = str_replace("[u]","<u>",$content);
- $content = str_replace("[/u]","</u>",$content);
- $content = str_replace("[i]","<i>",$content);
- $content = str_replace("[/i]","</i>",$content);
- $content = str_replace("[p]","<p>",$content);
- $content = str_replace("[/p]","</p>",$content);
- if($captcha && $user && $game) {
- $query="insert into kdegames_comments
- (`user`,`date`,`content`,`game`)
- values
- ('".addslashes($user)."',NOW(),'".addslashes($content)."', \
'".addslashes($game)."')";
- $res=mysql_query($query);
- if(!$res) {
- echo "Database Error: ".mysql_error()."<br/>\n";
- }
- else {
- echo "Comment added successfull.<br/>";
- mail('kde-games-devel@kde.org', "[New comment for {$game}]", \
strip_tags($content), array('from'=>'noreply@games.kde.org'));
- }
- }
- else echo "Error<br/>";
- }
- if(isset($_POST['delete']) && $_POST['delete']=='delete' && \
isset($_POST['delete']) && $_SESSION['rights'] >= 100)
- mysql_query("delete from kdegames_comments where id='".$_POST['id']."'");
- $query = "select id, user, date, content from kdegames_comments where game='". \
$_GET['game'] ."' order by date desc";
- $result = mysql_query($query);
- $i=0;
- if(mysql_num_rows($result)<1)
- echo 'There are no comments in this game section. Your comment could be \
first.<br/>'."\n";
- else {
- while($row = mysql_fetch_assoc($result)) {
- $i++;
- ($i%2) ? $color = '#DDD' : $color = '#FEFEFE';
- echo '<div style="background-color:'.$color.'"><b>User:</b> '.$row['user']. \
"\n<br/><b>Date:</b> " . $row['date']. "\n<br/>". $row['content'] \
."<br/></div>";
- if(isset($_SESSION['rights']) && $_SESSION['rights']>=100) {
- echo
- '<form action="" method="post">
- <input type="hidden" value="'.$row['id'] .'" name="id" />
- <input type="submit" value="delete" name="delete">
- </form>';
- }
- }
- }
- mysql_close($conn);
- ?>
- <h2>
- Add new comment
- </h2>
- </h2>
- <form action="" method="post">
- <table>
- <tr>
- <td>Name: </td>
- <Td><input type="text" name="name" size="20" /></td>
- </tr>
- <tr>
- <td>You can use bbcode:<br/>[b] <b>bold</b> [/b]<br/>[u] <u>underlined</u> \
[/u]<br/>[i] <i>italic</i> [/i]</td>
- <td><textarea name="content" style="height: 100%; width: \
100%;"></textarea></td>
- </tr>
- </table>
- <?php
- $publickey = "6LeDSQEAAAAAALfj4rLUPJzezr8azXAYLYqf6duQ";
- echo recaptcha_get_html($publickey);
- ?>
- <input type="submit" value="add" name="add" />
- </form>
- </div>
<?php
include "footer.inc";
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic