}
/* ---  modul  --- */
// titulek
if (_template_autoheadings == 1) {
    $module .= "<h1>" . $_lang['mod.profile.arts'] . "</h1><br />";
}
// vyhledavaci pole
// odkaz zpet na profil
if ($list) {
    $module .= "\n<a href='index.php?m=profile&amp;id=" . $id . "' class='backlink'>&lt; " . $_lang['global.return'] . "</a>\n";
}
$module .= "\n  <form action='index.php' method='get'>\n  <input type='hidden' name='m' value='profile-arts' />\n  <input type='text' name='id'" . ($id != null ? " value='" . $id . "'" : '') . " class='inputmedium' /> <input type='submit' value='" . $_lang['global.open'] . "' />\n  </form><br />\n  " . $message;
// tabulka
if ($list == true) {
    $cond = "art.author=" . $query['id'] . " AND " . _sqlArticleFilter(true);
    $paging = _resultPaging("index.php?m=profile-arts&amp;id=" . $id, 15, "articles:art", $cond);
    if (_pagingmode == 1 or _pagingmode == 2) {
        $module .= $paging[0];
    }
    $arts = DB::query("SELECT art.id,art.title,art.title_seo,art.author,art.perex,art.picture_uid,art.time,art.comments,art.public,art.readed,cat.title_seo AS cat_title_seo,(SELECT COUNT(id) FROM `" . _mysql_prefix . "-posts` AS post WHERE home=art.id AND post.type=2) AS comment_count FROM `" . _mysql_prefix . "-articles` AS art JOIN `" . _mysql_prefix . "-root` AS cat ON(cat.id=art.home1) WHERE " . $cond . " ORDER BY art.time DESC " . $paging[1]);
    if (DB::size($arts) != 0) {
        while ($art = DB::row($arts)) {
            $module .= _articlePreview($art, true, true, $art['comment_count']);
        }
        if (_pagingmode == 2 or _pagingmode == 3) {
            $module .= '<br />' . $paging[0];
        }
    } else {
        $module .= $_lang['global.nokit'];
    }
}
Example #2
0
function _HCM_articles($typ = 1, $pocet = null, $perex = true, $info = true, $kategorie = null)
{
    // priprava
    $result = "";
    $typ = intval($typ);
    if ($typ < 1 or $typ > 9) {
        $typ = 1;
    }
    $pocet = intval($pocet);
    if ($pocet < 1) {
        $pocet = 1;
    }
    $perex = intval($perex);
    $info = _boolean($info);
    // limitovani na kategorie
    $rcats = _sqlArticleWhereCategories($kategorie);
    // priprava casti sql dotazu
    switch ($typ) {
        case 1:
            $rorder = "art.time DESC";
            $rcond = "";
            break;
        case 2:
            $rorder = "art.readed DESC";
            $rcond = "art.readed!=0";
            break;
        case 3:
            $rorder = "art.ratesum/art.ratenum DESC";
            $rcond = "art.ratenum!=0";
            break;
        case 4:
            $rorder = "art.ratenum DESC";
            $rcond = "art.ratenum!=0";
            break;
        case 5:
            $rorder = "RAND()";
            $rcond = "";
            break;
        case 6:
            $rorder = "(SELECT time FROM `" . _mysql_prefix . "-iplog` WHERE type=2 AND var=art.id AND art.visible=1 AND art.time<=" . time() . " AND art.confirmed=1 ORDER BY id DESC LIMIT 1) DESC";
            $rcond = "art.readed!=0";
            break;
        case 7:
            $rorder = "(SELECT time FROM `" . _mysql_prefix . "-iplog` WHERE type=3 AND var=art.id AND art.visible=1 AND art.time<=" . time() . " AND art.confirmed=1 ORDER BY id DESC LIMIT 1) DESC";
            $rcond = "art.ratenum!=0";
            break;
        case 8:
            $rorder = "(SELECT time FROM `" . _mysql_prefix . "-posts` WHERE home=art.id AND type=2 ORDER BY time DESC LIMIT 1) DESC";
            $rcond = "(SELECT COUNT(id) FROM `" . _mysql_prefix . "-posts` WHERE home=art.id AND type=2)!=0";
            break;
        case 9:
            $rorder = "(SELECT COUNT(id) FROM `" . _mysql_prefix . "-posts` WHERE home=art.id AND type=2) DESC";
            $rcond = "(SELECT COUNT(id) FROM `" . _mysql_prefix . "-posts` WHERE home=art.id AND type=2)!=0";
            break;
    }
    // pripojeni casti
    if ($rcond != "") {
        $rcond = " AND " . $rcond;
    }
    $rcond = " WHERE " . _sqlArticleFilter(true) . $rcond;
    if ($rcats != "") {
        $rcond .= " AND " . $rcats;
    }
    // vypis
    $query = DB::query("SELECT art.id,art.title,art.title_seo,art.perex," . ($perex === 2 ? 'art.picture_uid,' : '') . "art.author,art.time,art.readed,art.comments,cat.title_seo AS cat_title_seo" . ($info !== 0 ? ",(SELECT COUNT(id) FROM `" . _mysql_prefix . "-posts` AS post WHERE home=art.id AND post.type=2) AS comment_count" : '') . " FROM `" . _mysql_prefix . "-articles` AS art JOIN `" . _mysql_prefix . "-root` AS cat ON(cat.id=art.home1)" . $rcond . " ORDER BY " . $rorder . " LIMIT " . $pocet);
    while ($item = DB::row($query)) {
        $result .= _articlePreview($item, $info, $perex !== 0, $info !== 0 ? $item['comment_count'] : null);
    }
    return $result;
}
Example #3
0
$title = $query['title'];
if (_template_autoheadings && $query['autotitle']) {
    $content .= "<h1>" . $query['title'] . _linkRSS($id, 4) . "</h1>\n";
}
_extend('call', 'page.category.aftertitle', $extend_args);
// obsah
_extend('call', 'page.category.content.before', $extend_args);
if ($query['content'] != "") {
    $content .= _parseHCM($query['content']) . "\n\n<div class='hr'><hr /></div>\n\n";
}
_extend('call', 'page.category.content.after', $extend_args);
// vypis clanku
$arts_cond = "(art.home1=" . $id . " OR art.home2=" . $id . " OR art.home3=" . $id . ") AND " . _sqlArticleFilter() . " ORDER BY " . $artorder;
$paging = _resultPaging(_indexOutput_url, $artsperpage, "articles:art", $arts_cond);
$arts = DB::query("SELECT art.id,art.title,art.title_seo,art.author,art.perex," . ($query['var4'] ? 'art.picture_uid,' : '') . "art.time,art.comments,art.readed,cat.title_seo AS cat_title_seo,(SELECT COUNT(id) FROM `" . _mysql_prefix . "-posts` AS post WHERE home=art.id AND post.type=2) AS comment_count FROM `" . _mysql_prefix . "-articles` AS art JOIN `" . _mysql_prefix . "-root` AS cat ON(cat.id=art.home1) WHERE " . $arts_cond . " " . $paging[1]);
if (DB::size($arts) != 0) {
    if (_pagingmode == 1 or _pagingmode == 2) {
        $content .= $paging[0];
    }
    while ($art = DB::row($arts)) {
        $extend_item_args = _extendArgs($content, array('query' => $query, 'item-query' => &$art));
        _extend('call', 'page.category.item.before', $extend_item_args);
        $content .= _articlePreview($art, $query['var3'] == 1, true, $art['comment_count']);
        _extend('call', 'page.category.item.after', $extend_item_args);
    }
    if (_pagingmode == 2 or _pagingmode == 3) {
        $content .= '<br />' . $paging[0];
    }
} else {
    $content .= '<p>' . $_lang['misc.category.noarts'] . '</p>';
}