Example #1
0
function itemurl($item, $page = 0)
{
    global $DT, $MOD, $L;
    if ($MOD['show_html'] && $item['filepath']) {
        if ($page === 0) {
            return $item['filepath'];
        }
        $ext = file_ext($item['filepath']);
        return str_replace('.' . $ext, '_' . $page . '.' . $ext, $item['filepath']);
    }
    include DT_ROOT . '/api/url.inc.php';
    $file_ext = $DT['file_ext'];
    $index = $DT['index'];
    $itemid = $item['itemid'];
    $title = file_vname($item['title']);
    $addtime = $item['addtime'];
    $catid = $item['catid'];
    $year = date('Y', $addtime);
    $month = date('m', $addtime);
    $day = date('d', $addtime);
    $prefix = $MOD['htm_item_prefix'];
    $urlid = $MOD['show_html'] ? $MOD['htm_item_urlid'] : $MOD['php_item_urlid'];
    $ext = $MOD['show_html'] ? 'htm' : 'php';
    $alloc = dalloc($itemid);
    $url = $urls[$ext]['item'][$urlid];
    $url = $page ? $url['page'] : $url['index'];
    if (strpos($url, 'cat') !== false && $catid) {
        $cate = get_cat($catid);
        $catdir = $cate['catdir'];
        $catname = $cate['catname'];
    }
    eval("\$itemurl = \"{$url}\";");
    if (substr($itemurl, 0, 1) == '/') {
        $itemurl = substr($itemurl, 1);
    }
    return $itemurl;
}
Example #2
0
if ($pid > 0) {
    $result = $db->query("SELECT * FROM {$DT_PRE}ad WHERE pid={$pid} AND status=3 AND totime>{$DT_TIME} ORDER BY listorder ASC,addtime ASC LIMIT 10", 'CACHE');
    while ($r = $db->fetch_array($result)) {
        $r['image_src'] = linkurl($r['image_src']);
        $r['url'] = $r['stat'] ? DT_PATH . 'api/redirect.php?aid=' . $r['aid'] : linkurl($r['url']);
        $ads[] = $r;
    }
}
$MOD_MY = array();
$data = '';
$local = get_cookie('mobile_setting');
if ($local) {
    $data = $local;
} else {
    if ($_userid) {
        $data = file_get(DT_ROOT . '/file/user/' . dalloc($_userid) . '/' . $_userid . '/mobile.php');
        if ($data) {
            set_cookie('mobile_setting', $data, $DT_TIME + 30 * 86400);
        }
    }
}
if ($data) {
    $MOB_MOD = array();
    foreach ($MOB_MODULE as $m) {
        $MOB_MOD[$m['moduleid']] = $m;
    }
    foreach (explode(',', $data) as $id) {
        if (isset($MOB_MOD[$id])) {
            $MOD_MY[] = $MOB_MOD[$id];
        }
    }
Example #3
0
<?php

defined('IN_DESTOON') or exit('Access Denied');
if (!$_userid) {
    exit;
}
isset($MODULE[$mid]) or exit;
if ($job == 'get') {
    $file = DT_ROOT . '/file/user/' . dalloc($_userid) . '/' . $_userid . '/editor.data.' . $mid . '.php';
    $content = file_get($file);
    if ($content) {
        echo substr($content, 13);
    } else {
        echo '';
    }
} else {
    if (!$content) {
        exit;
    }
    $content = stripslashes($content);
    $content = convert($content, 'UTF-8', DT_CHARSET);
    $content = '<?php exit;?>' . timetodate($DT_TIME) . $content;
    file_put(DT_ROOT . '/file/user/' . dalloc($_userid) . '/' . $_userid . '/editor.data.' . $mid . '.php', $content);
}
Example #4
0
    $user = $do->get_one();
    extract($user);
    $logintime = timetodate($logintime, 5);
    $regtime = timetodate($regtime, 5);
    $userurl = userurl($_username, '', $domain);
    $sys = array();
    $i = 0;
    $result = $db->query("SELECT itemid,title,addtime,groupids FROM {$DT_PRE}message WHERE groupids<>'' ORDER BY itemid DESC", 'CACHE');
    while ($r = $db->fetch_array($result)) {
        $groupids = explode(',', $r['groupids']);
        if (!in_array($_groupid, $groupids)) {
            continue;
        }
        if ($i > 2) {
            continue;
        }
        $i++;
        $sys[] = $r;
    }
    $note = DT_ROOT . '/file/user/' . dalloc($_userid) . '/' . $_userid . '/note.php';
    $note = file_get($note);
    if ($note) {
        $note = substr($note, 13);
    } else {
        $note = $MOD['usernote'];
    }
    $trade = $db->count("{$DT_PRE}mall_order", "seller='{$_username}' AND status=0");
    $expired = $totime && $totime < $DT_TIME ? true : false;
    $havedays = $expired ? 0 : ceil(($totime - $DT_TIME) / 86400);
    include template('index', $module);
}
Example #5
0
<?php

defined('IN_DESTOON') or exit('Access Denied');
if (!$_userid) {
    exit;
}
isset($MODULE[$mid]) or exit;
$file = DT_ROOT . '/file/user/' . dalloc($_userid) . '/' . $_userid . '/editor.data.' . $mid . '.php';
$content = file_get($file);
if ($content) {
    echo substr($content, 13);
} else {
    echo '';
}
Example #6
0
<?php

/*
	[Destoon B2B System] Copyright (c) 2008-2015 www.destoon.com
	This is NOT a freeware, use is subject to license.txt
*/
require 'common.inc.php';
$file = DT_ROOT . '/file/user/' . dalloc($_userid) . '/' . $_userid . '/mobile.php';
$local = get_cookie('mobile_setting');
$MOB_MOD = array();
foreach ($MOB_MODULE as $m) {
    $MOB_MOD[$m['moduleid']] = $m;
}
if ($action == 'sync') {
    isset($id) or $id = '';
    if ($id == 'clear') {
        if ($_userid) {
            file_del($file);
        }
        set_cookie('mobile_setting', '');
        exit('ok');
    } else {
        $ids = '';
        foreach (explode(',', $id) as $mid) {
            $mid = intval($mid);
            if (isset($MOB_MOD[$mid])) {
                $ids .= ',' . $mid;
            }
        }
        if ($ids) {
            $ids = substr($ids, 1);