ezPortal

Started by SMFHacks.com Team, November 02, 2008, 10:10:03 AM

Previous topic - Next topic

vbgamer45

Quote from: Mikeric on February 11, 2009, 01:20:55 PM
I just updated to RC1 and installed the newest version and now whenever anyone says anythign in the shoutbox they get this error.

QuoteAn Error Has Occurred!
Unable to load the 'main' template.
I see that issue will work on a fix
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

ke4obt

Thanks Kindred,

Now for the hard part, where can I find a color chart that is done in text format, i.e. "red = #00000 or eeffee", sence I beleave you need to do the colors other than just writing down a color i.e. "blue, green or red" or am I wrong about that.
Also where do I need to change these, under member groups or sence I've got MC Color ledgened II id this where I need to do the changes or better yet do I need to do this in both places or what.
As one of my instructors in school would say:
ABAPITA
Aint
Blindness
A
Paine
In
The
As*

Thanks Again Flip
Thanks Much

Flip - KE4OBT
     The Blind Ham
Helping other blind hams
get on the air!


Yes I am really a BLIND user!

So, if a mod doesn't install properly, and I can't get help from your part of the forum,
I will come begging for YOUR help since you wrote it and know how it works
um, uh, well,
At least I would really, really hope you do!
HEE-HEE-HEE

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

quietstorm

Quote from: quietstorm on February 11, 2009, 01:18:47 AM
This is a great mod..but it lacks a block for the calendar!  :(
Does anyone know how to add one?

It would be greatly appreciative


TIA

It is a shame no one knows how to do this?  :(

"Meet A Stranger...Make A Friend!"

ke4obt

Quote from: quietstorm on February 12, 2009, 09:27:59 AM
Quote from: quietstorm on February 11, 2009, 01:18:47 AM
This is a great mod..but it lacks a block for the calendar!  :(
Does anyone know how to add one?

It would be greatly appreciative




TIA

It is a shame no one knows how to do this?  :(

Try this if you are using SMF 1.1.x, apparently it doesn't work with 2.x. Just follow the directions in the top of the code. Hope it helps.
/
******************************************************************************************
*                                                                                         *
* 'Mini' Calendar in phpblock -                                                           *
*                                                                                         *
* Program Parameters/Switches can be specified to change what is displayed and how.       *
*   If highlighting is turned on, only the types of entries which are selected to         *
*   be shown will be highlighted (and have to be shown to guests for guests to see        *
*   highlights). If option of linking the day numbers to calendar event posting form      *
*   is chosen ($date_links_to_posting = true), SMF permissions are in effect and only     *
*   those allowed to post events to the calendar will have this link in effect. For       *
*   $date_links_to_posting = false, and for those not permitted to post events, day       *
*   numbers will link to the full SMF Calendar page. Additionally, if option to show      *
*   a separate 'Post Event' button is chosen ($show_post_event_button = true), it will    *
*   only show for those permitted to post events to the calendar.                         *
*                                                                                         *
* Look for 'NON-ENGLISH' to see section for changing language. This is actually more      *
*   correctly referred to as 'language other than server default' as this Calendar will   *
*   use the server's default LOCALE language for Month and Day names unless overides      *
*   are specified in the code section labeled 'NON-ENGLISH  LABELS, MONTH & DAY NAMES',   *
*   below.                                                                                *
*                                                                                         *
* Once a given day is highlighted, the highlight will not be supplanted. That means       *
*   you may want to modify the order in which highlights are applied in order to set      *
*   desired 'precedence' (i.e. if b-days highlights are applied first, once a given       *
*   day is highlighted with b-day color, it will not be changed to be highlighted         *
*   with event color if an event occurs on the same day; you need to choose an order      *
*   of precedence and sequence the highlighting accordingly by changing the sequence      *
*   of sections in the $order_hilites array. Highlighting will be done in the given       *
*   order.                                                                                *
*                                                                                         *
* Also, if you want the individual B-day/Event/Holiday sections to be ordered in a        *
*   different sequence, you need to change the sequence of entries in the $order_lists    *
*   array.                                                                                *
*                                                                                         *
* Examples of highlighting can be seen in the section 'Highlight colors & backgrounds'    *
*   below. As given, highlighting is done by applying the admin specified calendar        *
*   entry color to the date, bolded, on the default background. Commented example given   *
*   of using bold white on a background box of the admin specified calendar entry color.  *
*                                                                                         *
******************************************************************************************/
global $scripturl, $modSettings, $context, $db_prefix, $user_profile, $user_info, $sourcedir;

///////////////////////////////////////////////////////////////////////////////////////////////////

//////
//
//  Program Paramters/Switches Section
//

// use forum's date/time
//$now = mktime() + $modSettings['time_offset'] * 3600;                                 
// include user's time offset to forum date/time
$now = mktime() + (($user_info['time_offset'] + $modSettings['time_offset']) * 3600);

// Order to do highlightling - earlier have precedence
$order_hilites = array('Birthdays', 'Events', 'Holidays');

// Order to show calendar entry lists
$order_lists = array('Birthdays', 'Events', 'Holidays');

// Alignment of calendar entry lists
// $align_list_entries = 'left';
$align_list_entries = 'center';

// Use 'bordercolor' class for 'gridlines' (table background)
$bordercolor_gridlines = true; // Will 'show through' between table cells to act as 'grid lines'
$gridlines_thickness = 5;       // Pixel thickness for table "cellspacing" - only used w/

$bordercolor_gridlines = true;

// Letters to show on calendar for names of each of the days
$day_name_length = 3;

// Selection for first day of the week: 0-Sunday; 1-Monday
$first_day = 0;

// Show B-Day list at all / to guests
$show_bdays = true;
$show_bdays_to_guests = false;

// Show Event list at all / to guests
$show_events = true;
$show_events_to_guests = true;

// Show Holiday list at all / to guests
$show_hdays = true;
$show_hdays_to_guests = true;

// If true, calendar date numbers link to calendar event posting form
//    if not, links to full calendar page
$date_links_to_posting = true;

// Adds 'Post Event' button to bottom of block
$show_post_event_button = true; 

// Highlight events, b-days, holidays (only if they're selected to show at all)
$show_hilites = true;         

$color_sunday = '#D00000';    // comment out to use default text colors -
$color_saturday = '#D00000';  //   can use hex codes with leading '#'
$color_today = 'steelblue';   //   or color names
$bkgrd_today = 'white';

// Default class to use when no other class specified
$class_default = '';
// $class_default = 'smalltext';
// $class_default = 'windowbg2';

// Class to use for column top day names
// $class_day_names = 'titlebg';  // Ex.: titlebg, catbg, catbg2, catbg3, windowbg, windowbg2,

windowbg3

// Class to use for 'Today' highlight
$class_today = 'windowbg2';

// Text Labels to use for calendar entry lists
$list_label_bdays =  '__Birthdays__';
$list_label_events = '____Events___';
$list_label_hdays =  '__ Holidays___';

// Colors for text labels on calendar entry lists
$list_label_bdays_color = '#'.$modSettings['cal_bdaycolor'];
$list_label_events_color = '#'.$modSettings['cal_eventcolor'];
$list_label_hdays_color = '#'.$modSettings['cal_holidaycolor'];

// Choose to show 'look-behind' for the various entry types
$show_bdays_past = true;
$show_events_past = true;
$show_hdays_past = true;

// For any of the above chosen, days prior to today to display -
//    use '0' (zero) to use beginning of current month
$past_look_behind_period = 7;

// Class for 'cells' holding text labels on calendar entry lists
// $list_label_class = 'titlebg'; // Ex.: titlebg, catbg, catbg2, catbg3, windowbg, windowbg2,

windowbg3

// Class for 'cells' holding calendar entry lists
//   use regular variable for all same class
//   use two-member array to alternate between the two
$list_entry_class = '';
// $list_entry_class = 'windowbg';
// $list_entry_class = array('windowbg2','windowbg3');

///////////////////////////////
//   Highlight colors & backgrounds
//
//   Admin-specified birthday color: $modSettings['cal_bdaycolor']
//   Admin-specified event color:    $modSettings['cal_eventcolor']
//   Admin-specified holiday color:  $modSettings['cal_holidaycolor']

// Highlight bold white on backgound of forum's defined color for date entry type
//
// $hilite_bday_color = 'white';
// $hilite_bday_bkgrd = '#'.$modSettings['cal_bdaycolor'];
// $hilite_bday_bold = true;
// $hilite_bday_class = '';
//
// $hilite_event_color = 'white';
// $hilite_event_bkgrd = '#'.$modSettings['cal_eventcolor'];
// $hilite_event_bold = true;
// $hilite_event_class = '';
//
// $hilite_hday_color = 'white';
// $hilite_hday_bkgrd = '#'.$modSettings['cal_holidaycolor'];
// $hilite_hday_bold = true;
// $hilite_hday_class = '';
////////////////////////////////

// Highlight bolded color for date entry type on default backgound
//
$hilite_bday_color = '#'.$modSettings['cal_bdaycolor'];
// $hilite_bday_bkgrd = '';
$hilite_bday_bold = true;
// $hilite_bday_class = 'windowbg3';
//
$hilite_event_color = '#'.$modSettings['cal_eventcolor'];
// $hilite_event_bkgrd = '';
$hilite_event_bold = true;
// $hilite_event_class = 'windowbg3';
//
$hilite_hday_color = '#'.$modSettings['cal_holidaycolor'];
// $hilite_hday_bkgrd = '';
$hilite_hday_bold = true;
// $hilite_hday_class = 'windowbg3';
////////////////////////////////

/////////////////////////////////////////////// NON-ENGLISH  LABELS, MONTH & DAY //NAMES (start)
//
// Non-English Labels, Month and Day Names
//
// To use Month and Day names other than the default on your server,
//   remove the two asterisk '*******' lines (the first starts with '/***'
//   and the second ends '***/') and supply the List Section Labels and the
//   Month and Day names to use per instructions below.
//
/***
$list_label_bdays = '-----Cumpleaños-----';  // Change to labels in language of choice
$list_label_events = '----Fiestas----';
$list_label_hdays = '----Festivos----';
***/
/***
// specify all the day names in desired language
//   if you specify "$first_day = 1;" above, first entry below must be for Monday; e.g:
//      when $first_day = 0;  then $day_names =

array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
//      when $first_day = 1;  then $day_names =

array('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday');
//   
$day_names = array('Lunes','Martes','Miercoles','Jueves','Viernes','Sabado','Domingo');
***/
/***
// specify the month names in desired language
//   
$month_nam = array();
$month_nam['01'] = 'Enero';       
$month_nam['02'] = 'Febrero';
$month_nam['03'] = 'Marzo';
$month_nam['04'] = 'Abril';
$month_nam['05'] = 'Mayo';
$month_nam['06'] = 'Junio';
$month_nam['07'] = 'Julio';
$month_nam['08'] = 'Agosto';
$month_nam['09'] = 'Septiembre';
$month_nam['10'] = 'Octubre';
$month_nam['11'] = 'Noviembre';
$month_nam['12'] = 'Diciembre';
$month_name = $month_nam[date('m',$now)];
/////////////////////////////// NON-ENGLISH  LABELS, MONTH & DAY
//NAMES (end)
***/
//
//  Program Paramters/Switches Section - End
//    (modify below at your own risk!!!)
//
///////////////////////////////////////////////////////////////////////////////////////////////////

//////

$hi_bday_color = '';
if (isset($hilite_bday_color)) $hi_bday_color = 'color:'.$hilite_bday_color.'; ';
$hi_bday_bkgrd = '';
if (isset($hilite_bday_bkgrd)) $hi_bday_bkgrd = 'background-color: '.$hilite_bday_bkgrd.'; ';
$hi_bday_fontwt = '';
if (isset($hilite_bday_bold) && $hilite_bday_bold) $hi_bday_fontwt = 'font-weight:bold; ';

$hi_event_color = '';
if (isset($hilite_event_color)) $hi_event_color = 'color:'.$hilite_event_color.'; ';
$hi_event_bkgrd = '';
if (isset($hilite_event_bkgrd)) $hi_event_bkgrd = 'background-color: '.$hilite_event_bkgrd.'; ';
$hi_event_fontwt = '';
if (isset($hilite_event_bold) && $hilite_event_bold) $hi_event_fontwt = 'font-weight:bold; ';

$hi_hday_color = '';
if (isset($hilite_hday_color)) $hi_hday_color = 'color:'.$hilite_hday_color.'; ';
$hi_hday_bkgrd = '';
if (isset($hilite_hday_bkgrd)) $hi_hday_bkgrd = 'background-color: '.$hilite_hday_bkgrd.'; ';
$hi_hday_fontwt = '';
if (isset($hilite_hday_bold) && $hilite_hday_bold) $hi_hday_fontwt = 'font-weight:bold; ';

if (!isset($class_default)) $class_default = 'windowbg';
if ($class_default == '') $class_default = 'windowbg';

$table_bkgrd = 'class="'.$class_default.'" cellspacing="1"';
if ($bordercolor_gridlines) $table_bkgrd = 'class="bordercolor"

cellspacing="'.$gridlines_thickness.'"';

$today = strftime('%d', $now);
$year = date('Y',$now);
$month = date('n',$now);
$nowdate = strftime('%Y-%m-%d', $now);

$month_href = $scripturl . '?action=calendar;year='.$year.';month='.$month;

require_once($sourcedir . '/Calendar.php');

$low_date_base = strftime('%Y-%m-%d', $now - 24 * 3600);
$high_date_base = strftime('%Y-%m-%d', $now + $modSettings['cal_days_for_index'] * 24 * 3600);

$low_date = ($show_bdays_past || $show_events_past || $show_hdays_past) ? (

($past_look_behind_period == 0) ? date('Y',$now).'-'.date('m',$now).'-01' : strftime('%Y-%m-%d',

$now - (($past_look_behind_period + 1) * 24 * 3600)) ) : $low_date_base;
$high_date = $high_date_base;

$low_date_ts = strtotime($low_date);

if ($show_bdays) {
    $bdays = $show_bdays_past ? calendarBirthdayArray($low_date, $high_date) :

calendarBirthdayArray($low_date_base, $high_date);
    ksort($bdays); }

if ($show_events) {
    $events = $show_events_past ? calendarEventArray($low_date, $high_date, false) :

calendarEventArray($low_date_base, $high_date, false);
    ksort($events); }

if ($show_hdays) {
    $holidays = $show_hdays_past ? calendarHolidayArray($low_date, $high_date) :

calendarHolidayArray($low_date_base, $high_date);
    ksort($holidays); }

$todays_color = isset($color_today) ?'color:'.$color_today.'; ' : '';
$todays_bkgrd = isset($bkgrd_today) ?'background-color:'.$bkgrd_today.'; ' : '';

$stub = '<a class="smalltext" style="'.$todays_color.'font-weight:bold; border:solid 1px black;

'.$todays_bkgrd.'padding: 0px 2px 0px 2px;"';

// Highlighted 'Today' Box
if ($date_links_to_posting && allowedTo('calendar_post')) {
    $days = array($today=>array(NULL,$class_today,$stub.'

href="'.$scripturl.'?action=calendar;sa=post;month='.$month.';year='.$year.';day='.$today.'"

target="_self">'.date('j',$now).'</a>'));}
else {
    $days = array($today=>array(NULL,$class_today,$stub.' href="'.htmlspecialchars($month_href).'"

target="_self">'.date('j',$now).'</a>'));}

////////////////////////////////////////////////////////////////////////////// HIGHLIGHTING (start)
//
if ($show_hilites) {
    foreach($order_hilites as $hilite_to_do){
        $flag = strtoupper(substr($hilite_to_do,0,1));

///////////////////////////////////////////////// B-Day Highlighting
        if ($flag == 'B') {
            if ($show_bdays) {
                if ($show_bdays_to_guests or !$user_info['is_guest']) {
                    $stub = '<a class="smalltext" style="'. $hi_bday_color . $hi_bday_bkgrd .

$hi_bday_fontwt .'padding: 0px 2px 0px 2px;"';
                    if (!isset($hilite_bday_class)) $hilite_bday_class = $class_default;
                    if ($hilite_bday_class == '') $hilite_bday_class = $class_default;
                    foreach($bdays as $startdate => $value)
                        if(!isset($days[substr($startdate,8)]) or

!is_array($days[substr($startdate,8)])) {
                            if (substr($startdate,0,7) == substr($nowdate,0,7)) {
                                if ($date_links_to_posting && allowedTo('calendar_post')) {
                                    $days[substr($startdate,8)] =

array(NULL,$hilite_bday_class,$stub.'

href="'.$scripturl.'?action=calendar;sa=post;month='.$month.';year='.$year.';day='.substr($startdat

e,8).'" target="_self">'.sprintf('%d',substr($startdate,8)).'</a>');}
                                else {
                                    $days[substr($startdate,8)] =

array(NULL,$hilite_bday_class,$stub.' href="'.htmlspecialchars($month_href).'"

target="_self">'.sprintf('%d',substr($startdate,8)).'</a>');}
                            }
                        }
                }
            }
        }
////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////// Event Highlighting
        if ($flag == 'E') {
            if ($show_events) {
                if ($show_events_to_guests or !$user_info['is_guest']) {
                    $stub = '<a class="smalltext" style="'. $hi_event_color . $hi_event_bkgrd .

$hi_event_fontwt .'padding: 0px 2px 0px 2px;"';
                    if (!isset($hilite_event_class)) $hilite_event_class = $class_default;
                    if ($hilite_event_class == '') $hilite_event_class = $class_default;
                    foreach($events as $startdate => $value)
                        if(!isset($days[substr($startdate,8)]) or

!is_array($days[substr($startdate,8)])) {
                            if (substr($startdate,0,7) == substr($nowdate,0,7)) {
                                if ($date_links_to_posting && allowedTo('calendar_post')) {
                                    $days[substr($startdate,8)] =

array(NULL,$hilite_event_class,$stub.'

href="'.$scripturl.'?action=calendar;sa=post;month='.$month.';year='.$year.';day='.substr($startdat

e,8).'" target="_self">'.sprintf('%d',substr($startdate,8)).'</a>');}
                                else {
                                    $days[substr($startdate,8)] =

array(NULL,$hilite_event_class,$stub.' href="'.htmlspecialchars($month_href).'"

target="_self">'.sprintf('%d',substr($startdate,8)).'</a>');}
                            }
                        }
                }
            }
        }
////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////// Holiday Highlighting
        if ($flag == 'H') {
            if ($show_hdays) {
                if ($show_hdays_to_guests or !$user_info['is_guest']) {
                    $stub = '<a class="smalltext" style="'. $hi_hday_color . $hi_hday_bkgrd .

$hi_hday_fontwt .'padding: 0px 2px 0px 2px;"';
                    if (!isset($hilite_hday_class)) $hilite_hday_class = $class_default;
                    if ($hilite_hday_class == '') $hilite_hday_class = $class_default;
                    foreach($holidays as $startdate => $value)
                        if (!isset($days[substr($startdate,8)]) or

!is_array($days[substr($startdate,8)])) {
                            if (substr($startdate,0,7) == substr($nowdate,0,7)) {
                                if ($date_links_to_posting && allowedTo('calendar_post')) {
                                    $days[substr($startdate,8)] =

array(NULL,$hilite_hday_class,$stub.'

href="'.$scripturl.'?action=calendar;sa=post;month='.$month.';year='.$year.';day='.substr($startdat

e,8).'" target="_self">'.sprintf('%d',substr($startdate,8)).'</a>');}
                                else {
                                    $days[substr($startdate,8)] =

array(NULL,$hilite_hday_class,$stub.' href="'.htmlspecialchars($month_href).'"

target="_self">'.sprintf('%d',substr($startdate,8)).'</a>');}
                            }
                        }
                }
            }
        }
////////////////////////////////////////////////////////////////////
    }
}

////////////////////////////////////////////////////////////////////////////// HIGHLIGHTING (end)

$first_of_month = gmmktime(0,0,0,$month,1,$year);
list($month, $year, $weekday) = explode(',',gmstrftime('%m,%Y,%w',$first_of_month));

if (!isset($month_nam['12'])) {
    $day_names = array();                                      // generate all the day names

according to the current locale
    for($n=0,$t=(3+$first_day)*86400; $n<7; $n++,$t+=86400)    // January 4, 1970 was a Sunday
        $day_names[$n] = ucfirst(gmstrftime('%A',$t));         // %A means full textual day name
    list($month, $year, $month_name, $weekday) =

explode(',',gmstrftime('%m,%Y,%B,%w',$first_of_month));
}

$weekday = ($weekday + 7 - $first_day) % 7;                // adjust for $first_day
$title   = htmlentities(ucfirst($month_name)).' '.$year;   // note that some locales don't

capitalize month and day names

$calendar = '<table '.$table_bkgrd.' align="center">'.'<caption >'.($month_href ? '<a

href="'.htmlspecialchars($month_href).'">'.$title.'</a>' : $title).'</caption><tr>';

if (!isset($class_day_names)) $class_day_names = $class_default;
if ($class_day_names == '') $class_day_names = $class_default;
if($day_name_length){                                      #if the day names should be shown

($day_name_length > 0)
    foreach($day_names as $d)
    $calendar .= '<th class="'.$class_day_names.'" align="center" valign="middle"

style="padding-left: 0px; padding-right: 0px;font-size: x-small;"

abbr="'.htmlentities($d).'">'.htmlentities($day_name_length < 4 ? substr($d,0,$day_name_length) :

$d).'</th>';
    $calendar .= '</tr><tr style="text-align:right;">';
    }

if($weekday > 0) $calendar .= '<td class="'.$class_default.'" colspan="'.$weekday.'"> </td>';

#initial 'empty' days

for($day=1,$days_in_month=gmdate('t',$first_of_month); $day<=$days_in_month; $day++,$weekday++){
    if($weekday == 7){
        $weekday   = 0; #start a new week
        $calendar .= '</tr><tr style="text-align:right;">';
        }

    $daynow = sprintf('%02d',$day);
    $col_width = ' width="14%"';
    if ( ((($weekday+$first_day) % 7) == 0) || ((($weekday+$first_day) % 7) == 0) ) $col_width = '

width="15%"';

    if(isset($days[$daynow]) and is_array($days[$daynow])){
        @list($link, $classes, $content) = $days[$daynow];
        if(is_null($content))  $content  = $daynow;
        $calendar .= '<td'.$col_width.' align="center" valign="middle" '.($classes ? '

class="'.htmlspecialchars($classes).'" style="padding: 0px 0px 0px 0px;font-size: x-small;">' :

'>').($link ? '<a href="'.htmlspecialchars($link).'">'.$content.'</a>' : $content).'</td>';
        }
    else
        {
        $calendar .= '<td'.$col_width.' class="'.$class_default.'" align="center" valign="middle"

style="padding: 0px 0px 0px 0px;font-size: x-small;"><a class="smalltext"';
        if (((($weekday+$first_day) % 7) == 0) && isset($color_sunday))
            $calendar .= ' style="color:'.$color_sunday.';"';
        if (((($weekday+$first_day) % 7) == 6) && isset($color_saturday))
            $calendar .= ' style="color:'.$color_saturday.';"';
        if ($date_links_to_posting && allowedTo('calendar_post')) {
            $calendar .= '

href="'.$scripturl.'?action=calendar;sa=post;month='.$month.';year='.$year.';day='.$day.'"

target="_self">'.$day.'</a></td>';}
        else {
            $calendar .= ' href="'.htmlspecialchars($month_href).'"

target="_self">'.$day.'</a></td>';}
        }
    }

if($weekday != 7) $calendar .= '<td class="'.$class_default.'" colspan="'.(7-$weekday).'"> </td>';

#remaining "empty" days

echo $calendar.'</tr>';

foreach($order_lists as $list_to_do){
    $flag = strtoupper(substr($list_to_do,0,1));

if (!isset($align_list_entries)) $align_list_entries = 'center';
if (isset($align_list_entries))
    if ($align_list_entries <> 'left') $align_list_entries = 'center';

if (!isset($list_label_class)) $list_label_class = $class_default;
if ($list_label_class == '') $list_label_class = $class_default;

if (!isset($list_entry_class)) $list_entry_class = $class_default;
if ($list_entry_class == '') $list_entry_class = $class_default;

/////////////////////////////////////////////////////////////////
//   BIRTHDAY SECTION
//
if(($flag == 'B') and $show_bdays) {
    if($show_bdays_to_guests or !$user_info['is_guest']) {
        if (!empty($bdays))
        {
            echo '<tr'. (isset($list_label_class) ? ' class="'.$list_label_class.'"' : '') .'><td

colspan="7" class="smalltext" align="center" style="font-weight: bold; color: ' .

$list_label_bdays_color . ';">'.$list_label_bdays.'</td></tr>';
            $ctr = 0;

            foreach($bdays as $startdate => $bday_date)
            {

                if (($startdate >= strftime('%Y-%m-%d', $low_date_ts)) && ($startdate <=

strftime('%Y-%m-%d', $now + $modSettings['cal_days_for_index'] * 24 * 3600)))

                foreach ($bday_date as $member)
                {
                    $class_to_use = isset($list_entry_class) ? ( !is_array($list_entry_class) ? '

class="'.$list_entry_class.'"' : ' class="'.$list_entry_class[($ctr++) %

count($list_entry_class)].'"') : '';
                    $birthdate = strtotime($startdate);
                    $text_start = !isset($month_nam['12']) ? date("M j",$birthdate) :

substr($month_nam[strftime('%m', $birthdate)],0,3) . date(" j",$birthdate);

                    echo '<tr'.$class_to_use.'><td colspan="7" class="smalltext" style="padding:

0px 0px 0px 0px;" width="100%" align="'.$align_list_entries.'">';
                    echo '<a href="', $scripturl, '?action=calendar;year=' . date("Y") . ';month='

. substr($startdate,5,2) . '"><strong>' . $text_start . '</strong></a>';
                    echo ' - ';
                    echo '<a href="' . $scripturl . '?action=profile;u=' . $member['id'] . '"

title="' . $txt[92] . ' ' . $member['name'] . '">' . '<font color="'. $member['color']  .'">' . (

($nowdate == $startdate) ? '<b>' : '') . $member['name'] . (isset($member['age']) ? '(' .

$member['age'] . ')' : '') . ( ($nowdate == $startdate) ? '</b>' : '') . '</font>' . '</a>';
                    echo '</td></tr>';
                }

            }
        }
    }
}

/////////////////////////////////////////////////////////////////
//   EVENTS SECTION
//
if(($flag == 'E') and $show_events) {
    if($show_events_to_guests or !$user_info['is_guest']) {

        if (!empty($events))
        {
            $events_printed = array();
            echo '<tr'. (isset($list_label_class) ? ' class="'.$list_label_class.'"' : '') .'><td

colspan="7" class="smalltext" align="center" style="font-weight: bold; color: ' .

$list_label_events_color . ';">'.$list_label_events.'</td></tr>';
            $ctr = 0;

            foreach ($events as $startdate => $evt_date)
            {

                if (($startdate >= strftime('%Y-%m-%d', $low_date_ts)) && ($startdate <=

strftime('%Y-%m-%d', $now + $modSettings['cal_days_for_index'] * 24 * 3600)))

                foreach ($evt_date as $event)
                {
                    if (!in_array($event['id'],$events_printed)) {
                        $events_printed[] = $event['id'];
                        $class_to_use = isset($list_entry_class) ? ( !is_array($list_entry_class) ?

' class="'.$list_entry_class.'"' : ' class="'.$list_entry_class[($ctr++) %

count($list_entry_class)].'"') : '';

                        $evt_start = strtotime($event['start_date']);
                        $evt_end = strtotime($event['end_date']);
                        $text_start = !isset($month_nam['12']) ? date("M j",$evt_start) :

substr($month_nam[strftime('%m', $evt_start)],0,3) . date(" j",$evt_start);
                        $text_end = ($event['start_date'] == $event['end_date'] ? '' : '-'.

(substr($event['start_date'],5,2) == substr($event['end_date'],5,2) ? date("j",$evt_end) :

(!isset($month_nam['12']) ? date("M j",$evt_end) : substr($month_nam[strftime('%m',

$evt_start)],0,3) . date(" j",$evt_start))));

                        $link = $event['topic'] == 0 ? $event['title'] : '<a href="' . $scripturl .

'?topic=' . $event['topic'] . '.0' . '">' . $event['title'] . '</a>';
     
                        echo '<tr'.$class_to_use.'><td colspan="7" class="smalltext"

style="padding: 0px 0px 0px 0px;" width="100%" align="'.$align_list_entries.'">';
                        echo '<a href="', $scripturl, '?action=calendar;year=' . date("Y") .

';month=' . substr($startdate,5,2) . '"><strong>' . $text_start . $text_end . '</strong></a>';
                        echo ' - ';
                        echo  ( ($nowdate >= $event['start_date']) && ($event['end_date'] >=

$nowdate) ) ? '<b>'.$link.'</b>' : $link  ;
                        echo '</td></tr>';
                   }
                }


            }
        }
    }
}

/////////////////////////////////////////////////////////////////
//   HOLIDAY SECTION
//
if(($flag == 'H') and $show_hdays) {
    if($show_hdays_to_guests or !$user_info['is_guest']) {

        if (!empty($holidays))
        {
            echo '<tr'. (isset($list_label_class) ? ' class="'.$list_label_class.'"' : '') .'><td

colspan="7" class="smalltext" align="center" style="font-weight: bold; color: ' .

$list_label_hdays_color . ';">'.$list_label_hdays.'</td></tr>';
            $ctr = 0;

            foreach ($holidays as $hDate => $hday)
            {

                if (($hDate >= strftime('%Y-%m-%d', $low_date_ts)) && ($hDate <=

strftime('%Y-%m-%d', $now + $modSettings['cal_days_for_index'] * 24 * 3600)))
                {
                $eventdate = strtotime(date("Y").substr($hDate, 4));
                foreach ($hday as $holiday)
                {
                    $class_to_use = isset($list_entry_class) ? ( !is_array($list_entry_class) ? '

class="'.$list_entry_class.'"' : ' class="'.$list_entry_class[($ctr++) %

count($list_entry_class)].'"') : '';
                    $text_start = !isset($month_nam['12']) ? date("M j",$eventdate) :

substr($month_nam[strftime('%m', $eventdate)],0,3) . date(" j",$eventdate);

                    echo '<tr'.$class_to_use.'><td colspan="7" class="smalltext" style="padding:

0px 0px 0px 0px;" width="100%" align="'.$align_list_entries.'">';
                    echo '<a href="', $scripturl, '?action=calendar;year=' . date("Y") . ';month='

. substr($startdate,5,2) . '"><strong>' . $text_start . '</strong></a>';
                    echo ' - ';
                    echo $holiday;
                    echo '</td></tr>';
                }

                }

            }
        }
    }
}
}

if ($show_post_event_button) {
        if (allowedTo('calendar_post')) {
            echo '<tr><td colspan="7" class="'.$class_default.'" align="center" valign="middle">';
            echo '<hr/ >';
            echo '<a href="', $scripturl,  '?action=calendar;sa=post;month=', $month, ';year=',

$year, ';sesc=', $context['session_id'], '">','<br />', create_button('calendarpe.gif',

'calendar23', 'calendar23', 'align="middle"'), '</a>';
            echo '</td></tr>';
    }
}
Thanks Much

Flip - KE4OBT
     The Blind Ham
Helping other blind hams
get on the air!


Yes I am really a BLIND user!

So, if a mod doesn't install properly, and I can't get help from your part of the forum,
I will come begging for YOUR help since you wrote it and know how it works
um, uh, well,
At least I would really, really hope you do!
HEE-HEE-HEE

quietstorm

Quote from: ke4obt on February 12, 2009, 09:42:04 AM
Quote from: quietstorm on February 12, 2009, 09:27:59 AM
Quote from: quietstorm on February 11, 2009, 01:18:47 AM
This is a great mod..but it lacks a block for the calendar!  :(
Does anyone know how to add one?

It would be greatly appreciative




TIA

It is a shame no one knows how to do this?  :(

Try this if you are using SMF 1.1.x, apparently it doesn't work with 2.x. Just follow the directions in the top of the code. Hope it helps.
/
******************************************************************************************
*                                                                                         *
* 'Mini' Calendar in phpblock -                                                           *
*                                                                                         *
* Program Parameters/Switches can be specified to change what is displayed and how.       *
*   If highlighting is turned on, only the types of entries which are selected to         *
*   be shown will be highlighted (and have to be shown to guests for guests to see        *
*   highlights). If option of linking the day numbers to calendar event posting form      *
*   is chosen ($date_links_to_posting = true), SMF permissions are in effect and only     *
*   those allowed to post events to the calendar will have this link in effect. For       *
*   $date_links_to_posting = false, and for those not permitted to post events, day       *
*   numbers will link to the full SMF Calendar page. Additionally, if option to show      *
*   a separate 'Post Event' button is chosen ($show_post_event_button = true), it will    *
*   only show for those permitted to post events to the calendar.                         *
*                                                                                         *
* Look for 'NON-ENGLISH' to see section for changing language. This is actually more      *
*   correctly referred to as 'language other than server default' as this Calendar will   *
*   use the server's default LOCALE language for Month and Day names unless overides      *
*   are specified in the code section labeled 'NON-ENGLISH  LABELS, MONTH & DAY NAMES',   *
*   below.                                                                                *
*                                                                                         *
* Once a given day is highlighted, the highlight will not be supplanted. That means       *
*   you may want to modify the order in which highlights are applied in order to set      *
*   desired 'precedence' (i.e. if b-days highlights are applied first, once a given       *
*   day is highlighted with b-day color, it will not be changed to be highlighted         *
*   with event color if an event occurs on the same day; you need to choose an order      *
*   of precedence and sequence the highlighting accordingly by changing the sequence      *
*   of sections in the $order_hilites array. Highlighting will be done in the given       *
*   order.                                                                                *
*                                                                                         *
* Also, if you want the individual B-day/Event/Holiday sections to be ordered in a        *
*   different sequence, you need to change the sequence of entries in the $order_lists    *
*   array.                                                                                *
*                                                                                         *
* Examples of highlighting can be seen in the section 'Highlight colors & backgrounds'    *
*   below. As given, highlighting is done by applying the admin specified calendar        *
*   entry color to the date, bolded, on the default background. Commented example given   *
*   of using bold white on a background box of the admin specified calendar entry color.  *
*                                                                                         *
******************************************************************************************/
global $scripturl, $modSettings, $context, $db_prefix, $user_profile, $user_info, $sourcedir;

///////////////////////////////////////////////////////////////////////////////////////////////////

//////
//
//  Program Paramters/Switches Section
//

// use forum's date/time
//$now = mktime() + $modSettings['time_offset'] * 3600;                                 
// include user's time offset to forum date/time
$now = mktime() + (($user_info['time_offset'] + $modSettings['time_offset']) * 3600);

// Order to do highlightling - earlier have precedence
$order_hilites = array('Birthdays', 'Events', 'Holidays');

// Order to show calendar entry lists
$order_lists = array('Birthdays', 'Events', 'Holidays');

// Alignment of calendar entry lists
// $align_list_entries = 'left';
$align_list_entries = 'center';

// Use 'bordercolor' class for 'gridlines' (table background)
$bordercolor_gridlines = true; // Will 'show through' between table cells to act as 'grid lines'
$gridlines_thickness = 5;       // Pixel thickness for table "cellspacing" - only used w/

$bordercolor_gridlines = true;

// Letters to show on calendar for names of each of the days
$day_name_length = 3;

// Selection for first day of the week: 0-Sunday; 1-Monday
$first_day = 0;

// Show B-Day list at all / to guests
$show_bdays = true;
$show_bdays_to_guests = false;

// Show Event list at all / to guests
$show_events = true;
$show_events_to_guests = true;

// Show Holiday list at all / to guests
$show_hdays = true;
$show_hdays_to_guests = true;

// If true, calendar date numbers link to calendar event posting form
//    if not, links to full calendar page
$date_links_to_posting = true;

// Adds 'Post Event' button to bottom of block
$show_post_event_button = true; 

// Highlight events, b-days, holidays (only if they're selected to show at all)
$show_hilites = true;         

$color_sunday = '#D00000';    // comment out to use default text colors -
$color_saturday = '#D00000';  //   can use hex codes with leading '#'
$color_today = 'steelblue';   //   or color names
$bkgrd_today = 'white';

// Default class to use when no other class specified
$class_default = '';
// $class_default = 'smalltext';
// $class_default = 'windowbg2';

// Class to use for column top day names
// $class_day_names = 'titlebg';  // Ex.: titlebg, catbg, catbg2, catbg3, windowbg, windowbg2,

windowbg3

// Class to use for 'Today' highlight
$class_today = 'windowbg2';

// Text Labels to use for calendar entry lists
$list_label_bdays =  '__Birthdays__';
$list_label_events = '____Events___';
$list_label_hdays =  '__ Holidays___';

// Colors for text labels on calendar entry lists
$list_label_bdays_color = '#'.$modSettings['cal_bdaycolor'];
$list_label_events_color = '#'.$modSettings['cal_eventcolor'];
$list_label_hdays_color = '#'.$modSettings['cal_holidaycolor'];

// Choose to show 'look-behind' for the various entry types
$show_bdays_past = true;
$show_events_past = true;
$show_hdays_past = true;

// For any of the above chosen, days prior to today to display -
//    use '0' (zero) to use beginning of current month
$past_look_behind_period = 7;

// Class for 'cells' holding text labels on calendar entry lists
// $list_label_class = 'titlebg'; // Ex.: titlebg, catbg, catbg2, catbg3, windowbg, windowbg2,

windowbg3

// Class for 'cells' holding calendar entry lists
//   use regular variable for all same class
//   use two-member array to alternate between the two
$list_entry_class = '';
// $list_entry_class = 'windowbg';
// $list_entry_class = array('windowbg2','windowbg3');

///////////////////////////////
//   Highlight colors & backgrounds
//
//   Admin-specified birthday color: $modSettings['cal_bdaycolor']
//   Admin-specified event color:    $modSettings['cal_eventcolor']
//   Admin-specified holiday color:  $modSettings['cal_holidaycolor']

// Highlight bold white on backgound of forum's defined color for date entry type
//
// $hilite_bday_color = 'white';
// $hilite_bday_bkgrd = '#'.$modSettings['cal_bdaycolor'];
// $hilite_bday_bold = true;
// $hilite_bday_class = '';
//
// $hilite_event_color = 'white';
// $hilite_event_bkgrd = '#'.$modSettings['cal_eventcolor'];
// $hilite_event_bold = true;
// $hilite_event_class = '';
//
// $hilite_hday_color = 'white';
// $hilite_hday_bkgrd = '#'.$modSettings['cal_holidaycolor'];
// $hilite_hday_bold = true;
// $hilite_hday_class = '';
////////////////////////////////

// Highlight bolded color for date entry type on default backgound
//
$hilite_bday_color = '#'.$modSettings['cal_bdaycolor'];
// $hilite_bday_bkgrd = '';
$hilite_bday_bold = true;
// $hilite_bday_class = 'windowbg3';
//
$hilite_event_color = '#'.$modSettings['cal_eventcolor'];
// $hilite_event_bkgrd = '';
$hilite_event_bold = true;
// $hilite_event_class = 'windowbg3';
//
$hilite_hday_color = '#'.$modSettings['cal_holidaycolor'];
// $hilite_hday_bkgrd = '';
$hilite_hday_bold = true;
// $hilite_hday_class = 'windowbg3';
////////////////////////////////

/////////////////////////////////////////////// NON-ENGLISH  LABELS, MONTH & DAY //NAMES (start)
//
// Non-English Labels, Month and Day Names
//
// To use Month and Day names other than the default on your server,
//   remove the two asterisk '*******' lines (the first starts with '/***'
//   and the second ends '***/') and supply the List Section Labels and the
//   Month and Day names to use per instructions below.
//
/***
$list_label_bdays = '-----Cumpleaños-----';  // Change to labels in language of choice
$list_label_events = '----Fiestas----';
$list_label_hdays = '----Festivos----';
***/
/***
// specify all the day names in desired language
//   if you specify "$first_day = 1;" above, first entry below must be for Monday; e.g:
//      when $first_day = 0;  then $day_names =

array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
//      when $first_day = 1;  then $day_names =

array('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday');
//   
$day_names = array('Lunes','Martes','Miercoles','Jueves','Viernes','Sabado','Domingo');
***/
/***
// specify the month names in desired language
//   
$month_nam = array();
$month_nam['01'] = 'Enero';       
$month_nam['02'] = 'Febrero';
$month_nam['03'] = 'Marzo';
$month_nam['04'] = 'Abril';
$month_nam['05'] = 'Mayo';
$month_nam['06'] = 'Junio';
$month_nam['07'] = 'Julio';
$month_nam['08'] = 'Agosto';
$month_nam['09'] = 'Septiembre';
$month_nam['10'] = 'Octubre';
$month_nam['11'] = 'Noviembre';
$month_nam['12'] = 'Diciembre';
$month_name = $month_nam[date('m',$now)];
/////////////////////////////// NON-ENGLISH  LABELS, MONTH & DAY
//NAMES (end)
***/
//
//  Program Paramters/Switches Section - End
//    (modify below at your own risk!!!)
//
///////////////////////////////////////////////////////////////////////////////////////////////////

//////

$hi_bday_color = '';
if (isset($hilite_bday_color)) $hi_bday_color = 'color:'.$hilite_bday_color.'; ';
$hi_bday_bkgrd = '';
if (isset($hilite_bday_bkgrd)) $hi_bday_bkgrd = 'background-color: '.$hilite_bday_bkgrd.'; ';
$hi_bday_fontwt = '';
if (isset($hilite_bday_bold) && $hilite_bday_bold) $hi_bday_fontwt = 'font-weight:bold; ';

$hi_event_color = '';
if (isset($hilite_event_color)) $hi_event_color = 'color:'.$hilite_event_color.'; ';
$hi_event_bkgrd = '';
if (isset($hilite_event_bkgrd)) $hi_event_bkgrd = 'background-color: '.$hilite_event_bkgrd.'; ';
$hi_event_fontwt = '';
if (isset($hilite_event_bold) && $hilite_event_bold) $hi_event_fontwt = 'font-weight:bold; ';

$hi_hday_color = '';
if (isset($hilite_hday_color)) $hi_hday_color = 'color:'.$hilite_hday_color.'; ';
$hi_hday_bkgrd = '';
if (isset($hilite_hday_bkgrd)) $hi_hday_bkgrd = 'background-color: '.$hilite_hday_bkgrd.'; ';
$hi_hday_fontwt = '';
if (isset($hilite_hday_bold) && $hilite_hday_bold) $hi_hday_fontwt = 'font-weight:bold; ';

if (!isset($class_default)) $class_default = 'windowbg';
if ($class_default == '') $class_default = 'windowbg';

$table_bkgrd = 'class="'.$class_default.'" cellspacing="1"';
if ($bordercolor_gridlines) $table_bkgrd = 'class="bordercolor"

cellspacing="'.$gridlines_thickness.'"';

$today = strftime('%d', $now);
$year = date('Y',$now);
$month = date('n',$now);
$nowdate = strftime('%Y-%m-%d', $now);

$month_href = $scripturl . '?action=calendar;year='.$year.';month='.$month;

require_once($sourcedir . '/Calendar.php');

$low_date_base = strftime('%Y-%m-%d', $now - 24 * 3600);
$high_date_base = strftime('%Y-%m-%d', $now + $modSettings['cal_days_for_index'] * 24 * 3600);

$low_date = ($show_bdays_past || $show_events_past || $show_hdays_past) ? (

($past_look_behind_period == 0) ? date('Y',$now).'-'.date('m',$now).'-01' : strftime('%Y-%m-%d',

$now - (($past_look_behind_period + 1) * 24 * 3600)) ) : $low_date_base;
$high_date = $high_date_base;

$low_date_ts = strtotime($low_date);

if ($show_bdays) {
    $bdays = $show_bdays_past ? calendarBirthdayArray($low_date, $high_date) :

calendarBirthdayArray($low_date_base, $high_date);
    ksort($bdays); }

if ($show_events) {
    $events = $show_events_past ? calendarEventArray($low_date, $high_date, false) :

calendarEventArray($low_date_base, $high_date, false);
    ksort($events); }

if ($show_hdays) {
    $holidays = $show_hdays_past ? calendarHolidayArray($low_date, $high_date) :

calendarHolidayArray($low_date_base, $high_date);
    ksort($holidays); }

$todays_color = isset($color_today) ?'color:'.$color_today.'; ' : '';
$todays_bkgrd = isset($bkgrd_today) ?'background-color:'.$bkgrd_today.'; ' : '';

$stub = '<a class="smalltext" style="'.$todays_color.'font-weight:bold; border:solid 1px black;

'.$todays_bkgrd.'padding: 0px 2px 0px 2px;"';

// Highlighted 'Today' Box
if ($date_links_to_posting && allowedTo('calendar_post')) {
    $days = array($today=>array(NULL,$class_today,$stub.'

href="'.$scripturl.'?action=calendar;sa=post;month='.$month.';year='.$year.';day='.$today.'"

target="_self">'.date('j',$now).'</a>'));}
else {
    $days = array($today=>array(NULL,$class_today,$stub.' href="'.htmlspecialchars($month_href).'"

target="_self">'.date('j',$now).'</a>'));}

////////////////////////////////////////////////////////////////////////////// HIGHLIGHTING (start)
//
if ($show_hilites) {
    foreach($order_hilites as $hilite_to_do){
        $flag = strtoupper(substr($hilite_to_do,0,1));

///////////////////////////////////////////////// B-Day Highlighting
        if ($flag == 'B') {
            if ($show_bdays) {
                if ($show_bdays_to_guests or !$user_info['is_guest']) {
                    $stub = '<a class="smalltext" style="'. $hi_bday_color . $hi_bday_bkgrd .

$hi_bday_fontwt .'padding: 0px 2px 0px 2px;"';
                    if (!isset($hilite_bday_class)) $hilite_bday_class = $class_default;
                    if ($hilite_bday_class == '') $hilite_bday_class = $class_default;
                    foreach($bdays as $startdate => $value)
                        if(!isset($days[substr($startdate,8)]) or

!is_array($days[substr($startdate,8)])) {
                            if (substr($startdate,0,7) == substr($nowdate,0,7)) {
                                if ($date_links_to_posting && allowedTo('calendar_post')) {
                                    $days[substr($startdate,8)] =

array(NULL,$hilite_bday_class,$stub.'

href="'.$scripturl.'?action=calendar;sa=post;month='.$month.';year='.$year.';day='.substr($startdat

e,8).'" target="_self">'.sprintf('%d',substr($startdate,8)).'</a>');}
                                else {
                                    $days[substr($startdate,8)] =

array(NULL,$hilite_bday_class,$stub.' href="'.htmlspecialchars($month_href).'"

target="_self">'.sprintf('%d',substr($startdate,8)).'</a>');}
                            }
                        }
                }
            }
        }
////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////// Event Highlighting
        if ($flag == 'E') {
            if ($show_events) {
                if ($show_events_to_guests or !$user_info['is_guest']) {
                    $stub = '<a class="smalltext" style="'. $hi_event_color . $hi_event_bkgrd .

$hi_event_fontwt .'padding: 0px 2px 0px 2px;"';
                    if (!isset($hilite_event_class)) $hilite_event_class = $class_default;
                    if ($hilite_event_class == '') $hilite_event_class = $class_default;
                    foreach($events as $startdate => $value)
                        if(!isset($days[substr($startdate,8)]) or

!is_array($days[substr($startdate,8)])) {
                            if (substr($startdate,0,7) == substr($nowdate,0,7)) {
                                if ($date_links_to_posting && allowedTo('calendar_post')) {
                                    $days[substr($startdate,8)] =

array(NULL,$hilite_event_class,$stub.'

href="'.$scripturl.'?action=calendar;sa=post;month='.$month.';year='.$year.';day='.substr($startdat

e,8).'" target="_self">'.sprintf('%d',substr($startdate,8)).'</a>');}
                                else {
                                    $days[substr($startdate,8)] =

array(NULL,$hilite_event_class,$stub.' href="'.htmlspecialchars($month_href).'"

target="_self">'.sprintf('%d',substr($startdate,8)).'</a>');}
                            }
                        }
                }
            }
        }
////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////// Holiday Highlighting
        if ($flag == 'H') {
            if ($show_hdays) {
                if ($show_hdays_to_guests or !$user_info['is_guest']) {
                    $stub = '<a class="smalltext" style="'. $hi_hday_color . $hi_hday_bkgrd .

$hi_hday_fontwt .'padding: 0px 2px 0px 2px;"';
                    if (!isset($hilite_hday_class)) $hilite_hday_class = $class_default;
                    if ($hilite_hday_class == '') $hilite_hday_class = $class_default;
                    foreach($holidays as $startdate => $value)
                        if (!isset($days[substr($startdate,8)]) or

!is_array($days[substr($startdate,8)])) {
                            if (substr($startdate,0,7) == substr($nowdate,0,7)) {
                                if ($date_links_to_posting && allowedTo('calendar_post')) {
                                    $days[substr($startdate,8)] =

array(NULL,$hilite_hday_class,$stub.'

href="'.$scripturl.'?action=calendar;sa=post;month='.$month.';year='.$year.';day='.substr($startdat

e,8).'" target="_self">'.sprintf('%d',substr($startdate,8)).'</a>');}
                                else {
                                    $days[substr($startdate,8)] =

array(NULL,$hilite_hday_class,$stub.' href="'.htmlspecialchars($month_href).'"

target="_self">'.sprintf('%d',substr($startdate,8)).'</a>');}
                            }
                        }
                }
            }
        }
////////////////////////////////////////////////////////////////////
    }
}

////////////////////////////////////////////////////////////////////////////// HIGHLIGHTING (end)

$first_of_month = gmmktime(0,0,0,$month,1,$year);
list($month, $year, $weekday) = explode(',',gmstrftime('%m,%Y,%w',$first_of_month));

if (!isset($month_nam['12'])) {
    $day_names = array();                                      // generate all the day names

according to the current locale
    for($n=0,$t=(3+$first_day)*86400; $n<7; $n++,$t+=86400)    // January 4, 1970 was a Sunday
        $day_names[$n] = ucfirst(gmstrftime('%A',$t));         // %A means full textual day name
    list($month, $year, $month_name, $weekday) =

explode(',',gmstrftime('%m,%Y,%B,%w',$first_of_month));
}

$weekday = ($weekday + 7 - $first_day) % 7;                // adjust for $first_day
$title   = htmlentities(ucfirst($month_name)).' '.$year;   // note that some locales don't

capitalize month and day names

$calendar = '<table '.$table_bkgrd.' align="center">'.'<caption >'.($month_href ? '<a

href="'.htmlspecialchars($month_href).'">'.$title.'</a>' : $title).'</caption><tr>';

if (!isset($class_day_names)) $class_day_names = $class_default;
if ($class_day_names == '') $class_day_names = $class_default;
if($day_name_length){                                      #if the day names should be shown

($day_name_length > 0)
    foreach($day_names as $d)
    $calendar .= '<th class="'.$class_day_names.'" align="center" valign="middle"

style="padding-left: 0px; padding-right: 0px;font-size: x-small;"

abbr="'.htmlentities($d).'">'.htmlentities($day_name_length < 4 ? substr($d,0,$day_name_length) :

$d).'</th>';
    $calendar .= '</tr><tr style="text-align:right;">';
    }

if($weekday > 0) $calendar .= '<td class="'.$class_default.'" colspan="'.$weekday.'"> </td>';

#initial 'empty' days

for($day=1,$days_in_month=gmdate('t',$first_of_month); $day<=$days_in_month; $day++,$weekday++){
    if($weekday == 7){
        $weekday   = 0; #start a new week
        $calendar .= '</tr><tr style="text-align:right;">';
        }

    $daynow = sprintf('%02d',$day);
    $col_width = ' width="14%"';
    if ( ((($weekday+$first_day) % 7) == 0) || ((($weekday+$first_day) % 7) == 0) ) $col_width = '

width="15%"';

    if(isset($days[$daynow]) and is_array($days[$daynow])){
        @list($link, $classes, $content) = $days[$daynow];
        if(is_null($content))  $content  = $daynow;
        $calendar .= '<td'.$col_width.' align="center" valign="middle" '.($classes ? '

class="'.htmlspecialchars($classes).'" style="padding: 0px 0px 0px 0px;font-size: x-small;">' :

'>').($link ? '<a href="'.htmlspecialchars($link).'">'.$content.'</a>' : $content).'</td>';
        }
    else
        {
        $calendar .= '<td'.$col_width.' class="'.$class_default.'" align="center" valign="middle"

style="padding: 0px 0px 0px 0px;font-size: x-small;"><a class="smalltext"';
        if (((($weekday+$first_day) % 7) == 0) && isset($color_sunday))
            $calendar .= ' style="color:'.$color_sunday.';"';
        if (((($weekday+$first_day) % 7) == 6) && isset($color_saturday))
            $calendar .= ' style="color:'.$color_saturday.';"';
        if ($date_links_to_posting && allowedTo('calendar_post')) {
            $calendar .= '

href="'.$scripturl.'?action=calendar;sa=post;month='.$month.';year='.$year.';day='.$day.'"

target="_self">'.$day.'</a></td>';}
        else {
            $calendar .= ' href="'.htmlspecialchars($month_href).'"

target="_self">'.$day.'</a></td>';}
        }
    }

if($weekday != 7) $calendar .= '<td class="'.$class_default.'" colspan="'.(7-$weekday).'"> </td>';

#remaining "empty" days

echo $calendar.'</tr>';

foreach($order_lists as $list_to_do){
    $flag = strtoupper(substr($list_to_do,0,1));

if (!isset($align_list_entries)) $align_list_entries = 'center';
if (isset($align_list_entries))
    if ($align_list_entries <> 'left') $align_list_entries = 'center';

if (!isset($list_label_class)) $list_label_class = $class_default;
if ($list_label_class == '') $list_label_class = $class_default;

if (!isset($list_entry_class)) $list_entry_class = $class_default;
if ($list_entry_class == '') $list_entry_class = $class_default;

/////////////////////////////////////////////////////////////////
//   BIRTHDAY SECTION
//
if(($flag == 'B') and $show_bdays) {
    if($show_bdays_to_guests or !$user_info['is_guest']) {
        if (!empty($bdays))
        {
            echo '<tr'. (isset($list_label_class) ? ' class="'.$list_label_class.'"' : '') .'><td

colspan="7" class="smalltext" align="center" style="font-weight: bold; color: ' .

$list_label_bdays_color . ';">'.$list_label_bdays.'</td></tr>';
            $ctr = 0;

            foreach($bdays as $startdate => $bday_date)
            {

                if (($startdate >= strftime('%Y-%m-%d', $low_date_ts)) && ($startdate <=

strftime('%Y-%m-%d', $now + $modSettings['cal_days_for_index'] * 24 * 3600)))

                foreach ($bday_date as $member)
                {
                    $class_to_use = isset($list_entry_class) ? ( !is_array($list_entry_class) ? '

class="'.$list_entry_class.'"' : ' class="'.$list_entry_class[($ctr++) %

count($list_entry_class)].'"') : '';
                    $birthdate = strtotime($startdate);
                    $text_start = !isset($month_nam['12']) ? date("M j",$birthdate) :

substr($month_nam[strftime('%m', $birthdate)],0,3) . date(" j",$birthdate);

                    echo '<tr'.$class_to_use.'><td colspan="7" class="smalltext" style="padding:

0px 0px 0px 0px;" width="100%" align="'.$align_list_entries.'">';
                    echo '<a href="', $scripturl, '?action=calendar;year=' . date("Y") . ';month='

. substr($startdate,5,2) . '"><strong>' . $text_start . '</strong></a>';
                    echo ' - ';
                    echo '<a href="' . $scripturl . '?action=profile;u=' . $member['id'] . '"

title="' . $txt[92] . ' ' . $member['name'] . '">' . '<font color="'. $member['color']  .'">' . (

($nowdate == $startdate) ? '<b>' : '') . $member['name'] . (isset($member['age']) ? '(' .

$member['age'] . ')' : '') . ( ($nowdate == $startdate) ? '</b>' : '') . '</font>' . '</a>';
                    echo '</td></tr>';
                }

            }
        }
    }
}

/////////////////////////////////////////////////////////////////
//   EVENTS SECTION
//
if(($flag == 'E') and $show_events) {
    if($show_events_to_guests or !$user_info['is_guest']) {

        if (!empty($events))
        {
            $events_printed = array();
            echo '<tr'. (isset($list_label_class) ? ' class="'.$list_label_class.'"' : '') .'><td

colspan="7" class="smalltext" align="center" style="font-weight: bold; color: ' .

$list_label_events_color . ';">'.$list_label_events.'</td></tr>';
            $ctr = 0;

            foreach ($events as $startdate => $evt_date)
            {

                if (($startdate >= strftime('%Y-%m-%d', $low_date_ts)) && ($startdate <=

strftime('%Y-%m-%d', $now + $modSettings['cal_days_for_index'] * 24 * 3600)))

                foreach ($evt_date as $event)
                {
                    if (!in_array($event['id'],$events_printed)) {
                        $events_printed[] = $event['id'];
                        $class_to_use = isset($list_entry_class) ? ( !is_array($list_entry_class) ?

' class="'.$list_entry_class.'"' : ' class="'.$list_entry_class[($ctr++) %

count($list_entry_class)].'"') : '';

                        $evt_start = strtotime($event['start_date']);
                        $evt_end = strtotime($event['end_date']);
                        $text_start = !isset($month_nam['12']) ? date("M j",$evt_start) :

substr($month_nam[strftime('%m', $evt_start)],0,3) . date(" j",$evt_start);
                        $text_end = ($event['start_date'] == $event['end_date'] ? '' : '-'.

(substr($event['start_date'],5,2) == substr($event['end_date'],5,2) ? date("j",$evt_end) :

(!isset($month_nam['12']) ? date("M j",$evt_end) : substr($month_nam[strftime('%m',

$evt_start)],0,3) . date(" j",$evt_start))));

                        $link = $event['topic'] == 0 ? $event['title'] : '<a href="' . $scripturl .

'?topic=' . $event['topic'] . '.0' . '">' . $event['title'] . '</a>';
     
                        echo '<tr'.$class_to_use.'><td colspan="7" class="smalltext"

style="padding: 0px 0px 0px 0px;" width="100%" align="'.$align_list_entries.'">';
                        echo '<a href="', $scripturl, '?action=calendar;year=' . date("Y") .

';month=' . substr($startdate,5,2) . '"><strong>' . $text_start . $text_end . '</strong></a>';
                        echo ' - ';
                        echo  ( ($nowdate >= $event['start_date']) && ($event['end_date'] >=

$nowdate) ) ? '<b>'.$link.'</b>' : $link  ;
                        echo '</td></tr>';
                   }
                }


            }
        }
    }
}

/////////////////////////////////////////////////////////////////
//   HOLIDAY SECTION
//
if(($flag == 'H') and $show_hdays) {
    if($show_hdays_to_guests or !$user_info['is_guest']) {

        if (!empty($holidays))
        {
            echo '<tr'. (isset($list_label_class) ? ' class="'.$list_label_class.'"' : '') .'><td

colspan="7" class="smalltext" align="center" style="font-weight: bold; color: ' .

$list_label_hdays_color . ';">'.$list_label_hdays.'</td></tr>';
            $ctr = 0;

            foreach ($holidays as $hDate => $hday)
            {

                if (($hDate >= strftime('%Y-%m-%d', $low_date_ts)) && ($hDate <=

strftime('%Y-%m-%d', $now + $modSettings['cal_days_for_index'] * 24 * 3600)))
                {
                $eventdate = strtotime(date("Y").substr($hDate, 4));
                foreach ($hday as $holiday)
                {
                    $class_to_use = isset($list_entry_class) ? ( !is_array($list_entry_class) ? '

class="'.$list_entry_class.'"' : ' class="'.$list_entry_class[($ctr++) %

count($list_entry_class)].'"') : '';
                    $text_start = !isset($month_nam['12']) ? date("M j",$eventdate) :

substr($month_nam[strftime('%m', $eventdate)],0,3) . date(" j",$eventdate);

                    echo '<tr'.$class_to_use.'><td colspan="7" class="smalltext" style="padding:

0px 0px 0px 0px;" width="100%" align="'.$align_list_entries.'">';
                    echo '<a href="', $scripturl, '?action=calendar;year=' . date("Y") . ';month='

. substr($startdate,5,2) . '"><strong>' . $text_start . '</strong></a>';
                    echo ' - ';
                    echo $holiday;
                    echo '</td></tr>';
                }

                }

            }
        }
    }
}
}

if ($show_post_event_button) {
        if (allowedTo('calendar_post')) {
            echo '<tr><td colspan="7" class="'.$class_default.'" align="center" valign="middle">';
            echo '<hr/ >';
            echo '<a href="', $scripturl,  '?action=calendar;sa=post;month=', $month, ';year=',

$year, ';sesc=', $context['session_id'], '">','<br />', create_button('calendarpe.gif',

'calendar23', 'calendar23', 'align="middle"'), '</a>';
            echo '</td></tr>';
    }
}



Sorry..I should have mention I am using SMF 2.0RC1   :(
Can anyone else help out> This is would great!  :)

TIA
"Meet A Stranger...Make A Friend!"

ke4obt

Sorry, forgot to let you know just paste the above code into a custom php block. That's it.

Flip
Thanks Much

Flip - KE4OBT
     The Blind Ham
Helping other blind hams
get on the air!


Yes I am really a BLIND user!

So, if a mod doesn't install properly, and I can't get help from your part of the forum,
I will come begging for YOUR help since you wrote it and know how it works
um, uh, well,
At least I would really, really hope you do!
HEE-HEE-HEE

Kindred

I'm working on a calendar mod right now...   After I am done that, I will look at an SSI mini-calendar block for 2.0
(I made one for 1.1.x in mambo/joomla)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Isaiahs Grandma

I have installed it and could see what I put in just fine,
but I am unclear on how to change the it in my template
so it creates my home and forum tabs to seperate it.
I want the portal to be my home page, and to set the forum index
as the second tab. If someone could help me I would appreciate it.
I am wanting to have a home and a foum tab similar to what i have on
my old site  http://ourhangout.smfforfree4.com/index.php
This is what I have in my template now.

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
   global $context, $settings, $options, $scripturl, $txt;

   // Work out where we currently are.
   $current_action = 'home';
   if (in_array($context['current_action'], array('admin', 'managegames', 'arcadesettings', 'arcadecategory', 'managegames', 'arcadesettings', 'arcadecategory', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
      $current_action = 'admin';
   if (in_array($context['current_action'], array('search', 'arcade', 'arcade', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
      $current_action = $context['current_action'];
   if ($context['current_action'] == 'search2')
      $current_action = 'search';
   if ($context['current_action'] == 'theme')
      $current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';

   // Are we using right-to-left orientation?
   if ($context['right_to_left'])
   {
      $first = 'last';
      $last = 'first';
   }
   else
   {
      $first = 'first';
      $last = 'last';
   }

   // Show the start of the tab section.
   echo '
         <table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
            <tr>
               <td class="maintab_' , $first , '"> </td>';

   // Show the [home] button.
   echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '">' , $txt[103] , '</a>
            </td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '"> </td>' : '';

   // Show the [help] button.
   echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'help' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=help">' , $txt[119] , '</a>
            </td>' , $current_action == 'help' ? '<td class="maintab_active_' . $last . '"> </td>' : '';

       echo ($current_action == 'arcade' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
         <td valign="top" class="maintab_' , $current_action == 'arcade' ? 'active_back' : 'back' , '">
            <a href="', $scripturl, '?action=arcade">' , $txt['arcade'] , '</a>
         </td>' , $current_action == 'arcade' ? '<td class="maintab_active_' . $last . '"> </td>' : '';// How about the [search] button?
   if ($context['allow_search'])
      echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'search' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=search">' , $txt[182] , '</a>
            </td>' , $current_action == 'search' ? '<td class="maintab_active_' . $last . '"> </td>' : '';

   // Is the user allowed to administrate at all? ([admin])
   if ($context['allow_admin'])
      echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'admin' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=admin">' , $txt[2] , '</a>
            </td>' , $current_action == 'admin' ? '<td class="maintab_active_' . $last . '"> </td>' : '';

   // Edit Profile... [profile]
   if ($context['allow_edit_profile'])
      echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'profile' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=profile">' , $txt[79] , '</a>
            </td>' , $current_action == 'profile' ? '<td class="maintab_active_' . $last . '"> </td>' : '';

   // Go to PM center... [pm]
   if ($context['user']['is_logged'] && $context['allow_pm'])
      echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
            </td>' , $current_action == 'pm' ? '<td class="maintab_active_' . $last . '"> </td>' : '';

   // The [calendar]!
   if ($context['allow_calendar'])
      echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'calendar' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
            </td>' , $current_action == 'calendar' ? '<td class="maintab_active_' . $last . '"> </td>' : '';

   // the [member] list button
   if ($context['allow_memberlist'])
      echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'mlist' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a>
            </td>' , $current_action == 'mlist' ? '<td class="maintab_active_' . $last . '"> </td>' : '';


   // If the user is a guest, show [login] button.
   if ($context['user']['is_guest'])
      echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'login' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=login">' , $txt[34] , '</a>
            </td>' , $current_action == 'login' ? '<td class="maintab_active_' . $last . '"> </td>' : '';


   // If the user is a guest, also show [register] button.
   if ($context['user']['is_guest'])
      echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'register' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=register">' , $txt[97] , '</a>
            </td>' , $current_action == 'register' ? '<td class="maintab_active_' . $last . '"> </td>' : '';


   // Otherwise, they might want to [logout]...
   if ($context['user']['is_logged'])
      echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'logout' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
            </td>' , $current_action == 'logout' ? '<td class="maintab_active_' . $last . '"> </td>' : '';

   // The end of tab section.
   echo '
            <td class="maintab_' , $last , '"> </td>
         </tr>
      </table>';

}

LT07

Hey great mod, love it ;D

But unfortunately I have a couple of problems :-X

On SMF 1.1.8 the forum crashes (badly) if I enable the home page feature, but only if I actually visit the home page i.e.. mydomain/index.php ... all other pages are unaffected as far as I could tell

My SMF 1.1.8 is installed in the root directory of the domain.

My SMF 2.0 RC1 is installed in a subdomain (forum.mydomain.com) and every time anybody uses the shoutbox ( which is waaaay cool ) gives an error "Unable to load the 'main' template." ... its driving everybody nuts :-*

A fix for the shoutbox would be awesome, I've tried changing themes but it doesn't seem to be theme related as it happens on the default one. any ideas where I should look ?

Cheers <insert missing thumbs up smiley here>

kingkingston

great mod but it need a block where you can put it at the bottom of the forum  there's only center left and right so a bottom choice would be great

ke4obt

Quote from: Kindred on February 11, 2009, 07:44:17 PM
yup... here's your problem:

<font color="'. $member['color']  .'">

I would bet that $member['color'] is never actually set, hence the error message

Hey Kindred,
OK, set all the member group colors and I still have the same error,
Was there another place I need to go and change setings?
If not, what am I missing?
Should I just deal with-it till a calendar block is ready  for EZ Portal?

Thanks Flip
Thanks Much

Flip - KE4OBT
     The Blind Ham
Helping other blind hams
get on the air!


Yes I am really a BLIND user!

So, if a mod doesn't install properly, and I can't get help from your part of the forum,
I will come begging for YOUR help since you wrote it and know how it works
um, uh, well,
At least I would really, really hope you do!
HEE-HEE-HEE

filipes

Hello
I have a problem, I made a Portal and I want to install four EzBlock in the Portal, the problem is when I do that it is in the homepage that they are install, why?
thank you

~Killer~

How would I center all chat in the shoutbox?
Also, how exactly could I, or maybe in your next release, in the ShoutBox, if you press [Enter], it posts that text, not does a linebreak, it's very annoying. Maybe an option?

I AM Legend

This is a reply to the same question asked by me on SMF Helper from ccbtimewiz,

ccbtimewiz: Alright, I went through and fixed EzPortal's theme_linktree() issue.

Open ./Sources/Load.php

Find:

   // Robots shouldn't be logging in or registering.  So, they aren't a bot.  Better to be wrong than sorry (or people won't be able to log in!), anyway.
   if ((isset($_REQUEST['action']) && in_array($_REQUEST['action'], array('login', 'login2', 'register'))) || !$context['user']['is_guest'])
      $context['browser']['possibly_robot'] = false;

   // Set the top level linktree up.
   array_unshift($context['linktree'], array(
      'url' => $scripturl,
      'name' => $context['forum_name_html_safe']
   ));


Replace with

   // Robots shouldn't be logging in or registering.  So, they aren't a bot.  Better to be wrong than sorry (or people won't be able to log in!), anyway.
   if ((isset($_REQUEST['action']) && in_array($_REQUEST['action'], array('login', 'login2', 'register'))) || !$context['user']['is_guest'])
      $context['browser']['possibly_robot'] = false;

   // -----------------------------------------------------------------------------------------------
   // + EzPortal v0.2.4 linktree() fix by ccbtimewiz [2/12/09] (http://jeunosky.net/)

   # Just in case... making this a global.
   global $ezpSettings;

   # Does $ezpSettings exist?! If not, set it to false and log NO errors.
   if (empty($ezpSettings))
    {
      $ezpSettings = array();
      $ezpSettings['ezp_portal_enable'] = 0;
    }

   # Are they perhaps running SMF 1.1.x and forum_name_html_safe doesn't exist? If so, let's fix 'em up.
   if (empty($context['forum_name_html_safe']))
      $forum_title = $context['forum_name'];
   else
      $forum_title = $context['forum_name_html_safe'];

   // This contains the "home" of the theme_linktree(). This is set first if no portal page is active.
   # @example: My Website
   if (empty($ezpSettings['ezp_portal_enable']))
      array_unshift($context['linktree'], array(
         'url' => $scripturl,
         'name' => $forum_title
      ));
   // And finally, if the portal IS set, show the forum name and then "forum".
   # @example: My Website => Forum
   else
      array_unshift($context['linktree'],
         array(
            'url' => $scripturl,
            'name' => $forum_title
         ),
         array(
            'url' => $scripturl . '?action=forum',
            'name' => 'Forum'
         )
      );
   unset($ezpSettings);
   unset($forum_title);
   // -----------------------------------------------------------------------------------------------


Issue Solved.


On a personal note from me, I was wondering, can this be incorporated into the mod for new people downloading it  ??? so they don't encounter the issue ever again.

Isaiahs Grandma

Can someone tell me how to add a tab for my portal to my
template?

Marsh

Quote from: vbgamer45 on February 11, 2009, 08:32:53 PM
Quote from: Mikeric on February 11, 2009, 01:20:55 PM
I just updated to RC1 and installed the newest version and now whenever anyone says anythign in the shoutbox they get this error.

QuoteAn Error Has Occurred!
Unable to load the 'main' template.
I see that issue will work on a fix

Any estimated time on the fix? i really need it. Thanks
625,195 Posts in 50,808 Topics by 34,295 Members.

Powered by SMF 2.0

www.touchofdeathproductions.com

Kindred

Hi Flip,

I think the problem is not that $member['color'] is not set, but that the $member array is not defined (hence the system tries to call something that does not exist.

I bumped into the same problem with my list events block when I tried to define the colors.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

ke4obt

Quote from: Kindred on February 13, 2009, 07:26:56 PM
Hi Flip,

I think the problem is not that $member['color'] is not set, but that the $member array is not defined (hence the system tries to call something that does not exist.

I bumped into the same problem with my list events block when I tried to define the colors.


ok. so, is there any way to "fake" the calendar out by commenting out that line? Or adding a call so that it thinks it's actually there? Or adding something to SMF so that string sees what it's looking for? If so, where and how would I go about doing that?
Otherwise, any clue as to when a calendar block will be available for EZPortal and SMF 1.1.x? (I know that you've been working on one)
Maybe I missed it, but what's the difference between EZP 0.2.5 and EZP 0.2.5.1?

Thanks again,
Thanks Much

Flip - KE4OBT
     The Blind Ham
Helping other blind hams
get on the air!


Yes I am really a BLIND user!

So, if a mod doesn't install properly, and I can't get help from your part of the forum,
I will come begging for YOUR help since you wrote it and know how it works
um, uh, well,
At least I would really, really hope you do!
HEE-HEE-HEE

Kindred

hey flip...   try adding

global $member;

near the top of the function.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: