Help No of times downlaods not working Please edit code and reply here

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help No of times downlaods not working Please edit code and reply here

    This is my sea scripts view.php




    <?php
    #-----------------------------------------------------#
    # #
    #-----------------------------------------------------#

    require 'moduls/ini.php';
    require 'moduls/fun.php';
    require 'moduls/connect.php';
    require 'moduls/header1.php';
    require 'online.php';
    // Test variables
    $id = intval($_GET['id']);
    is_num($_GET['eval'],'eval');

    // Get the ин�� file
    $file_info = mysql_fetch_assoc(mysql_query('SELECT * FROM `files` WHERE `id` = '.$id));
    if(!is_file($file_info['path'])){
    die('File does not exist');
    }
    ###############Get the current directory#############
    if(!$id){
    $d['path'] = $setup['path'].'/';
    }
    else{
    $d = mysql_fetch_assoc(mysql_query('SELECT `path` FROM `files` WHERE `id` = '.$id.' LIMIT 1'));
    }

    ###############Cooking title###################
    $ex = explode('/',$d['path']);
    foreach($ex as $k=>$v)
    {
    if($v!='' and $v!='.' and $v!='..' and $v!=$setup['path'])
    {
    $s = mysql_fetch_array(mysql_query("SELECT `id`,`name` FROM `files` WHERE `path` LIKE '%".clean($v)."/' AND `size` = '0'"));
    $s['name'] = str_replace('*','',$s['name']);
    if($k >= sizeof($ex)-1) $put .= $s['name'];
    else $put .= ' &raquo; <a href="index.php?id='.$s['id'].'">'.$s['name'].'</a>';
    }
    }
    ##############Title##########################

    /*echo '<div class="menu"> <a href="'.$setup['site_url'].'">'.$setup['site_url'].'</a>&raquo;<a href="index.php">Downloads</a>&raquo;'.$put.'</div>';*/

    ##############Total comments
    $all_komments = mysql_result(mysql_query('SELECT COUNT(`id`) FROM `komments` WHERE `file_id` = '.$id),0);

    ##############Polls are##############
    if(isset($_GET['eval']) and $setup['eval_change'] == 1)
    {
    $ips = explode("\n",$file_info['ips']);
    if(in_array($ip ,$ips) === false)
    {
    $vote = 0;
    if(empty($file_info['ips'])){
    $ipp = $ip;
    }
    else{
    $ipp = $file_info['ips']."\n".$ip;
    }

    if($_GET['eval']==0){
    $str = 'UPDATE `files` SET `no`=`no`+1,`ips`="'.$ipp.'" WHERE `id` = '.$file_info['id'];
    }
    elseif($_GET['eval']==1){
    $str = 'UPDATE `files` SET `yes`=`yes`+1,`ips`="'.$ipp.'" WHERE `id` = '.$file_info['id'];
    }

    mysql_query($str);
    $vote = 1;
    $file_info = mysql_fetch_assoc(mysql_query('SELECT * FROM `files` WHERE `id` = '.$id));
    }
    else $vote = 2;
    }
    #######Get the file name and the reverse directory#####
    $filename = pathinfo($file_info['path']);
    $ext = strtolower($filename['extension']);
    $dir = $filename['dirname'].'/';
    $filename = $filename['basename'];
    $back = mysql_fetch_assoc(mysql_query("SELECT * FROM `files` WHERE `path` = '".clean($dir)."'"));
    ###############Nice size###################
    if($file_info['size'] < 1024){
    $file_info['size'] = $file_info['size'].'b';
    }
    elseif($file_info['size'] < 1048576 and $file_info['size'] >= 1024){
    $file_info['size'] = round($file_info['size']/1024, 2).'Kb';
    }
    else{
    $file_info['size'] = round($file_info['size']/1024/1024, 2).'Mb';
    }

    ###############Output###################
    print '<div class="header"><img alt=" xxxxxx" width="200" height="70" src="http://www.xxxxxx/logo.jpg" /></div>';
    echo '<div class="ad1 tCenter">';
    include 'RandomAd.php';
    echo '</div>';
    echo '<div class="tCenter">';
    include 'smaato.php';
    echo '</div>';




    echo '<div class="tCenter">';
    include 'admob.php';
    echo '</div>';
    echo '<div class="tCenter">';
    include 'vserv.php';
    echo '</div>';

    echo '<center><div class="search"><form name="sfiles" action="http://www.xxxxxx/search.php?act=search" method="post">
    Search File : <form><input class="enter" name="word" type="text" maxlength="20" value=""><input class=buttom type="submit" value="Search"></form></div></center>';
    echo '<div class="devider"></div>';

    if ($ext =='jar') echo '<h2> '.$filename.'</h2><div class="devider"></div>';
    else echo '<h2>Download- '.$filename.'</h2><div class="devider"></div>';
    ###############Description######################## #####
    if ($ext == 'txt') {$popis=file_get_contents($file_info['path']);
    $popis=substr($popis,0,500);
    $popis = htmlentities($popis, ENT_QUOTES, 'UTF-8');
    echo '<div class="filedescription">'.$popis.'...</div><div class="devider"></div>
    ';

    }
    if(!empty($file_info['about'])){
    $file_info['about'] = str_replace("\n", '<br>', $file_info['about']);
    echo '<div class="filedescription">'.$file_info['about'].'</div><div class="devider">&nbsp;</div>
    ';
    }
    if(is_file($setup['opath'].'/'.$filename.'.txt'))
    {
    include('kodirovka.php');
    $a=file_get_contents($setup['opath'].'/'.$filename.'.txt');
    $a=charset_x_win("$a");
    $a=iconv("windows-1251", "UTF-8", "$a");
    $f = str_replace("\n",'<br>', $a);
    echo '<div class="filedescription">'.$f.'</div><div class="devider"></div>
    ';
    }

    if($ext == 'thm' || $ext == 'nth'){
    echo '<p class="showimage"><img class="absmiddle" src="http://www.xxxxxx/theme.php?id='.$id.' "width="100" height="120" alt="Screen"></p><div class="devider">&nbsp;</div>';
    }
    ##############Screenshot##############

    if(is_file($setup['spath'].'/'.$filename.'.gif')){
    echo '<p class="showimage"><img class="absmiddle" src="'.$setup['spath'].'/'.$filename.'.gif" alt="screen"></p>';
    }
    if(is_file($setup['spath'].'/'.$filename.'.jpg')){echo '<p class="showimage"><img class="absmiddle" src="'.$setup['spath'].'/'.$filename.'.jpg" alt="screen"></p>';
    }
    if(is_file($setup['spath'].'/'.$filename.'.jpeg')){echo '<p class="showimage"><img class="absmiddle" src="'.$setup['spath'].'/'.$filename.'.jpeg" alt="screen"></p>';
    }
    // Video (ffmpeg)
    elseif(($ext == '3gp' || $ext == 'avi' || $ext == 'mp4') && extension_loaded('ffmpeg')){
    $mov = new ffmpeg_movie($file_info['path']);


    // 80x80
    print '<p class="showimage"><img class="absmiddle" src="http://www.xxxxxx/ffmpeg.php?id='.$id.'&amp;W=100&amp;H=120" alt="prev">
    </p><div class="devider">&nbsp;</div>';
    }
    ###############Custom size for images############
    $image = '';
    $ext = strtolower($ext);
    if ($ext == 'gif' or $ext == 'jpg' or $ext == 'jpeg' or $ext == 'jpe' or $ext == 'png') $image = 1;
    if ($image == 1)
    {
    $arr = array('128x128','128x160','176x220','220x176','240 x320','320x240','360x640','640x480',);
    //Upload Image
    echo '<p class="showimage"><img class="absmiddle" src="http://www.xxxxxx/im.php?id='.$id.'&amp;W=100&amp;H=120" alt="Screen"></p><div class="devider">&nbsp;</div><div class="tCenter">Select Your Screen Size:<br />';
    foreach($arr as $v)
    {
    list ($W,$H) = explode('x',$v);
    echo '<b><a class="dwnLink" rel="nofollow" href="http://www.xxxxxx/im.php?id='.$id.'&amp;H='.$H.'&amp;W='.$W.'">'.$v. '</a></b>, ';
    }
    echo'</div>';
    }




    /*$image = '';
    $ext = strtolower($ext);
    if ($ext == 'gif' or $ext == 'jpg' or $ext == 'jpeg' or $ext == 'jpe' or $ext == 'png') $image = 1;
    if ($image == 1)
    {

    echo '<div class="a">


    <b>Custom size:</b>
    <form action="http://www.xxxxxx/im.php" method="GET">
    <input type="hidden" name="id" value="'.$id.'">
    <input type="text" name="W" maxlength="3" size="3">x<input type="text" name="H" maxlength="3" size="3"> px.
    <input type="submit" value="Ok">
    </form></div>';

    }*/

    echo '<center><div class="devider">&nbsp;</div> Download Link: <a class="dwnLink" rel="nofollow" href="'.$setup['site_url'].dirname($_SERVER['PHP_SELF']).'/'.$file_info['path'].'"onclick="vserv();"><strong>[ Download File ]</strong></a><br>';
    echo 'File Size:<b> '.$file_info['size'].'</b></div><br>';

    ###############Recent downloads###################
    /*if($file_info['timeload'])
    {
    $file_info['timeload'] = date('d.m.Y (H:i)', $file_info['timeload']);
    print '<div class="title2"><b>Recent downloads:</b>'.$file_info['timeload'].'</div>';
    }*/
    ###############Time added######################
    /*$file_info['timeupload'] = date('d.m.Y (H:i)', $file_info['timeupload']);
    print '<div class="title2"><b>Time added:</b>'.$file_info['timeupload'].'</div>';*/

    ###############INFO on jar###########################
    /*elseif($ext == 'jar'){
    include 'jar_info.php';
    echo '<div class="a"><b>Developer:'.$poz.'</b><br></div>';
    echo '<div class="a"><b>Version:'.$ver.'</b><br>';


    echo '</div>';
    }*/
    ###############INFO on mp3###########################
    if($ext == 'mp3' or $ext == 'wav'){

    if (
    !$h_ua ||
    strpos($h_ua, 'windows') !== false ||
    strpos($h_ua, 'linux') !== false ||
    strpos($h_ua, 'bsd') !== false ||
    strpos($h_ua, 'x11') !== false ||
    strpos($h_ua, 'unix') !== false ||
    strpos($h_ua, 'macintosh') !== false ||
    strpos($h_ua, 'macos') !== false)
    {
    /*echo'<div class="a"><b>Play Mp3 Online:</b> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0 " width="96" height="20" id="own_flashplayer" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <embed src="own_flashplayer_plc.swf?file='.$file_info['path']. '&amp;sta rtplay=false" quality="high" bgcolor="#ffffff" width="96" height="20" name="own_flashplayer" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object></div>';*/ }
    /*echo '<div class="a">';


    include 'moduls/classAudioFile.php';
    $AF = new AudioFile;
    $AF->loadFile($file_info['path']);
    $AF->printSampleInfo();echo '</div>';*/
    }


    if(($ext == 'avi' || $ext == 'flv' || $ext =='swf' || $ext =='mp4') AND (
    !$h_ua ||
    strpos($h_ua, 'windows') !== false ||
    strpos($h_ua, 'linux') !== false ||
    strpos($h_ua, 'bsd') !== false ||
    strpos($h_ua, 'x11') !== false ||
    strpos($h_ua, 'unix') !== false ||
    strpos($h_ua, 'macintosh') !== false ||
    strpos($h_ua, 'macos') !== false))
    {
    echo '<div class="a"><object type="application/x-shockwave-flash" data="uflvplayer_500x375.swf" height="188" width="250">
    <param name="bgcolor" value="#DFE6EF" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="movie" value="uflvplayer_500x375.swf" />
    <param name="FlashVars" value="way='.$file_info['path'].'&amp;swf=uflvplayer_500x375.swf&amp;w=400&amp;h= 300&amp;pic=ffmpeg.php?id='.$file_info['id'].'&amp;autoplay=0&amp;tools=1&amp;skin=white&amp;v olume=70&amp;q=&amp;comment=" /></object>
    </div>';

    }


    ###############Vote###########################
    /*if($setup['eval_change'] == 1)
    {
    $i = @round(($file_info['yes'])/($file_info['yes']+$file_info['no'])*100,0);
    echo '<div class="a"><div class="b">
    <b>Rate File : <font color="green">'.$file_info['yes'].'</font>/<font color="red">'.$file_info['no'].'</font></b><br>
    <img src="rate.php?i='.$i.'" alt="" style="margin: 1px;">';
    if ($vote==0) echo '( <a href="view.php?id='.$id.'&amp;eval=1"><b>+</b></a>/<a href="view.php?id='.$id.'&amp;eval=0"><b>-</b></a>)</div></div>';
    if ($vote==1) echo '<br>Thanks, your vote counted!</div></div>';
    if ($vote==2) echo '<br>You have already voted for this file.</div></div>';
    }*/
    ###############Thread###########################

    if($setup['cut_change'] == 1)
    {
    if ($ext == 'mp3') print '<div class="a"><a href="cut.php?id='.$id.'"><b>Thread</b></a><br> <a href="cut1.php?id='.$id.'&s=10&p=17&way=time"><b>L isten to an excerpt [7c.]</b></a><br></div>';
    }
    //echo '<div class="a">';
    ###############Browse archive####################
    /*if($setup['zip_change'] == 1)
    {
    if($ext == 'zip'){
    print '<a href="zip.php?id='.$id.'"><strong>Browse archive</strong></a><br>';
    }
    }*/



    ##############txt##############
    /*if($ext == 'txt'){
    echo'<a href="read.php?id='.$id.'&id2='.$back['id'].'">Read</a><br/>';
    print '<a href="txt_zip.php?id='.$id.'">Download [ZIP]</a><br/>
    <a href="txt_jar.php?id='.$id.'">Download [JAR]</a><br/>';
    }*/




    ###############Download Menu#######################

    /*if($ext == 'jar' and $setup['jad_change'] == 1){
    echo '<a href="jad.php?id='.$id.'"><strong>Download [Jad]</strong></a><br>';
    }*/
    $backdir = @mysql_fetch_array(mysql_query("SELECT * FROM `files` WHERE `path` = '".clean($file_info['infolder'])."'"));

    ###############Picture Text#######################
    $pyt=$file_info[path];
    if($ext==png or $ext==jpg )
    {
    $h_ua = str_replace('windows ce', '', strtolower($_SERVER['HTTP_USER_AGENT']));
    if (
    !$h_ua ||
    strpos($h_ua, 'windows') !== false ||
    strpos($h_ua, 'linux') !== false ||
    strpos($h_ua, 'bsd') !== false ||
    strpos($h_ua, 'x11') !== false ||
    strpos($h_ua, 'unix') !== false ||
    strpos($h_ua, 'macintosh') !== false ||
    strpos($h_ua, 'macos') !== false)
    {
    /*echo('<a href="tekst.php?pic='.$pyt.'"><strong>Download image as text [txt]</strong></a><br>');*/
    }}
    //<tr><td width="10%" align=left style="background: #DFE6EF;"><b>Downloads:</b></td><td style="background: #DFE6EF;"> '.$file_info['loads'].' �аз(а)</td></tr>
    echo'Downloads:<b> '.$file_info['loads'].' time</b><div class="devider"></div>';
    $backdir=str_replace('*',' ',$backdir);
    echo'Category:<b>'.$backdir['name'].'</b>';

    /*echo '<input class="enter" size="20" type="text" value="'.$setup['site_url'].dirname($_SERVER['PHP_SELF']).'/'.$file_info['path'].'"/>
    </div>';*/


    ###############Comments#######################
    if($setup['komments_change'] == 1){
    echo '<a href="http://www.xxxxxx/komm.php?id='.$id.'"><div class="a"><strong>Comments ['.$all_komments.']</strong></a><br></div>';
    }


    echo' <div class="devider"></div>
    <div class="bt"></div>
    <div class="devider"></div>
    <div class="devider"></div>
    <div class="path"><b>
    &laquo; <a href="http://www.xxxxxx/dj-'.$back['id'].'/'.$back['name'].'.html">Go Back</a>
    ';
    echo '<br /><a href="/">Home</a></b></div>';
    /*if($setup['online'] == 1)echo '</div><div class="tCenter"><strong>Online: '.$all_online[0].'</strong></div>';*/


    echo '<div class="tCenter">';
    include 'smaato1.php';
    echo '</div>';

    echo '<div class="tCenter">';
    include 'vserv1.php';
    echo '</div>';


    echo '<div class="tCenter">';
    include 'admob1.js';
    echo '</div><br />';
    echo '<div class="ad2 tCenter">Sponsor Sites: ';
    include 'RandomAd.php';





    echo '</div>';
    include 'moduls/foot.php';
    echo '</body></html>';
    ?>




    <script language=JavaScript>
    <!--

    //This will disable the right click for guests at your forum.

    var message="Right Clicks Not Allowed!";

    ///////////////////////////////////
    function clickIE4(){
    if (event.button==2){
    alert(message);
    return false;
    }
    }

    function clickNS4(e){
    if (document.layers||document.getElementById&&!docume nt.all){
    if (e.which==2||e.which==3){
    alert(message);
    return false;
    }
    }
    }

    if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=clickNS4;
    }
    else if (document.all&&!document.getElementById){
    document.onmousedown=clickIE4;
    }

    document.oncontextmenu=new Function("alert(message);return false")

    // -->
    </script>

    #2
    is there a field in your database called "loads" on your table called "files" ?

    Comment


      #3
      yes there is load column in files. what should i do in that in order to get no of times downlaods for files in sea script from where visitors realise that how many times any song downloaded???? from loads column i will get but i want for visitors so that they realise how many times song downlaoded. As shown in screen shot i having problem with no of views. please help me.
      Attached Files
      Last edited by zong11; 19.07.11, 16:21.

      Comment

      Working...
      X