View file lospaciprian/muzica/lospa/muzica/index.php

File size: 5.68Kb
<?php
#######################################
### Script si baza de date 
### descarcate de pe http://simpatie.us
### by Lospa Ciprian 
#######################################
error_reporting(0);
ini_set('display_errors','Off');

date_default_timezone_set("Europe/Bucharest");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Content-type: text/html; charset=utf-8");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")."GMT");

echo'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ro" lang="ro"><head>
<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet" href="http://m.wapstar.ro/style.css" type="text/css"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/> 
<meta name="google-site-verification" content="M5SRXmhMT-eakA7P6fObmk5P-DEQencj3_bO3_dYaI0" />
<title>WapStar.Ro</title>
</head><body>';
echo"<div class=\"header\">
<a href=\"http://m.wapstar.ro\"><img src=\"http://m.wapstar.ro/imagini/home.gif\" alt=\"acasa\"/></a>
</div>";
include  ("../footer.php");


////////////////////// Autentificare Baza De Date ////////////////
define("NUME_BAZA","wapstarr_lospaciprian");
define("DBHOST","localhost");
define("DBUSER","wapstarr_lospa");
define("PAROLADB","filmehd9");

$conexiune = mysql_connect(DBHOST,DBUSER,PAROLADB,TRUE) or die("Nu se poate conecta la MySQL!");
mysql_select_db(NUME_BAZA, $conexiune) or die("Nu gasesc baza de date!");
mysql_set_charset('utf8',$conexiune);
//////////////////////////////////////////////////////////////////

function title($item){

$arr=explode('/',$item);

foreach($arr as $title){$item_title=$title; }

return $item_title;

 }
 

function cutout($string, $howmuch, $etc = false) { 
    return mb_strlen($string, 'UTF-8') > $howmuch  
    ? mb_substr($string, 0, $howmuch, 'UTF-8').($etc !== false ? '' : '') : $string; 
} 


   function byte_convert($bytes)
   {
     $symbol = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');

     $exp = 0;
     $converted_value = 0;
     if( $bytes > 0 )
     {
       $exp = floor( log($bytes)/log(1024) );
       $converted_value = ( $bytes/pow(1024,floor($exp)) );
     }

     return sprintf( '%.2f '.$symbol[$exp], $converted_value );
   }


function url_size($fileurl){
    $userAgent = 'Nokia3500c/2.0 (06.60) Profile/MIDP-2.0 Configuration/CLDC-1.1';
    
     // initialize curl with given url
     $ch = curl_init($fileurl);
     // make sure we get the header
     curl_setopt($ch, CURLOPT_HEADER, 1);
     // make it a http HEAD request
     curl_setopt($ch, CURLOPT_NOBODY, 1);
     // add useragent
     curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
     //Tell curl to write the response to a variable
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     // The maximum number of seconds to allow cURL functions to execute. 
    // curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,60);
     // Tell curl to stop when it encounters an error 
     curl_setopt($ch, CURLOPT_FAILONERROR, 1);
     
     $execute = curl_exec($ch);
     
     // Check if any error occured
     if(!curl_errno($ch))
     {$bytes = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD);
     
    $size = byte_convert($bytes); clearstatcache();
     
     }
     curl_close($ch);
      return $size;
     }


$pages = $_GET["page"];

$count_items= mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM store_music"));

$count_items = $count_items[0];
$items_per_page=6; 
if(empty($pages)){$page=1;}
else{if(!ctype_digit($pages)){$page = 1;} else {$page=$pages;}}
$num_pages = ceil($count_items/$items_per_page);
if(($page>$num_pages)&&$page!=1)$page= $num_pages;
$start_dela = ($page-1)*$items_per_page;

$items=mysql_query("SELECT * FROM store_music ORDER BY id desc LIMIT $start_dela,$items_per_page");



while($item=mysql_fetch_array($items))
{$start_dela++; //cutout($string, $howmuch, $etc = false)
echo "<div class=\"header\"><img src=\"http://m.wapstar.ro/imagini/lospablue.png\" alt=\"\"/><a href=\"".$item['itemurl']."\" title=\"".cutout(title($item['title']),50)."\"><small><b>".title($item['title'])."</b></small></a><br/></div>";
echo"<div class=\"header\">Marime fisier:".url_size($item['itemurl'])." ...<br/></div>";
}


echo "<div class='float-center'>";
if($page>1)
{ $ppage = $page-1;
echo "<a href=\"index.php?page=".$ppage."\">&#171;inapoi</a> | ";
}

if($page<$num_pages)
{ $npage = $page+1;
echo "<a href=\"index.php?page=".$npage."\">inainte&#187;</a>";
}

echo "<form action=\"index.php\" method=\"get\">";
echo "<input type=\"text\" name=\"page\" value=\"".$page."\" size=\"2\"/>";
echo "<b>/$num_pages</b> <input type=\"submit\" value=\"go\"/></form>&nbsp;</div>";

echo "<div class=\"surfmen\"><b><a href=\"http://m.wapstar.ro/contact.php\"><img src=\"http://m.wapstar.ro/imagini/contact.png\"></a></b> | <b><a href=\"http://m.wapstar.ro/reclama.php\"><img src=\"http://m.wapstar.ro/imagini/info.png\"></a></b> | <b><a href=\"http://m.wapstar.ro/index.php?actiune=parteneri\"><img src=\"http://m.wapstar.ro/imagini/parteneri.png\"></a></b> | <b><a href=\"http://gb.wapstar.ro/wapstar\"><img src=\"http://m.wapstar.ro/imagini/guestbook.png\"></a></b> | <b><a href=\"http://m.wapstar.ro\"><img src=\"http://m.wapstar.ro/imagini/tvlive.png\"></a></b></div>";


echo "</div>";
echo"\n\n\n\n</body></html>\n\n
<!-- P.S. echo'~ lospa e wapmaster frt ~'; -->";
?>