authenticate("U_Display,U_Groups"); // ------------------------------------------------------------------------- // Need to see what forums they have access to, so we don't show events with // topics in private forums // ---------------------------------------------------------------- // If they are logged in then we check their groups, otherwise they // get set to the guest group $Groups = $user['U_Groups']; if (!$Groups) { $Groups = "-4-"; } // -------------------------------------------------------------- // Let's make sure they are supposed to be looking at this board $Grouparray = split("-",$Groups); $gsize = sizeof($Grouparray); $groupquery = "AND ("; $g = 0; for ($i=0; $i<$gsize;$i++) { if (!preg_match("/[0-9]/",$Grouparray[$i])) { continue; }; $g++; if ($g > 1) { $groupquery .= " OR "; } $groupquery .= "Bo_Read_Perm LIKE '%-$Grouparray[$i]-%'"; } $groupquery .= ")"; $query = " SELECT Bo_Keyword FROM {$config['tbprefix']}Boards WHERE Bo_Active = '1' $groupquery "; $sth = $dbh -> do_query($query,__LINE__,__FILE__); $i = 0; while (list($thisboard) = $dbh -> fetch_array($sth)) { $canview[$i] = $thisboard; $i++; } // -------------------------------------- // Do we link to showthreaded or showflat isset($user['U_Display']) && $mode = $user['U_Display']; if (!$mode) { $mode = $theme['postlist']; } $mode = "show$mode"; // -------------------------------------------------------------- // Make sure that we have the day we are supposed to be showing if (!is_numeric($day) || !is_numeric($month) || !is_numeric($year)) { $html -> not_right("{$ubbt_lang['ALL_FIELDS']}",$Cat); } $mname = "MONTH$month"; $html -> send_header("{$ubbt_lang['HEAD']} $ubbt_lang[$mname] $day $year",$Cat,0,$user); // ------------------------------------ // Grab all the birthday's for this day $query = " SELECT U_Username,U_Number,U_Birthday FROM {$config['tbprefix']}Users WHERE U_Birthday LIKE '$month/$day/%' AND U_ShowBday = '1' "; $sth = $dbh -> do_query($query,__LINE__,__FILE__); $i=0; while(list($uname,$unumber,$birthday) = $dbh -> fetch_array($sth)) { @list($bmonth,$bday,$byear) = @split("/",$birthday); $age = ""; if ($config['showage']) { $age = $year - $byear; $age = " ($age)"; } $event[$i]['edit'] = ""; $event[$i]['type'] = $ubbt_lang['BDAY']; $event[$i]['brief'] = "$uname $age"; $event[$i]['desc'] = ""; $i++; } // ---------------------------------- // Now grab all events for this day $query = " SELECT t1.C_Entry,t1.C_Brief,t1.C_Notes,t1.C_Owner,t2.U_Username FROM {$config['tbprefix']}Calendar AS t1, {$config['tbprefix']}Users AS t2 WHERE ( (t1.C_Month = '$month' AND t1.C_Year = '$year' AND t1.C_Date = '$day' AND t1.C_Recurring='never') OR (t1.C_Month = '$month' AND t1.C_Date = '$day' AND t1.C_Recurring='yearly') OR (t1.C_Recurring='monthly' AND t1.C_Date = '$day') ) AND ( (t1.C_Type='public') OR (t1.C_Type='private' AND t1.C_Owner='{$user['U_Number']}') ) AND t1.C_Owner = t2.U_Number "; $sth = $dbh -> do_query($query,__LINE__,__FILE__); while(list($entry,$brief,$desc,$owner,$ownername) = $dbh -> fetch_array($sth)) { $event[$i]['type'] = $ubbt_lang['EVENT']; $event[$i]['brief'] = "$brief ({$ubbt_lang['BY']} $ownername)"; if ($desc) { $desc = str_replace("\n","
",$desc); $event[$i]['desc'] = "
     $desc"; } else { $event[$i]['desc'] = ""; } $event[$i]['edit'] = ""; if ($owner == $user['U_Number'] || $user['U_Status'] == "Administrator") { $event[$i]['edit'] = "\"{$ubbt_lang['EDIT_ICON']}\""; } $i++; } // ---------------------------- // Grab all topics for this day $query = " SELECT t1.B_Subject,t1.B_Number,t1.B_Board,t1.B_Approved,t1.B_Posterid,t2.U_Username FROM {$config['tbprefix']}Posts AS t1, {$config['tbprefix']}Users AS t2 WHERE t1.B_CalDay='$day' AND t1.B_CalMonth='$month' AND t1.B_CalYear='$year' AND t1.B_Posterid = t2.U_Number "; $sth = $dbh -> do_query($query,__LINE__,__FILE__); while(list($subject,$Number,$board,$approved,$owner,$ownername) = $dbh -> fetch_array($sth)) { if (!in_array($board,$canview)) { continue; } if ($approved != "yes") { continue; } $event[$i]['type'] = $ubbt_lang['TOPIC']; $event[$i]['brief'] = "$subject ({$ubbt_lang['BY']} $ownername)"; $event[$i]['desc'] = ""; $event[$i]['edit'] = ""; $i++; } list($tbopen,$tbclose) = $html -> table_wrapper(); if (!$debug) { include("$thispath/templates/$tempstyle/showday.tmpl"); } $html -> send_footer(); ?>