Beispiel #1
0
function inv_forum()
{
    echo "Time to Build a Forum!";
    ?>
<link rel="stylesheet" href="assets/DataTables-1.10.7/media/css/jquery.dataTables.css" type="text/css" />
<script src="assets/DataTables-1.10.7/media/js/jquery.js"></script>
<script src="assets/DataTables-1.10.7/media/js/jquery.dataTables.js"></script>
			<style>
		tr.clickable-row { cursor: pointer; }
		</style>
		<script>
		jQuery(document).ready(function($) {
    $(".clickable-row").click(function() {
        window.document.location = $(this).data("href");
    });
});
</script>

<table id="viewCategories" class="display compact" cellspacing="0" width="100%">
    <thead>
        <tr>
		
		<th>Category</th>
		<th>Description</th>
        </tr>
    </thead>

 
    <tbody>
		<?php 
    GetCategories();
    ?>
	</tbody>
	</table>
	<script>
	
	var $j = jQuery.noConflict();
				$j(document).ready(function($) {
				$('#viewCategories').dataTable();
				} (jQuery));
				</script>

		<?php 
}
Beispiel #2
0
function breadcrumbs()
{
    global $lang, $catz, $catmap, $template, $CurrentHandler, $config, $SYSTEM_FLAGS, $tpl, $systemAccessURL, $twig;
    $tpath = locatePluginTemplates(array('breadcrumbs'), 'breadcrumbs', pluginGetVariable('breadcrumbs', 'template_source'));
    $location = array();
    $location_last = '';
    # processing 404 page
    if ($SYSTEM_FLAGS['info']['title']['group'] == $lang['404.title']) {
        $link = str_replace(array('{home_url}', '{home_title}'), array($config['home_url'], $lang['bc:mainpage']), $lang['bc:page_404']);
        $location[] = array('url' => $config['home_url'], 'title' => $lang['bc:mainpage'], 'link' => $link);
        $location_last = $lang['404.title'];
    } else {
        if ($CurrentHandler) {
            $params = $CurrentHandler['params'];
            $pluginName = $CurrentHandler['pluginName'];
        }
        # generate main page with or without link
        $main_page = $systemAccessURL != '/' ? str_replace(array('{home_url}', '{home_title}'), array($config['home_url'], $lang['bc:mainpage']), $lang['bc:page_404']) : $lang['bc:mainpage'];
        $location[] = array('url' => $systemAccessURL != '/' ? $config['home_url'] : '', 'title' => $systemAccessURL != '/' ? $lang['bc:mainpage'] : $lang['bc:mainpage'], 'link' => $main_page);
        $location_last = $main_page;
        # if category
        if ($CurrentHandler['handlerName'] == 'by.category') {
            $location_last = GetCategories($catz[$params['category']]['id'], true);
            # show full path [if requested]
            if ($catz[$params['category']]['parent'] != 0 && !pluginGetVariable('breadcrumbs', 'block_full_path')) {
                $id = $catz[$params['category']]['parent'];
                do {
                    $location_tmp[] = array('url' => generateLink('news', 'by.category', array('category' => $catz[$params['category']]['alt'], 'catid' => $catz[$params['category']]['id'])), 'title' => $catz[$params['category']]['name'], 'link' => GetCategories($id, false));
                    $id = $catz[$catmap[$id]]['parent'];
                } while ($id != 0);
                $location = array_merge($location, array_reverse($location_tmp));
            }
        } elseif ($params['year']) {
            # if we have only year then $year = plain text, if we have month then $year = link
            $year = !$params['month'] ? $params['year'] : str_replace(array('{year_url}', '{year}'), array(generateLink('news', 'by.year', array('year' => $params['year'])), $params['year']), $lang['bc:by.year']);
            $month_p = LangDate("F", mktime(0, 0, 0, $params['month'], 7, 0));
            # if we have only year and month then $month = plain text, if we have day then $month = link
            $month = !$params['day'] ? $month_p : str_replace(array('{month_url}', '{month_p}'), array(generateLink('news', 'by.month', array('year' => $params['year'], 'month' => $params['month'])), $month_p), $lang['bc:by.month']);
            $day = $params['day'];
            $location_last = $year;
            if ($params['month']) {
                $location[] = array('url' => !$params['month'] ? '' : generateLink('news', 'by.year', array('year' => $params['year'])), 'title' => !$params['month'] ? $params['year'] : $params['year'], 'link' => $year);
                $location_last = $month;
            }
            if ($params['day']) {
                $location[] = array('url' => !$params['day'] ? '' : generateLink('news', 'by.month', array('year' => $params['year'], 'month' => $params['month'])), 'title' => !$params['day'] ? $month_p : $month_p, 'link' => $month);
                $location_last = $day;
            }
            # plugin, static, etc.
        } elseif ($pluginName != 'news') {
            if ($pluginName == "static") {
                $location_last = $SYSTEM_FLAGS['info']['title']['item'];
            } elseif ($pluginName == 'uprofile' && $CurrentHandler['handlerName'] == 'edit' || $pluginName == 'search') {
                $location_last = $SYSTEM_FLAGS['info']['title']['group'];
            } elseif ($pluginName == 'uprofile' && $CurrentHandler['handlerName'] == 'show') {
                $location_last = $SYSTEM_FLAGS['info']['title']['group'] . ' ' . $SYSTEM_FLAGS['info']['title']['item'];
            } elseif ($pluginName == 'core' && in_array($CurrentHandler['handlerName'], array('registration', 'lostpassword', 'login'))) {
                $location_last = $SYSTEM_FLAGS['info']['title']['group'];
            } elseif ($params['plugin'] || $pluginName) {
                # if plugin provide put some info
                if ($SYSTEM_FLAGS['info']['breadcrumbs']) {
                    # plugin name becomes link
                    $count = count($SYSTEM_FLAGS['info']['breadcrumbs']) - 1;
                    # all items except last become links
                    for ($i = 0; $i < $count; $i++) {
                        $link = str_replace(array('{plugin_url}', '{plugin}'), array($SYSTEM_FLAGS['info']['breadcrumbs'][$i]['link'], $SYSTEM_FLAGS['info']['breadcrumbs'][$i]['text']), $lang['bc:plugin']);
                        $location[] = array('url' => $SYSTEM_FLAGS['info']['breadcrumbs'][$i]['link'], 'title' => $SYSTEM_FLAGS['info']['breadcrumbs'][$i]['text'], 'link' => $link);
                    }
                    # last item becomes plain text
                    $location_last = $SYSTEM_FLAGS['info']['breadcrumbs'][$i]['text'];
                } else {
                    $link = str_replace(array('{plugin_url}', '{plugin}'), array(generatePluginLink($params['plugin'], '', array(), array(), false, true), $SYSTEM_FLAGS['info']['title']['group'] != $lang['loc_plugin'] ? $SYSTEM_FLAGS['info']['title']['group'] : $params['plugin']), $lang['bc:plugin']);
                    $location[] = array('url' => generatePluginLink($params['plugin'], '', array(), array(), false, true), 'title' => $SYSTEM_FLAGS['info']['title']['group'] != $lang['loc_plugin'] ? $SYSTEM_FLAGS['info']['title']['group'] : $params['plugin'], 'link' => $link);
                    if ($SYSTEM_FLAGS['info']['title']['group'] != $lang['loc_plugin']) {
                        $location_last = $SYSTEM_FLAGS['info']['title']['group'];
                    } else {
                        $location_last = $params['plugin'];
                    }
                }
            }
            # full news
        } elseif ($CurrentHandler['pluginName'] == 'news' && $CurrentHandler['handlerName'] == 'news') {
            $catids = $SYSTEM_FLAGS['news']['db.categories'];
            $location_last = $SYSTEM_FLAGS['info']['title']['item'];
            if (count($catids) != 1 || pluginGetVariable('breadcrumbs', 'block_full_path')) {
                if ($CurrentHandler['params']['category'] != 'none') {
                    foreach ($catids as $cid) {
                        foreach ($catz as $cc) {
                            if ($cc['id'] == $cid) {
                                $location[] = array('url' => generateLink('news', 'by.category', array('category' => $cc['alt'], 'catid' => $cc['id'])), 'title' => $cc['name'], 'link' => GetCategories($cc['id'], false));
                            }
                        }
                    }
                }
            } else {
                $id = $catz[$params['category']]['parent'];
                $location_tmp[] = array('url' => generateLink('news', 'by.category', array('category' => $catz[$params['category']]['alt'], 'catid' => $catz[$params['category']]['id'])), 'title' => $catz[$params['category']]['name'], 'link' => GetCategories($catz[$params['category']]['id'], false));
                while ($id != 0) {
                    foreach ($catz as $cc) {
                        if ($cc['id'] == $id) {
                            $location_tmp[] = array('url' => generateLink('news', 'by.category', array('category' => $cc['alt'], 'catid' => $cc['id'])), 'title' => $cc['name'], 'link' => GetCategories($cc['id'], false));
                            $id = $catz[$cc['alt']]['parent'];
                        }
                    }
                }
                $location = array_merge($location, array_reverse($location_tmp));
            }
        }
    }
    $tVars = array('location' => $location, 'location_last' => $location_last, 'separator' => $separator);
    $xt = $twig->loadTemplate($tpath['breadcrumbs'] . 'breadcrumbs.tpl');
    $template['vars']['breadcrumbs'] = $xt->render($tVars);
}
Beispiel #3
0
     $breadcrumbs->addElement($article['title'], makeURL($mod, array('categoryid' => $article['categoryid'], 'articleid' => $articleid)));
     $smarty->assign('article', $article);
     if ($login->currentUser() !== false) {
         $smarty->assign('loggedin', true);
         if (isset($_POST['add'])) {
             $comments->add($mod, $login->currentUserID(), $_POST['comment'], $articleid);
         }
     }
     $smarty->assign('comments', $comments->get($mod, $articleid));
     if ($rights->isAllowed($mod, 'publish')) {
         $menu->addSubElement($mod, $lang->get('edit'), 'edit', array('articleid' => $articleid));
     }
 } else {
     if ($categoryid == 0) {
         $smarty->assign('path', $template_dir . "/default.tpl");
         $categories = GetCategories();
         $articles['this_week'] = GetArticlesThisWeek();
         $articles['last_week'] = GetArticlesLastWeek();
         $articles['older'] = GetArticlesOlder();
         $smarty->assign('articles', $articles);
     } else {
         $category = $db->selectOneRow('article_categories', '*', '`categoryid`=' . $categoryid);
         if ($category['parentid'] > 0) {
             $smarty->assign('path', $template_dir . "/subcategory.tpl");
             $articles = $db->selectList('article', '*', "`categoryid`=" . $categoryid . " AND `published`=1", "`timestamp` DESC");
             foreach ($articles as $i => $article) {
                 $articles[$i]['url'] = makeURL($mod, array('categoryid' => $categoryid, 'articleid' => $article['articleid']));
                 $articles[$i]['comments'] = $comments->count('article', $article['articleid']);
             }
             $smarty->assign('articles', $articles);
         } else {