%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/nailstv/public_html/es.nails.tv/
Upload File :
Create Path :
Current File : /home/nailstv/public_html/es.nails.tv/__dev.php

<?php
ob_start();
header('Content-Type: text/html; charset=utf-8');
error_reporting(E_ALL);
ini_set('display_errors',1);


$urls = array();
$tmp = array();
$path = realpath('video');
$index = 0;
foreach (
	new RecursiveIteratorIterator(
		new RecursiveDirectoryIterator(
			$path,
			RecursiveDirectoryIterator::SKIP_DOTS
		)
	) as $filename)
{
	$index ++;
	$url = str_replace('/home/elite/www.nails.tv/','http://www.nails.tv/',$filename);
	$tmp[] = $url;

	if($index % 2000 == 0)
	{
		$urls[] = $tmp;
		$tmp = array();
	}
	//echo "$url \n<br />";
}
$urls[] = $tmp;

foreach($urls as $i => $u)
{
	echo '$str['.$i.'] = \''.serialize($u) ."'; \n\n<br ><br />";

	if($i == 21)
	{
		echo '<pre>';
		//$n = str_replace('http://www.nails.tv/','/home/elite/www.nails.tv/',$u[81]);
		//$n = $;
		//exec('rm -rf /home/elite/www.nails.tv/video/21_super_bizarro__jogador_do_america-sp_cai_em_p*');
		//rename($n,'');
		//echo $u[81];
		//print_r( $u );

		die();
	}
}



die();
die();

$dir = scandir('video');
$mdir = scandir('video/mp4');

$videos = array();
$missing = array();
$mp4_ids = array();
$convart_again = array();

require_once 'config/config.php';

Registry::set('debug', false);

$db = Db::getInstance();

/*
$sql = "SELECT id, file, file_mp4,file_webm FROM video WHERE aktiv = 't' AND storno = 'f'";
$videos = $db->GetArray($sql);

*/

function getProductUrl($id = null)
{
	if(!isset($id))
		return '';

	$db = Db::kdb('csbolt');

	$s = 1;
	$bind = array($s, $s, $id);
	$sql = "SELECT t.id, t.ar, t.kedvezmeny, t.kedvezmeny_szazalek,
			    t.bevezeto, t.nev,s.url, ks.url AS kategoria_url,
				t.akcio_kezdete_datum, t.akcio_kezdete_ido, t.akcio_vege_datum, t.akcio_vege_ido
            FROM termek t
            LEFT JOIN termek_seo s ON s.termek_id = t.id AND s.site_id = ?
            LEFT JOIN kategoria_seo ks ON t.kategoria_id = ks.kategoria_id AND ks.site_id = ?
            WHERE t.storno = 'f'
                AND t.aktiv = 't'
                AND t.bolt_vis = 't'
                AND t.id = ?
            ORDER BY t.sorrend";
	$termek = $db->GetRow($sql, $bind);

	if(!isset($termek['kategoria_url']) && !isset($termek['id']))
		return false;

	if(!empty($termek['url']))
		$url = $termek['url'];
	else
		$url = strtolower(String2::fancyurl($termek['nev']));

	$product_url = 'http://www.crystalnails.hu/bolt/'. $termek['kategoria_url'] . '/' . $url . '-' . $termek['id'];

	$product_url = str_replace(' ', '', $product_url);

	return trim($product_url);
}

function getCategoryUrl($id = null)
{
	if(!isset($id))
		return '';

	$db = Db::kdb('csbolt');

	$bind = array(1, $id);
	$sql = "SELECT k.id, s.url
                FROM kategoria k
                LEFT JOIN kategoria_seo s ON s.kategoria_id = k.id AND s.site_id = ?
                WHERE k.id = ?";
	$row = $db->GetRow($sql, $bind);

	return 'http://www.crystalnails.hu/bolt/'.$row['url'];
}

function getProductPicture($id = null,$type = 'termek')
{
	if(!isset($id))
		return '';

	$db = Db::kdb('csbolt');
	$bind = array($id);

	$sql = "SELECT k.file
                FROM termek t
                INNER JOIN kep k ON k.galeria_id = t.id AND k.tipus = '".$type."' AND def='t'
                WHERE /*t.storno = 'f'
                    AND */t.id = ?
                ORDER BY t.storno ASC
                LIMIT 1
                ";

	$termekek = $db->GetArray($sql, $bind);

	if(isset($termekek[0]['file']))
		return '110_110/'.$termekek[0]['file'];
	else
		return false;
}

	//$db = Registry::get('db');
	//$kdb = Db::kdb('csbolt');

	/*k.file AS kep, kp.kepzes_id
			FROM kepzes e
			" . $db->joinDefPic('kepzes', 'e') . "*/
	$sql = "SELECT t.id,t.nev, t.link,t.kep_link, t.ext_id,t.ext_id_cat
			FROM termekek t
			WHERE t.storno = 'f'
				AND t.aktiv = 't'
				AND t.tipus = 'video'
			ORDER BY t.sorrend";

	$termekek = $db->GetArray($sql);



	$product_ids = array();
	foreach( $termekek as $termek)
	{
		$e = explode('-',$termek['link']);
		//echo intval(end($e)).'<br />';
		$iv = intval(end($e));
		if($iv != 0) {
			$product_ids[] = $iv;
			//echo $iv."|Termek id: " . $termek['id'].'<br />';
		}
	}

$kdb = Db::kdb('csbolt');
	$sql2 = "
            SELECT galeria_id,file
            FROM `kep`
            WHERE `galeria_id` IN(".implode(',',$product_ids).")
            AND tipus = 'termek'
            AND `def` = 't'
        ";

	$r2 = $kdb->GetAssoc( $sql2 );


	$error_i = array();
	$error_f = array();
	$total_num = 0;
	foreach($termekek as &$termek)
	{
		$e = explode('-',$termek['link']);
		$p_id = intval(end($e));
		//$termek['kep'] = '---';

		if(!empty($termek['ext_id_cat']))
		{
			$termek['link'] = getCategoryUrl($termek['ext_id_cat']);
			$termek['kep'] = getProductPicture($termek['ext_id_cat'],'kategoria');
			$total_num++;
		}
		else if(!empty($termek['ext_id']))
		{
			$termek['link'] = getProductUrl($termek['ext_id']);
			$termek['kep'] = getProductPicture($termek['ext_id']);
			$total_num++;
		}
		else
		{
			if(!isset($termek['kep_link']))
			{
				$e = explode('-',$termek['link']);
				//echo intval(end($e)).'<br />';
				$iv = intval(end($e));
				if($iv != 0) {
					$product_ids[] = $iv;
					$termek['kep'] = $r2[$iv];
				}
			}
			else
			{
				$total_num++;
			}

		}

		if(!file_exists('/home/jakob/public_html/www.crystalnails.hu/bolt/img/galeria/'.$termek['kep']) && !isset($termek['kep_link']))
		{
			$error_f[] = $termek;

			$termek['file_exists'] = false;
			$error_i[] = $termek;
		}
		else
		{
			$termek['file_exists'] = true;
		}

		if(!isset($termek['kep']) && !isset($termek['kep_link']))
		{
			$error_i[] = $termek;
		}
	}

	echo '<pre>--> ';
	echo '<strong>Hátravan: '. count($error_i).'</strong><br />';
	echo '<strong>Összes: '. $total_num.'/'.($total_num+count($error_i)).'</strong><br /><br />';
	print_r( $error_i );

	if(isset($_GET['lotto']))
	{
		$l = 0;
		$img_error = array();
		foreach($termekek as $t)
		{

			$l++;
			if(isset($t['kep']) && !empty($t['kep']))
				echo "<img src=\"http://www.crystalnails.hu/bolt/img/galeria/".$t['kep']."\" width='60' />";
			else
				echo "<img src='".$t['kep_link']."' width='60' data-kep='".$t['kep']."' data-link='".$t['link']."' data-nev='".$t['nev']."' data-id='".$t['id']."' />";

			if($t['kep'] == '' && $t['kep_link'] == '')
			{
				$img_error[] = $t;
			}

			if($l % 10 == 0)
			{
				echo '<br />';
			}
		}
	}

echo '<hr />||'.count($img_error);
echo '<pre>';
print_r( $img_error );
die();
	die();




die();

Zerion Mini Shell 1.0