Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Siuntinių Perdarymas

Parašė avice· 2011 Sau. 31 20:01:27
#15

Licenzija: img
Versija: trukme
mix : os


<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2010 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: downloads.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."downloads.php";

add_to_title($locale['global_200'].$locale['400']);
function zip($urla) {

if(!preg_match('/locale/i', $urla)) {$idx = explode('/', $urla); $idx=$idx[4]; } else {$idx = explode('=', $urla);
$idx=$idx[2]; }
$urla = explode('.', $urla);
$urla = str_replace('http://www', '', $urla['0']);

return "<embed allowscriptaccess='never' src='http://www.zippyshare.com/mediaplayer/mediaplayer.swf?file=http://www".$urla.".zippyshare.com/downloadMusic%3Fkey%3D".$idx."f3%26time%3D1253458883&amp;type=flv' menu='false' quality='high' name='mp3player' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' wmode='transparent' width='100%' border='0' height='20'>";

}
if (isset($_GET['download_id']) && isnum($_GET['download_id'])) {
   $res = 0;
   if ($data = dbarray(dbquery("SELECT download_url, download_file, download_cat FROM ".DB_DOWNLOADS." WHERE download_id='".$_GET['download_id']."'"))) {
      $cdata = dbarray(dbquery("SELECT download_cat_access FROM ".DB_DOWNLOAD_CATS." WHERE download_cat_id='".$data['download_cat']."'"));
      if (checkgroup($cdata['download_cat_access'])) {
         $result = dbquery("UPDATE ".DB_DOWNLOADS." SET download_count=download_count+1 WHERE download_id='".$_GET['download_id']."'");
         if (!empty($data['download_file']) && file_exists(DOWNLOADS.$data['download_file'])) {
            $res = 1;
            require_once INCLUDES."class.httpdownload.php";
            ob_end_clean();
            $object = new httpdownload;
            $object->set_byfile(DOWNLOADS.$data['download_file']);
            $object->use_resume = true;
            $object->download();
            exit;
         } elseif (!empty($data['download_url'])) {
            $res = 1;
            redirect($data['download_url']);
         }
      }
   }
   if ($res == 0) { redirect("downloads.php"); }
}

if (!isset($_GET['cat_id']) || !isnum($_GET['cat_id'])) {
   opentable($locale['400']);
   echo "<!--pre_download_idx-->\n";
   $result = dbquery("SELECT download_cat_id, download_cat_name, download_cat_description FROM ".DB_DOWNLOAD_CATS." WHERE ".groupaccess('download_cat_access')." ORDER BY download_cat_name");
   $rows = dbrows($result);
   if ($rows) {
      $counter = 0; $columns = 2;
      echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
      while ($data = dbarray($result)) {
         if ($counter != 0 && ($counter % $columns == 0)) { echo "</tr>\n<tr>\n"; }
         $num = dbcount("(download_cat)", DB_DOWNLOADS, "download_cat='".$data['download_cat_id']."'");
         echo "<td valign='top' width='50%' class='tbl download_idx_cat_name'><!--download_idx_cat_name--><a href='".FUSION_SELF."?cat_id=".$data['download_cat_id']."'>".$data['download_cat_name']."</a> <span class='small2'>($num)</span>";
         if ($data['download_cat_description'] != "") { echo "<br />\n<span class='small'>".$data['download_cat_description']."</span>"; }
         echo "</td>\n" ;
         $counter++;
      }
      echo "</tr>\n</table>\n";
   } else {
      echo "<div style='text-align:center'><br />\n".$locale['430']."<br /><br />\n</div>\n";
   }
   echo "<!--sub_download_idx-->";
   closetable();
} else {
   $res = 0;
   $result = dbquery("SELECT download_cat_name, download_cat_sorting, download_cat_access FROM ".DB_DOWNLOAD_CATS." WHERE download_cat_id='".$_GET['cat_id']."'");
   if (dbrows($result) != 0) {
      $cdata = dbarray($result);
      if (checkgroup($cdata['download_cat_access'])) {
         $res = 1;
         add_to_title($locale['global_201'].$cdata['download_cat_name']);
         opentable($locale['400'].": ".$cdata['download_cat_name']);
         echo "<!--pre_download_cat-->";
         $rows = dbcount("(download_id)", DB_DOWNLOADS, "download_cat='".$_GET['cat_id']."'");
         if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
         if ($rows != 0) {
            $result = dbquery("SELECT download_id, download_cat, download_url, download_title, download_description, download_license, download_os, download_version, download_filesize, download_datestamp, download_count FROM ".DB_DOWNLOADS." WHERE download_cat='".$_GET['cat_id']."' ORDER BY ".$cdata['download_cat_sorting']." LIMIT ".$_GET['rowstart'].",".$settings['downloads_per_page']);
            $numrows = dbrows($result); $i = 1;
                  echo "<style>

.taskas3 {
   border: 1px solid #d0cec4;

}

.title-up {
   background-image: url(http://www.electroza.com/themes/zDon/title/up.png);
   widht: 186px;
   height: 31px;
   font-family: Verdana;
   font-size: 9px;
   color: #2c2c2c;
   padding-left: 10px;
}

.inputas {
   font-family : Verdana, Arial, Helvetica, sans-serif;
   font-size : 9px;
   color : #fff;
   background: none;
   border-bottom : 1px dashed #fff;
   border-top : 0px dashed #989898;
   border-left : 0px dashed #989898;
   border-right : 0px dashed #989898;
}


.title-body {
   background-image: url(http://www.electroza.com/themes/zDon/title/body.png);
   widht: 186px;
   height: 200px;
   font-family: Verdana;
   font-size: 9px;
   color: #e0e0e0c;
   padding: 5px 5px 0px 5px;
}

.tlbas {
   font-family: Verdana;
   font-size: 9px;
   color: #fff;
}

.infobar {
   background : url(http://www.electroza.com/themes/zDon/images/BG_subnav.png);
   background-repeat : no-repeat;
   background-position : left;
   width : 756px;
   height : 48px;
   font-family : Tahoma, Verdana, Arial, Helvetica;
   font-size : 10px;
}


</style>";
            while ($data = dbarray($result)) {
               echo "<table style='float:left'>
<tr>
<td><table width='186' height='240'   align='center' cellpadding='0' cellspacing='0'>
<tr>
<td class='title-up'>".trimlink($data['download_title'], 30)."</td>
</tr>
<tr>
<td class='title-body' valign='top'>
<center><img src='";
if (!empty($data['download_license'])) {
echo " ".$data['download_license']." ";
}else{
echo "http://skinnymoose.com/health/wp-content/uploads/2008/06/whitetail-deer-bizare-sex.jpg";
}
echo " ' width='134' height='134'  class='taskas3'></center>

<br>
<center>
</center>
<table cellpadding='0' cellspacing='0' width='176'>
<tr>
<td align='left' class='tlbas'><img src='http://www.electroza.com/applet_basedir/applet_images/tarpas.png' style='border:0' height='5px'>
<br>Mixavo : <b>".$data['download_os']."</b>
<br>Siunt&#279;si : <b>".$data['download_count']."</b>
<br>Trukm&#279; : <b>".$data['download_version']."</b><br><b>";
echo "</td>
<td align='right'>";
echo "<a href=".BASEDIR."index.php?url=".$data['download_id']."";
echo "</b>

</td>
<td align='right'><a href='".FUSION_SELF."?cat_id=".$data['download_cat']."&amp;download_id=".$data['download_id']."' ><img src='http://www.electroza.com/applet_basedir/applet_images/siunciam1.png' border='0' width='79' height='31' border='0'></a>
</td>
</tr>
</table>
<br>";
if(preg_match('/zippyshare/i' , $data['download_url'])){
echo zip($data['download_url']);
}
echo "</td>
</tr>
<tr>
<td><img src='http://www.electroza.com/themes/zDon/title/down.png'></td>
</tr>
</table></td>
</tr>
</table>";

            }
            closetable();
            if ($rows > $settings['downloads_per_page']) { echo "<div align='center' style=';margin-top:5px;'>\n".makepagenav($_GET['rowstart'], $settings['downloads_per_page'], $rows, 3, FUSION_SELF."?cat_id=".$_GET['cat_id']."&amp;")."\n</div>\n"; }
         } else {
            echo "<div style='text-align:center'>".$locale['431']."</div>\n";
            echo "<!--sub_download_cat-->";
            closetable();
         }
      }
   }
   if ($res == 0) { redirect(FUSION_SELF); }
}

require_once THEMES."templates/footer.php";
?>