/************************************************************************** * * * SePortal - The Weblog System * * ---------------------------------------------------------------- * * * * File: index.php * * Copyright: (C) 2007 SePortal * * Email: admin@seportal.org * * Web: http://www.seportal.org * * Scriptversion: 2.4 * * * *************************************************************************/ $main_template = 'home'; define('GET_CACHES', 1); define('ROOT_PATH', './'); define('GET_USER_ONLINE', 1); define('GET_STATS_BOX', 1); define('GET_BIRTHDAYS_BOX', 1); define('GET_EVENTS_BOX', 1); include(ROOT_PATH.'global.php'); require(ROOT_PATH.'includes/sessions.php'); define('LEFT_BLOK', 1); define('RIGHT_BLOK', 1); function get_article_template($data) { global $config, $site_template, $site_sess, $cat_cache, $topics, $lang, $user_info, $page; $show_rating = 0; $read_more = !empty($data['article']) ? $lang['read_more'] : ""; $cat_image = !empty($cat_cache[$data['cat_id']]['cat_thumb_file']) ? "url(ROOT_PATH."index.php?".URL_CAT_ID."=".$cat_cache[$data['cat_id']]['cat_id'])."\">".format_text($cat_cache[$data[" : ""; $username = get_user_info($data['user_id']); $show_signature = empty($data['article']) ? 1 : 0; $user_signature = (!empty($username['user_signature']) && $data['use_sig']) ? format_text($username['user_signature'], 0, $config['wordwrap_comments'], (($config['pm_bbcode']) ? 1 : 0), $config['pm_img'], $config['pm_bbcode']) : ""; if (isset($username['user_name']) && $data['user_id'] != GUEST) { $user_name = format_text($username['user_name'], 2); $user_profile_link = (!empty($url_show_profile)) ? str_replace("{user_id}", $data['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$data['user_id']; $user_name_link = "url($user_profile_link)."\">".$user_name.""; $article_user_status_img = ($username['user_lastaction'] >= (time() - 300) && ((isset($username['user_invisible']) && $username['user_invisible'] == 0) || $user_info['user_level'] == ADMIN)) ? "\"Online\"" : "\"Offline\""; } else { $user_name = format_text($lang['userlevel_guest'], 2); $user_name_link = $user_name; $article_user_status_img = ""; } $lang_comment = !empty($data['article_comments']) ? $lang['comments']." (".$data['article_comments'].")" : $lang['post_comment']; $site_template->register_vars(array( "article_title" => $data['article_title'], "article_id" => $data['article_id'], "url_article_print" => $site_sess->url(ROOT_PATH."print.php?mode=article&client=printer&".URL_ARTICLE_ID."=".$data['article_id']), "url_article_forward" => $site_sess->url(ROOT_PATH."forward.php?mode=article&".URL_ARTICLE_ID."=".$data['article_id']), "url_article" => $site_sess->url(ROOT_PATH."article.php?".URL_ARTICLE_ID."=".$data['article_id']), "lang_topic" => $lang['topic'], "cat_name" => format_text($cat_cache[$data['cat_id']]['cat_name']), "url_cat" => $site_sess->url(ROOT_PATH."index.php?".URL_CAT_ID."=".$cat_cache[$data['cat_id']]['cat_id']), "url_comments" => $site_sess->url(ROOT_PATH."article.php?".URL_ARTICLE_ID."=".$data['article_id']."#comments"), "lang_comment_txt" => $lang_comment, "article_hits" => $data['article_hits'], "article_rating" => $data['article_rating'], "article_votes" => $data['article_votes'], "lang_views" => $lang['views'], "snippet" => format_text($data['snippet'], (($config['pm_html']) ? $data['use_html'] : 0), $config['wordwrap_comments'], (($config['pm_bbcode']) ? $data['use_bbcode'] : 0), $config['pm_img'], $data['use_emo']), "article" => $article, "article_date" => format_date($config['date_format']." - ".$config['time_format'], $data['article_date']), "cat_image" => $cat_image, "show_signature" => $show_signature, "user_signature" => $user_signature, "read_more" => $read_more, "lang_words" => $lang['words'], "lang_rating" => $lang['rating'], "strlen_article" => strlen($data['article']), "lang_contributed_by" => $lang['contributed_by'], "user_name_link" => $user_name_link, "article_user_status_img" => $article_user_status_img, "lang_printable_format" => $lang['printable_format'], "lang_mail_friend" => $lang['mail_friend'], "topics" => $topics, "show_rating" => $show_rating )); } include(ROOT_PATH.'includes/page_header.php'); $cache_id = create_cache_id( 'page.index', array( $cat_id, $page, $user_info[$user_table_fields['user_id']], $config['template_dir'], $config['language_dir'] ) ); if (!$cache_page_index || !$content = get_cache_file($cache_id)) { // Always append session id if cache is enabled if ($cache_page_index) { $old_session_mode = $site_sess->mode; $site_sess->mode = 'get'; } ob_start(); $a = explode( ',', gmdate( 'Y,n,j,G,i,s', time() + $time_offset ) ); $now_date = array( 'year' => $a[0], 'mon' => $a[1], 'mday' => $a[2], 'hours' => $a[3], 'minutes' => $a[4], 'seconds' => $a[5] ); $month_words = array( $lang['M_1'] , $lang['M_2'] , $lang['M_3'] , $lang['M_4'] , $lang['M_5'] , $lang['M_6'] , $lang['M_7'] , $lang['M_8'] , $lang['M_9'] , $lang['M_10'], $lang['M_11'], $lang['M_12'] ); $day_words = array( $lang['D_0'], $lang['D_1'], $lang['D_2'], $lang['D_3'], $lang['D_4'], $lang['D_5'], $lang['D_6'] ); $chosen_month = $now_date['mon'] - 1; $chosen_year = $now_date['year']; $newstories = false; $displayall = false; if (isset ($HTTP_GET_VARS['display']) && !$cat_id) { if ($HTTP_GET_VARS['display'] == 'new') { $newstories = true; } else if ($HTTP_GET_VARS['display'] == 'all') { $displayall = true; } } $show_allpage = 1; if (!$newstories && !$displayall) { $newcontent = centerblock_staticpages (0, $page, $cat_id); if (!empty ($newcontent)) { $show_allpage = 0; } $site_template->register_vars("newcontent", $newcontent); } $welcome = 1; $show_link = 0; $where = ""; if ($newstories) { $expiry = time() - $config['newstoriesinterval']; $where .= " article_date >= $expiry AND "; } el