Videos uploader

Started on the old forum in September 2009 · view the original in the archive · old links redirect here

1 reply · 337 views · started 17 years ago · 1 min read

2 participants
riderz Lead · 975 posts #1

Hey i want to make a place where ppl upload their videos who can help me to change this upload to support 3gp mp4 upload.php

<?php

include("config.php");
include("core.php");
include("xhtmlfunctions.php");
include("themecs.php");
include("class.upload.php");

header("Content-type: text/html; charset=ISO-8859-1");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";

echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
?>

<?php
$bcon = connectdb();
if (!$bcon)
{
    echo xhtmlheadnotheme("$sitetitle (DB Error!)");
    echo "<p align=\"center\">";
    echo "<img src=\"images/exit.gif\" alt=\"*\"/><br/>";
    echo "ERROR! cannot connect to database<br/><br/>";
    echo "This error happens usually when backing up the database, please be patient, The site will be up any minute<br/><br/>";
    echo "<b>THANK YOU VERY MUCH</b><br/><br/>";
    echo "<a href=\"http://wapb2b.playfon.com/?d_e=79772025\">1000's of Downloads</a><br/>";
          echo "<a href=\"http://click.buzzcity.com/click.php?bid=1&partnerid=10019\"><img src=\"http://ads.buzzcity.com/show.php?bid=1&partnerid=10019\" alt=\"\" /></a>";
    echo "</p>";
    echo xhtmlfoot();
    exit();
}

$sid = $_GET["sid"];
$uid = getuid_sid($sid);
$descript = $_POST["descript"];
$theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));

if(islogged($sid)==false)
    {
      echo xhtmlheadnotheme("$sitetitle (Not Logged In!)");
      echo "<p align=\"center\">";
      echo "You are not logged in<br/>";
      echo "Or Your session has been expired<br/><br/>";
      echo "</p>";
      echo "<p align=\"center\">";
      echo "<form action=\"login.php\" method=\"get\">";
      echo "Username:<input name=\"loguid\" size=\"8\" maxlength=\"30\"/><br/>";
      echo "Password:<input name=\"logpwd\" size=\"8\" maxlength=\"30\" type=\"password\" /><br/>";
      echo "<input type=\"submit\" value=\"Login\"/>";
      echo "</form>"; 
      echo "</p>";
      echo xhtmlfoot();
      exit();
    } 

if(isbanned($uid))
    {
      echo xhtmlheadnotheme("$sitetitle (BANNED!)");
      echo "<p align=\"center\">";
      echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";
      echo "You are <b>Banned</b><br/>";
      $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_metpenaltiespl WHERE uid='".$uid."' AND penalty='1'"));
          $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));          
      $remain = $banto[0]- time() ;
      $rmsg = gettimemsg($remain);
      echo "Time to finish your penalty: $rmsg<br/><br/>";
          echo "Ban Reason: $banres[0]";
      echo "</p>";
      echo xhtmlfoot();
      exit();
    }

error_reporting(E_ALL); 

$userinfo = mysql_fetch_array(mysql_query("SELECT name, sex FROM ibwf_users WHERE id='".$uid."'"));
$membername = $userinfo[0];

////////////////////////////////////////UPLOADING AND HANDLING THE IMAGE
if ($_POST['action'] == 'image')
{

      addonline(getuid_sid($sid),"Uploading Photo - xHTML:v3","");
      echo xhtmlheadnotheme("Uploading Photo");
          echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">";
      echo "<p align=\"center\">";

    // ---------- IMAGE UPLOAD ----------
    
    // we create an instance of the class, giving as argument the PHP object 
    // corresponding to the file field from the form
    // All the uploads are accessible from the PHP object $_FILES
    $handle = new Upload($_FILES['f1']);

    // then we check if the file has been uploaded properly
    // in its *temporary* location in the server (often, it is /wap/usergallery)
    if ($handle->uploaded) {
        
        // yes, the file is on the server
        // below are some example settings which can be used if the uploaded file is an image.
        $handle->image_resize            = true;
        $handle->image_ratio_y           = true;
        $handle->image_x                 = 200;

        // now, we start the upload 'process'. That is, to copy the uploaded file
        // from its temporary location to the wanted location
        // It could be something like $handle->Process('/home/www/my_uploads/');
        $handle->Process('../gallery');
        
        // we check if everything went OK
        if ($handle->processed) {
            // everything was fine !
            
            echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"60\" width=\"159\">";
echo "<tr>";
echo "<td id=\"logo\" width=\"155\">";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<table border=\"0\" width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" class=\"boxed\" align=\"center\">";
echo "<tr>";
echo "<td class=\"boxedTitle\" height=\"20\">";

echo "<h1 align=\"center\" class=\"boxedTitleText\">";

            echo '  File uploaded with success<br/>';
            echo "</h1>";
            

echo "</td>";
echo "</tr>";

echo "<td class=\"boxedContent\"><center>";
            echo '  <img src="'. $imgpath . '/' . $handle->file_dst_name . '" /><br/>';
            $info = getimagesize($handle->file_dst_pathname);
            $imageurl = "$imgpath/$handle->file_dst_name";
            $reg = mysql_query("INSERT INTO ibwf_usergallery SET uid='".$uid."', imageurl='".$imageurl."', sex='".$userinfo[1]."', time='".time()."', descript='".$descript."'");

        } else {
            // one error occured

            echo '  File not uploaded to the wanted location<br/>';
            echo '  Error: ' . $handle->error . '<br/>';

        }

        // we delete the temporary files
        $handle-> Clean();

    } else {
        // if we're here, the upload file failed for some reasons
        // i.e. the server didn't receive the file

        echo '  File not uploaded on the server<br/>';
        echo '  Error: ' . $handle->error . '';

    }

    echo "</center>";
  
  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"gallery.php?action=main&sid=$sid\">Gallery</a>";
  echo " > ";
  echo "Uploading Photo";
  echo "</small></p>";  
  
  echo xhtmlfoot();
}
?>

sql

--
-- Table structure for table `ibwf_uservideos`
--

CREATE TABLE IF NOT EXISTS `ibwf_uservideos` (
  `id` int(100) NOT NULL auto_increment,
  `uid` int(100) NOT NULL default '0',
  `imageurl` varchar(100) NOT NULL default '',
  `sex` char(1) NOT NULL default '',
  `time` int(100) NOT NULL default '0',
  `descript` varchar(200) NOT NULL default '',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1180 ;# MySQL returned an empty result set (i.e. zero rows).

-- --------------------------------------------------------

--
-- Table structure for table `ibwf_uservideos_rating`
--

CREATE TABLE IF NOT EXISTS `ibwf_uservideos_rating` (
  `id` int(100) NOT NULL auto_increment,
  `imageid` int(100) NOT NULL default '0',
  `rating` int(100) NOT NULL default '0',
  `comments` varchar(250) NOT NULL default '',
  `commentsreply` varchar(250) NOT NULL default '',
  `byuid` int(100) NOT NULL default '0',
  `time` int(100) NOT NULL default '0',
  `commentsyn` char(1) NOT NULL default '',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3623 ;# MySQL returned an empty result set (i.e. zero rows).

video.php

<?php

include("config.php");
include("core.php");
include("xhtmlfunctions.php");
include("themecs.php");

header("Content-type: text/html; charset=ISO-8859-1");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
?>
<?php
$bcon = connectdb();
if (!$bcon)
{
    echo xhtmlheadnotheme("$sitetitle (DB Error!)");
    echo "<p align=\"center\">";
    echo "<img src=\"images/exit.gif\" alt=\"*\"/><br/>";
    echo "ERROR! cannot connect to database<br/><br/>";
    echo "This error happens usually when backing up the database, please be patient, The site will be up any minute<br/><br/>";
    echo "<b>THANK YOU VERY MUCH</b><br/><br/>";
     echo "</p>";
    echo xhtmlfoot();
    exit();
}

$action = $_GET["action"];
$page = $_GET["page"];
$sid = $_GET["sid"];
$whoimage = $_GET["whoimage"];
$uid = getuid_sid($sid);
$theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));
$popuppm = mysql_fetch_array(mysql_query("SELECT popuppm FROM ibwf_users WHERE id='".$uid."'"));

if(islogged($sid)==false)
    {
      echo xhtmlheadnotheme("$sitetitle (Not Logged In!)");
      echo "<p align=\"center\">";
      echo "You are not logged in<br/>";
      echo "Or Your session has been expired<br/><br/>";
      echo "</p>";
      echo "<p align=\"center\">";
      echo "<form action=\"login.php\" method=\"get\">";
      echo "Username:<input name=\"loguid\" size=\"8\" maxlength=\"30\"/><br/>";
      echo "Password:<input name=\"logpwd\" size=\"8\" maxlength=\"30\" type=\"password\" /><br/>";
      echo "<input type=\"submit\" value=\"Login\"/>";
      echo "</form>";
      echo "</p>";
      echo xhtmlfoot();
      exit();
    }

if(isbanned($uid))
    {
      echo xhtmlheadnotheme("$sitetitle (BANNED!)");
      echo "<p align=\"center\">";
      echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";
      echo "You are <b>Banned</b><br/>";
      $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_metpenaltiespl WHERE uid='".$uid."' AND penalty='1'"));
          $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));
      $remain = $banto[0]- time() ;
      $rmsg = gettimemsg($remain);
      echo "Time to finish your penalty: $rmsg<br/><br/>";
          echo "Ban Reason: $banres[0]";
      echo "</p>";
      echo xhtmlfoot();
      exit();
    }

////////////////////////////////////////VIDEOS MAIN PAGE
if($action=="main")
{
  addonline(getuid_sid($sid),"Videos - xHML:v3","");
      echo "<head>\n";
          echo "<title>Adult</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">";
                    echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />\n";
      echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />\n";
      echo "<meta http-equiv=\"Pragma\" content=\"no-cache\" />\n";
          echo "</head>";
      echo "<body>";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"60\" width=\"159\">";
echo "<tr>";
echo "<td id=\"body\" width=\"159\">";
echo "</td>";
echo "</tr>";
echo "</table>";

 echo "<table border=\"0\" width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" class=\"boxed\" align=\"center\">";
echo "<tr>";
echo "<td class=\"boxedTitle\" height=\"20\">";
echo "<h1 align=\"center\" class=\"boxedTitleText\">Videos</h1></td>";
echo "</tr>";

echo "<td class=\"boxedContent\">";

                                        echo "<small>";
                                                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_uservideos WHERE sex='F'"));
                                                  echo "<a href=\"video.php?action=females&sid=$sid\"><img src=\"images/female.gif\" alt=\"*\"/>Females</a>($noi[0])<br/>";
                                                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_uservideos WHERE sex='M'"));
                                                  echo "<a href=\"video.php?action=males&sid=$sid\"><img src=\"images/male.gif\" alt=\"*\"/>Males</a>($noi[0])";
                                        echo "</td>";
                                echo "</tr>";
                        echo "</table>";
                echo "</div>";
                echo "</div>";

  echo "</div>";

    echo "<p align=\"center\">";
            echo "<a href=\"video.php?action=upload&sid=$sid\">Add Your Videos</a>";
    echo "</p>";

  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "Videos";
  echo "</small></p>";

  echo xhtmlfoot();
}

////////////////////////////////////////MALE VIDEOS
else if($action=="males")
{
  addonline(getuid_sid($sid),"Male Videos - xHML:v3","");
      echo "<head>\n";
          echo "<title>Adult</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">";
                    echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />\n";
      echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />\n";
      echo "<meta http-equiv=\"Pragma\" content=\"no-cache\" />\n";
          echo "</head>";
      echo "<body>";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"60\" width=\"159\">";
echo "<tr>";
echo "<td id=\"body\" width=\"159\">";
echo "</td>";
echo "</tr>";
echo "</table>";

 echo "<table border=\"0\" width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" class=\"boxed\" align=\"center\">";
echo "<tr>";
echo "<td class=\"boxedTitle\" height=\"20\">";
echo "<h1 align=\"center\" class=\"boxedTitleText\">Male Videos</h1></td>";
echo "</tr>";

echo "<td class=\"boxedContent\">";

    echo "<small>";

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

                                            if($who!="")
                                            {
                                            $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_uservideos WHERE sex='M'"));
                                            }else{
                                            $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_uservideos WHERE sex='M'"));
                                            }

                                            $num_items = $noi[0]; //changable
                                            $items_per_page= 10;
                                            $num_pages = ceil($num_items/$items_per_page);
                                            if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                                            $limit_start = ($page-1)*$items_per_page;

                                                $sql = "SELECT DISTINCT `uid` FROM `ibwf_uservideos` WHERE sex='M' ORDER BY `id` DESC LIMIT $limit_start , $items_per_page";

                                            $items = mysql_query($sql);
                                            echo mysql_error();

                                            if(mysql_num_rows($items)>0)
                                            {
                                            while ($item = mysql_fetch_array($items))
                                            {
                                                $who = $item[0];

                                                $user=getnick_uid($who);
                                        $avlink = getavatar($item[0]);
if ($avlink!=""){
echo "<img src=\"$avlink\" height=\"25\" width=\"25\" alt=\"avatar\"/>";
}else{
echo "<img src=\"/images/nopic.jpg\" height=\"25\" width=\"25\" alt=\"avatar\"/>";
}
                                                $countpics = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_uservideos WHERE uid='".$who."'"));
                                                $lnk = "<a href=\"video.php?action=viewuservideo&who=$who&sid=$sid\">$user($countpics[0])</a><br/>";
                                               echo "$lnk";
                                            }
                                            }
                                        echo "</td>";
                                echo "</tr>";
                        echo "</table>";
                echo "</div>";
                echo "</div>";

  echo "</div>";

    echo "<p align=\"center\">";
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"video.php?action=$action&page=$ppage&sid=$sid\"><small>« Prev</small></a> ";
    }
    echo "<small> $page/$num_pages </small>";
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"video.php?action=$action&page=$npage&sid=$sid\"><small>Next »</small></a>";
    }
    if($num_pages>2)
    {
        $rets = "<center><form action=\"video.php\" method=\"get\">";
        $rets .= "Jump to page:<input name=\"page\" format=\"*N\" size=\"3\"/><br/>";
        $rets .= "<input type=\"submit\" value=\"GO\"/>";
        $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
        $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
        $rets .= "</form></center>";
        echo $rets;
    }
    echo "</p>";

  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"video.php?action=main&sid=$sid\">Videos</a>";
  echo " > ";
  echo "Male Videos";
  echo "</small></p>";

  echo xhtmlfoot();
}

////////////////////////////////////////FEMALE VIDEOS
else if($action=="females")
{
  addonline(getuid_sid($sid),"Female Videos - xHML:v3","");
      echo "<head>\n";
          echo "<title>Adult</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">";
                    echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />\n";
      echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />\n";
      echo "<meta http-equiv=\"Pragma\" content=\"no-cache\" />\n";
          echo "</head>";
      echo "<body>";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"60\" width=\"159\">";
echo "<tr>";
echo "<td id=\"body\" width=\"159\">";
echo "</td>";
echo "</tr>";
echo "</table>";

 echo "<table border=\"0\" width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" class=\"boxed\" align=\"center\">";
echo "<tr>";
echo "<td class=\"boxedTitle\" height=\"20\">";
echo "<h1 align=\"center\" class=\"boxedTitleText\">Female Videos</h1></td>";
echo "</tr>";

echo "<td class=\"boxedContent\">";

    echo "<small>";

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

                                            if($who!="")
                                            {
                                            $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_uservideos WHERE sex='F'"));
                                            }else{
                                            $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_uservideos WHERE sex='F'"));
                                            }

                                            $num_items = $noi[0]; //changable
                                            $items_per_page= 10;
                                            $num_pages = ceil($num_items/$items_per_page);
                                            if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                                            $limit_start = ($page-1)*$items_per_page;

                                                $sql = "SELECT DISTINCT `uid` FROM `ibwf_uservideos` WHERE sex='F' ORDER BY `id` DESC LIMIT $limit_start , $items_per_page";

                                            $items = mysql_query($sql);
                                            echo mysql_error();

                                            if(mysql_num_rows($items)>0)
                                            {
                                            while ($item = mysql_fetch_array($items))
                                            {
                                                $who = $item[0];

                                                $user=getnick_uid($who);
                                        $avlink = getavatar($item[0]);
if ($avlink!=""){
echo "<img src=\"$avlink\" height=\"25\" width=\"25\" alt=\"avatar\"/>";
}else{
echo "<img src=\"/images/nopic.jpg\" height=\"25\" width=\"25\" alt=\"avatar\"/>";
}
                                                $countpics = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_uservideos WHERE uid='".$who."'"));
                                                $lnk = "<a href=\"video.php?action=viewuservideo&who=$who&sid=$sid\">$user($countpics[0])</a><br/>";
                                               echo "$lnk";
                                            }
                                            }
                                        echo "</td>";
                                echo "</tr>";
                        echo "</table>";
                echo "</div>";
                echo "</div>";

  echo "</div>";

    echo "<p align=\"center\">";
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"video.php?action=$action&page=$ppage&sid=$sid\"><small>« Prev</small></a> ";
    }
    echo "<small> $page/$num_pages </small>";
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"video.php?action=$action&page=$npage&sid=$sid\"><small>Next »</small></a>";
    }
    if($num_pages>2)
    {
        $rets = "<center><form action=\"video.php\" method=\"get\">";
        $rets .= "Jump to page:<input name=\"page\" format=\"*N\" size=\"3\"/><br/>";
        $rets .= "<input type=\"submit\" value=\"GO\"/>";
        $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
        $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
        $rets .= "</form></center>";
        echo $rets;
    }
    echo "</p>";

  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"video.php?action=main&sid=$sid\">Videos</a>";
  echo " > ";
  echo "Female Videos";
  echo "</small></p>";

  echo xhtmlfoot();
}

else if($action=="viewuservideo")
{
  addonline(getuid_sid($sid),"Viewing Users Video's - xHTML:v3","");
      echo "<head>\n";
          echo "<title>Adult</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">";
                    echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />\n";
      echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />\n";
      echo "<meta http-equiv=\"Pragma\" content=\"no-cache\" />\n";
          echo "</head>";
      echo "<body>";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"60\" width=\"159\">";
echo "<tr>";
echo "<td id=\"body\" width=\"159\">";
echo "</td>";
echo "</tr>";
echo "</table>";

 echo "<table border=\"0\" width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" class=\"boxed\" align=\"center\">";
echo "<tr>";
echo "<td class=\"boxedTitle\" height=\"20\">";
echo "<h1 align=\"center\" class=\"boxedTitleText\">Viewing Videos</h1></td>";
echo "</tr>";
echo "<tr>";
echo "<td class=\"boxedContent\">";

    echo "<small>";

  $who = $_GET["who"];
  $uid1 = getuid_sid($sid);
  $nick = getnick_uid($who);

                        echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"169\">";

                                        echo "<center>";
                                            if($page=="" || $page<=0)$page=1;
                                            $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_uservideos WHERE uid='".$who."'"));
                                            $num_items = $noi[0]; //changable
                                            $items_per_page= 1;
                                            $num_pages = ceil($num_items/$items_per_page);
                                            if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                                            $limit_start = ($page-1)*$items_per_page;

                                            //changable sql

                                            $sql = "SELECT uid, id, imageurl, sex, descript FROM ibwf_uservideos WHERE uid='".$who."' ORDER BY time DESC LIMIT $limit_start, $items_per_page";

                                            $items = mysql_query($sql);

                                            echo mysql_error();
                                            if(mysql_num_rows($items)>0)
                                            {
                                            while ($item = mysql_fetch_array($items))
                                            {
                                                        $sql = "SELECT rating FROM ibwf_uservideos_rating WHERE imageid='".$item[1]."'";
                                                        $imginfo = mysql_query($sql);

                                                        echo mysql_error();
                                                if(mysql_num_rows($imginfo)>0)
                                                {
                                                   while ($imginfos = mysql_fetch_array($imginfo)){
                                                      $ratingtotal = $ratingtotal + $imginfos[0];}
                                                }

                                                        if($totalcomments<1){$totalcomments=0;}
                                                        $norm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_uservideos_rating WHERE imageid='".$item[1]."'"));
                                                        if ($norm[0]>0){
                                                        $rating = ceil($ratingtotal/$norm[0]);
                                                        }else{$rating=0;}

                                                        $rated = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_uservideos_rating WHERE byuid='".$uid1."' and imageid ='".$item[1]."'"));
                                                        $totalcomments = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_uservideos_rating WHERE imageid ='".$item[1]."' and commentsyn ='Y'"));
                                                        $userinfo = mysql_fetch_array(mysql_query("SELECT name FROM ibwf_users WHERE id='".$item[0]."'"));

                                                if(canratephoto($uid1, $item[0]) and ($rated[0]==0))
                                                    {
                                                 echo "<a href=\"video.php?action=rate&sid=$sid&whoimage=$item[1]\">Rate This Video</a>";
                                                }/*
                                                if($uid1==$item[0])
                                                    {
                                                 echo "<a href=\"genproc.php?action=upavg&sid=$sid&avsrc=$item[2]\">Use As Avatar</a>";
                                                }*/
                                                if(($uid1=="1") or ($uid1==$item[0]))
                                                    {
                                                 echo " / <a href=\"video.php?action=del&sid=$sid&whoimage=$item[1]\">Delete</a>";
                                                }
                                                echo "<br/><a href=\"$item[2]\"><img src=\"$item[2]\" alt=\"$userinfo[0]: $page\"/></a><br/>";
                                                if($uid1==$item[0])
                                                    {
                                                    if(strlen($item[4])>1){
                                                $edtlnk = "<a href=\"video.php?action=edtdescript&sid=$sid&whoimage=$item[1]\">*</a>";
                                                }else{
                                                $edtlnk = "<a href=\"video.php?action=edtdescript&sid=$sid&whoimage=$item[1]\">*Add Description*</a>";
                                                }
                                                echo "<small>$item[4] </small>$edtlnk<br/><br/>";

                                                }
                                                echo "Rating: $rating/10 (<a href=\"video.php?action=votes&sid=$sid&whoimage=$item[1]\">$norm[0]</a> Votes)<br/><a href=\"video.php?action=comments&sid=$sid&whoimage=$item[1]\">Comments</a>($totalcomments[0])";
                                                echo "<br/>";
                                                $ratingtotal = 0;
                                                $sex = $item[3];

                                            }
                                            }
                                        echo "</td>";
                                echo "</tr>";
                        echo "</table>";
                echo "</div>";
                echo "</div>";

  echo "</div>";

    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"video.php?action=$action&sid=$sid&page=$ppage&who=$who\"><small>« Prev</small></a> ";
    }
    echo "<small> $page/$num_pages </small>";
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"video.php?action=$action&sid=$sid&page=$npage&who=$who\"><small>Next »</small></a>";
    }

    if($num_pages>2)
    {
        $rets = "<form action=\"video.php\" method=\"get\">";
        $rets .= "Jump to Video:<input name=\"page\" format=\"*N\" size=\"3\"/><br/>";
        $rets .= "<input type=\"submit\" value=\"GO\"/>";
        $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
        $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
        $rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\"/>";
        $rets .= "<input type=\"hidden\" name=\"page\" value=\"$(pg)\"/>";
        $rets .= "</form>";
        echo $rets;
    }
    echo "</center>";

  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"video.php?action=main&sid=$sid\">Videos</a>";
  echo " > ";
  if ($sex=="M"){
  echo "<a href=\"video.php?action=males&sid=$sid\">Male Videos</a>";
  }else{
  echo "<a href=\"video.php?action=females&sid=$sid\">Female Videos</a>";
  }
  echo " > ";
  echo "$userinfo[0]";
  echo "</small></p>";

  echo xhtmlfoot();
}

////////////////////////////////////////RATE A VIDEO
else if($action=="rate")
{
   addonline(getuid_sid($sid),"Viewing Users Video's - xHTML:v3","");
      echo "<head>\n";
          echo "<title>Adult</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">";
                    echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />\n";
      echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />\n";
      echo "<meta http-equiv=\"Pragma\" content=\"no-cache\" />\n";
          echo "</head>";
      echo "<body>";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"60\" width=\"159\">";
echo "<tr>";
echo "<td id=\"body\" width=\"159\">";
echo "</td>";
echo "</tr>";
echo "</table>";

 echo "<table border=\"0\" width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" class=\"boxed\" align=\"center\">";
echo "<tr>";
echo "<td class=\"boxedTitle\" height=\"20\">";
echo "<h1 align=\"center\" class=\"boxedTitleText\">rating user Video</h1></td>";
echo "</tr>";
echo "<tr>";
echo "<td class=\"boxedContent\">";

    echo "<small>";

  $uid1 = getuid_sid($sid);
  $item = mysql_fetch_array(mysql_query("SELECT uid, id, imageurl, sex FROM ibwf_uservideos WHERE uid='".$whoimage."'"));

  $rated = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_uservideos_rating WHERE byuid='".$uid1."' and imageid ='".$whoimage."'"));

  if(canratephoto($uid1, $item[0]) and ($rated[0]==0))
  {
  echo "<p align=\"center\"><small>";
  echo "Rate this members Video: 1=Low, 10=High<br/>You can also leave a comment for this video!<br/>";
  echo "<br/>";
  echo "</small></p>";
  echo "<p>";
    echo "<form action=\"video.php?action=rateuser&sid=$sid&whoimage=$whoimage\" method=\"post\">";
    echo "<small>Rate:</small> <select name=\"rate\" value=\"$rate[0]\">";
    echo "<option value=\"1\">1</option>";
    echo "<option value=\"2\">2</option>";
    echo "<option value=\"3\">3</option>";
    echo "<option value=\"4\">4</option>";
    echo "<option value=\"5\">5</option>";
    echo "<option value=\"6\">6</option>";
    echo "<option value=\"7\">7</option>";
    echo "<option value=\"8\">8</option>";
    echo "<option value=\"9\">9</option>";
    echo "<option value=\"10\">10</option>";
    echo "</select><br/>";

  echo "<small>Comments:</small> <input name=\"comment\" format=\"*M\" maxlength=\"200\"/><br/>";
  echo "<input type=\"submit\" value=\"Rate\"/>";
  echo "</form>";
  }else{
  echo "You have already rated this Video";
  }
  echo "</p>";

  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"video.php?action=main&sid=$sid\">Videos</a>";
  echo " > ";
  echo "Rating a Video";
  echo "</small></p>";

  echo xhtmlfoot();
}

////////////////////////////////////////READ COMMENTS
else if($action=="comments")
{
  addonline(getuid_sid($sid),"Reading Video's Comments - xHTML:v3","");
  addonline(getuid_sid($sid),"Viewing Users Video's - xHTML:v3","");
      echo "<head>\n";
          echo "<title>Adult</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">";
                    echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />\n";
      echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />\n";
      echo "<meta http-equiv=\"Pragma\" content=\"no-cache\" />\n";
          echo "</head>";
      echo "<body>";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"60\" width=\"159\">";
echo "<tr>";
echo "<td id=\"body\" width=\"159\">";
echo "</td>";
echo "</tr>";
echo "</table>";

 echo "<table border=\"0\" width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" class=\"boxed\" align=\"center\">";
echo "<tr>";
echo "<td class=\"boxedTitle\" height=\"20\">";
echo "<h1 align=\"center\" class=\"boxedTitleText\">read comments</h1></td>";
echo "</tr>";
echo "<tr>";
echo "<td class=\"boxedContent\">";

    echo "<small>";

      //////ALL LISTS SCRIPT <<

    if($page=="" || $page<=0)$page=1;
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_uservideos_rating WHERE imageid='".$whoimage."' and commentsyn ='Y'"));
    $num_items = $noi[0]; //changable
    $items_per_page= 5;
    $num_pages = ceil($num_items/$items_per_page);
    if(($page>$num_pages)&&$page!=1)$page= $num_pages;
    $limit_start = ($page-1)*$items_per_page;

    $uidinfo = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_uservideos WHERE id='".$whoimage."'"));
    $uid = getuid_sid($sid);

    $sql = "SELECT rating, comments, byuid, time, commentsreply, id  FROM ibwf_uservideos_rating WHERE imageid ='".$whoimage."' and commentsyn ='Y' ORDER BY time DESC LIMIT $limit_start, $items_per_page";

    echo "<p>";
    $items = mysql_query($sql);
    echo mysql_error();
    if(mysql_num_rows($items)>0)
    {
    while ($item = mysql_fetch_array($items))
    {

    if(isonline($item[2]))
  {
    $iml = "<img src=\"images/onl.gif\" alt=\"+\"/>";

  }else{
    $iml = "<img src=\"images/ofl.gif\" alt=\"-\"/>";
  }
    if(strlen($item[1])>1){

      $snick = getnick_uid($item[2]);
      $uid1 = getuid_sid($sid);

                  if($uid==$uidinfo[0])
                  {
                      $dellnk = "<a href=\"video.php?action=delvote&sid=$sid&whoimage=$item[5]\">*</a>";
              }else{
                        $dellnk = "";
              }

      $lnk = "<small><a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\">$iml$snick:</a> <b>$item[0]/10</b> $dellnk</small>";
          echo "$lnk<br/><small>";
      $bs = date("d/m/y",$item[3]);
      $text = parsepm($item[1], $sid);
      if(($uid==$uidinfo[0]) and (strlen($item[4])<1))
      {
        $replylink = "<a href=\"video.php?action=commentreply&sid=$sid&id=$item[5]\">Reply to Comment</a><br/><i>$bs</i>";
      }else{
        $replylink = " <i>$bs</i>";
      }
      echo "$text";
      if(strlen($item[4])>1)
      {
      $text1 = parsepm($item[4], $sid);
      echo "<br><b><i>Reply:</i> $text1</b>";
      }
      echo "<br/>$replylink<br/><br/>";
      echo "</small>";
    }
    }
    }
    echo "</p>";
    echo "<p><center>";
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"video.php?action=$action&sid=$sid&page=$ppage&whoimage=$whoimage\"><small>« Prev</small></a> ";
    }
    echo "<small> $page/$num_pages </small>";
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"video.php?action=$action&sid=$sid&page=$npage&whoimage=$whoimage\"><small>Next »</small></a>";
    }

    if($num_pages>2)
    {
        $rets = "<center><form action=\"video.php\" method=\"get\">";
        $rets .= "Jump to Video:<input name=\"page\" format=\"*N\" size=\"3\"/><br/>";
        $rets .= "<input type=\"submit\" value=\"GO\"/>";
        $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
        $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
        $rets .= "<input type=\"hidden\" name=\"whoimage\" value=\"$whoimage\"/>";
        $rets .= "<input type=\"hidden\" name=\"page\" value=\"$(pg)\"/>";
        $rets .= "</form></center>";
        echo $rets;
    }
    echo "</center></p>";

  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"video.php?action=main&sid=$sid\">Videos</a>";
  echo " > ";
  echo "Reading Video's Comments";
  echo "</small></p>";

  echo xhtmlfoot();
}

////////////////////////////////////////MAKE A COMMENT
else if($action=="commentreply")
{
  addonline(getuid_sid($sid),"Replying to a Video's Comment - xHTML:v3","");
      echo "<head>\n";
          echo "<title>Adult</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">";
                    echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />\n";
      echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />\n";
      echo "<meta http-equiv=\"Pragma\" content=\"no-cache\" />\n";
          echo "</head>";
      echo "<body>";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"60\" width=\"159\">";
echo "<tr>";
echo "<td id=\"body\" width=\"159\">";
echo "</td>";
echo "</tr>";
echo "</table>";

 echo "<table border=\"0\" width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" class=\"boxed\" align=\"center\">";
echo "<tr>";
echo "<td class=\"boxedTitle\" height=\"20\">";
echo "<h1 align=\"center\" class=\"boxedTitleText\">reply comment</h1></td>";
echo "</tr>";
echo "<tr>";
echo "<td class=\"boxedContent\">";

    echo "<small>";

  echo "Reply to a Comment<br/>";
  echo "<br/>";
  echo "</small></p>";
  echo "<p>";
  echo "<form action=\"video.php?action=commentreplyaction&sid=$sid&id=$id\" method=\"post\">";
  echo "<small>Reply:</small> <input name=\"reply\" format=\"*M\" maxlength=\"200\"/><br/>";
  echo "<input type=\"submit\" value=\"Reply\"/>";
  echo "</form>";
  echo "</p>";

  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"video.php?action=main&sid=$sid\">Videos</a>";
  echo " > ";
  echo "Replying to a Comment";
  echo "</small></p>";

  echo xhtmlfoot();
}

////////////////////////////////////////READ VOTES WITHOUT COMMENTS
else if($action=="votes")
{
  addonline(getuid_sid($sid),"Viewing Votes of a Video - xHTML:v3","");
      echo "<head>\n";
          echo "<title>Adult</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">";
                    echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />\n";
      echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />\n";
      echo "<meta http-equiv=\"Pragma\" content=\"no-cache\" />\n";
          echo "</head>";
      echo "<body>";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"60\" width=\"159\">";
echo "<tr>";
echo "<td id=\"body\" width=\"159\">";
echo "</td>";
echo "</tr>";
echo "</table>";

 echo "<table border=\"0\" width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" class=\"boxed\" align=\"center\">";
echo "<tr>";
echo "<td class=\"boxedTitle\" height=\"20\">";
echo "<h1 align=\"center\" class=\"boxedTitleText\">viewing user Video</h1></td>";
echo "</tr>";
echo "<tr>";
echo "<td class=\"boxedContent\">";

    echo "<small>";

    if($page=="" || $page<=0)$page=1;
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_uservideos_rating WHERE imageid='".$whoimage."'"));
    $num_items = $noi[0]; //changable
    $items_per_page= 20;
    $num_pages = ceil($num_items/$items_per_page);
    if(($page>$num_pages)&&$page!=1)$page= $num_pages;
    $limit_start = ($page-1)*$items_per_page;

    $imageratinginfo = "SELECT rating, byuid  FROM ibwf_uservideos_rating WHERE imageid='".$item[1]."'";
    $uidinfo = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_uservideos WHERE id='".$whoimage."'"));

    $sql = "SELECT rating, byuid, time  FROM ibwf_uservideos_rating WHERE imageid ='".$whoimage."' ORDER BY time DESC LIMIT $limit_start, $items_per_page";

    echo "<p>";
    $items = mysql_query($sql);
    echo mysql_error();
    if(mysql_num_rows($items)>0)
    {
    while ($item = mysql_fetch_array($items))
    {

          if(isonline($item[1]))
  {
    $iml = "<img src=\"images/onl.gif\" alt=\"+\"/>";

  }else{
    $iml = "<img src=\"images/ofl.gif\" alt=\"-\"/>";
  }

    $snick = getnick_uid($item[1]);
    $uid1 = getuid_sid($sid);

                  if($uid==$uidinfo[0])
                  {
                      $dellnk = "<a href=\"video.php?action=delvote&sid=$sid&whoimage=$whoimage\">*</a>";
              }else{
                        $dellnk = "";
              }
      $lnk = "<a href=\"index.php?action=viewuser&who=$item[1]&sid=$sid\">$iml$snick:</a> <b>$item[0]/10</b> $dellnk";
      echo "$lnk<br/>";

    }
    }
    echo "</p>";
    echo "<p><center>";
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"video.php?action=$action&sid=$sid&page=$ppage&who=$who\"><small>« Prev</small></a> ";
    }
    echo "<small> $page/$num_pages </small>";
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"video.php?action=$action&sid=$sid&page=$npage&who=$who\"><small>Next »</small></a>";
    }

    if($num_pages>2)
    {
        $rets = "<center><form action=\"video.php\" method=\"get\">";
        $rets .= "Jump to Video:<input name=\"page\" format=\"*N\" size=\"3\"/><br/>";
        $rets .= "<input type=\"submit\" value=\"GO\"/>";
        $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
        $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
        $rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\"/>";
        $rets .= "<input type=\"hidden\" name=\"page\" value=\"$(pg)\"/>";
        $rets .= "</form></center>";
        echo $rets;
    }
    echo "</center></p>";

  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"video.php?action=main&sid=$sid\">Videos</a>";
  echo " > ";
  echo "Votes";
  echo "</small></p>";

  echo xhtmlfoot();
}

////////////////////////////////////////RATE USER
else if($action=="rateuser")
{
  addonline(getuid_sid($sid),"Rating a Video - xHTML:v3","");
      echo "<head>\n";
          echo "<title>Adult</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">";
                    echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />\n";
      echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />\n";
      echo "<meta http-equiv=\"Pragma\" content=\"no-cache\" />\n";
          echo "</head>";
      echo "<body>";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"60\" width=\"159\">";
echo "<tr>";
echo "<td id=\"body\" width=\"159\">";
echo "</td>";
echo "</tr>";
echo "</table>";

 echo "<table border=\"0\" width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" class=\"boxed\" align=\"center\">";
echo "<tr>";
echo "<td class=\"boxedTitle\" height=\"20\">";
echo "<h1 align=\"center\" class=\"boxedTitleText\">rating user Video</h1></td>";
echo "</tr>";
echo "<tr>";
echo "<td class=\"boxedContent\">";

    echo "<small>";

  $rate = $_POST["rate"];
  $comment = $_POST["comment"];

  $uid1 = getuid_sid($sid);
  $item = mysql_fetch_array(mysql_query("SELECT uid, id, imageurl, sex FROM ibwf_uservideos WHERE uid='".$whoimage."'"));

  $rated = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_uservideos_rating WHERE byuid='".$uid1."' and imageid ='".$whoimage."'"));

  if(canratephoto($uid1, $item[0]) and ($rated[0]==0))
  {
   echo "<p align=\"center\">";
   $uid = getuid_sid($sid);
   if((strlen($comment))>1){
   $res= mysql_query("INSERT INTO ibwf_uservideos_rating SET imageid='".$whoimage."', rating='".$rate."', comments='".$comment."', byuid='".$uid."', time='".time()."', commentsyn='Y'");
   }else
   if((strlen($comment))<2){
   $res= mysql_query("INSERT INTO ibwf_uservideos_rating SET imageid='".$whoimage."', rating='".$rate."', comments='".$comment."', byuid='".$uid."', time='".time()."', commentsyn='N'");
   }

   if(($res) and ((strlen($comment))>1)){

     echo "<img src=\"images/ok.gif\" alt=\"o\"/>Rated Successfully<br/>";
     echo "<img src=\"images/ok.gif\" alt=\"o\"/>Comments added Successfully<br/>";
   }else
   if(($res) and ((strlen($comment))<2)){

     echo "<img src=\"images/ok.gif\" alt=\"o\"/>Rated Successfully<br/>";
     echo "<img src=\"images/notok.gif\" alt=\"x\"/>No Comments were added<br/>";
   }
   else{
     echo "<img src=\"images/notok.gif\" alt=\"x\"/>Rated unsuccessfully<br/>";
     echo "<img src=\"images/notok.gif\" alt=\"x\"/>No Comments were added<br/>";
   }
   }else{
   echo "You have already rated this Video";
   }
  echo "</p>";

  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"video.php?action=main&sid=$sid\">Videos</a>";
  echo " > ";
  echo "Rating a Video";
  echo "</small></p>";

  echo xhtmlfoot();
}

////////////////////////////////////////REPLY TO COMMENT
else if($action=="commentreplyaction")
{
  addonline(getuid_sid($sid),"Replying To a Video's Comment - xHTML:v3","");
  $pstyle = theme($sid);
  echo xhtmlhead("Replying to a Video's Comment",$pstyle);

  $id = $_GET["id"];
  $reply = $_POST["reply"];

  echo "<p align=\"center\">";
  $uid = getuid_sid($sid);
  $res = mysql_query("UPDATE ibwf_uservideos_rating SET commentsreply='".$reply."' WHERE id='".$id."'");
   if($res){

     echo "<img src=\"images/ok.gif\" alt=\"o\"/>Replyed Successfully<br/>";
   }
   else{
     echo "<img src=\"images/notok.gif\" alt=\"x\"/>Replyed unsuccessfully<br/>";
   }
  echo "</p>";

  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"video.php?action=main&sid=$sid\">Videos</a>";
  echo " > ";
  echo "Replyed to a Comment";
  echo "</small></p>";

  echo xhtmlfoot();
}

////////////////////////////////////////UPLOAD Video
else if($action=="upload")
{
      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">";
  addonline(getuid_sid($sid),"Uploading a Video - xHTML:v3","");
  echo xhtmlheadnotheme("Uploading a Video");

  $rate = $_POST["rate"];
  $comment = $_POST["comment"];
  echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"60\" width=\"159\">";
echo "<tr>";
echo "<td id=\"logo\" width=\"155\">";
echo "</td>";
echo "</tr>";
echo "</table>";

  echo "<table border=\"0\" width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" class=\"boxed\" align=\"center\">";
echo "<tr>";
echo "<td class=\"boxedTitle\" height=\"20\">";

echo "<h1 align=\"center\" class=\"boxedTitleText\">";

echo "Uploader";

echo "</h1></td>";
echo "</tr>";
echo "<td class=\"boxedContent\">";

  echo "<p>";

          echo "<small>Note:<br/>";
          echo "* File size limit 2000kb. If your upload does not work, try a smaller Video.<br/>";
          echo "* Allowed formats: <b>.3gb, .mp4</b><br/>";
          echo "* You have the right to distribute the Video<br/>";
          echo "* The Video does not violate the <a href=\"index.php?action=terms&sid=$sid\">Terms of Use</a><br/>";
          echo "<center><br/>Pick a Video to upload, and press 'Upload'<br/>";
        echo "<form enctype=\"multipart/form-data\" method=\"post\" action=\"upload.php?action=upload&sid=$sid\">";
        echo "<input type=\"file\" name=\"f1\" size=\"15\"><br/>";
        echo "Description: <input name=\"descript\" maxlength=\"100\" size=\"20\"/>";
        echo "<input type=\"hidden\" name=\"action\" value=\"image\" /><br/>";
        echo "<INPUT TYPE=\"submit\" name=\"upl\" VALUE=\"Upload\"></form>";
  echo "</center></small></p>";

  echo "</td></table>";

  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"video.php?action=main&sid=$sid\">Videos</a>";
  echo " > ";
  echo "Uploading a Video";
  echo "</small></p>";
    echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">";

        echo "<td id=\"footer\">";
echo "<p id=\"legal\">© Adult 2009</p>";
          echo "<p>";

echo "</td>";

echo "</table>";

  echo xhtmlfoot();
}

////////////////////////////////////////DEL VIDEO
else if($action=="del")
{
  $pstyle = theme($sid);
  echo xhtmlhead("User Videos",$pstyle);

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

    $imageurl = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_uservideos WHERE id='".$whoimage."'"));
    $imagename = explode("/",$imageurl[0]);
    $delpath = "../uservideos/$imagename[4]";
    unlink($delpath);
    $res = mysql_query("DELETE FROM ibwf_uservideos WHERE id='".$whoimage."'");
    $res = mysql_query("DELETE FROM ibwf_uservideos_rating WHERE imageid='".$whoimage."'");

        if($res)
      {
        echo "<img src=\"images/ok.gif\" alt=\"O\"/>Videos and all the Comments have been deleted";
      }else{
        echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error deleting Video";
      }
  echo "</p>";

  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"video.php?action=main&sid=$sid\">Video</a>";
  echo " > ";
  echo "Deleting a Video";
  echo "</small></p>";

  echo xhtmlfoot();
}

////////////////////////////////////////DEL COMMENT
else if($action=="delvote")
{
  $pstyle = theme($sid);
  echo xhtmlhead("User Videos",$pstyle);

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

      if($res)
      {
        echo "<img src=\"images/ok.gif\" alt=\"O\"/>Video and all the Comments have been deleted";
      }else{
        echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error deleting Video";
      }
  echo "</p>";

  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"video.php?action=main&sid=$sid\">Videos</a>";
  echo " > ";
  echo "Deleting Comment";
  echo "</small></p>";

  echo xhtmlfoot();
}

////////////////////////////////////////EDIT DESCRIPTION / ADD DESCRIPTION
else if($action=="edtdescript")
{
  $pstyle = theme($sid);
  echo xhtmlhead("User Videos",$pstyle);

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

      if($res)
      {
        echo "<img src=\"images/ok.gif\" alt=\"O\"/>Video and all the Comments have been deleted";
      }else{
        echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error deleting Video";
      }
  echo "</p>";

  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"video.php?action=main&sid=$sid\">Videos</a>";
  echo " > ";
  echo "Deleting Comment";
  echo "</small></p>";

  echo xhtmlfoot();
}

////////////////////////////////////////LOST IN VIDEO
else
{
  addonline(getuid_sid($sid),"Lost in Videos - xHTML:v3","");
  echo xhtmlheadnotheme("Lost In Videos");

  echo "<p align=\"center\">";
  echo "I don't know how did you get into here, but there's nothing to show.";
  echo "</p>";

  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"video.php?action=main&sid=$sid\">Videos</a>";
  echo " > ";
  echo "LOST";
  echo "</small></p>";

  echo xhtmlfoot();
}

?>

Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

something else Fellow · 2,296 posts #2

as far as i can see it already excepts 3gp mp4??? only line wrong is:

        $reg = mysql_query("INSERT INTO ibwf_usergallery SET uid='".$uid."', imageurl='".$imageurl."', sex='".$userinfo[1]."', time='".time()."', descript='".$descript."'");

your inserting it into gallery

It Looks like a very unsafe script to me

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close