<?php define('VIEW_DEBAG', true); require './lib.php'; $dirFiles = '/home/vench/dev/see/test-new/B/'; ////circl/'; $idFetch = 4; $sacn = scandir($dirFiles); $hashObj = getHashTObjects($idFetch); $hashTags = getTagHash(); foreach ($sacn as $file) { if ($file == '.' || $file == '..') { continue; } echo $file . "\n"; $sing = getDirectionPath($dirFiles . $file); if (empty($sing)) { echo "...is empty\n"; continue; } if (in_array($sing, $hashObj)) { echo "...isset\n"; continue; } $id = registerTObject($idFetch, $sing); echo "\n"; echo $sing, '-', $id; echo "\n"; //find tags $tags = findTags($sing, $hashObj); //add new object to hash
<?php require './lib.php'; $filename = 'geo_4.jpg'; //$filename = 'photo.jpg'; $sing = getDirectionPath($filename); echo "\n"; print_r($sing); echo "\n";
<?php define('VIEW_DEBAG', !true); require './lib.php'; $file = '/home/vench/dev/see/test-new/circl/index.png'; $file = '/home/vench/32.jpg'; $s = getDirectionPath($file); if (empty($s)) { echo "...is empty\n"; exit; } echo "find tags\n"; $hashTags = getTagHash(); $find = []; for ($i = 0; $i < strlen($s); $i++) { $n = MIN_TAG_LENGTH; do { $p = substr($s, $i, $n++); if (isset($hashTags[$p])) { $find[] = $hashTags[$p]; } } while ($i + $n < strlen($s)); } //print_r($find); $sql = 'SELECT o.object_id, sum(g.size) s , count(*) c FROM `tag_object_templ` t inner join object_templ o ON (t.object_templ_id = o.id) inner join tag g ON (t.tag_id = g.id) WHERE t.tag_id IN (' . join(',', $find) . ') GROUP by o.object_id';