*

Recent

Author Topic: Comment Deleting  (Read 11826 times)

soulwebsites

  • Jr. Member
  • **
  • Posts: 71
  • Force: +0/-0
    • Jamsite
Comment Deleting
« on: December 04, 2011, 09:24:45 AM »
I would like to make it so users are able to delete their own comment or just for admins to be able to remove comments that have been posted

this is how far I have got: 

in play.php I put this before the function writebody()

Code: [Select]
function commentdelete(){
global $domain, $db;
$ID = abs((int) $_GET['ID']);
if(!$ID){exit;}
$db->query(sprintf('DELETE FROM dd_comments WHERE ID=\'%u\'', $ID));
echo '<div class=\'msg\'>Comment Deleted.<br />
<A href="#" onclick="history.go(-1)">Back</a></div>';
}

then just under "<small><i><b>Posted On:</b> '.$date.'</i></small>';"

Code: [Select]
if(!isset($suserid)){
echo ' ';
}else{
mysql_query('DELETE FROM dd_comments WHERE ID='.$row['ID'].'');
echo '<div><a href=\''.$domain.'/index.php?action=play&case=approvecomments&cmd=delete&ID='.$row['ID'].'\'  onclick="return confirm(\'Are you sure you want to delete the comment?\')"><img src=\''.$domain.'/templates/'.$template.'/images/deletebtn.png\' border=\'0\'></a></div> ';
}

then at the end

Code: [Select]
switch($_GET['cmd']){
case 'commentdelete':
deletecomment();
break;
}

so what I was expecting was a red X to appear for logged on users which works fine also the removal of the comment works but just a little too well as soon as I refresh the page all comments are removed (this happens even if I dont click on the x and just refresh the page)

ive been looking at it for quite a few hours and cant see where im going wrong I tried looking at spagetiokiller's favorite delete script but still couldnt figure it

also I would like to secure it up a bit so user can only delete their own comments and not others

i was looking at this as I couldn't see how if you had auto approve comments on you could delete comments?

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: Comment Deleting
« Reply #1 on: December 04, 2011, 09:50:20 AM »
Mort has already made this mod but it only allows admins to delete them however u could probably easily edit it to work for the user who posted it aswell

http://freearcadescript.net/forums/index.php/topic,507.0.html

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: Comment Deleting
« Reply #2 on: December 04, 2011, 09:57:04 AM »
Morts code is specific to his version of FAS so ill post the version that works with the normal FAS and i believe i figured out how to add the user who posted it the ability to delete it.

Code: [Select]
play.php

Find:
<td valign=\'top\' class=\'content\'>'.$row['comment'].'</td>

Replace With:

<td valign=\'top\' class=\'content\'>'.$row['comment'].'';
if($usrdata['user_level'] == 2 || $useridl == $userid){
echo '
<div style="float: right; padding-right: 20px;"><a href=\''.$domain.'/index.php?action=admin&amp;case=approvecomments&amp;cmd=delete&amp;ID='.$row['ID'].'\'  onclick="return confirm(\'Are you sure you want to delete the

comment?\')"><img src=\''.$domain.'/templates/'.$template.'/images/deletebtn.png\' border=\'0\' alt=\'\' /></a></div>';
}

echo '</td>

I have not tested the code myself but that should work from what i understand
« Last Edit: December 04, 2011, 10:05:10 AM by spagetiokillers »

soulwebsites

  • Jr. Member
  • **
  • Posts: 71
  • Force: +0/-0
    • Jamsite
Re: Comment Deleting
« Reply #3 on: December 04, 2011, 12:56:41 PM »
thanks spagetoikiller must have missed morts post

you script works fine for admin but still doesnt give individual users ability to remove own comment but this is fine at least I can now delete comments  :)

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: Comment Deleting
« Reply #4 on: December 04, 2011, 02:58:32 PM »
Code: [Select]
function commentdelete(){
global $domain, $db, $suserid;
$ID = abs((int) $_GET['ID']);
if(!$ID){exit;}
mysql_query("DELETE FROM dd_comments WHERE ID='$ID' AND commenter='$suserid');
echo '<div class=\'msg\'>Comment Deleted.<br />
<A href="#" onclick="history.go(-1)">Back</a></div>';
}

Code: [Select]
if(isset($suserid) && $suserid == $row['commenter']){
echo '<a href=\''.$domain.'/index.php?action=play&case=approvecomments&cmd=delete&ID='.$row['ID'].'\'  onclick="return confirm(\'Are you sure you want to delete the comment?\')"><img src=\''.$domain.'/templates/'.$template.'/images/deletebtn.png\' border=\'0\'></a>';
}

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: Comment Deleting
« Reply #5 on: December 05, 2011, 01:49:04 PM »
try replacing $useridl == $userid with $suserid == $userid in the code i posted that may work

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: Comment Deleting
« Reply #6 on: December 07, 2011, 05:26:53 AM »
try replacing $useridl == $userid with $suserid == $userid in the code i posted that may work

Between you and Adam - All you are doing is confusing people to try something that is NEVER going to work.

@spagh

if($usrdata['user_level'] == 2 || $useridl == $userid){

Look at this line ->

href=\''.$domain.'/index.php?action=admin&amp;case=approvecomments&amp

Admin functions are protected by user-level and you can't just simply call Admin-Functions for any user other than those who have Admin permissions.

@Adam

if(isset($suserid) && $suserid == $row['commenter']){
         echo '<a href=\''.$domain.'/index.php?action=play&case=approvecomments&cmd=delete&ID='.$row['ID'].'\'

play.php does not have any case that relates to approving or deleting comments - It's strictly Admin stuff, unless you copy the functions from approvecomments.php to play.php

I also think that the BOTH of you should really STOP posting crap with the comment "Haven't tested it - But it should work" until you DO test what you suggest before you post it.

Because neither of you are helping anyone.


Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: Comment Deleting
« Reply #7 on: December 07, 2011, 06:25:36 AM »
o im sorry i didnt know i had to do all the work for everyone else when im busy working on things myself. I didnt know i wasnt allowed to try and help someone get lead in the right direction. But your always right mort so i guess ill stop.

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: Comment Deleting
« Reply #8 on: December 07, 2011, 12:29:10 PM »
Also, for the record, this is the first time iv posted code on here without testing it first. I just knew that you had already made a mod like that so i posted the version that works with the default FAS and figured id attempt to add the second feature he was looking for.

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: Comment Deleting
« Reply #9 on: December 07, 2011, 03:16:29 PM »
Don't worry I banned the know it all asshole.
I'm sick of his shit, so yeah lol.
This is a place to learn and not a place to fight and act like a total dick..

He is correct though.. but I was going off of the idea that Soul had added the switch() inside the play.php file already.

soulwebsites

  • Jr. Member
  • **
  • Posts: 71
  • Force: +0/-0
    • Jamsite
Re: Comment Deleting
« Reply #10 on: December 29, 2011, 08:14:59 AM »
Sorry for the late reply been a bit busy leading up to Christmas.

I have managed to apply your suggestion Adam which works (had to add an extra " at the end of commenter='$suserid'); )  ;)

the problem I have now is it redirects to a random game page

I tried adding target="_parent" and few others to the end of onclick each with a different outcome

also tried the onclick as an if(confirm ##### ) & location.href on the end of the onclick but still a random game shows after deleting a comment.

any ideas?


Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: Comment Deleting
« Reply #11 on: December 29, 2011, 12:15:24 PM »
try this:

Code: [Select]
//top of the file
//this is already done for you, but I don't remember the var name.. could be something like $ID = clean($_GET['ID']);
$gameidn = $_GET['ID'];

Code: [Select]
//either use the $gameidn or the $ID
if(isset($suserid) && $suserid == $row['commenter']){
echo '<a href=\''.$domain.'/index.php?action=play&ID=$gameidn&case=approvecomments&cmd=delete&ID='.$row['ID'].'\'  onclick="return confirm(\'Are you sure you want to delete the comment?\')"><img src=\''.$domain.'/templates/'.$template.'/images/deletebtn.png\' border=\'0\'></a>';
}

'.$domain.'/index.php?action=play&ID=$gameidn&case=approvecomments&cmd=delete&ID='.$row['ID'].'

EDIT:
Code: [Select]
//top of the file
//this is already done for you, but I don't remember the var name.. could be something like $ID = clean($_GET['ID']);
$gameidn = $_GET['ID'];

Code: [Select]
function commentdelete(){
global $domain, $db, $suserid;
$comid = abs((int) $_GET['comid']);
if(!$ID){exit;}
mysql_query("DELETE FROM dd_comments WHERE ID='$comid' AND commenter='$suserid');
echo '<div class=\'msg\'>Comment Deleted.<br />
<A href="#" onclick="history.go(-1)">Back</a></div>';
}


Code: [Select]
if(isset($suserid) && $suserid == $row['commenter']){
echo '<a href=\''.$domain.'/index.php?action=play&ID=$gameidn&case=approvecomments&cmd=delete&comid='.$row['ID'].'\'  onclick="return confirm(\'Are you sure you want to delete the comment?\')"><img src=\''.$domain.'/templates/'.$template.'/images/deletebtn.png\' border=\'0\'></a>';
}
« Last Edit: December 29, 2011, 01:08:10 PM by Adam LaCombe »

soulwebsites

  • Jr. Member
  • **
  • Posts: 71
  • Force: +0/-0
    • Jamsite
Re: Comment Deleting
« Reply #12 on: December 30, 2011, 08:48:12 AM »
applied the changes but it didn't work just displayed nothing for the ID in the end I swapped the gameidn for '.$ID.' and it now shows the correct game id but with a blank page (due to the case and cmd on the end if this is removed it works fine)

again tried using the onclick location
Code: [Select]
window.location.href=(\''.$domain.'/index.php?action=play&ID='.$ID.'\') but still fails to redirect

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: Comment Deleting
« Reply #13 on: December 30, 2011, 03:15:28 PM »
okay lol just paste the full play.php file here
I must be missing something.

soulwebsites

  • Jr. Member
  • **
  • Posts: 71
  • Force: +0/-0
    • Jamsite
Re: Comment Deleting
« Reply #14 on: December 31, 2011, 08:40:16 AM »
Code: [Select]
<?php
switch($_GET['cmd']){
case 'delete':
delete();
break;
}

$gameidn $_GET['ID'];
$ID clean($_GET['ID']);
$ID abs((int) ($ID));

$ir1 "SELECT * FROM dd_games WHERE ID='$ID'" ;
$sqltitle "gamedata-".$ID ;
$ir2 sqlcache($sqltitle$cachelife$ir1);

foreach ( 
$ir2 as $r ); {

$fsponsor $r['sponsor'];
$fads1 $r['ads1'];
if ( 
$fads1 !='' ) { $ads1 $fads1; };
$fads2 $r['ads2'];
if ( 
$fads2 !='' ) { $ads2 $fads2; };
$fads3 $r['ads3'];
if ( 
$fads3 !='' ) { $ads3 $fads3; };
$fabovegames $r['abovegames'];
$fsponsoractive $r['sponsoractive'];
if ( 
$fabovegames !='' ) { $abovegames $fabovegames; };
if ( 
$fsponsoractive == '2' ) { $abovegames $fsponsor; } ;
if ( 
$fsponsoractive == '1' ) { $abovegames .= ""; } ;
if ( 
$fsponsoractive == '0' ) { $abovegames .= ""; };

$fbelowgames $r['belowgames'];
if ( 
$fbelowgames !='' ) { $belowgames $fbelowgames; };
$fheaderspace $r['headerspace'];
if ( 
$headerspace !='' ) { $headerspace $fheaderspace; };
$ffooterspace $r['footerspace'];
if ( 
$ffooterspace !='' ) { $footerspace $ffooterspace; };
$cname $r['name'];
$metadescription $r['description'];
$pagetitle=$cname;
if ( 
$r['tags'] == '' ) { $metatags $cname; } else { $metatags $r['tags']; };
};
 
// $gwidth
// $gheight
// $gfile
// $genabledcode
// $gdescription
// $gviews

function delete(){
global 
$domain$db$suserid;
$comid abs((int) $_GET['comid']);
if(!
$ID){exit;}
mysql_query("DELETE FROM dd_comments WHERE ID='$comid' AND commenter='$suserid'");
echo 
'<div class=\'msg\'>Comment Deleted.<br />
<A href="#" onclick="history.go(-1)">Back</a></div>'
;
}

function 
writebody() {
global 
$db$domain$suserid$ir$ir2$r$cname$sponsor$ads1$ads2$ads3$headerspace$footerspace$ID$sitename$domain$template$gamesfolder$thumbsfolder$limitboxgames$seo_on$blogentriesshown$enabledcode_on$comments_on$directorypath$autoapprovecomments$gamesonpage$abovegames$belowgames$showwebsitelimit$supportemail$showblog$blogentriesshown$blogcharactersshown$blogcommentpermissions$blogcommentsshown$blogfollowtags$blogcharactersrss$usrdata$userid$template;


if(!
$ID){
echo '<div class=\'error\'>No game selected</div>';
exit;
}
if(!
$r['name']){
echo '<div class=\'error\'>Game does not exist</div>';
exit;
}
 
$ir $db->query(sprintf('SELECT * FROM dd_games WHERE ID=\'%u\''$ID));

 
$r $db->fetch_row($ir);

$cname ereg_replace('[^A-Za-z0-9]''-'$cname );
if(isset(
$_POST['commentsubmit'])){
$commenter $usrdata['userid'];
      
$gameid $ID;
$comment clean($_POST['comment']);
$date time();
if($autoapprovecomments == 1){
$approved 1;
}else{
$approved 0;
}
$db->query(sprintf('INSERT INTO dd_comments SET
gameid=\'%u\',
commenter=\'%u\',
comment=\'%s\',
date=\'%u\',
approved=\'%u\'
'
$ID$commenter$comment$date$approved));
if($autoapprovecomments == 1){
$msgcom 'Comment Posted.';
}else{
$msgcom 'Comment Posted, Awaiting admin approval.';
}
echo '<div class=\'msg\'>'.$msgcom.'</div><br />';
}
echo 
'
<table width=\'98%\' align=\'center\'>
<tr>
<td class=\'contentplay\' colspan=\'3\'>
<div align=\'center\'>
<fb:like send="false" layout="button_count" width="40" show_faces="false"></fb:like>
<g:plusone size="medium"></g:plusone>
<a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal">Tweet</a>
</div>'
;




if(!isset($suserid)){
echo '<div align=\'center\'>'.$abovegames.'</div>';

}else{
echo ' ';

}





echo 
'

</td>


</tr>

<tr>
<td class=\'header\' colspan=\'3\' >'
.$r['name'].'</td>
</tr>

<tr>
<td class=\'content2\' align=\'center\' colspan=\'3\'>
<div align=\'center\'>'
;
if($r['type'] == 1){
echo ' <object width=\''.$r['width'].'\' height=\''.$r['height'].'\' align=\'center\'>
<param name=\'movie\' value=\''
.$domain.'/'.$gamesfolder.'/'.$r['file'].'\'>
<embed src=\''
.$domain.'/'.$gamesfolder.'/'.$r['file'].'\' width=\''.$r['width'].'\' height=\''.$r['height'].'\'></embed>
</object>'
;
}else{
echo $r['enabledcode'];
}

echo '
</div>
</td>
</tr>
<tr>
<td class=\'header\' colspan=\'3\'>Details</td>
</tr>
<tr>
<td class=\'content2\' colspan=\'3\'><div align=\'center\'>'
.$belowgames.'</div></td>
</tr>

<tr>
<td class=\'content2\' width=\'40%\' valign=\'top\'><a href=\''
.$playlink.'\'>
       <img src=\''
.$domain.'/'.$thumbsfolder.'/'.$ro['ID'].'\'>

<b>Description:</b> '
.$r['description'].'</td>
<td class=\'content2\' valign=\'top\' style=\'padding:2px;\'><b>Total Views:</b> '
.$r['views'].'<br />
<a href=\''
.$domain.'/index.php?action=addtofavorites&cmd='.$ID.'\'><img src=\''.$domain.'/templates/'.$template.'/images/favorite.png\' /></a></td>
    <td class=\'content2\'>
<div align="center">'
; echo pullRating($ID,true,false,true); echo '</div>
</td>
</tr>


<tr>
<td colspan=\'3\' class=\'header\'>Bored of this game? check these out!</td>
</tr>
<tr>
<td class=\'content2\' colspan=\'3\'>
<div align=\'center\' style=\'padding:7px;\'>'
;
$rrb $db->query('SELECT * FROM dd_games ORDER BY RAND() LIMIT 0,6');

echo '<table align=\'center\'>';

while($ro $db->fetch_row($rrb)){
$gamename ereg_replace('[^A-Za-z0-9]'''$ro['name']);
if($seo_on == 1){
$playlink ''.$domain.'/play/'.$ro['ID'].'-'.$gamename.'.html';
}else{
$playlink ''.$domain.'/index.php?action=play&amp;ID='.$ro['ID'].'';
}
if($ro['type'] == 1){
$imgg ''.$domain.'/'.$thumbsfolder.'/'.$ro['thumb'].'';
}else{
$imgg $ro['thumburl'];
}
echo '<td class=\'contentrec\'>
<div align=\'center\'><A href=\''
.$playlink.'\'>
<img src=\''
.$imgg.'\' border=\'0\' width=\'55\' height=\'55\'><br />
'
.$ro['name'].'</a>
</div>
</td>
<td width=\'%2\'></td>'
;
}
echo '</table> </div>
</td>
</tr>'
;
if($enabledcode_on == 1){
echo 
' <tr>
<td colspan=\'3\' class=\'header\'>Enabled Code</td>
</tr>
<tr>
<td class=\'content2\' colspan=\'3\'>
<div align=\'center\' style=\'padding:5px;\'>
<textarea cols=\'60\' rows=\'5\'>'
;
if($r['type'] == 1){
echo '
&lt;object width=&quot;500&quot; height=&quot;500&quot;&gt;
&lt;param name=&quot;movie&quot; value=&quot;'
.$domain.'/'.$gamesfolder.$r['file'].'&quot;&gt;
&lt;embed src=&quot;'
.$domain.'/'.$gamesfolder.$r['file'].'&quot; width=&quot;500&quot; height=&quot;500&quot;&gt;
&lt;/embed&gt;
&lt;/object&gt; '
;
}else{
echo 
'
'
.$r['enabledcode'].'
'
;
}


echo ' </textarea>
</div>
</td>
</tr>'
;
}

if($comments_on == 1){
echo 
' <tr>
<td class=\'header\' colspan=\'3\'>Comments</td>
</tr>
<tr>
<td  width=\'70%\' valign=\'top\' colspan=\'3\' align=\'center\'>
<div align=\'center\'>
<table width=\'100%\' border=\'0\'>'
;
$rrr2 "SELECT * FROM dd_comments WHERE gameid='$ID' AND approved='1' ORDER BY date DESC LIMIT 3";
            
$sqltitle "gamecomments0-".$ID ;


            if (
$rrr1 sqlcache($sqltitle$cachelife$rrr2)) {
foreach ($rrr1 as $row ){
$date date('d-m-Y'$row['date']);
            
$useridc=$row['commenter'] ;
$rra2 "SELECT * FROM dd_users WHERE userid='$useridc'";

            
$sqltitle "userprofile-".$row['commenter'] ;
            
$rra1 sqlcache($sqltitle$cachelife$rra2);
            foreach ( 
$rra1 as $rra ) {
            
$useridl=$row['commenter'];
            if ( 
$rra['avatar'] == '1' ) { $avatarfileurl '<p><img src=\''.$domain.'/avatars/'.$rra['avatarfile'].'\' height=\'40\' width=\'40\' border=\'0\'>'; } else { $avatarfileurl '<img src=\''.$domain.'/avatars/default.jpg\' height=\'40\' width=\'40\'>'; };


            if(
$seo_on == 1){
           $urlp ''.$domain.'/showprofile/'.$useridl.'.html';
            }else{
       
$urlp ''.$domain.'/index.php?action=showprofile&profile='.$useridl ;
            };
            if ( 
$row['commenter'] == '0' ) {$commenter='Guest';} else {$commenter=$rra['username'];};
echo ' <tr>
<td width=\'20%\' class=\'content2\' style=\'padding:4px;\' valign=\'top\'><a href="'
.$urlp.'">'.$avatarfileurl.'</a><p><br><b>Posted By:</b> <a href="'.$urlp.'">'.$commenter.'</a><p>
                        <small><i><b>Posted On:</b> '
.$date.'</i></small>
</td>
<td valign=\'top\' class=\'content2\'>'
.$row['comment'].'';
if(isset(
$suserid) && $suserid == $row['commenter']){
echo '<a href=\''.$domain.'/index.php?action=play&ID='.$ID.'case=approvecomments&cmd=delete&comid='.$row['ID'].'\'  onclick="if(confirm(\'Are you sure you want to delete the comment?\')) window.location.href=(\''.$domain.'/index.php?action=play&ID='.$ID.'\')"><img src=\''.$domain.'/templates/'.$template.'/images/deletebtn.png\' border=\'0\'></a>';
}

echo 
'</td>
</tr>
<tr>
<td width=\'100%\' colspan=\'3\' class=\'content2\'>&nbsp;</td>
</tr>'
;

};
            };

} else { echo 
'<tr><td colspan=\'3\' class=\'content2\'>no comments yet</td></tr>';};
if(
$seo_on == 1){
$urco ''.$domain.'/showcomments/'.$cname.'/'.$ID.'/1.html';
}else{
$urco ''.$domain.'/index.php?action=showcomments&name='.$cname.'&ID='.$ID.'&page=1';
};


echo ' <tr>
<td width=\'100%\' colspan=\'3\' class=\'content2\'><a href=\''
.$urco.'\'><small><i><b>More Comments</b></i></small></a></td>
</tr>'
;
              
$gamename ereg_replace('[^A-Za-z0-9]'''$r['name']);
if($seo_on == 1){
$comlink ''.$domain.'/play/'.$ID.'-'.$gamename.'.html';
}else{
$comlink ''.$domain.'/index.php?action=play&amp;ID='.$ID.'';
}



                        if(!isset(
$suserid)) { $commentvar 'You must be logged in to post a comment'; }
                        else {
$commentvar '
<form action=\''
.$comlink.'\' method=\'POST\'>
<textarea cols=\'35\' rows=\'5\' name=\'comment\'></textarea>
<br />
<input type=\'submit\' name=\'commentsubmit\' value=\'Add Comment\'>
</form>' 
;
                        } ;



echo ' <tr>
<td colspan=\'3\' class=\'header\'>Post Comment</td>
</tr>
<tr>
<td colspan=\'3\' class=\'content2\'>
<div align=\'center\'>
                        '
.$commentvar.'
</div>
</td>
</tr>
</table>'
;
}
if(
$seo_on == 1){
$taf1 ''.$domain.'/taf/';
}else{
$taf1 ''.$domain.'/index.php?action=taf';
};
echo '

</div>
</td>
</tr>
<tr>
<td class=\'header\' colspan=\'3\'>Tell a Friend</td>
</tr>
<tr>
<td  width=\'70%\' valign=\'top\' colspan=\'3\' class=\'content2\' align=\'center\'>
<div align=\'center\'>

<form action =\''
.$taf1.'\' method=\'POST\'>
Your Name: <input type=\'text\' name=\'sender\' size=\'30\'>
   Your friend\'s e-mail: <input type=\'text\' name=\'recipient\' size=\'30\'>
<input type=\'hidden\' name=\'gamei\' value=\''
.$ID.'\'>
<input type=\'hidden\' name=\'gamen\' value=\''
.$gamename.'\'>

<input type=\'submit\' value=\'Send\'>





            </div>
            </td>
      </tr>

</table>'
;
$useridp=$usrdata['userid'] ;
if (
$useridp=='0' or $useridp=='') {$useridp='-1'; };
$db->query(sprintf('UPDATE dd_games SET views=views+1 WHERE ID=\'%u\''$ID));

if (
$useridp!='-1') {
$db->query('UPDATE dd_users SET plays=plays+1 WHERE userid=\''.$useridp.'\'');

 };
 
 switch(
$_GET['cmd']){
case 
'commentdelete':
deletecomment();
break;
}

};



?>