1
koltz
Re: Feature for a great calendar module ?
  • 2005/2/18 11:42

  • koltz

  • Just popping in

  • Posts: 19

  • Since: 2003/7/22


Ok, all you should have to do is replace the following code:

<tr class='prevcurentnext'>
      <
td colspan='2'><img src="images/arrow_left.gif" />&nbsp;<a href='index.php?month=<{$prevmonth.id}>&year=<{$prevmonth.year}>'><{$prevmonth.name}> <{$prevmonth.year}></a></td>
      <
td colspan='3' class='<{$classcurrentmonth}>'> <{$thismonth.name}> <{$thismonth.year}></td>
      <
td colspan='2'><a href='index.php?month=<{$nextmonth.id}>&year=<{$nextmonth.year}>'><{$nextmonth.name}> <{$nextmonth.year}></a>&nbsp;<img src="images/arrow_right.gif" /></td>
    </
tr>


with

<tr class='prevcurentnext'>
      <
td colspan='2'><img src="images/arrow_left.gif" />&nbsp;<a href='index.php?month=<{$prevmonth.id}>&year=<{$prevmonth.year}>&cat=<{$catselected}>'><{$prevmonth.name}> <{$prevmonth.year}></a></td>
      <
td colspan='3' class='<{$classcurrentmonth}>'> <{$thismonth.name}> <{$thismonth.year}></td>
      <
td colspan='2'><a href='index.php?month=<{$nextmonth.id}>&year=<{$nextmonth.year}>&cat=<{$catselected}>'><{$nextmonth.name}> <{$nextmonth.year}></a>&nbsp;<img src="images/arrow_right.gif" /></td>
    </
tr>


in the extcal_index.html file (don't forget to update the install when messing with the HTML files :).

Still could use the help on the daily_view.php on the main page though :)

Corey



2
koltz
Re: Feature for a great calendar module ?
  • 2005/2/18 11:07

  • koltz

  • Just popping in

  • Posts: 19

  • Since: 2003/7/22


You french always so difficult :), anyway got it working. Actually found a bug in your v1 code :P. To change it to meet where the calendar starts on a Sunday, in you INDEX.php and EXTCAL_MINICAL.php file, change the lines to read below:
// Counter for the day number of this month
    
$day_count 0;
    
    
// Counter for the number's cell in cellendar
    
$cell_count 1;


In Index.php, you had them equal 0 & 0, in extcal_minical you had them equal to 1 & 1. Not really a bug, but can be confusing.

Now really I think the last thing I have to do is when switching between calendars, it will reset to all, but I am on the right track and should have that done shortly :).

I guess one more thing that I would like, I have the upcoming events listed on the main page, am I able to some how get the daily_view.php listed there instead. It gives more upfront info like the Category and I really only need today's events listed.

Thanks for your help. I will post the code with the calendar view change with categories when I am done.

Corey



3
koltz
Re: Feature for a great calendar module ?
  • 2005/2/17 21:42

  • koltz

  • Just popping in

  • Posts: 19

  • Since: 2003/7/22


Well i got the physical dates to read in order (Sunday - Saturday), but can't figure out the actual days to bump them by 1. Will continue to look, but if you have some clue, that would be greatly appreciated. Some of the comments are in french also.

Corey



4
koltz
Re: Feature for a great calendar module ?
  • 2005/2/17 16:33

  • koltz

  • Just popping in

  • Posts: 19

  • Since: 2003/7/22


Thanks, that did it. Now, am I going psycho or did Sunday move to the right at the end after Saturday? It displays as Monday Tuesday Wednesday Thursday Friday Saturday Sunday in that order? I will see if I can find it in the code, if you know what is wrong :)

Thanks for all your help, this is a great contrib and looking forward to v2 when it becomes avail. Maybe some of this will be put to use in v2?

Thanks, Corey



5
koltz
Re: Feature for a great calendar module ?
  • 2005/2/17 15:58

  • koltz

  • Just popping in

  • Posts: 19

  • Since: 2003/7/22


SELECT id, title, day, description, contact, url, email, start_date, end_date, cat_name, cat_desc, cat_color FROM xoops_extcal_events E INNER JOIN xoops_extcal_cat C ON E.cat = C.cat_id WHERE year = 2005 AND month = 2 AND day = 2 ORDER BY day ASC, start_date ASC

Thanks, Corey



6
koltz
Re: Feature for a great calendar module ?
  • 2005/2/17 14:33

  • koltz

  • Just popping in

  • Posts: 19

  • Since: 2003/7/22


Thanks for the post. I made the changes, when I go to view all, it will show all, but when I select only the seperate categories, it doesn't show anything :(. If you want to see the page, go tohttp://www.koltz.com/rrsd2, the links on the the "Calendar" and underneath are the individual calendars. I will also post my index.php, maybe I screwed something up while trying to do it myself?

<?php
// $Id: index.php,v 1.2 2004/08/27 21:05:07 zoullou Exp $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System                      //
// Copyright (c) 2000 XOOPS.org                           //
// <https://xoops.org/>                             //
// ------------------------------------------------------------------------ //
// This program is free software; you can redistribute it and/or modify     //
// it under the terms of the GNU General Public License as published by     //
// the Free Software Foundation; either version 2 of the License, or        //
// (at your option) any later version.                                      //
// //
// You may not change or alter any portion of this comment or credits       //
// of supporting developers from this source code or any supporting         //
// source code which is considered copyrighted (c) material of the          //
// original comment or credit authors.                                      //
// //
// This program is distributed in the hope that it will be useful,          //
// but WITHOUT ANY WARRANTY; without even the implied warranty of           //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
// GNU General Public License for more details.                             //
// //
// You should have received a copy of the GNU General Public License        //
// along with this program; if not, write to the Free Software              //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
// ------------------------------------------------------------------------ //

include("header.php");

if (
$xoopsModuleConfig['extcal_listview'] == '1') {

    
$xoopsOption['template_main'] = 'extcal_listview.html';
    include(
XOOPS_ROOT_PATH."/header.php");

    
$cat = isset($HTTP_GET_VARS['cat']) ? intval($HTTP_GET_VARS['cat']) : 0;
    
$xoopsTpl->assign('catselected'$cat);

    
$show = isset($HTTP_GET_VARS['show']) ? intval($HTTP_GET_VARS['show']) : 0;
    
    if (
$show == 0) {
        
$year $info['cal']['month']['current']['year'];
        
$lastyear "2003";
        
$nextyear "2005";
    } else {
        
$year $show;
        
$lastyear $show 1;
        
$nextyear $show 1;
    }

    
// Get all events for this year
    
$event = new Event();
    
$all_events     $event->getListViewEvents($year$cat);
    
$all_categories $event->getAllCategories();

    
$xoopsTpl->assign('events'$all_events);
    
$xoopsTpl->assign('categories'$all_categories);
    
    
$lang["title"]        = _MD_CALENDAR;
    
$lang["year"]         = $year;
    
$lang["lastyear"]     = $lastyear;
    
$lang["nextyear"]     = $nextyear;
    
$lang["date"]         = _MD_DATE;
    
$lang["event"]        = _MD_EVENT;
    
$lang["category"]     = _MD_CATEGORY;
    
$lang["more"]         = _MD_MORE;
    
$lang["catselect"]    = _MD_CATSELECT;
    
$lang["catselectall"] = _MD_CATSELECTALL;
                
    
$xoopsTpl->assign('lang'$lang);

} else {

    
$xoopsOption['template_main'] = 'extcal_index.html';
    include(
XOOPS_ROOT_PATH."/header.php");
    
    
$cat = isset($HTTP_GET_VARS['cat']) ? intval($HTTP_GET_VARS['cat']) : 0;
    
$xoopsTpl->assign('catselected'$cat);

    
$show = isset($HTTP_GET_VARS['show']) ? intval($HTTP_GET_VARS['show']) : 0;

    
$html "";
    
    
$event = new Event();
    
$all_events     $event->getListViewEvents($year$cat);
    
$all_categories $event->getAllCategories();

    
$xoopsTpl->assign('events'$all_events);
    
$xoopsTpl->assign('categories'$all_categories);
    
    
// Get all events for this month
    
$cat = isset($HTTP_GET_VARS['cat']) ? intval($HTTP_GET_VARS['cat']) : 0;
    
$xoopsTpl->assign('catselected'$cat);
    
$event = new Event();
    
$all_event $event->getAllEvent($info['cal']['month']['current']['month'], $info['cal']['month']['current']['year'], $cat);
    
    
// Number of day in this month
    
$nb_day $info['cal']['month']['current']['daynumber'];
    
    
// Id of the first day for this month
    
$start_day $info['cal']['month']['current']['firstday'];
    
    
// Get cell of the first row where began this month
    
if( $start_day == ) {
        
$start_cell 7;
    } else {
        
$start_cell $start_day;
    }
    
    
// Get number of row for this month
    
if( $nb_day == 31 ) {
        
        if( 
$start_day == || $start_day == ) {
            
$nb_row 6;
        } else {
            
$nb_row 5;
        }
    
    } elseif( 
$nb_day == 30 ) {
    
        if( 
$start_day == ) {
            
$nb_row 6;
        } else {
            
$nb_row 5;
        }
    
    } elseif( 
$nb_day == 29 ) {
    
        
$nb_row 5;
    
    } elseif( 
$nb_day == 28 ) {
    
        if( 
$start_day != ) {
            
$nb_row 5;
        } else {
            
$nb_row 4;
        }
    
    }
    
    
// Counter for the day number of this month
    
$day_count 1;
    
    
// Counter for the number's cell in cellendar
    
$cell_count 1;
    
    for( 
$i=$i<$nb_row $i++ ) {
    
        
$html .= "<tr height='50px'>n";
        
        
// Counter for number's cell in the row (Monday, tuesday...)
        
$k 0;
        do {
            
            
// Cellules faisant parties d'un mois
            
if( $cell_count >= $start_cell && $day_count <= $nb_day ) {
                
                
// If it's the current day
                
if($day_count == $info['now']['day'] && $info['cal']['month']['current']['month'] == $info['now']['month'] && $info['cal']['month']['current']['year'] == $info['now']['year']) {
                    
$class "currentday";
                } else {
                    
$class "day";
                }
                
$html .= "<td class='$class'>n";
                
                
$html .= "<table width='100%'><tr><td>$day_count</td><td>&nbsp;</td></tr></table>n";
                
                
// Si il y a des evenements pour le jour en cours
                
if( array_key_exists($day_count$all_event) ) {
                    
$html .= "<table style='font-size: 10px;'>";
                    foreach(
$all_event[$day_count] as $key=>$value) {
                        
$html .= "<tr><td><a href='daily_view.php?day=".$day_count."&month=".$info['cal']['month']['current']['month']."&year=".$info['cal']['month']['current']['year']."&id=".$value['id']."'>".$value['title']."</a></td></tr>";
                    }        
                    
$html .= "</table>n";
                }
                
                
$html .= "</td>n";
                
$day_count++;
            
// Cellules ne faisant pas partie d'un mois
            
} else {
                
$html .= "<td class='emptyday'>";
                
$html .= $info['cal']['month']['current']['monthname']." ".$info['cal']['month']['current']['year'];
                
$html .= "</td>n";
            }
            
$cell_count++;
            
$k++;
    
        } while( 
$k != );
    
        
$html .= "</tr>n";
    
    }

    
$lang["title"]        = _MD_CALENDAR;
    
$lang["year"]         = $year;
    
$lang["lastyear"]     = $lastyear;
    
$lang["nextyear"]     = $nextyear;
    
$lang["date"]         = _MD_DATE;
    
$lang["event"]        = _MD_EVENT;
    
$lang["category"]     = _MD_CATEGORY;
    
$lang["more"]         = _MD_MORE;
    
$lang["catselect"]    = _MD_CATSELECT;
    
$lang["catselectall"] = _MD_CATSELECTALL;
                
    
    if( 
$info['cal']['month']['current']['month'] == $info['now']['month'] && $info['cal']['month']['current']['year'] == $info['now']['year'] ) {
        
$xoopsTpl->assign('classcurrentmonth''currentmonth');
    } else {
        
$xoopsTpl->assign('classcurrentmonth''thismonth');
    }
    
    
$curentdate $info['now']['dayname']." ".$info['now']['day']." ".$info['now']['monthname']." ".$info['now']['year'];
    
$xoopsTpl->assign('curentdate'$curentdate);
    
    
$prevmonth = array('id'=>$info['cal']['month']['preview']['month'], 'year'=>$info['cal']['month']['preview']['year'], 'name'=>$info['cal']['month']['preview']['monthname']);
    
$xoopsTpl->assign('prevmonth'$prevmonth);
    
    
$thismonth = array('year'=>$info['cal']['month']['current']['year'], 'name'=>$info['cal']['month']['current']['monthname']);
    
$xoopsTpl->assign('thismonth'$thismonth);
    
    
$nextmonth = array('id'=>$info['cal']['month']['next']['month'], 'year'=>$info['cal']['month']['next']['year'], 'name'=>$info['cal']['month']['next']['monthname']);
    
$xoopsTpl->assign('nextmonth'$nextmonth);
    
    
$xoopsTpl->assign('lang'$lang);
    
$xoopsTpl->assign('calendar'$html);

}

include(
XOOPS_ROOT_PATH."/footer.php");
?>



7
koltz
Re: Feature for a great calendar module ?
  • 2005/2/16 14:59

  • koltz

  • Just popping in

  • Posts: 19

  • Since: 2003/7/22


I have a question on V1 if you could help :) I am trying to mix the listview with the calendar view by allowing items in category's to be displayed only. Like the pulldown menu in listview. I have found the code where it lists it, but can't figure out the code I need to change it to as the listview code is in HTML w/PHP and this is PHP w/HTML. Here is the code:

if( array_key_exists($day_count$all_event) ) {
                    
$html .= "<table style='font-size: 10px;'>";
                                foreach(
$all_event[$day_count] as $key=>$value) {
                        
$html .= "<tr><td><a href='daily_view.php?day=".$day_count."&month=".$info['cal']['month']['current']['month']."&year=".$info['cal']['month']['current']['year']."&id=".$value['id']."'>".$value['title']."</a></td></tr>";
                    }        
                    
$html .= "</table>n";
                }{


I have copied the INDEX.PHP code in the UPPER part where it forwards to the listview down to the calendar code area to get the categories to display, just can't figure out how to only show certain categories.

Thanks, Corey



8
koltz
Re: Feature for a great calendar module ?
  • 2005/2/11 17:40

  • koltz

  • Just popping in

  • Posts: 19

  • Since: 2003/7/22


What I meant was if you have an "Add An Event" link on the calendar any place, have a feature in the Admin area to disable it for Anonymous or even registered users so it doesn't display. Most of the calendars that I have seen leave this on it without that option.

Also, Just noticed, if I go directly to the v1 of the extCal (http://www.koltz.com/rrsd2/modules/extcal/), most dates I don't have an end time on them. But it comes up here as 1969/12/31 when no end date/time is selected.

Another nice feature would be to not have to choose a time on the calendar at all. As an example, I am currently testing v1 using it for events, sporting events, breakfast/lunch menus. Lunch menus don't have times along with some events, but it would come up as 00:00 when I select it just for no purpose (or whatever time I select).

Corey



9
koltz
Re: Feature for a great calendar module ?
  • 2005/2/11 14:37

  • koltz

  • Just popping in

  • Posts: 19

  • Since: 2003/7/22


On the event submission by user, it would be nice to have a checkbox to turn off that feature. I think it would be a great feature, but personally, I don't want it on my site. I would have a bunch of kids submitting junk submissions.

Corey



10
koltz
Re: Feature for a great calendar module ?
  • 2005/2/10 23:22

  • koltz

  • Just popping in

  • Posts: 19

  • Since: 2003/7/22


Whatever you like :) Anyway, I got version 1 installed fine, I am wondering if the people who have successfully installed v2 upgraded from ver 1 or fresh install. Since I installed ver 2 first, that might make sense, but who knows.

Corey




TopTop
(1) 2 »



Login

Who's Online

208 user(s) are online (150 user(s) are browsing Support Forums)


Members: 0


Guests: 208


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits