View file wapirate/wml/dare.php

File size: 26.43Kb
<?php

include("head.php");



$nopl = mysql_fetch_array(mysql_query("SELECT birthday FROM ibwf_users WHERE id='".$uid."'"));

$uage = getage($nopl[0]);

///ban under 18 and uid = 2 below

if(($uage<18)||($uid==1781)){

    echo "<card id=\"main\" title=\"wapirate\">";

    echo "<p align=\"center\">";

    echo "<img src=\"images/error.gif\" alt=\"*\"/><br/>";

    echo "ERROR! You Are Under 18 This Is Not For You!<br/>Or You Are Banned From Adult Dares For Cheating!<br/><br/>";

    echo "</p>";

    echo "</card>";

    echo "</wml>";

    exit();

}



$did = $_GET["did"];



addonline(getuid_sid($sid),"Online List","http://wapirate.net/wml/dare.php?action=main");

//////////////////////////////////////////

if($action=="main")

{

  echo "<card id=\"main\" title=\"wapirate\">";

echo "<p align=\"center\">";

echo "<b>Adult Dares</b><br/>";

echo "<img src=\"/smilies/naugh.gif\" alt=\"\"/><br/>";

$nom = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_dares WHERE sex='m' AND pic!=''"));

$nof = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_dares WHERE sex='f' AND pic!=''"));

if($nof[0]>$nom[0]){

echo "Come On Ladz Get Your Trousers Down.<br/> Your Getting An Ass Whiping From The Girlz!<br/>";

}else{

echo "Come On Girlz Get Snapping Your Bits.<br/> Your Getting An Ass Whipping From The Ladz!<br/>"; 

}

echo "</p>";

echo "<p>";

echo "<a href=\"dare.php?action=add\">Add Dare</a><br/>";

$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_dares WHERE sex='m'"));

echo "<a href=\"dare.php?action=dares&amp;sex=m\">Male Dares [$nom[0]/$noi[0]]</a><br/>";

$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_dares WHERE sex='f'"));

echo "<a href=\"dare.php?action=dares&amp;sex=f\">Female Dares [$nof[0]/$noi[0]]</a><br/>";

$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_dares WHERE sex='b'"));

$nob = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_dares WHERE sex='b' AND pic!=''"));

echo "<a href=\"dare.php?action=dares&amp;sex=b\">Male, Female Or Both Dares [$nob[0]/$noi[0]]</a><br/>";

$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_dares"));

$tod = $nom[0] + $nof[0] + $nob[0];

echo "<a href=\"dare.php?action=dares\">All Dares [$tod/$noi[0]]</a><br/><br/>";

echo "<b><a href=\"dare.php?action=rules\">Rules</a></b><br/>";

echo "</p>";

echo "<p align=\"center\">";

  echo "<br/><a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

  echo "</card>";

}



//////////////////////////////////////////

if($action=="rules")

{

  echo "<card id=\"main\" title=\"wapirate\">";

echo "<p align=\"center\">";

echo "<img src=\"/smilies/naugh.gif\" alt=\"\"/><br/>";

echo "<b>Rules</b><br/>";

echo "</p>";

echo "<p>";

echo "All Dares Must Be Over 100 Gold <br/>Gold Will Be Removed from The Person Who Dares<br/>";

echo "On Completion Of The Dare The Person Who Made The Dare Will Recieve There Gold Back And An Extra 100 Gold<br/>";

echo "Also The Person Completed The Dare Will Get Double The Amount Of Gold That Was Dared<br/>";

echo "If The Person Who Does The Dare Does It Non-anonymous They Will Recieve an Extra 200 Gold!<br/>"; 

echo "Other Members Can Now Do The Same Dare And Win The Gold Again But The Person Who Made The Dare Will Not Recieve The Extra 100 Gold (But Even So You Can Earn A Lot Of Gold By Just Creating Decent Dares)<br/>";

echo "All Dares Are To Be Of A Adult Nature And a Photo Must Be Taken At Home And Uploaded To Prove It Is Done<br/>";

echo "Dares Can Be As Rude As you like !<br/>";

echo "Both The Person Who Dares And The Person Who Completes The Dare Have The Option To Stay Anonymous and even people comenting<br/>";

echo "Any Stupid Or Virtually Impossible Or Double Posted Dares Will Be Deleted With No Returns On Gold<br/>"; 

echo "Also Old Dares May Be Deleted If They Have Not Been Used For A While.. To Make Space For New Dares<br/>";

echo "Remember That The Wilder The Dare The Higher The Gold Should Be!<br/>";

echo "Any Cheating Or May Result In Being Banned From Dares Or Even Wapirate<br/>";

echo "Have Fun And See How Many Dares You Can Complete!<br/>";

echo "</p>";

echo "<p align=\"center\">";

echo "<a href=\"dare.php?action=main\">Dares</a><br/>";

  echo "<br/><a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

  echo "</card>";

}



//////////////////////////////

else if($action=="add")

{

  echo "<card id=\"main\" title=\"wapirate\">";





echo "<p align=\"center\">";

/*

echo "<b>Add Dare</b><br/>";

echo "Name Of Dare:<br/> <input name=\"name\" maxlength=\"50\"/><br/>";

echo "Dare:<br/> <input name=\"dare\"  maxlength=\"500\"/><br/>";

echo "Gold:<br/> <input name=\"gold\"  maxlength=\"3\"/><br/>";

echo "Anonymous Dare:<br/><select name=\"anonymous\">";

echo "<option value=\"1\">yes</option>";

echo "<option value=\"0\">no</option>";

echo "</select><br/>";

echo "Dare For Which Gender:<br/><select name=\"sex\">";

echo "<option value=\"m\">Male</option>";

echo "<option value=\"f\">Female</option>";

echo "<option value=\"b\">Either</option>";

echo "</select><br/>";



    echo "<anchor>Create";

    echo "<go href=\"dare.php?action=add2\" method=\"post\">";

    echo "<postfield name=\"name\" value=\"$(name)\"/>";

    echo "<postfield name=\"dare\" value=\"$(dare)\"/>";

    echo "<postfield name=\"gold\" value=\"$(gold)\"/>";

    echo "<postfield name=\"anonymous\" value=\"$(anonymous)\"/>";

    echo "<postfield name=\"sex\" value=\"$(sex)\"/>";

    echo "</go></anchor><br/>";

*/

echo "Sorry Dares Has Been Closed.<br/>However You Can Participate In More Dares On <a href=\"http://wapdare.co.uk\">Wapdare.co.uk</a><br/>";





echo "<a href=\"dare.php?action=main\">Dares</a><br/>";

  echo "<br/><a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

  echo "</card>";

}

/////////////////////////////////////////

else if($action=="add2")

{

$nog = mysql_fetch_array(mysql_query("SELECT gold FROM ibwf_users WHERE id='".$uid."'"));

  echo "<card id=\"main\" title=\"wapirate\">";

echo "<p align=\"center\">";

echo "<b>Add Dare</b><br/>";

$name = $_POST["name"];

$anonymous = $_POST["anonymous"];

$dare = $_POST["dare"];

$sex = $_POST["sex"];

$gold = $_POST["gold"];



if($gold<100){

echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";

      echo "<b>Gold Must Be Over 99 Gold!</b><br/>";

}else if(($dare=="")||($name==""))

{

echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";

      echo "<b>Please Fill In All Details!</b><br/>";

}else if($nog[0]<$gold){

echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";

      echo "<b>Not Enough Gold!</b><br/>";

}else{

/*

$newg = $nog[0] - $gold;

mysql_query("UPDATE ibwf_users SET gold='".$newg."' WHERE id='".$uid."'");

mysql_query("INSERT INTO ibwf_dares SET uid='".$uid."', sex='".$sex."', dare='".$dare."', gold='".$gold."', hidden='".$anonymous."', title='".$name."'");



echo "<img src=\"images/ok.gif\" alt=\"0\"/><br/>";

      echo "<b>Dare Added Successfully!</b><br/>";

	  */

	  echo "Sorry Dares Has Been Closed.<br/>However You Can Participate In More Dares On <a href=\"http://wapdare.co.uk\">Wapdare.co.uk</a><br/>";

}





echo "<a href=\"dare.php?action=main\">Dares</a><br/>";

  echo "<br/><a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

  echo "</card>";

}

////////////////////////////////////////

else if($action=="dares")

{

$sex = $_GET["sex"];



  echo "<card id=\"main\" title=\"wapirate\">";

echo "<p align=\"center\">";

echo "<b>Dares</b><br/>";

echo "</p>";

    if($page=="" || $page<=0)$page=1;

if($sex!=""){

 $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_dares WHERE sex='".$sex."'"));

}else{

 $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_dares"));

}

    $num_items = $noi[0]; //changable

$items_per_page= 5;

    $num_pages = ceil($num_items/$items_per_page);

    if($page>$num_pages)$page= $num_pages;

    $limit_start = ($page-1)*$items_per_page;

if($num_items>0)

    {



    //changable sql

if($sex!=""){

    $sql = "

    SELECT id, uid, hidden, title, pic, gold FROM ibwf_dares WHERE sex='".$sex."' ORDER BY id DESC

            LIMIT $limit_start, $items_per_page

    ";

}else{

    $sql = "

    SELECT id, uid, hidden, title, pic, gold FROM ibwf_dares ORDER BY id DESC

            LIMIT $limit_start, $items_per_page

    ";

}

    echo "<p>";

    $items = mysql_query($sql);

    echo mysql_error();

    while ($item = mysql_fetch_array($items))

    {



if($item[2]==0){

$nick = getnick_uid($item[1]);

$lnk = "<a href=\"index.php?action=viewuser&amp;who=$item[1]\">$nick</a>";

}else{

$lnk = "Anonymous!";

}

if($item[4]!=""){

$ddare = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_daresmore WHERE did='".$item[0]."'"));

$times = 1 + $ddare[0];

if($times==1){

$times = "Once";

}else{

$times = "$times Times";

}

$mission = "<b>Completed $times</b>";

}else{

$mission = "Uncomplete";

}

if(isstatus8(getuid_sid($sid))){

$del = "<a href=\"dare.php?action=deld&amp;did=$item[0]\">[x]</a>";

}

echo "<a href=\"dare.php?action=details&amp;did=$item[0]\">$item[3]</a><br/>";

echo "By: $lnk<br/>";

$item[5] = $item[5] * 2;

echo "Gold: $item[5]<br/>";

$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_darecom WHERE did='".$item[0]."'"));

echo "<a href=\"dare.php?action=cmt&amp;did=$item[0]\">Comments [$noi[0]]</a><br/>";

echo "$mission $del<br/><br/>";





}

    echo "</p>";

    echo "<p align=\"center\">";



if($page > 1){ 

    $prev = ($page - 1);

    echo "<a href=\"dare.php?action=$action&amp;page=$prev&amp;sex=$sex\">Previous</a> ";

}





if($page < $num_pages){ 

    $next = ($page + 1); 

    echo "<a href=\"dare.php?action=$action&amp;page=$next&amp;sex=$sex\">Next</a><br/>"; 

}

echo "<br/>$page/$num_pages<br/>"; 



    if($num_pages>2)

    {





        $rets = "Jump To Page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";

        $rets .= "<anchor>[GO]";

        $rets .= "<go href=\"dare.php\" method=\"get\">";

        $rets .= "<postfield name=\"action\" value=\"$action\"/>";

        $rets .= "<postfield name=\"sex\" value=\"$sex\"/>";      

        $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";

        $rets .= "</go></anchor><br/>";



       echo $rets;



    }





}else{

echo "<p align=\"center\">";

echo "<b>No Dares At Preset Time!</b><br/>";

}

echo "<br/><a href=\"dare.php?action=add\">Add Dare</a><br/>";

echo "<a href=\"dare.php?action=main\">Dares</a><br/>";

  echo "<br/><a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

  echo "</card>";

}





/////////////////////////////////////////////////////////////////////

else if($action=="details")

{



$dare = mysql_fetch_array(mysql_query("SELECT dare, title, uid, hidden, id, pic, who, whohid, gold FROM ibwf_dares WHERE id='".$did."'"));

$multidare = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_daresmore WHERE did='".$did."' AND uid='".$uid."'"));

$ddare = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_daresmore WHERE did='".$did."'"));

echo "<card id=\"main\" title=\"wapirate\">";

echo "<p align=\"center\">";

echo "<b>$dare[1]</b><br/><br/>";

if($dare[3]==0){

$nick = getnick_uid($dare[2]);

$lnk = "<a href=\"index.php?action=viewuser&amp;who=$dare[2]\">$nick</a>";

}else{

$lnk = "Anonymous!";

}

$text = parsepm($dare[0], $sid,left,$dare[2]);

echo "$lnk Dare:<br/>$text<br/>";

$dare[8] = $dare[8] * 2;

echo "Dare is worth $dare[8] Gold<br/>";

if($dare[5]!=""){

if($dare[7]==0){

$cnick = getnick_uid($dare[6]);

$com = "<a href=\"index.php?action=viewuser&amp;who=$dare[6]\">$cnick</a>";

}else{

$com = "Anonymous!";

$cnick = $com;

}

echo "<br/><b>Completed By: $com</b><br/>";

echo "<a href=\"$dare[5]\"><img src=\"$dare[5]\" alt=\"\" width=\"150\" height=\"150\"/></a><br/>";



if($dare[6]!=$uid){

//echo "<br/><a href=\"dare.php?action=give&amp;did=$did\">Give $cnick Gold </a><br/>For Being Brave And Doing This Dare First!<br/><br/>";



if(($multidare[0]<1)&&($dare[2]!=$uid)&&($dare[6]!=$uid)){

echo "<a href=\"/xhtml/dare.php?action=complete3&amp;did=$did\">Do Dare!</a><br/>";

}

}

}else{

if($dare[2]!=$uid){

echo "<a href=\"/xhtml/dare.php?action=complete&amp;did=$did\">Do Dare</a><br/>";

}else{

echo "<a href=\"dare.php?action=edit&amp;did=$did\">Edit Dare</a><br/>";

}

}



if($ddare[0]>0){

echo "<a href=\"dare.php?action=ddares&amp;did=$did\">Other Challangers! [$ddare[0]]</a><br/>";

}



 $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_darecom WHERE did='".$did."'"));

echo "<a href=\"dare.php?action=cmt&amp;did=$did\">Dare Comments [$noi[0]]</a><br/>";

echo "<a href=\"dare.php?action=main\">Dares</a><br/>";

  echo "<br/><a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

  echo "</card>";

}



////////////////////////////////////////

else if($action=="ddares")

{



  echo "<card id=\"main\" title=\"wapirate\">";

echo "<p align=\"center\">";

echo "<b>Dares</b><br/>";

echo "</p>";

    if($page=="" || $page<=0)$page=1;

 $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_daresmore WHERE did='".$did."'"));

    $num_items = $noi[0]; //changable

$items_per_page= 5;

    $num_pages = ceil($num_items/$items_per_page);

    if($page>$num_pages)$page= $num_pages;

    $limit_start = ($page-1)*$items_per_page;

if($num_items>0)

    {



    //changable sql

    $sql = "

    SELECT id, uid, hidden, pic FROM ibwf_daresmore WHERE did='".$did."' ORDER BY id DESC

            LIMIT $limit_start, $items_per_page

    ";



    echo "<p align=\"center\">";

    $items = mysql_query($sql);

    echo mysql_error();

    while ($item = mysql_fetch_array($items))

    {



if($item[2]==0){

$nick = getnick_uid($item[1]);

$lnk = "<a href=\"index.php?action=viewuser&amp;who=$item[1]\">$nick</a>";

}else{

$lnk = "Anonymous!";

}

/*

if(isstatus8(getuid_sid($sid))){

$del = "<a href=\"dare.php?action=deldm&amp;did=$item[0]\">[x]</a><br/>";

}*/





echo "<br/><b>Completed By: $lnk</b><br/>";

echo "<a href=\"$item[3]\"><img src=\"$item[3]\" alt=\"\" width=\"150\" height=\"150\"/></a> $del<br/><br/>";





}

    echo "</p>";

    echo "<p align=\"center\">";



if($page > 1){ 

    $prev = ($page - 1);

    echo "<a href=\"dare.php?action=$action&amp;page=$prev&amp;sex=$sex\">Previous</a> ";

}





if($page < $num_pages){ 

    $next = ($page + 1); 

    echo "<a href=\"dare.php?action=$action&amp;page=$next&amp;sex=$sex\">Next</a><br/>"; 

}

echo "<br/>$page/$num_pages<br/>"; 



    if($num_pages>2)

    {





        $rets = "Jump To Page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";

        $rets .= "<anchor>[GO]";

        $rets .= "<go href=\"dare.php\" method=\"get\">";

        $rets .= "<postfield name=\"action\" value=\"$action\"/>";

        $rets .= "<postfield name=\"sex\" value=\"$sex\"/>";      

        $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";

        $rets .= "</go></anchor><br/>";



       echo $rets;



    }





}else{

echo "<p align=\"center\">";

echo "<b>No Dares Complete At Preset Time!</b><br/>";

}

echo "<a href=\"dare.php?action=details&amp;did=$did\">Dare</a><br/>";

$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_darecom WHERE did='".$did."'"));

echo "<a href=\"dare.php?action=cmt&amp;did=$did\">Dare Comments [$noi[0]]</a><br/>";

echo "<a href=\"dare.php?action=main\">All Dares</a><br/>";

  echo "<br/><a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

  echo "</card>";

}





//////////////////////////////

else if($action=="edit")

{

  echo "<card id=\"main\" title=\"wapirate\">";

echo "<p align=\"center\">";

$udare = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_dares WHERE id='".$did."'"));

if($udare[0]==$uid){

    echo "<onevent type=\"onenterforward\">";

$name = mysql_fetch_array(mysql_query("SELECT title FROM ibwf_dares WHERE id='".$did."'"));

$dare = mysql_fetch_array(mysql_query("SELECT dare FROM ibwf_dares WHERE id='".$did."'"));

$hid = mysql_fetch_array(mysql_query("SELECT hidden FROM ibwf_dares WHERE id='".$did."'"));

$sex = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_dares WHERE id='".$did."'"));



  echo "<refresh>

        <setvar name=\"name\" value=\"$name[0]\"/>

        <setvar name=\"dare\" value=\"$dare[0]\"/>

        <setvar name=\"anonymous\" value=\"$hid[0]\"/>

        <setvar name=\"sex\" value=\"$sex[0]\"/>";

  echo "</refresh></onevent>";







echo "<b>Add Dare</b><br/>";

echo "Name Of Dare:<br/> <input name=\"name\" value=\"$name[0]\" maxlength=\"50\"/><br/>";

echo "Dare:<br/> <input name=\"dare\" value=\"$dare[0]\" maxlength=\"255\"/><br/>";

echo "Anonymous Dare:<br/><select name=\"anonymous\" value=\"$hid[0]\">";

echo "<option value=\"1\">yes</option>";

echo "<option value=\"0\">no</option>";

echo "</select><br/>";

echo "Dare For Which Gender:<br/><select name=\"sex\" value=\"$sex[0]\">";

echo "<option value=\"m\">Male</option>";

echo "<option value=\"f\">Female</option>";

echo "<option value=\"b\">Either</option>";

echo "</select><br/>";



    echo "<anchor>Edit";

    echo "<go href=\"dare.php?action=edit2&amp;did=$did\" method=\"post\">";

    echo "<postfield name=\"name\" value=\"$(name)\"/>";

    echo "<postfield name=\"dare\" value=\"$(dare)\"/>";

    echo "<postfield name=\"anonymous\" value=\"$(anonymous)\"/>";

    echo "<postfield name=\"sex\" value=\"$(sex)\"/>";

    echo "</go></anchor><br/><br/>";



}



echo "<a href=\"dare.php?action=details&amp;did=$did\">Dare</a><br/>";

echo "<a href=\"dare.php?action=main\">All Dares</a><br/>";

  echo "<br/><a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

  echo "</card>";

}





/////////////////////////////////////////

else if($action=="edit2")

{



  echo "<card id=\"main\" title=\"wapirate\">";

echo "<p align=\"center\">";

$name = $_POST["name"];

$anonymous = $_POST["anonymous"];

$dare = $_POST["dare"];

$sex = $_POST["sex"];



$udare = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_dares WHERE id='".$did."'"));

if($udare[0]==$uid){

if(($dare=="")||($name==""))

{

echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";

      echo "<b>Please Fill In All Details!</b><br/>";

}else{



mysql_query("UPDATE ibwf_dares SET sex='".$sex."', dare='".$dare."', hidden='".$anonymous."', title='".$name."' WHERE id='".$did."'");





echo "<img src=\"images/ok.gif\" alt=\"0\"/><br/>";

      echo "<b>Dare Edited Successfully!</b><br/>";

}

}

echo "<a href=\"dare.php?action=details&amp;did=$did\">Dare</a><br/>";

echo "<a href=\"dare.php?action=main\">All Dares</a><br/>";

  echo "<br/><a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

  echo "</card>";

}





////////////////////////////////////////

else if($action=="cmt")

{



  echo "<card id=\"main\" title=\"wapirate\">";

echo "<p align=\"center\">";

echo "<b>Dare Comments</b><br/>";

echo "</p>";

    if($page=="" || $page<=0)$page=1;

 $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_darecom WHERE did='".$did."'"));

    $num_items = $noi[0]; //changable

$items_per_page= 5;

    $num_pages = ceil($num_items/$items_per_page);

    if($page>$num_pages)$page= $num_pages;

    $limit_start = ($page-1)*$items_per_page;

if($num_items>0)

    {



    //changable sql

    $sql = "

    SELECT id, uid, did, text, time, hidden  FROM ibwf_darecom WHERE did='".$did."' ORDER BY id DESC

            LIMIT $limit_start, $items_per_page

    ";

    echo "<p>";

    $items = mysql_query($sql);

    echo mysql_error();

    while ($item = mysql_fetch_array($items))

    {

$nick = getnick_uid($item[1]);



$text = parsepm($item[3], $sid,left,$item[1]);

$tmstamp = $item[4];

  $tmdt = date("d m Y - H:i:s", $tmstamp);

if($item[5]==0){

      $lnk = "<a href=\"index.php?action=viewuser&amp;who=$item[1]\">$nick</a>:$text<br/>$tmdt";

}else{

$lnk = "Anonymous: $text<br/>$tmdt";

}



if(isstatus8(getuid_sid($sid))){

$dlnk = "<a href=\"dare.php?action=delc&amp;cid=$item[0]\">[x]</a>";

}





      echo "$lnk $dlnk<br/><br/>";

}

    echo "</p>";

    echo "<p align=\"center\">";



if($page > 1){ 

    $prev = ($page - 1);

    echo "<a href=\"dare.php?action=$action&amp;page=$prev&amp;did=$did\">Previous</a> ";

}





if($page < $num_pages){ 

    $next = ($page + 1); 

    echo "<a href=\"dare.php?action=$action&amp;page=$next&amp;did=$did\">Next</a><br/>"; 

}

echo "<br/>$page/$num_pages<br/>"; 



    if($num_pages>2)

    {

 



        $rets = "Jump To Page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";

        $rets .= "<anchor>[GO]";

        $rets .= "<go href=\"dare.php\" method=\"get\">";

        $rets .= "<postfield name=\"action\" value=\"$action\"/>";

        $rets .= "<postfield name=\"did\" value=\"$did\"/>";      

        $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";

        $rets .= "</go></anchor><br/>";



      echo $rets;



    }





}else{

echo "<p align=\"center\">";

echo "<b>No Comments On This Dare!</b><br/>";

}



echo "<br/><a href=\"dare.php?action=addcmt&amp;did=$did\">Add Comment</a><br/>";

echo "<a href=\"dare.php?action=details&amp;did=$did\">Dare</a><br/>";

echo "<a href=\"dare.php?action=main\">All Dares</a><br/>";

  echo "<br/><a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

  echo "</card>";

}

///////////////////////////////////////////////

else if($action=="addcmt")

{



  echo "<card id=\"main\" title=\"wapirate\">";

echo "<p align=\"center\">";



echo "<b>Add Comments</b><br/>";



echo "<b>Type Your Comment</b><br/>";

echo "Text:<br/> <input name=\"text\" size=\"12\" maxlength=\"250\"/><br/>";

echo "Anonymous Comment:<br/><select name=\"anonymous\">";

echo "<option value=\"1\">yes</option>";

echo "<option value=\"0\">no</option>";

echo "</select><br/>";

    echo "<anchor>Send";

    echo "<go href=\"dare.php?action=addcmt2&amp;did=$did\" method=\"post\">";

    echo "<postfield name=\"text\" value=\"$(text)\"/>";

   echo "<postfield name=\"anonymous\" value=\"$(anonymous)\"/>";

    echo "</go></anchor><br/>";





echo "<a href=\"dare.php?action=cmt&amp;did=$did\">Dare Comments</a><br/>";

echo "<a href=\"dare.php?action=details&amp;did=$did\">Dare</a><br/>";

echo "<a href=\"dare.php?action=main\">All Dares</a><br/>";

  echo "<br/><a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

  echo "</card>";

}

////////////////////////////////////////////////////

else if($action=="addcmt2")

{

  echo "<card id=\"main\" title=\"wapirate\">";

echo "<p align=\"center\">";

echo "<b>Add Comments</b><br/>";

$text = $_POST["text"];

$anonymous = $_POST["anonymous"];

if($text=="")

{

echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";

      echo "<b>Error: No Text!</b><br/>";

}else{

$time = time();

mysql_query("INSERT INTO ibwf_darecom SET uid='".$uid."', did='".$did."', text='".$text."', hidden='".$anonymous."',  time='".$time."'");

echo "<img src=\"images/ok.gif\" alt=\"x\"/><br/>";

      echo "<b>Comment Added Successfully!</b><br/>";

}

echo "<a href=\"dare.php?action=cmt&amp;did=$did\">Dare Comments</a><br/>";

echo "<a href=\"dare.php?action=details&amp;did=$did\">Dare</a><br/>";

echo "<a href=\"dare.php?action=main\">All Dares</a><br/>";

  echo "<br/><a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

  echo "</card>";

}



////////////////////////////////////////////////////

else if($action=="delc")

{

$cid = $_GET["cid"];

  echo "<card id=\"main\" title=\"wapirate\">";

echo "<p align=\"center\">";

echo "<b>Delete Comments</b><br/>";

if(isstatus8(getuid_sid($sid))){

      

mysql_query("DELETE FROM ibwf_darecom WHERE id='".$cid."'");

echo "<img src=\"images/ok.gif\" alt=\"*\"/><br/>";

      echo "<b>Comment Deleted Sucessfully!</b><br/>";

}else{

echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";

      echo "<b>Error Deleting Comment!</b><br/>";

}

echo "<a href=\"dare.php?action=cmt&amp;did=$did\">Dare Comments</a><br/>";

echo "<a href=\"dare.php?action=details&amp;did=$did\">Dare</a><br/>";

echo "<a href=\"dare.php?action=main\">All Dares</a><br/>";

  echo "<br/><a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

  echo "</card>";

}



////////////////////////////////////////////////////

else if($action=="deld")

{

$did = $_GET["did"];

  echo "<card id=\"main\" title=\"wapirate\">";

echo "<p align=\"center\">";

echo "<b>Delete Dare</b><br/>";

if(isstatus8(getuid_sid($sid))){

   

$dare = mysql_fetch_array(mysql_query("SELECT pic FROM ibwf_dares WHERE id='".$did."'"));

$ran = explode("/",$dare[0]);



$old = getcwd(); 

chdir(dares);

$new = unlink($ran[2]);

chdir($old); 

mysql_query("DELETE FROM ibwf_dares WHERE id='".$did."'");

mysql_query("DELETE FROM ibwf_darecom WHERE did='".$did."'");

echo "<img src=\"images/ok.gif\" alt=\"*\"/><br/>";

      echo "<b>Dare Deleted Sucessfully!</b><br/>";

}else{

echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";

      echo "<b>Error Deleting Dare!</b><br/>";

}

echo "<a href=\"dare.php?action=main\">Dares</a><br/>";

  echo "<br/><a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

  echo "</card>";

}



/////////////////////////////////////////////////////////

else{

  echo "<card id=\"main\" title=\"wapirate\">";

echo "<p align=\"center\">";

echo "Nothing To Show Here lol!<br/><br/>";

  echo "<br/><a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

  echo "</card>";

}

?>

</wml>