Exemplo n.º 1
0
function _HCM_recentposts($limit = null, $stranky = "", $typ = null)
{
    // priprava
    $result = "";
    if (isset($limit) and intval($limit) >= 1) {
        $limit = abs(intval($limit));
    } else {
        $limit = 10;
    }
    // filtr cisel sekci, knih nebo clanku
    if (isset($stranky) and isset($typ)) {
        $rtype = intval($typ);
        if ($rtype < 1 or $rtype > 3) {
            $rtype = 1;
        }
        $rroots = "(" . _sqlWhereColumn("home", $stranky) . ") AND type=" . $rtype;
    } else {
        $rroots = "type!=4 AND type!=6 AND type!=7";
    }
    $query = DB::query("SELECT id,type,home,xhome,subject,author,guest,time,text FROM `" . _mysql_prefix . "-posts` WHERE " . $rroots . " ORDER BY id DESC LIMIT " . $limit);
    while ($item = DB::row($query)) {
        // nacteni titulku a odkazu na stranku
        switch ($item['type']) {
            case 1:
            case 3:
                $hometitle = DB::query_row("SELECT title,title_seo FROM `" . _mysql_prefix . "-root` WHERE id=" . $item['home']);
                $homelink = _linkRoot($item['home'], $hometitle['title_seo']);
                break;
            case 2:
                $hometitle = DB::query_row("SELECT art.title,art.title_seo,cat.title_seo AS cat_title_seo FROM `" . _mysql_prefix . "-articles` AS art JOIN `" . _mysql_prefix . "-root` AS cat ON(cat.id=art.home1) WHERE art.id=" . $item['home']);
                $homelink = _linkArticle($item['home'], $hometitle['title_seo'], $hometitle['cat_title_seo']);
                break;
            case 5:
                if ($item['xhome'] == -1) {
                    $tid = $item['id'];
                    $hometitle = array("title" => $item['subject']);
                } else {
                    $tid = $item['xhome'];
                    $hometitle = DB::query_row("SELECT subject FROM `" . _mysql_prefix . "-posts` WHERE id=" . $item['xhome']);
                    $hometitle = array("title" => $hometitle['subject']);
                }
                $homelink = "index.php?m=topic&amp;id=" . $tid;
                break;
        }
        // nacteni jmena autora
        if ($item['author'] != -1) {
            $authorname = _linkUser($item['author'], null, true, true);
        } else {
            $authorname = $item['guest'];
        }
        $hometitle = $hometitle['title'];
        $result .= "\n<h2 class='list-title'><a href='" . $homelink . "'>" . $hometitle . "</a></h2>\n<p class='list-perex'>" . _cutStr(strip_tags(_parsePost($item['text'])), 256) . "</p>\n<div class='list-info'>\n<span>" . $GLOBALS['_lang']['global.postauthor'] . ":</span> " . $authorname . _template_listinfoseparator . "\n<span>" . $GLOBALS['_lang']['global.time'] . ":</span> " . _formatTime($item['time']) . "\n</div>\n\n";
    }
    return $result;
}
Exemplo n.º 2
0
function _HCM_linkroot($id = null, $text = null, $nove_okno = false)
{
    $is_id = is_numeric($id);
    if ($is_id) {
        $id = intval($id);
    } else {
        $id = DB::val($id);
    }
    $query = DB::query("SELECT title,title_seo FROM `" . _mysql_prefix . "-root` WHERE " . ($is_id ? 'id' : 'title_seo') . "=" . $id);
    if (isset($nove_okno) and _boolean($nove_okno)) {
        $target = " target='_blank'";
    } else {
        $target = "";
    }
    if (DB::size($query) != 0) {
        $query = DB::row($query);
        if (isset($text) and $text != "") {
            $query['title'] = $text;
        }
        return "<a href='" . _linkRoot($id, $query['title_seo']) . "'" . $target . ">" . $query['title'] . "</a>";
    }
}
Exemplo n.º 3
0
}
$id = intval($_GET['redir_id']);
$type = intval($_GET['redir_type']);
if ($type !== 1) {
    $type = 0;
}
/* ---  test existence  --- */
if (0 === $type) {
    $query = DB::query('SELECT `id`,`title_seo` FROM `' . _mysql_prefix . '-root` WHERE `id`=' . $id);
} else {
    $query = DB::query('SELECT art.`id`,art.`title_seo`,cat.`title_seo` AS cat_title_seo FROM `' . _mysql_prefix . '-articles` AS art JOIN `' . _mysql_prefix . '-root` AS cat ON(cat.id=art.home1) WHERE art.`id`=' . $id);
}
$query = DB::row($query);
if ($query === false) {
    // neexistuje
    $_GET = array('m' => '404');
    define('_index_noinit', true);
    require _indexroot . 'index.php';
    die;
}
/* ---  presmerovani  --- */
// sestavit adresu
$redir = $type === 0 ? _linkRoot($query['id'], $query['title_seo']) : _linkArticle($query['id'], $query['title_seo'], $query['cat_title_seo']);
unset($_GET['redir_id'], $_GET['redir_type']);
if (!empty($_GET)) {
    $redir = _addGetToLink($redir, _buildQuery($_GET), false);
}
// poslat hlavicky
header("HTTP/1.1 301 Moved Permanently");
header("Location: " . _url . "/" . $redir);
die;
Exemplo n.º 4
0
 // vyhledani obrazku
 if ($image) {
     // zaklad dotazu
     $sql = 'SELECT img.id,img.prev,img.full,img.ord,img.home,img.title,gal.title AS gal_title,gal.title_seo,gal.var2 FROM `' . _mysql_prefix . '-images` AS img';
     // join na galerii
     $sql .= ' JOIN `' . _mysql_prefix . '-root` AS gal ON(gal.id=img.home)';
     // podminky
     $sql .= ' WHERE gal.visible=1';
     if ($public) {
         $sql .= ' AND gal.public=1';
     }
     $sql .= ' AND ' . _tmpSearchQuery('img', array('title'));
     // vykonani a nacteni vysledku
     $q = DB::query($sql . ' LIMIT 20');
     while ($r = DB::row($q)) {
         $link = _addGetToLink(_linkRoot($r['home'], $r['title_seo']), 'page=' . _resultPagingGetItemPage($r['var2'], "images", "ord<" . $r['ord'] . " AND home=" . $r['home']));
         $results[] = array($link, $r['gal_title'], ($r['title'] !== '' ? $r['title'] . '<br />' : '') . _galleryImage($r, 'search', 128, 128));
     }
     DB::free($q);
 }
 // extend
 _extend('call', 'mod.search.results', array('results' => &$results, 'query' => $search_query, 'query_sql' => $search_query_sql));
 // vypis vysledku
 if (count($results) != 0) {
     foreach ($results as $item) {
         $module .= "\n<h2 class='list-title'><a href='" . $item[0] . "'>" . $item[1] . "</a></h2>\n<p class='list-perex'>" . $item[2] . "</p>\n";
         if (isset($item[3])) {
             $module .= "<div class='list-info'>" . $item[3] . "</div>\n";
         }
     }
 } else {
Exemplo n.º 5
0
 case 5:
 case 6:
     $items = DB::query("SELECT * FROM `" . _mysql_prefix . "-posts` WHERE " . $homelimit . $typelimit . " ORDER BY id DESC LIMIT " . _rsslimit);
     $titlebonus = "";
     while ($item = DB::row($items)) {
         // nacteni jmena autora
         if ($item['author'] != -1) {
             $author = _linkUser($item['author'], null, true, true);
         } else {
             $author = $item['guest'];
         }
         // odkaz na stranku
         switch ($item['type']) {
             case 1:
             case 3:
                 $homelink = _linkRoot($item['home']);
                 break;
             case 2:
                 $homelink = _linkArticle($item['home']);
                 break;
             case 5:
                 if ($item['xhome'] == -1) {
                     $homelink = "index.php?m=topic&amp;id=" . $item['id'];
                 } else {
                     $homelink = "index.php?m=topic&amp;id=" . $item['xhome'];
                 }
                 break;
         }
         // ulozeni zaznamu
         $feeditems[] = array($author . ": " . $item['subject'], $homelink . "#posts", _cutStr(strip_tags(_parsePost($item['text'])), 255, false), $item['time']);
     }
Exemplo n.º 6
0
// kontrola jadra
if (!defined('_core')) {
    exit;
}
// vystup
$title = $query['title'];
// odkazani podle ID
if ($query['content'] !== '') {
    if (mb_substr($query['content'], 0, 1) == "*") {
        // stranka
        $lid = intval(mb_substr($query['content'], 1));
        $query['content'] = "";
        $rootdata = DB::query_row("SELECT id,title_seo FROM `" . _mysql_prefix . "-root` WHERE id=" . $lid);
        if ($rootdata !== false) {
            $query['content'] = _linkRoot($rootdata['id'], $rootdata['title_seo']);
        }
    } else {
        // clanek
        if (mb_substr($query['content'], 0, 1) == "%") {
            $lid = intval(mb_substr($query['content'], 1));
            $query['content'] = "";
            $artdata = DB::query_row("SELECT art.id,art.title_seo,cat.title_seo AS cat_title_seo FROM `" . _mysql_prefix . "-articles` AS art JOIN `" . _mysql_prefix . "-root` AS cat ON(cat.id=art.home1) WHERE art.id=" . $lid);
            if ($artdata !== false) {
                $query['content'] = _linkArticle($artdata['id'], $artdata['title_seo']);
            }
        }
    }
}
// aktivace presmerovani
if ($query['content'] != "") {
Exemplo n.º 7
0
if (_template_autoheadings && $query['autotitle']) {
    $content .= "<h1>" . $query['title'] . "</h1>\n";
}
_extend('call', 'page.intersection.aftertitle', $extend_args);
// obsah
_extend('call', 'page.intersection.content.before', $extend_args);
if ($query['content'] != "") {
    $content .= _parseHCM($query['content']) . "\n\n<div class='hr'><hr /></div>\n\n";
}
_extend('call', 'page.intersection.content.after', $extend_args);
// vypis polozek
$items = DB::query("SELECT id,title,title_seo,type,type_idt,intersectionperex,var1 FROM `" . _mysql_prefix . "-root` WHERE intersection=" . $id . " AND visible=1 ORDER BY ord");
if (DB::size($items) != 0) {
    while ($item = DB::row($items)) {
        // titulek
        $content .= "<h2 class='list-title'><a href='" . _linkRoot($item['id'], $item['title_seo']) . "'" . (($item['type'] == 6 and $item['var1'] == 1) ? " target='_blank'" : '') . ">" . $item['title'] . "</a></h2>\n";
        // perex
        if ($item['intersectionperex'] != "") {
            $content .= "<p class='list-perex'>" . $item['intersectionperex'] . "</p>\n";
        }
        // informace
        if ($query['var1'] == 1) {
            $iteminfo = "";
            switch ($item['type']) {
                // sekce
                case 1:
                    if ($item['var1'] == 1) {
                        $iteminfo .= "<span>" . $_lang['article.comments'] . ":</span> " . DB::result(DB::query("SELECT COUNT(id) FROM `" . _mysql_prefix . "-posts` WHERE type=1 AND home=" . $item['id']), 0);
                    }
                    break;
                    // kategorie
Exemplo n.º 8
0
$module .= "\n  <form action='index.php' method='get'>\n  <input type='hidden' name='m' value='profile-posts' />\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 = "author=" . $query['id'] . " AND `type`!=4 AND `type`!=6 AND `type`!=7";
    $paging = _resultPaging("index.php?m=profile-posts&amp;id=" . $id, 15, "posts", $cond);
    if (_pagingmode == 1 or _pagingmode == 2) {
        $module .= $paging[0];
    }
    $posts = DB::query("SELECT id,type,home,xhome,subject,text,author,time FROM `" . _mysql_prefix . "-posts` WHERE " . $cond . " ORDER BY time DESC " . $paging[1]);
    if (DB::size($posts) != 0) {
        while ($post = DB::row($posts)) {
            switch ($post['type']) {
                case 1:
                case 3:
                    $hometitle = DB::query_row("SELECT title,title_seo FROM `" . _mysql_prefix . "-root` WHERE id=" . $post['home']);
                    $homelink = _linkRoot($post['home'], $hometitle['title_seo']);
                    $hometitle = $hometitle['title'];
                    break;
                case 2:
                    $hometitle = DB::query_row("SELECT art.title,art.title_seo,cat.title_seo AS cat_title_seo FROM `" . _mysql_prefix . "-articles` AS art JOIN `" . _mysql_prefix . "-root` AS cat ON(cat.id=art.home1) WHERE art.id=" . $post['home']);
                    $homelink = _linkArticle($post['home'], $hometitle['title_seo']);
                    $hometitle = $hometitle['title'];
                    break;
                case 5:
                    $homelink = 'index.php?m=topic&amp;id=' . $post[$post['xhome'] == '-1' ? 'id' : 'xhome'];
                    if ($post['xhome'] == '-1') {
                        $hometitle = $post['subject'];
                    } else {
                        $hometitle = DB::query_row("SELECT subject FROM `" . _mysql_prefix . "-posts` WHERE id=" . $post['xhome']);
                        $hometitle = $hometitle['subject'];
                    }
Exemplo n.º 9
0
 case 2:
     $backlink = _addGetToLink(_linkArticle($query['home']), "page=" . _resultPagingGetItemPage(_commentsperpage, "posts", "id>" . $query['id'] . " AND type=2 AND xhome=-1 AND home=" . $query['home'])) . "#post-" . $query['id'];
     break;
 case 3:
     $postsperpage = DB::query_row("SELECT var2 FROM `" . _mysql_prefix . "-root` WHERE id=" . $query['home']);
     $backlink = _addGetToLink(_linkRoot($query['home']), "page=" . _resultPagingGetItemPage($postsperpage['var2'], "posts", "id>" . $query['id'] . " AND type=3 AND xhome=-1 AND home=" . $query['home'])) . "#post-" . $query['id'];
     break;
 case 4:
     $nobbcode = true;
     break;
 case 5:
     if ($query['xhome'] == -1) {
         if (!_checkboxLoad("delete")) {
             $backlink = "index.php?m=topic&amp;id=" . $query['id'];
         } else {
             $backlink = _linkRoot($query['home']);
         }
     } else {
         $backlink = _addGetToLink("index.php?m=topic&amp;id=" . $query['xhome'], "page=" . _resultPagingGetItemPage(_commentsperpage, "posts", "id<" . $query['id'] . " AND type=5 AND xhome=" . $query['xhome'] . " AND home=" . $query['home'])) . "#post-" . $query['id'];
     }
     break;
 case 6:
     $backlink = "index.php?m=messages&amp;a=list&amp;read=" . $query['home'] . '&amp;page=' . _resultPagingGetItemPage(_messagesperpage, 'posts', 'id<' . $query['id'] . ' AND type=6 AND home=' . $query['home']) . '#post-' . $query['id'];
     break;
 case 7:
     $backlink = null;
     _extend('call', 'posts.' . $query['flag'] . '.edit', array('query' => $query, 'backlink' => &$backlink));
     if (null === $backlink) {
         $module .= _formMessage(3, sprintf($_lang['plugin.error'], $query['flag']));
         return;
     }
/**
 * Sestavit kod menu
 * @param int|null $ord_start minimalni poradove cislo
 * @param int|null $ord_end maximalni poradove cislo
 * @param string $parent_class trida hlavniho tagu menu
 * @return string
 */
function _templateMenu($ord_start = null, $ord_end = null, $parent_class = 'menu')
{
    $output = "";
    if (defined("_indexOutput_pid")) {
        $pid = _indexOutput_pid;
    } else {
        $pid = -1;
    }
    if (!_notpublicsite or _loginindicator) {
        // limit
        if ($ord_start === null or $ord_end === null) {
            $ord_limit = $inter_ord_limit = "";
        } else {
            $ord_limit = " AND page.ord>=" . intval($ord_start) . " AND page.ord<=" . intval($ord_end);
            $inter_ord_limit = " AND inter.ord>=" . intval($ord_start) . " AND inter.ord<=" . intval($ord_end);
        }
        // nacteni dat
        $tree = array();
        $query = DB::query("SELECT page.id,page.type,page.title,page.title_seo,page.level,page.var1,page.var2,page.intersection FROM `" . _mysql_prefix . "-root` AS page LEFT JOIN `" . _mysql_prefix . "-root` AS inter ON(page.intersection=inter.id) WHERE page.visible=1 AND page.type!=4 AND (inter.id IS NULL" . $ord_limit . " OR inter.visible=1 AND inter.var2=1" . $inter_ord_limit . ") ORDER BY page.intersection,page.ord");
        while ($item = DB::row($query)) {
            if ($item['intersection'] == -1) {
                $tree[$item['id']] = $item;
            } else {
                if (!isset($tree[$item['intersection']]['children'])) {
                    $tree[$item['intersection']]['children'] = array();
                }
                $tree[$item['intersection']]['children'][] = $item;
            }
        }
        DB::free($query);
        // sestaveni kodu
        $output .= "<" . _template_menu_parent . " class='" . $parent_class . "'>\n";
        $counter = 0;
        $last = sizeof($tree) - 1;
        foreach ($tree as $item) {
            // rozsireni, priprava
            $classes = array();
            _extend('call', 'tpl.menu.item', array('item' => &$item, 'classes' => &$classes, 'sub' => false));
            // zpracovani polozky
            if (empty($item['children'])) {
                // stranka
                if ($item['id'] == $pid) {
                    $classes[] = 'act';
                }
                if ($item['type'] == 6 and $item['var1'] == 1) {
                    $target = " target='_blank'";
                } else {
                    $target = "";
                }
                $link = "<a href='" . _linkRoot($item['id'], $item['title_seo']) . "'" . $target . ">" . $item['title'] . "</a>";
            } else {
                // polozky rozcestniku
                $icounter = 0;
                $ilast = sizeof($item['children']) - 1;
                $childactive = false;
                $link_sublistitems = '';
                foreach ($item['children'] as $iitem) {
                    _extend('call', 'tpl.menu.item', array('item' => &$iitem, 'sub' => true));
                    $classes[] = 'menu-item-' . str_replace('/', '_', $iitem['title_seo']);
                    if ($iitem['id'] == $pid) {
                        $classes[] = 'act';
                        $childactive = true;
                    }
                    if ($icounter === 0) {
                        $classes[] = 'first';
                    }
                    if ($icounter !== 0 && $icounter === $ilast) {
                        $classes[] = 'last';
                    }
                    if ($iitem['type'] == 6 and $iitem['var1'] == 1) {
                        $target = " target='_blank'";
                    } else {
                        $target = "";
                    }
                    $link_sublistitems .= "    <li" . (!empty($classes) ? ' class="' . implode(' ', $classes) . '"' : '') . "><a href='" . _linkRoot($iitem['id'], $iitem['title_seo']) . "'" . $target . ">" . $iitem['title'] . "</a></li>\n";
                    $classes = array();
                    ++$icounter;
                }
                if (!$childactive && $item['id'] == $pid) {
                    $childactive = true;
                }
                $classes[] = 'menu-dropdown';
                if ($childactive || $item['id'] == $pid) {
                    $classes[] = 'act';
                }
                $link = "<a href='" . _linkRoot($item['id'], $item['title_seo']) . "' class='menu-dropdown-link'>" . $item['title'] . "</a>";
                if ($link_sublistitems !== '') {
                    $link .= "\n<ul class='menu-dropdown-list'>\n" . $link_sublistitems . "</ul>\n";
                }
            }
            $classes[] = 'menu-item-' . str_replace('/', '_', $item['title_seo']);
            if ($counter === 0) {
                $classes[] = 'first';
            }
            if ($counter !== 0 && $counter === $last) {
                $classes[] = 'last';
            }
            $output .= "<" . _template_menu_child . (!empty($classes) ? ' class="' . implode(' ', $classes) . '"' : '') . ">" . $link . "</" . _template_menu_child . ">\n";
            ++$counter;
        }
        $output .= "</" . _template_menu_parent . ">";
    }
    return $output;
}
/* ---  vystup  --- */
if ($continue != true) {
    $output .= _formMessage(3, $_lang['global.badinput']);
} else {
    // vyber rozcestniku
    if ($type != 7) {
        $intersection_select = "<select name='intersection' class='selectmedium'><option value='-1' class='special'>" . $_lang['admin.content.form.intersection.none'] . "</option>";
        $isquery = DB::query("SELECT id,title FROM `" . _mysql_prefix . "-root` WHERE type=7 ORDER BY ord");
        while ($item = DB::row($isquery)) {
            if ($item['id'] == $query['intersection']) {
                $selected = " selected='selected'";
            } else {
                $selected = "";
            }
            $intersection_select .= "<option value='" . $item['id'] . "'" . $selected . ">" . _cutStr($item['title'], 22) . "</option>";
        }
        $intersection_select .= "</select>";
        $intersection_row = "<td class='rpad'><strong>" . $_lang['admin.content.form.intersection'] . "</strong></td><td>" . $intersection_select . "</td>";
    } else {
        $intersection_select = "";
        $intersection_row = "";
    }
    // wysiwyg editor
    $output .= _admin_wysiwyg();
    // stylove oddeleni individualniho nastaveni
    if ($custom_settings != "") {
        $custom_settings = "<span class='customsettings'>" . $custom_settings . "</span>";
    }
    // formular
    $output .= "<div class='hr'><hr /></div><br />" . (isset($_GET['saved']) ? _formMessage(1, $_lang['global.saved'] . "&nbsp;&nbsp;<small>(" . _formatTime(time()) . ")</small>") : '') . "\n\n" . (!$new && $type != 4 && DB::result(DB::query('SELECT COUNT(*) FROM `' . _mysql_prefix . '-root` WHERE `id`!=' . $query['id'] . ' AND `title_seo`=\'' . $query['title_seo'] . '\''), 0) != 0 ? _formMessage(2, $_lang['admin.content.form.title_seo.collision']) : '') . "\n" . (!$new && $id == _index_page_id ? _admin_smallNote($_lang['admin.content.form.indexnote']) : '') . "\n<form" . ($type != 4 ? " class='cform'" : '') . " action='index.php?p=content-edit" . $type_array[$type] . (!$new ? "&amp;id=" . $id : '') . ($type == 9 && $new ? '&amp;idt=' . $type_idt : '') . "' method='post'>\n\n\n" . $editscript_extra . "\n" . (!$new && $type == 5 ? "<p><a href='index.php?p=content-manageimgs&amp;g=" . $id . "'><img src='images/icons/edit.png' alt='edit' class='icon' /><big>" . $_lang['admin.content.form.manageimgs'] . " &gt;</big></a></p>" : '') . "\n\n<table class='formtable'>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['admin.content.form.title'] . "</strong></td>\n<td><input type='text' name='title' value='" . $query['title'] . "' class='inputmedium' maxlength='96' /></td>\n\n" . ($type != 4 ? "<td class='rpad'><strong>" . $_lang['admin.content.form.title_seo'] . "</strong></td>\n<td><input type='text' name='title_seo' value='" . $query['title_seo'] . "' maxlength='255' class='inputmedium' /></td>" : $intersection_row) . "\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['admin.content.form.ord'] . "</strong></td>\n<td><input type='text' name='ord' value='" . $query['ord'] . "' class='inputmedium' /></td>\n\n" . ($type != 4 ? $intersection_row : '') . "\n</tr>\n\n" . ($type != 4 ? "\n<tr>\n<td class='rpad'><strong>" . $_lang['admin.content.form.description'] . "</strong></td>\n<td><input type='text' name='description' value='" . $query['description'] . "' maxlength='128' class='inputmedium' /></td>\n\n<td class='rpad'><strong>" . $_lang['admin.content.form.keywords'] . "</strong></td>\n<td><input type='text' name='keywords' value='" . $query['keywords'] . "' maxlength='128' class='inputmedium' /></td>\n</tr>\n\n<tr class='valign-top'>\n<td class='rpad'><strong>" . $_lang['admin.content.form.intersectionperex'] . "</strong></td>\n<td colspan='3'><textarea name='intersectionperex' rows='2' cols='94' class='arealine codemirror'>" . _htmlStr($query['intersectionperex']) . "</textarea></td>\n</tr>\n\n" . ($editscript_enable_content ? "\n<tr class='valign-top'>\n<td class='rpad'><strong>" . $_lang['admin.content.form.' . ($type != 6 ? 'content' : 'url')] . "</strong>" . (!$new ? " <a href='" . _indexroot . _linkRoot($query['id'], $query['title_seo']) . "' target='_blank'><img src='images/icons/loupe.png' alt='prev' /></a>" : '') . "</td>\n<td colspan='3'>\n" . ($type != 6 ? "<textarea name='content' rows='25' cols='94' class='areabig wysiwyg_editor" . (!_wysiwyg || !_loginwysiwyg ? ' codemirror' : '') . "'>" . _htmlStr($query['content']) . "</textarea>" : "<input type='text' name='content' value='" . _htmlStr($query['content']) . "' class='inputbig' />") . "\n</td>\n</tr>\n" : '') . "\n\n" . $editscript_extra_row . "\n\n<tr>\n<td class='rpad'><strong>" . $_lang['admin.content.form.settings'] . "</strong></td>\n<td colspan='3'>\n<label><input type='checkbox' name='visible' value='1'" . _checkboxActivate($query['visible']) . " /> " . $_lang['admin.content.form.visible'] . "</label>&nbsp;&nbsp;\n" . ($type != 6 ? "<label><input type='checkbox' name='autotitle' value='1'" . _checkboxActivate($query['autotitle']) . " /> " . $_lang['admin.content.form.autotitle'] . "</label>&nbsp;&nbsp;" : '') . "\n" . $custom_settings . "\n</td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['global.access'] . "</strong></td>\n<td>\n<label><input type='checkbox' name='public' value='1'" . _checkboxActivate($query['public']) . " /> " . $_lang['admin.content.form.public'] . "</label>&nbsp;&nbsp;\n<input type='text' name='level' value='" . $query['level'] . "' class='inputsmaller' maxlength='5' /> " . $_lang['admin.content.form.level'] . "\n</td>\n\n" . ($type != 4 ? "<td class='rpad'><strong>" . $_lang['admin.content.form.events'] . "</strong></td>\n<td><input type='text' name='events' value='" . (isset($query['events']) ? _htmlStr($query['events']) : '') . "' class='inputmedium' maxlength='255' /></td>" : '') . "\n</tr>\n\n" : '') . "\n\n\n<tr><td></td><td colspan='3'><br />\n<input type='submit' value='" . ($new ? $_lang['global.create'] : $_lang['global.savechanges']) . "' />" . (!$new ? "&nbsp;&nbsp;<small>" . $_lang['admin.content.form.thisid'] . " " . $query['id'] . "</small>" : '') . "\n</td></tr>\n\n</table>\n" . _xsrfProtect() . "</form>\n";
}
Exemplo n.º 12
0
     if (false !== $q) {
         define('_redirect_to', _url . '/' . (_modrewrite ? '' : 'index.php?p=') . $q['new']);
         break;
     }
     // presmerovani starych ciselnych adres bez mod_rewrite
     if (!$rewritten && is_numeric($ids[0])) {
         $ids = intval($ids[0]);
         if (0 === $type) {
             $query = DB::query('SELECT `id`,`title_seo` FROM `' . _mysql_prefix . '-root` WHERE `id`=' . $ids);
         } else {
             $query = DB::query('SELECT art.`id`,art.`title_seo`,cat.`title_seo` AS cat_title_seo FROM `' . _mysql_prefix . '-articles` AS art JOIN `' . _mysql_prefix . '-root` AS cat ON(cat.id=art.home1) WHERE art.`id`=' . $ids);
         }
         $query = DB::row($query);
         if ($query !== false) {
             // stranka nalezena podle ID, presmerovani
             define('_redirect_to', _url . '/' . ($type === 0 ? _linkRoot($query['id'], $query['title_seo']) : _linkArticle($query['id'], $query['title_seo'], $query['cat_title_seo'])));
             break;
         }
     }
     // odchyceni rozsirenim
     if ($rewritten || $type === 0) {
         $title = $content = null;
         _extend('call', 'index.notfound.hook', array('output' => &$content, 'title' => &$title, 'ids' => $ids));
         if (isset($title, $content)) {
             define('_indexOutput_ptype', 'plugin_hook');
             define('_indexOutput_title', $title);
             define('_indexOutput_content', $content);
             break;
         }
     }
 } while (false);
Exemplo n.º 13
0
        $homedata = DB::query_row("SELECT id,title,title_seo,public,level,var1,var2,var3 FROM `" . _mysql_prefix . "-root` WHERE id=" . $query['home']);
        $forumtitle = $homedata['title'];
        $continue = true;
        if (_publicAccess($homedata['public'], $homedata['level'])) {
            $need2login = false;
        } else {
            $need2login = true;
        }
    }
}
/* ---  vystup  --- */
if ($continue) {
    define('_indexOutput_url', "index.php?m=topic&id=" . $id);
    if (!$need2login) {
        // priprava zpetneho odkazu
        $backlink = _linkRoot($homedata['id'], $homedata['title_seo']);
        if (!$query['sticky']) {
            $backlink = _addGetToLink($backlink, "page=" . _resultPagingGetItemPage($homedata['var1'], "posts", "bumptime>" . $query['bumptime'] . " AND xhome=-1 AND type=5 AND home=" . $homedata['id']));
        }
        // zpetny odkaz, titulek
        $module .= "<a href='" . $backlink . "' class='backlink'>&lt; " . $_lang['global.return'] . "</a>\n";
        if (_template_autoheadings) {
            $module .= "<h1>" . $homedata['title'] . "</h1>\n<div class='hr'><hr /></div>\n";
        }
        // ikonky pro spravu
        if (_postAccess($query)) {
            $editlink = " &nbsp;\n<a href='index.php?m=editpost&amp;id=" . $id . "'><img src='" . _templateImage("icons/edit.png") . "' alt='edit' class='icon' title='" . $_lang['mod.editpost'] . "' /></a>\n" . (_loginright_locktopics ? "<a href='index.php?m=locktopic&amp;id=" . $id . "'><img src='" . _templateImage("icons/" . ($query['locked'] == 1 ? 'un' : '') . "lock.png") . "' alt='lock' class='icon' title='" . $_lang['mod.locktopic' . ($query['locked'] == 1 ? '2' : '')] . "' /></a>" : '') . "\n" . (_loginright_stickytopics ? "<a href='index.php?m=stickytopic&amp;id=" . $id . "'><img src='" . _templateImage("icons/" . ($query['sticky'] == 1 ? 'un' : '') . "stick.png") . "' alt='sticky' class='icon' title='" . $_lang['mod.stickytopic' . ($query['sticky'] == 1 ? '2' : '')] . "' /></a>" : '') . "\n" . (_loginright_movetopics ? "<a href='index.php?m=movetopic&amp;id=" . $id . "'><img src='" . _templateImage("icons/move.png") . "' alt='move' class='icon' title='" . $_lang['mod.movetopic'] . "' /></a>" : '');
        } else {
            $editlink = "";
        }
        // nacteni autora a avataru
Exemplo n.º 14
0
        } elseif ($r['id'] == $query['home2']) {
            $homei = 2;
        } else {
            $homei = 3;
        }
        $homes[$homei] = $r;
        if ($r['var3'] == 1) {
            $cat_showinfo = true;
        }
    }
    // vypsat kategorie
    for ($i = 1; $i <= 3; ++$i) {
        if (!isset($homes[$i])) {
            continue;
        }
        $homes[$i] = "<a href='" . _linkRoot($homes[$i]['id'], $homes[$i]['title_seo']) . "'>" . $homes[$i]['title'] . "</a>";
    }
    $content .= implode(', ', $homes) . "</div>\n";
    unset($homes);
} else {
    $cat_showinfo = null;
}
/* --  titulek  -- */
$title = $query['title'];
// if (_template_autoheadings) {
$content .= "<h1>" . $title . "</h1>\n";
// }
/* --  perex  -- */
_extend('call', 'article.perex.before', $extend_args);
// rozsireni pred perexem
$content .= "<p class='article-perex'>" . (isset($query['picture_uid']) ? "<img class='article-perex-image' src='" . _pictureStorageGet(_indexroot . 'pictures/articles/', null, $query['picture_uid'], 'jpg') . "' alt='" . $query['title'] . "' />" : '') . $query['perex'] . "</p>\n";
Exemplo n.º 15
0
 function _admin_rootItemOutput($item, $itr)
 {
     global $_lang, $counter, $highlight, $ppages;
     $type_array = _admin_getTypeArray();
     // pristup k polozce
     if (!constant('_loginright_admin' . $type_array[$item['type']])) {
         $denied = true;
     } else {
         $denied = false;
     }
     // trida pro neviditelnost anebo neverejnost
     $sclass = "";
     if ($item['visible'] == 0 xor $item['public'] == 0) {
         if ($item['visible'] == 0) {
             $sclass = " class='invisible'";
         }
         if ($item['public'] == 0) {
             $sclass = " class='notpublic'";
         }
     } else {
         if ($item['visible'] == 0 and $item['public'] == 0) {
             $sclass = " class='invisible-notpublic'";
         } else {
             $sclass = " class='normal'";
         }
     }
     // pozadi oddelovace
     if ($item['type'] == 4) {
         $sepbg_start = "<div class='sep'" . ($counter == 0 ? " style='padding-top:0;'" : '') . "><div class='sepbg'>";
         $sepbg_end = "</div></div>";
         $highlight = false;
     } else {
         $sepbg_start = "";
         $sepbg_end = "";
         $sepbg_start_sub = "";
         $sepbg_end_sub = "";
     }
     // kod radku
     $dclass = "";
     if ($itr == true) {
         if ($highlight) {
             $dclass = " class='intersecpad-hl'";
         } else {
             $dclass = " class='intersecpad'";
         }
     } else {
         if ($highlight) {
             $dclass = " class='hl'";
         }
     }
     $extra_actions = '';
     if (!$denied) {
         if ($item['type'] == 5) {
             $extra_actions = "&nbsp;&nbsp;&nbsp;<a href='index.php?p=content-manageimgs&amp;g=" . $item['id'] . "'><img src='images/icons/list.png' alt='images' class='contenttable-icon' />" . $_lang['admin.content.form.showpics'] . "</a>";
         }
         _extend('call', 'admin.root.actions', array('item' => $item, 'extra_actions' => &$extra_actions));
     }
     $extendOutput = _extend('buffer', 'admin.root.item', array('item' => $item, 'denied' => $denied, 'extra_actions' => $extra_actions, 'class' => $dclass));
     if ('' !== $extendOutput) {
         if (false === $extendOutput) {
             return '';
         }
         return $extendOutput;
     }
     return "\n        <tr" . $dclass . ">\n        <td class='name'>" . $sepbg_start . "<input type='text' name='" . $item['id'] . "' value='" . $item['ord'] . "' />" . ($item['id'] == _index_page_id ? "<img src='images/icons/tag.png' alt='index' class='contenttable-icon' />" : '') . "<a" . ($item['type'] != 4 ? " href='" . _indexroot . _linkRoot($item['id'], $item['title_seo']) . "' target='_blank'" . $sclass : '') . ">" . $item['title'] . "</a>" . $sepbg_end . "</td>\n        <td class='type'" . ($denied ? " colspan='2'" : '') . ">" . $sepbg_start . "<div class='tpad'>" . ($item['type'] != 9 ? $_lang['admin.content.' . $type_array[$item['type']]] : (isset($ppages[$item['type_idt']]) ? $ppages[$item['type_idt']] : _htmlStr($item['type_idt']))) . " <small>(" . $item['id'] . ")</small></div>" . $sepbg_end . "</td>\n        " . (!$denied ? "<td class='actions'>" . $sepbg_start . "<div class='tpad'><a href='index.php?p=content-edit" . $type_array[$item['type']] . "&amp;id=" . $item['id'] . "'><img src='images/icons/edit.png' alt='edit' class='contenttable-icon' />" . $_lang['global.edit'] . "</a>&nbsp;&nbsp;&nbsp;<a href='index.php?p=content-delete&amp;id=" . $item['id'] . "'><img src='images/icons/delete.png' alt='del' class='contenttable-icon' />" . $_lang['global.delete'] . "</a>" . $extra_actions . "</div>" . $sepbg_end . "</td>" : '') . "\n        </tr>\n\n        ";
 }