 |  |  | |
/*
+---------------------------------------------------------------+
| e107 website system
|
| ©Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
+---------------------------------------------------------------+
*/
//$ec_dir = e_PLUGIN."calendar_menu/";
$lan_file = $ec_dir."languages/".e_LANGUAGE.".php";
include(file_exists($lan_file) ? $lan_file : e_PLUGIN."calendar_menu/languages/English.php");
$datearray = getdate();
$current_day = $datearray['mday'];
$current_month = $datearray['mon'];
$current_year = $datearray['year'];
// get first and last days of month in unix format---------------------------------------------------
$monthstart= mktime(0,0,0,$current_month,1,$current_year);
$firstdayarray = getdate($monthstart);
$monthend = mktime(0,0,0,$current_month+1,0,$current_year);
$lastdayarray = getdate($monthend);
// ----------------------------------------------------------------------------------------------------------
// get events from current month----------------------------------------------------------------------
$sql -> db_Select("event", "*", "(event_start>='$monthstart' AND event_start<= '$monthend') OR (event_rec_y='$current_month')");
$events = $sql -> db_Rows();
while($row = $sql -> db_Fetch()){
extract($row);
$evf = getdate($event_start);
$tmp = $evf['mday'];
$event_true[$tmp] = $event_category;
}
// -----------------------------------------------------------------------------------------------------------
// set up arrays for calender display ------------------------------------------------------------------
$week = Array(EC_LAN_25,EC_LAN_19,EC_LAN_20,EC_LAN_21,EC_LAN_22,EC_LAN_23,EC_LAN_24);
$months = Array(EC_LAN_0,EC_LAN_1,EC_LAN_2,EC_LAN_3,EC_LAN_4,EC_LAN_5,EC_LAN_6,EC_LAN_7,EC_LAN_8,EC_LAN_9,EC_LAN_10,EC_LAN_11);
$calendar_title = $months[$datearray[mon]-1]." ".$current_year;
// -----------------------------------------------------------------------------------------------------------
$text = "";
if($events){
$text .= EC_LAN_26 . ": ".$events;
}else{
$text .= EC_LAN_27;
}
$start = $monthstart;
$text .= "
";
foreach($week as $day){
$text .= "| ".$day." | ";
}
$text .= " ";
$thismonth = $datearray['mon'];
$thisday = $datearray['mday'];
for($c=0; $c<$firstdayarray['wday']; $c++){
$text .= "
| ";
}
$loop = $firstdayarray['wday'];
for($c=1; $c<=31; $c++){
$dayarray = getdate($start+($c*84460));
if($dayarray['mon'] == $thismonth){
if($thisday == $c){
$text .= "";
}else{
$text .=" | ";
}
if($event_true[($c)]){
$sql -> db_Select("event_cat", "*", "event_cat_id='".$event_true[($c)]."' ");
$icon = $sql -> db_Fetch();
extract($icon);
$img = " ";
}else{
$img = " ";
}
$linkut = mktime(0 ,0 ,0 ,$dayarray['mon'], $c, $datearray['year']);
$text .="$img $c";
if($thisday == $c){
}
$text .= " | \n";
$loop++;
if($loop == 7){
$loop = 0;
$text .= " ";
}
}
}
for($a=($loop+1); $a<=7; $a++){
$text .="| | ";
}
$text .= "
";
$ns -> tablerender($calendar_title, $text);
?>
|
// Include promo piece
if (file_exists('promo/promo.html')){
$ptext = join('',file('promo/promo.html'));
$ns->gen_tablerend('',$ptext);
} else if (SHOW_DHL_BANNER) {
echo $ns->tablerender(' ');
}
// Include news
$ix = new news;
if(eregi("cat", e_QUERY)){
$qs = explode(".", e_QUERY);
$category = $qs[1];
if($category != 0){
$gen = new convert;
$sql2 = new db;
$sql -> db_Select("news_category", "*", "category_id='$category'");
list($category_id, $category_name, $category_icon) = $sql-> db_Fetch();
$category_name = $aj -> tpa($category_name);
if(eregi("images", $category_icon)){
$category_icon = THEME.$category_icon;
}else{
$category_icon = e_BASE.$category_icon;
}
$count = $sql -> db_SELECT("news", "*", "news_category='$category' ORDER BY news_datestamp DESC");
while($row = $sql-> db_Fetch()){
extract($row);
$news_title = $aj -> tpa($news_title);
$news_body = $aj -> tpa($news_body);
if($news_title == ""){ $news_title = "Untitled"; }
$datestamp = $gen->convert_date($news_datestamp, "short");
$news_body = strip_tags(substr($news_body, 0, 100))." ...";
$comment_total = $sql2 -> db_Count("comments", "(*)", "WHERE comment_item_id='$news_id' AND comment_type='0' ");
$text .= "
 ";
if($news_allow_comments){
$text .= " ".$news_title."";
}else{
$text .= " ".$news_title."";
}
$text .= "
".LAN_100." ".$datestamp." (".LAN_99.": ";
if($news_allow_comments){
$text .= COMMENTOFFSTRING.")";
}else{
$text .= $comment_total.")";
}
$text .= "
".$news_body."
\n";
}
$text = " ".
LAN_307.$count."
".$text;
$ns -> tablerender(LAN_82." '".$category_name."'", $text);
?>
|
// Search
addSearch($ns);
// Mechs
//include('mavs/1.html');
?>
// Coppermine based screenshot admin
$display = 0;
include('e107_plugins/coppermine_menu/coppermine_menu.php');
?>
|
require_once(FOOTERF);
exit;
}
}
if(eregi("extend", e_QUERY)){
$extend_id = substr(e_QUERY, (strpos(e_QUERY, ".")+1));
$sql -> db_Select("news", "*", "news_id='$extend_id' ");
list($news['news_id'], $news['news_title'], $news['data'], $news['news_extended'], $news['news_datestamp'], $news['admin_id'], $news_category, $news['news_allow_comments'], $news['news_start'], $news['news_end'], $news['news_class']) = $sql -> db_Fetch();
$sql -> db_Select("news_category", "*", "category_id='$news_category' ");
list($news['category_id'], $news['category_name'], $news['category_icon']) = $sql-> db_Fetch();
$news['comment_total'] = $sql -> db_Count("comments", "(*)", "WHERE comment_item_id='".$news['news_id']."' AND comment_type='0' ");
$sql -> db_Select("user", "user_name", "user_id='".$news['admin_id']."' ");
list($news['admin_name']) = $sql -> db_Fetch();
$ix -> render_newsitem($news);
?>
|
// Search
addSearch($ns);
// Mechs
include('mavs/1.html');
// Coppermine based screenshot admin
$display = 0;
include('e107_plugins/coppermine_menu/coppermine_menu.php');
?>
|
require_once(FOOTERF);
exit;
}
if(!e_QUERY || eregi("cat", e_QUERY)){ $from = 0; }else{ $from = e_QUERY; }
if(Empty($order)){ $order = "news_datestamp"; }
$news_total = $sql -> db_Count("news");
if($sql -> db_Select("news", "*", "news_class<255 AND news_class!='' AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") AND news_class!='' ORDER BY ".$order." DESC LIMIT $from,".ITEMVIEW)){
$disablecache = TRUE;
}
if($sql -> db_Select("cache", "*", "cache_url='news.php' ") && !$disablecache && !e_QUERY){
$row = $sql -> db_Fetch(); extract($row);
echo $aj -> formtparev($cache_data);
$cachestring = "Cache system activated (content originally served ".strftime("%A %d %B %Y - %H:%M:%S", $cache_datestamp).").";
require_once(e_HANDLER."np_class.php");
$ix = new nextprev("news.php", $from, ITEMVIEW, $news_total, LAN_84);
?>
|
// Search
addSearch($ns);
// Mechs
include('mavs/1.html');
// Coppermine based screenshot admin
$display = 0;
include('e107_plugins/coppermine_menu/coppermine_menu.php');
?>
|