Ejemplo n.º 1
0
function mod_guestbook()
{
    require_once BASE_DIR . '/functions/func.modulglobals.php';
    set_modul_globals('guestbook');
    require_once BASE_DIR . '/modules/guestbook/class.guest.php';
    $Guest = new Guest();
    $Guest->guestbookShow("standalone");
}
Ejemplo n.º 2
0
/**
 * Функция обработки тега модуля
 *
 */
function mod_moredoc()
{
    global $AVE_Core, $AVE_DB, $AVE_Template;
    require_once BASE_DIR . '/functions/func.modulglobals.php';
    set_modul_globals('moredoc');
    $AVE_Template->caching = true;
    // Включаем кеширование
    $AVE_Template->cache_lifetime = 60 * 60 * 24;
    // Время жизни кеша 1 день в секундах
    //	$AVE_Template->cache_dir .= '/moredoc';   // Папка для кеша модуля
    $tpl_dir = BASE_DIR . '/modules/moredoc/templates/';
    // Указываем путь к шаблону модуля
    // Если нету в кеше, то начинаем обрабатывать
    if (!$AVE_Template->is_cached($tpl_dir . 'moredoc.tpl', $AVE_Core->curentdoc->Id)) {
        $limit = 5;
        // Количество связных документов
        $flagrubric = 1;
        // Учитывать или нет рубрику документа (0 - нет, 1 - да)
        $moredoc = array();
        // Проверяем, есть ли папка для кеша, если нет (первый раз) — создаем
        if (!is_dir($AVE_Template->cache_dir)) {
            $oldumask = umask(0);
            @mkdir($AVE_Template->cache_dir, 0777);
            umask($oldumask);
        }
        // Получаем ключевые слова, рубрику, извлекаем первое ключевое слово
        $row = $AVE_DB->Query("\r\n\t\t\tSELECT\r\n\t\t\t\trubric_id,\r\n\t\t\t\tdocument_meta_keywords\r\n\t\t\tFROM " . PREFIX . "_documents\r\n\t\t\tWHERE Id = '" . $AVE_Core->curentdoc->Id . "'\r\n\t\t\tLIMIT 1\r\n\t\t")->FetchRow();
        $keywords = explode(',', $row->document_meta_keywords);
        $keywords = trim($keywords[0]);
        if ($keywords != '') {
            $inrubric = $flagrubric ? "AND rubric_id = '" . $row->rubric_id . "'" : '';
            $doctime = get_settings('use_doctime') ? "AND document_published <= " . time() . " AND (document_expire = 0 OR document_expire >= " . time() . ")" : '';
            // Ищем документы где встречается такое-же слово
            $sql = $AVE_DB->Query("\r\n\t\t\t\tSELECT\r\n\t\t\t\t\tId,\r\n\t\t\t\t\tdocument_expire,\r\n\t\t\t\t\tdocument_title,\r\n\t\t\t\t\tdocument_alias,\r\n\t\t\t\t\tdocument_meta_description\r\n\t\t\t\tFROM " . PREFIX . "_documents\r\n\t\t\t\tWHERE document_meta_keywords LIKE '" . $keywords . "%'\r\n\t\t\t\tAND Id != 1\r\n\t\t\t\tAND Id != '" . PAGE_NOT_FOUND_ID . "'\r\n\t\t\t\tAND Id != '" . $AVE_Core->curentdoc->Id . "'\r\n\t\t\t\tAND document_status != '0'\r\n\t\t\t\tAND document_deleted != '1'\r\n\t\t\t\t" . $inrubric . "\r\n\t\t\t\t" . $doctime . "\r\n\t\t\t\tORDER BY document_count_view DESC\r\n\t\t\t\tLIMIT " . $limit);
            while ($row = $sql->FetchRow()) {
                if ($doctime != '' && time() + $AVE_Template->cache_lifetime > $row->document_expire) {
                    // Изменяем время жизни кеша так что-бы оно не превышало
                    // время окончания публикации попавших в выборку документов
                    $AVE_Template->cache_lifetime = $row->document_expire - time();
                }
                $row->document_link = rewrite_link('index.php?id=' . $row->Id . '&amp;doc=' . (empty($row->document_alias) ? prepare_url($row->document_title) : $row->document_alias));
                array_push($moredoc, $row);
            }
            // Закрываем соединение
            $sql->Close();
        }
        // Передаём переменную moredoc в шаблон
        $AVE_Template->assign('moredoc', $moredoc);
    }
    // Выводим шаблон moredoc.tpl
    $AVE_Template->display($tpl_dir . 'moredoc.tpl', $AVE_Core->curentdoc->Id);
    $AVE_Template->caching = false;
    // Отключаем кеширование
}
Ejemplo n.º 3
0
{
    //	require_once(BASE_DIR . '/modules/recommend/class.recommend.php');
    //	require_once(BASE_DIR . '/functions/func.modulglobals.php');
    //
    //	set_modul_globals('recommend');
    //	$recommend = new Recommend;
    //	$recommend->displayLink();
    ?>
<a href="javascript:void(0);" onclick="popup('<?php 
    echo ABS_PATH;
    ?>
index.php?module=recommend&amp;action=form&amp;pop=1&amp;theme_folder=ave&amp;page=<?php 
    echo base64_encode(get_redirect_link());
    ?>
','recommend','500','380','1');">Рекомендовать сайт</a>
<?php 
}
if (isset($_REQUEST['module']) && $_REQUEST['module'] == 'recommend' && isset($_REQUEST['action'])) {
    require_once BASE_DIR . '/modules/recommend/class.recommend.php';
    require_once BASE_DIR . '/functions/func.modulglobals.php';
    set_modul_globals('recommend');
    $recommend = new Recommend();
    switch ($_REQUEST['action']) {
        case 'form':
            $recommend->displayForm($_REQUEST['theme_folder']);
            break;
        case 'recommend':
            $recommend->sendForm($_REQUEST['theme_folder']);
            break;
    }
}
Ejemplo n.º 4
0
 define('COMMENTSBBCODE', $row_set['bbcode']);
 define('MAXLENGTH_POST', $row_gs->max_lenght_post);
 define('MAXATTACHMENTS', $row_gs->max_attachments);
 define('forum_images', 'templates/' . THEME_FOLDER . '/modules/forums/');
 define('TOPIC_TYPE_NONE', 0);
 define('TOPIC_TYPE_STICKY', 1);
 define('TOPIC_TYPE_ANNOUNCE', 100);
 define('EXPIRE_MINUTE', time() + 60);
 define('EXPIRE_HOURS', time() + 60 * 60);
 define('EXPIRE_DAY', time() + 60 * 60 * 24);
 define('EXPIRE_MONTH', time() + 60 * 60 * 24 * 30);
 define('EXPIRE_YEAR', time() + 60 * 60 * 24 * 30 * 365);
 define('MAX_EDIT_PERIOD', $row_gs->max_edit_period);
 // Zeit in Stunden, in der der ein Beitrag editiert werden kann 720 = 1 Monat
 require_once BASE_DIR . '/functions/func.modulglobals.php';
 set_modul_globals('forums');
 if (defined('THEME_FOLDER')) {
     $AVE_Template->assign('theme_folder', THEME_FOLDER);
 }
 define('USERNAME', isset($_SESSION['user_id']) && is_numeric($_SESSION['user_id']) ? $forums->fetchusername($_SESSION['user_id']) : UNAME);
 $_SESSION['forum_user_name'] = isset($_SESSION['user_id']) ? $forums->fetchusername($_SESSION['user_id']) : $GLOBALS['mod']['config_vars']['FORUMS_GUEST'];
 $_SESSION['forum_user_email'] = isset($_SESSION['user_id']) ? $forums->getForumUserEmail($_SESSION['user_id']) : '';
 $forums->UserOnlineUpdate();
 $AVE_Template->register_function('cpencode', 'cpencode');
 $AVE_Template->register_function('cpdecode', 'cpdecode');
 $AVE_Template->register_function('get_post_icon', 'getPostIcon');
 $AVE_Template->assign('forum_images', 'templates/' . THEME_FOLDER . '/modules/forums/');
 $AVE_Template->assign('sys_avatars', SYSTEMAVATARS);
 $AVE_Template->assign('header', $row_set['pageheader']);
 $AVE_Template->assign('pageheader', $row_set['pageheader']);
 $AVE_Template->assign('inc_path', BASE_DIR . '/modules/forums/templates');
Ejemplo n.º 5
0
     require_once BASE_DIR . '/modules/shop/class.shop_admin.php';
 } else {
     require_once BASE_DIR . '/modules/shop/class.shop.php';
 }
 require_once BASE_DIR . '/modules/shop/funcs/func.parent_categ.php';
 require_once BASE_DIR . '/modules/shop/funcs/func.rewrite.php';
 if (defined('THEME_FOLDER')) {
     $AVE_Template->assign('shop_images', 'templates/' . THEME_FOLDER . '/modules/shop/');
 }
 if (defined('THEME_FOLDER')) {
     $AVE_Template->assign('theme_folder', THEME_FOLDER);
 }
 $_REQUEST['action'] = empty($_REQUEST['action']) ? 'shopstart' : $_REQUEST['action'];
 if (isset($_REQUEST['module']) && $_REQUEST['module'] == 'shop') {
     require_once BASE_DIR . '/functions/func.modulglobals.php';
     set_modul_globals('shop');
     $shop = new Shop();
     switch ($_REQUEST['action']) {
         case 'shopstart':
             $shop->checkShop();
             $shop->getTplSettings();
             $shop->displayShopStart();
             break;
         case 'product_detail':
             if (!isset($_REQUEST['product_id']) || !is_numeric($_REQUEST['product_id'])) {
                 header('Location:index.php?module=shop');
                 exit;
             }
             $shop->checkShop();
             $shop->getTplSettings();
             $shop->showDetails($_REQUEST['product_id']);
Ejemplo n.º 6
0
 //=======================================================
 if (defined('ACP') && !(isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) {
     require_once BASE_DIR . '/modules/download/class.download_admin.php';
 } else {
     require_once BASE_DIR . '/modules/download/class.download.php';
 }
 require_once BASE_DIR . '/functions/func.modulglobals.php';
 #require_once(BASE_DIR . '/modules/download/funcs/func.parent_categ.php');
 require_once BASE_DIR . '/modules/download/funcs/func.rewrite.php';
 if (defined('THEME_FOLDER')) {
     $GLOBALS['AVE_Template']->assign('download_images', 'templates/' . THEME_FOLDER . '/modules/download/');
     $GLOBALS['AVE_Template']->assign('theme_folder', THEME_FOLDER);
 }
 $_REQUEST['action'] = !isset($_REQUEST['action']) || $_REQUEST['action'] == '' ? 'downloadstart' : $_REQUEST['action'];
 if (isset($_REQUEST['module']) && $_REQUEST['module'] == 'download' && isset($_REQUEST['action'])) {
     set_modul_globals('download');
     $download = new Download();
     switch ($_REQUEST['action']) {
         case 'downloadstart':
             $download->overView();
             break;
         case 'showfile':
             $download->showFile($_GET['file_id']);
             break;
         case 'get_file':
             $download->getFile($_GET['file_id']);
             break;
         case 'get_nouserpay_file':
             $download->getNoUserPayFile($_GET['file_id'], $_GET['diff'], $_GET['val']);
             break;
         case 'get_nopay_file':