Example #1
0
foreach ($dates as $key => $value) {
    $month = explode(".", $value["date"]);
    $dates[$key]["month_eng"] = $value["date"];
    $dates[$key]["date"] = str_replace($month[1], " " . $months_hu[trim($month[1])], $value["date"]);
}
$tpl->assign('dates', $dates);
/**
 * hir megjelenitese
 */
if ($act == "show") {
    if (isset($_REQUEST['cid']) && is_numeric($_REQUEST['cid'])) {
        $cid = intval($_REQUEST['cid']);
        //ha engedelyezve van a szamlalo
        if (!empty($_SESSION['site_cnt_is_viewcounter'])) {
            include_once $include_dir . '/function.contents.php';
            $tpl->assign('view_counter', view_counter($cid));
        }
        $query = "\n\t\t\tSELECT c.title AS ctitle, c.lead AS clead, c.add_date AS add_date, c.picture AS cpic, \n\t\t\t\tc.content AS ccont, c.mod_date AS mod_date, u.user_name AS addname, u2.user_name AS modname, \n\t\t\t\tc.is_mainnews AS main, c.view_counter AS counter \n\t\t\tFROM iShark_Contents c \n\t\t\tLEFT JOIN iShark_Users u ON u.user_id = c.add_user_id \n\t\t\tLEFT JOIN iShark_Users u2 ON u2.user_id = c.mod_user_id\n\t\t\tWHERE c.content_id = {$cid}\n\t\t";
        $result =& $mdb2->query($query);
        if ($result->numRows() > 0) {
            $row = $result->fetchRow();
            $tpl->assign('news_title', $row['ctitle']);
            $tpl->assign('news_lead', $row['clead']);
            $tpl->assign('news_adddate', $row['add_date']);
            $tpl->assign('news_cpic', $row['cpic']);
            $tpl->assign('news_content', $row['ccont']);
            $tpl->assign('news_moddate', $row['mod_date']);
            $tpl->assign('news_addname', $row['addname']);
            $tpl->assign('news_modname', $row['modname']);
            $tpl->assign('news_main', $row['main']);
            $tpl->assign('news_counter', $row['counter']);
Example #2
0
        setcookie("iShark_Contents_Rated[" . $cid . "]", 1, 0);
        $cookie_contents_tmp[$cid] = 1;
        header('Location: index.php?p=' . $module_name . '&act=lst&cid=' . $cid);
        exit;
    }
    $tpl->assign('rated_contents', $cookie_contents_tmp);
}
/**
 * ha csak egyszeruen mutatjuk a tartalmat
 */
if ($act == "lst" && !empty($content_id)) {
    $tpl->assign('header_picture', 'header_pic.jpg');
    //ha engedelyezve van a szamlalo
    if (!empty($_SESSION['site_cnt_is_viewcounter'])) {
        include_once $include_dir . '/function.contents.php';
        $tpl->assign('view_counter', view_counter($content_id));
    }
    if (empty($_REQUEST['page'])) {
        $page_start = 0;
    } else {
        $page_start = $_REQUEST['page'] * 10;
    }
    $query = "\n\t\tSELECT c.content_id AS cid, c.title AS ctitle, c.lead AS clead, c.content AS ccont, c.content2 AS ccont2, c.add_date, c.mod_date, c.view_counter AS counter, \n\t\t\tu.user_name AS addname, u2.user_name AS modname, c.heading_color \n\t\tFROM iShark_Contents c \n\t\tLEFT JOIN iShark_Users u ON c.add_user_id = u.user_id \n\t\tLEFT JOIN iShark_Users u2 ON c.mod_user_id = u2.user_id \n\t\tWHERE c.content_id = {$content_id} AND c.is_active = 1\n\t";
    $result =& $mdb2->query($query);
    if ($result->numRows() > 0) {
        $row = $result->fetchRow();
        /*$contentexp = explode('<p>##pagebreak##</p>', nl2br($row['ccont']));
          $pages = count($contentexp);
          $contslice = array_slice($contentexp, $page_start, 10);
          $loopnum = count($contslice);*/
        //$tpl->assign('content_pages',   $page_start);