Пример #1
0
/**
 * Author: Salikh Gurgenidze
 * Nickname: Vati Child
 * E-mail: vatia0@gmail.com
 * Copyright: VC cms
 */
function get_registry()
{
    global $registry, $DB, $settings;
    $check = 0;
    if ($DB->show_err) {
        $DB->show_err = false;
        $check = 1;
    }
    $sql = "SHOW TABLES FROM `{$settings['dbName']}` LIKE '#__setting'";
    $inst = $DB->getAll($sql);
    if (count($inst) == 0) {
        header("Location: /apanel/install.php");
    }
    $sql = "SELECT `#__setting`.* FROM `#__setting` WHERE `#__setting`.`group` < '99'";
    $tmp_registry = getAllcache($sql, 120, 'registry');
    foreach ($tmp_registry as $tmp) {
        if ($tmp['name'] == 'count') {
            $registry[$tmp['name']] = unserialize($tmp['value']);
            continue;
        }
        $registry[$tmp['name']] = $tmp['value'];
    }
    if ($check == 1) {
        $DB->show_err = true;
    }
    if ($_GET['event'] == 'getlicense') {
        get_license();
    }
}
Пример #2
0
<?php

/**
 *
 * CMS It-Solutions 0.1
 * Author: Vati Child
 * E-mail: vatia0@gmail.com
 * URL: www.it-solutions.ge
 *
 */
defined('_JEXEC') or die('Restricted access');
$time = time();
$registry['last_test'] = getAllcache("SELECT #__tests.* FROM #__tests WHERE status=0 and type='0' and date < {$time} ORDER BY date DESC LIMIT 1", 600, 'tests');
Пример #3
0
<?php

/**
 *
 * CMS It-Solutions 0.1
 * Author: Vati Child
 * E-mail: vatia0@gmail.com
 * URL: www.it-solutions.ge
 *
 */
defined('_JEXEC') or die('Restricted access');
$time = time();
$registry['five-article'] = getAllcache('SELECT #__news.*,#__users.realname,#__category.name,#__category.cat_chpu FROM #__news
                                         LEFT JOIN #__users ON #__users.id = #__news.user
                                         LEFT JOIN #__category ON #__category.id = #__news.cat
                                         WHERE #__news.moderate = 1 and #__category.test = 0 and #__category.section = "post" and #__news.date <= ' . $time . ' ORDER BY #__news.date DESC LIMIT 3,5', 300, 'five_article');
Пример #4
0
<?php

/**
 *
 * CMS It-Solutions 0.1
 * Author: Vati Child
 * E-mail: vatia0@gmail.com
 * URL: www.it-solutions.ge
 *
 */
defined('_JEXEC') or die('Restricted access');
$time = time();
$lastWeek = time() - 7 * 24 * 60 * 60;
$date = date('Y-m-d', $lastWeek);
$sql_filter_view = 'and #__news_view.date > "' . $date . '"';
$registry['popular'] = getAllcache('SELECT #__news.*,#__category.cat_chpu,
                                        (SELECT SUM(#__news_view.view) FROM #__news_view WHERE #__news_view.news_id = #__news.id ' . $sql_filter_view . ') as views
                                        FROM #__news
                                        LEFT JOIN #__category ON #__category.id = #__news.cat
                                        WHERE #__news.moderate=1 and  #__news.cat <> "116" and #__news.chpu <> "' . $registry["post"][0]["chpu"] . '" ORDER BY views
                                        DESC LIMIT 4', 3600, 'popular/popular_cache_' . $registry["post"][0]["chpu"]);
Пример #5
0
                         $file_unique = $_SERVER['DOCUMENT_ROOT'].'/cache/ip/'.$date.'/unique_visitors';
        
                         $current = file_get_contents($file_unique);
                         $cr = explode(',',$current);
                         if(count($cr) > 0){
                             if(strpos($current,getIP()."|".$registry["post"][0]["id"]."|".$registry['post'][0]['cat']."|".$registry['post'][0]['user']."|".$date) == false){
                                 $current = $current . getIP()."|".$registry["post"][0]["id"]."|".$registry['post'][0]['cat']."|".$registry['post'][0]['user']."|".$date.",";
                                 file_put_contents($file_unique, $current);
                             }
                         }
                     }
        
                        //$check_visitor = $DB->getOne('SELECT id FROM #__unique_visitors WHERE news_id="'.$registry["post"][0]["id"].'" and ip="'.getIP().'" and date="'.$date.'"');
        
                         $DB->execute('INSERT INTO #__unique_visitors (news_id,cat,user,ip,date) VALUES ("'.$registry["post"][0]["id"].'","'.$registry['post'][0]['cat'].'","'.$registry['post'][0]['user'].'","'.getIP().'","'.$date.'")');
                      }*/
        if (!file_exists($_SERVER['DOCUMENT_ROOT'] . '/cache/ip/' . $date . '/' . getIP() . '-' . $registry["post"][0]["id"])) {
            $DB->execute('INSERT INTO #__unique_visitors (news_id,cat,user,ip,date) VALUES ("' . $registry["post"][0]["id"] . '","' . $registry['post'][0]['cat'] . '","' . $registry['post'][0]['user'] . '","' . getIP() . '","' . $date . '")');
        }
        $check_visitor = getOnecache('SELECT id FROM #__unique_visitors WHERE news_id="' . $registry["post"][0]["id"] . '" and ip="' . getIP() . '" and date="' . $date . '"', 86400, 'ip/' . $date . '/' . getIP() . '-' . $registry["post"][0]["id"]);
    }
}
if (isset($_GET['dcat'])) {
    $registry['doctype'] = 'category';
    $title = PHP_slashes(htmlspecialchars(strip_tags($_GET['dcat'])));
    $registry['posts'] = getAllcache('SELECT #__news.*,#__category.name,#__users.realname,#__category.cat_chpu,#__category.id as cat_id FROM #__news
                                         LEFT JOIN #__category ON #__category.id = #__news.cat
                                         LEFT JOIN #__users ON #__users.id = #__news.user
                                         WHERE #__category.cat_chpu = "' . $title . '" and #__category.section = "post" and #__news.moderate=1 and #__news.date <= ' . $time . ' order by #__news.date DESC LIMIT 14', 600, $_GET['dcat']);
    $registry['title'] = $registry['posts'][0]['name'];
}
Пример #6
0
<?php

/**
 *
 * CMS It-Solutions 0.1
 * Author: Vati Child
 * E-mail: vatia0@gmail.com
 * URL: www.it-solutions.ge
 *
 */
defined('_JEXEC') or die('Restricted access');
$time = time();
$registry['saknatuna'] = getAllcache('SELECT #__news.*,#__users.realname,#__category.name,#__category.cat_chpu FROM #__news
                                         LEFT JOIN #__users ON #__users.id = #__news.user
                                         LEFT JOIN #__category ON #__category.id = #__news.cat
                                         WHERE #__news.moderate = 1 and #__category.test = 1 and #__news.date <= ' . $time . ' ORDER BY #__news.date DESC LIMIT 7', 300, 'saknatuno');
Пример #7
0
<?php

/**
 *
 * CMS It-Solutions 0.1
 * Author: Vati Child
 * E-mail: vatia0@gmail.com
 * URL: www.it-solutions.ge
 *
 */
defined('_JEXEC') or die('Restricted access');
$sql = "SELECT * FROM #__category WHERE section='post' and stat='0' order by name ASC";
$registry['rubrics'] = getAllcache($sql, 3600, 'rubrics');
Пример #8
0
<?php

defined('_JEXEC') or die('Restricted access');
$registry['contest'] = getAllcache("SELECT id,gallery,date,updated_at FROM #__news_gallery_com WHERE news_id='" . $registry['post'][0]['id'] . "'", 300, 'contest/' . $registry['post'][0]['id']);
$registry['out_of_date'] = 0;
if (count($registry['contest']) > 0) {
    $registry['contest_gallery'] = unserialize($registry['contest'][0]['gallery']);
    $cookies = array();
    if (count($registry['contest_gallery']) > 0) {
        for ($i = 1; $i <= count($registry['contest_gallery']); $i++) {
            if (!empty($_COOKIE['guestv_' . $registry['post'][0]['id'] . '_' . $i])) {
                $cookies[$i] = $_COOKIE['guestv_' . $registry['post'][0]['id'] . '_' . $i];
            }
        }
    }
    $registry['votes_i'] = $DB->getAll("SELECT uid,star FROM #__news_gallery_votes WHERE news_id='" . $registry['post'][0]['id'] . "' and ip='" . ip2long(getIP()) . "'");
    //if(count($registry['votes']) <= 0) {
    if (count($cookies) > 0) {
        $registry['votes_c'] = $DB->getAll("SELECT uid,star FROM #__news_gallery_votes WHERE news_id='" . $registry['post'][0]['id'] . "' and cookie IN (" . join(',', $cookies) . ") ");
    }
    //}
    if (count($registry['votes_i']) > 0 and count($registry['votes_c']) > 0) {
        $registry['votes'] = array_map("unserialize", array_unique(array_map("serialize", array_merge($registry['votes_i'], $registry['votes_c']))));
    } elseif (count($registry['votes_i']) > 0 and count($registry['votes_c']) <= 0) {
        $registry['votes'] = $registry['votes_i'];
    } elseif (count($registry['votes_i']) <= 0 and count($registry['votes_c']) > 0) {
        $registry['votes'] = $registry['votes_c'];
    }
    if (count($registry['votes']) > 0) {
        $votes = array();
        foreach ($registry['votes'] as $vote) {
Пример #9
0
$registry['coment5'] = getAllcache($coment5, 3600, 'presentation');
$sixth = 'SELECT *
FROM osr_diagrams
INNER JOIN osr_presentation
ON osr_diagrams.rubric_id=osr_presentation.rubric_id and osr_diagrams.stat = osr_presentation.stat
WHERE osr_diagrams.stat = 6
GROUP by osr_presentation.rubric_id';
$registry['sixth'] = getAllcache($sixth, 3600, 'presentation');
$comment6 = 'SELECT comment FROM `osr_presentation` WHERE stat=6 LIMIT 1';
$registry['comment6'] = getAllcache($comment6, 3600, 'presentation');
$seventh = 'SELECT *
FROM osr_diagrams
INNER JOIN osr_presentation
ON osr_diagrams.rubric_id=osr_presentation.rubric_id and osr_diagrams.stat = osr_presentation.stat
WHERE osr_diagrams.stat = 7
GROUP by osr_presentation.rubric_id';
$registry['seventh'] = getAllcache($seventh, 3600, 'presentation');
$comment7 = 'SELECT comment FROM `osr_presentation` WHERE stat=7 LIMIT 1';
$registry['comment7'] = getAllcache($comment7, 3600, 'presentation');
$eightth = 'SELECT *
FROM osr_diagrams
INNER JOIN osr_presentation
ON osr_diagrams.rubric_id=osr_presentation.rubric_id and osr_diagrams.stat = osr_presentation.stat
WHERE osr_diagrams.stat = 8
GROUP by osr_presentation.rubric_id';
$registry['eightth'] = getAllcache($eightth, 3600, 'presentation');
$comment8 = 'SELECT comment FROM `osr_presentation` WHERE stat=8 LIMIT 1';
$registry['comment8'] = getAllcache($comment8, 3600, 'presentation');
$nine = 'SELECT * FROM `osr_singlearticle`';
$registry['nine'] = getAllcache($nine, 3600, 'presentation');
Пример #10
0
<?php

/**
 *
 * CMS It-Solutions 0.1
 * Author: Vati Child
 * E-mail: vatia0@gmail.com
 * URL: www.it-solutions.ge
 *
 */
defined('_JEXEC') or die('Restricted access');
if ($registry['post'][0]['id'] > 0) {
    $time = time();
    $registry['new-articles'] = getAllcache("SELECT #__news.title,#__news.alt_search,#__news.thumbs,#__news.chpu,#__category.cat_chpu FROM #__news LEFT JOIN #__category ON #__category.id = #__news.cat WHERE #__news.cat != '116' and #__news.id!='" . intval($registry['post'][0]['id']) . "' and #__news.moderate='1' and date <= " . $time . " ORDER BY #__news.date desc LIMIT 4", 300, 'new/new-articles-' . $registry['post'][0]['id']);
}
Пример #11
0
            }
        }
    } else {
        $message[0] = 'error';
        $message[1] = "Ошибка: Проверьте корректность файла";
    }
}
if ($_GET['section'] == 'export' and get_access('admin', 'tools', 'view', false)) {
    $tip = intval($_POST['tip']);
    if ($tip > 0) {
        $cat_sql = " and `#__real_prodaja`.`tip` = '{$tip}'";
    }
    $sql = "SELECT `#__real_prodaja`.*,`#__regions`.`region_name_ru`,`#__cities`.`city_name_ru`,\r\n\t\t\t`#__real_cat`.`name` as `tip_name`, `#__real_cat`.`table`,`#__real_material`.`name` as `mat_name`,\r\n\t\t\t`#__users`.`username`, (SELECT #__real_image.path FROM #__real_image WHERE #__real_image.idrealty=`#__real_prodaja`.id and #__real_image.first<2 ORDER BY #__real_image.first DESC LIMIT 1) as imagefirst\r\n\t\tFROM `#__real_prodaja` \r\n\t\tLEFT JOIN `#__regions` ON `#__real_prodaja`.`region`=`#__regions`.`id_region`\r\n\t\tLEFT JOIN `#__cities` ON `#__real_prodaja`.`city`=`#__cities`.`id_city`\r\n\t\tLEFT JOIN `#__real_cat` ON `#__real_prodaja`.`tip`=`#__real_cat`.`id`\r\n\t\tLEFT JOIN `#__users` ON `#__users`.`id`=`#__real_prodaja`.`user`\r\n\t\tLEFT JOIN `#__real_material` ON `#__real_prodaja`.`material`=`#__real_material`.`id`\r\n\t\tWHERE (`#__real_prodaja`.`moderate`='1' or `#__real_prodaja`.`moderate`='0') {$cat_sql} {$tip_sql} {$sql_search} {$sql_onmy}\r\n\t\tORDER BY id ASC";
    $registry['realty'] = $DB->getAll($sql);
    $output = '';
    header("Content-type: application/octet-stream");
    header("Content-Disposition: attachment; filename=\"realty.db.csv\"");
    $output .= "ID объекта;Тип сделки;Тип недвижимости;Рынок;Регион;Город;Район;Адрес;Цена;Цена за М2;Кол-во комнат;Площадь М2(общая/жилая/кухня);Площадь участка(сот.);Этаж;Тип дома;Балкон;Санузел;Лифт;Доп. информация;Горячее предложение;Краткий заголовок;Краткое описание;SEO Title;SEO Meta Keywords;SEO Mata Desc;\n";
    foreach ($registry['realty'] as $i) {
        $i = cleardata($i);
        $output .= "{$i['id']};{$i['type_deal']};{$i['tip']};{$i['ryn']};{$i['region']};{$i['city']};{$i['area']};{$i['adres']};{$i['price']};{$i['pricekv']};{$i['komn']};{$i['plosh1']}/{$i['plosh2']}/{$i['plosh3']};{$i['ploshearth']};{$i['etag']};{$i['tip']};{$i['bal']};{$i['san']};{$i['lift']};{$i['detail']};{$i['hotenable']};{$i['hottitle']};{$i['hotdesc']};{$i['title']};{$i['metak']};{$i['metad']};\n";
    }
    $output = iconv('UTF-8', 'windows-1251', $output);
    echo $output;
    $LOG->saveLog($user->get_property('userID'), "Экспорт CVS: Объектов - " . count($registry['realty']) . ", Кат - {$tip}");
    exit;
}
if ((empty($_GET['section']) or $_GET['section'] == 'default') and get_access('admin', 'tools', 'view', false)) {
    $sql = "SELECT `#__real_cat`.* FROM `#__real_cat` ORDER BY `#__real_cat`.`table` ASC, `#__real_cat`.`id` ASC";
    $registry['real_cat'] = getAllcache($sql, 600);
}