Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 02:22 pm EDT

Geeklog Forums

Multiple Group Calendar Hack


Status: offline

ronack

Forum User
Full Member
Registered: 05/27/03
Posts: 612
Has anyone tried to get the Multiple Group Calendar Hack to work with GL 1.3.11 or GL 1.4? This was very useful for me in the past and I need it again now. If I remember there were changes made to the latest vers of GL that made the hack not valid. I could be wrong tho.

 Quote

Turner

Anonymous
It doesn't work with 1.4. I tried it. I too need this. I think the geeklog calendar is probably better than any php calendar I have seen. I think it blows away webcalendar and many others. It just needs a little attention.

I think a bunch of us should gang up and give this thing what it needs. I have some skill (a little). So i can help. I canalso contribute some money to a real programmer who might want to help. Maybe if we can get about $300 would somebody go for it? I'll chip in $75. (auctioning voice) can I get $80, $80 dollars $80, $80 comin around to $80, can i get an $80... Laughing
 Quote

Status: offline

ronack

Forum User
Full Member
Registered: 05/27/03
Posts: 612
I know something has been in the works but I don't know what the status is. Basically making the Calendar a plugin. However I could use something now. Especially since I will hopefully have large groups who will want their own calendar.

As far as putting up some dough, right now I'm strapped for cash paying for two homes with one job. But as soon as the wife brings in a paycheck and I sell one house then I can.
 Quote

Status: offline

casper

Forum User
Full Member
Registered: 02/11/04
Posts: 142
Location:Skien, Norway
Has anyone done something with this?
Im also willing to pay for fixing this hack.
 Quote

Astrup

Anonymous
Pls post any progress with this Can someone help me
 Quote

Status: offline

ronack

Forum User
Full Member
Registered: 05/27/03
Posts: 612
Well I got tired of waiting and have modified made all the changes except one which I need a little help with. This is for 1.3.11.
I haven't looked at 1.4.0 yet. Here is the diff file. It's a little messy right now but I have the line numbers that I have changed. The part I'm not sure about is between the hash marks /////. I put the new line numbers under the old one.
Text Formatted Code
2d1
<
34c33
< // $Id: calendar.php,v 1.28 2003/03/29 19:12:28 dhaun Exp $
---
> // $Id: calendar.php,v 1.28 2003/03/29 19:12:28 dhaun Exp $ ** modified by klync
152c151
      236
<     global $_CONF, $LANG30;
---
>     global $_CONF, $LANG30, $group;
      164c163

250 Don't change the whole line only add the change
<         . '<tr><td align=center colspan=7><a href="' . $_CONF['site_url'] . '/calendar.php?month=' . $m . '&year=' . $y . $mode . '">'
---
>         . '<tr><td align=center colspan=7><a href="' . $_CONF['site_url'] . '/calendar.php?month=' . $m . '&year=' . $y . $mode . '&group=' . $group . '">'
         289a289,303
After 358
 /////////////////////////////////////////////////////////////////////
 // This is where the custom menu for group_events will go!!!!
 
 // The rest of the code needs to be modified to allow another get variable
 // $group = numeric gid of selected group calendar
 // (has to  be 0 or in $_TABLE['vars'] where name = event_groups)
 
 if (!isset($group)) {
     $group = '0';
 }
 
 $display .= GroupCalendarsLinks($group);
 
 /////////////////////////////////////////////////////////////////////
 
      380c394
475
<         $cal_templates->set_var('calendar_toggle', '[<a href="' . $_CONF['site_url'] . "/calendar.php?mode=&view=day&month=$month&day=$day&year=$year">" . $LANG30[11] . '</a>]');
---
>         $cal_templates->set_var('calendar_toggle', '[<a href="' . $_CONF['site_url'] . "/calendar.php?mode=&view=day&month=$month&day=$day&year=$year&group=$group">" . $LANG30[11] . '</a>]');
      384c398
479
<           $cal_templates->set_var('calendar_toggle', '[<a href="' . $_CONF['site_url'] . "/calendar.php?mode=personal&view=day&month=$month&day=$day&year=$year">" . $LANG30[12] . '</a>]');
---
>           $cal_templates->set_var('calendar_toggle', '[<a href="' . $_CONF['site_url'] . "/calendar.php?mode=personal&view=day&month=$month&day=$day&year=$year&group=$group">" . $LANG30[12] . '</a>]');
           394c408,413
489
<         $calsql = "SELECT * FROM {$_TABLES["events"]} WHERE ((allday=1 AND datestart = "$year-$month-$day") OR (datestart >= "$year-$month-$day 00:00:00" AND datestart <= "$year-$month-$day 23:59:59") OR (dateend >= "$year-$month-$day 00:00:00" AND dateend <= "$year-$month-$day 23:59:59") OR ("$year-$month-$day" between datestart and dateend)) ORDER BY datestart,timestart";
---
         if ($group == 0) {
             $calsql = "SELECT * FROM {$_TABLES["events"]} WHERE ((allday=1 AND datestart = "$year-$month-$day") OR (datestart >= "$year-$month-$day 00:00:00" AND datestart <= "$year-$month-$day 23:59:59") OR (dateend >= "$year-$month-$day 00:00:00" AND dateend <= "$year-$month-$day 23:59:59") OR ("$year-$month-$day" between datestart and dateend)) ORDER BY datestart,timestart";
         } else {
             $calsql = "SELECT * FROM {$_TABLES["events"]} WHERE ((group_id = $group) AND ((allday=1 AND datestart = "$year-$month-$day") OR (datestart >= "$year-$month-$day 00:00:00" AND datestart <= "$year-$month-$day 23:59:59") OR (dateend >= "$year-$month-$day 00:00:00" AND dateend <= "$year-$month-$day 23:59:59") OR ("$year-$month-$day" between datestart and dateend))) ORDER BY datestart,timestart";
         }
>        
        481c500
570
<         $cal_templates->set_var('calendar_toggle', '[<a href="' . $_CONF['site_url'] . "/calendar.php?mode=&view=week&month=$month&day=$day&year=$year">" . $LANG30[11] . '</a>]');
---
>         $cal_templates->set_var('calendar_toggle', '[<a href="' . $_CONF['site_url'] . "/calendar.php?mode=&view=week&month=$month&day=$day&year=$year&group=$group">" . $LANG30[11] . '</a>]');
    485c504
 574  
<             $cal_templates->set_var('calendar_toggle', '[<a href="' . $_CONF['site_url'] . "/calendar.php?mode=personal&view=week&month=$month&day=$day&year=$year">" . $LANG30[12] . '</a>]');
---
>             $cal_templates->set_var('calendar_toggle', '[<a href="' . $_CONF['site_url'] . "/calendar.php?mode=personal&view=week&month=$month&day=$day&year=$year&group=$group">" . $LANG30[12] . '</a>]');
    536c555
646    
<         $cal_templates->set_var('day'.$i,$dayname . ", <a href="{$_CONF['site_url']}/calendar.php?mode=$mode&view=day&day=$daynum&month=$monthnum&year=$yearnum">" . strftime ("%x", $thedate[1]) . '</a>');
---
>         $cal_templates->set_var('day'.$i,$dayname . ", <a href="{$_CONF['site_url']}/calendar.php?mode=$mode&group=$group&view=day&day=$daynum&month=$monthnum&year=$yearnum">" . strftime ("%x", $thedate[1]) . '</a>');
   541c560,564
658
<             $calsql = "SELECT * FROM {$_TABLES["events"]} WHERE ((allday=1 AND datestart = "$yearnum-$monthnum-$daynum") OR (datestart >= "$yearnum-$monthnum-$daynum 00:00:00" AND datestart <= "$yearnum-$monthnum-$daynum 23:59:59") OR (dateend >= "$yearnum-$monthnum-$daynum 00:00:00" AND dateend <= "$yearnum-$monthnum-$daynum 23:59:59") OR ("$yearnum-$monthnum-$daynum" between datestart and dateend)) ORDER BY datestart,timestart";
---
>             if ($group == 0) {
>                 $calsql = "SELECT * FROM {$_TABLES["events"]} WHERE ((allday=1 AND datestart = "$yearnum-$monthnum-$daynum") OR (datestart >= "$yearnum-$monthnum-$daynum 00:00:00" AND datestart <= "$yearnum-$monthnum-$daynum 23:59:59") OR (dateend >= "$yearnum-$monthnum-$daynum 00:00:00" AND dateend <= "$yearnum-$monthnum-$daynum 23:59:59") OR ("$yearnum-$monthnum-$daynum" between datestart and dateend)) ORDER BY datestart,timestart";
>             } else {
>                 $calsql = "SELECT * FROM {$_TABLES["events"]} WHERE ((group_id = $group) AND ((allday=1 AND datestart = "$yearnum-$monthnum-$daynum") OR (datestart >= "$yearnum-$monthnum-$daynum 00:00:00" AND datestart <= "$yearnum-$monthnum-$daynum 23:59:59") OR (dateend >= "$yearnum-$monthnum-$daynum 00:00:00" AND dateend <= "$yearnum-$monthnum-$daynum 23:59:59") OR ("$yearnum-$monthnum-$daynum" between datestart and dateend))) ORDER BY datestart,timestart";
>             }
686c709
<
---
> /// fix me with &group=$group
   688c711
844
<                 . '&year=' . $year . '" class="cal_date">' . $curday->daynumber. '</a><hr>');
---
>                 . '&year=' . $year . '&group=' . $group . '" class="cal_date">' . $curday->daynumber. '</a><hr>');
   699c722,733
851

<                 $calsql = "SELECT * FROM {$_TABLES["events"]} WHERE (datestart >= "$year-$month-$curday->daynumber 00:00:00" AND datestart <= "$year-$month-$curday->daynumber 23:59:59") OR (dateend >= "$year-$month-$curday->daynumber 00:00:00" AND dateend <= "$year-$month-$curday->daynumber 23:59:59") OR ("$year-$month-$curday->daynumber" between datestart and dateend) ORDER BY datestart,timestart";
---
>                 if ($group == 0) {
>                     $calsql = "SELECT * FROM {$_TABLES["events"]} WHERE (datestart >= "$year-$month-$curday->daynumber 00:00:00" AND datestart <= "$year-$month-$curday->daynumber 23:59:59") OR (dateend >= "$year-$month-$curday->daynumber 00:00:00" AND dateend <= "$year-$month-$curday->daynumber 23:59:59") OR ("$year-$month-$curday->daynumber" between datestart and dateend) ORDER BY datestart,timestart";
>                 } else {
>                     $calsql = "SELECT * FROM {$_TABLES["events"]} WHERE ((group_id = $group) AND ((datestart >= "$year-$month-$curday->daynumber 00:00:00" AND datestart <= "$year-$month-$curday->daynumber 23:59:59") OR (dateend >= "$year-$month-$curday->daynumber 00:00:00" AND dateend <= "$year-$month-$curday->daynumber 23:59:59") OR ("$year-$month-$curday->daynumber" between datestart and dateend))) ORDER BY datestart,timestart";
>                    
>                     /* Returns this crap:
>                    
>                     SELECT * FROM gl_events WHERE ((group_id = 19) AND (datestart >= "2003-05-31 00:00:00" AND datestart <= "2003-05-31 23:59:59") OR (dateend >= "2003-05-31 00:00:00" AND dateend <= "2003-05-31 23:59:59") OR ("2003-05-31" between datestart and dateend)) ORDER BY datestart,timestart
>
>                    
>                     */
>                 }
    712c746

870
<                             $entries .= '<a href="calendar_event.php?mode=' . $mode . '&eid=' . $results['eid'] . '" class="cal_event">'
---
>                             $entries .= '<a href="calendar_event.php?mode=' . $mode . '&eid=' . $results['eid'] . '&group=' . $group . '" class="cal_event">'

 


this part
if (!isset($group)) {
$group = '0';
}

$display .= GroupCalendarsLinks($group);

Also I think there were some template changes. Does anyone still have a old geeklog with this working?

Hope this isn't too confusing

Ron
 Quote

Status: offline

ronack

Forum User
Full Member
Registered: 05/27/03
Posts: 612
Oh here's the link to the hack

Multiple Calendar Hack
 Quote

Status: offline

casper

Forum User
Full Member
Registered: 02/11/04
Posts: 142
Location:Skien, Norway
I do have an testserver where I can put up and old install to test, if that is any help for you?
Tried to put together this hack for 1.4 but had to give up when I met errors that were above my skills.. hehe
But if it works for 1.3.11, it should also work for 1.4 I think, havent been any big changes in the calendar between those releases, or am I wrong?
 Quote

Status: offline

ronack

Forum User
Full Member
Registered: 05/27/03
Posts: 612
I didn't see anything since 1.3.8 And I think there were some big changes in 1.3.11.

This doesn't quite look like what I installed way back then.

Hey I did find another good calendar called phpicalendar. Maybe this can be made into a plugin?


PHPiCalendar

Of course I don't know where the calendar is going in GL 2
 Quote

Status: offline

casper

Forum User
Full Member
Registered: 02/11/04
Posts: 142
Location:Skien, Norway
I had a look at the phpicalendar. Looks good that one too. Also seen a calender who can be integrated in GL, for about $35 if I dont remember wrong.

But for now I only need the group hack, that would be sufficient for now.

Either way, some development of the calendar i GL, both for the next releases and for GL2 are nececary and I would like to fund some of that progress to give it a start.
 Quote

Status: offline

ronack

Forum User
Full Member
Registered: 05/27/03
Posts: 612
I got close on the hack, It didn't work quite the way I wanted it to. I will have to take another look at it when I have some time.
 Quote

Status: offline

casper

Forum User
Full Member
Registered: 02/11/04
Posts: 142
Location:Skien, Norway
Please let me know if you have any progress, it got to complicated for me..
 Quote

jeanne

Anonymous
Is there any progress for this?
Me, and I think several others would apreciate a final usable code for this Smile
 Quote

Status: offline

ronack

Forum User
Full Member
Registered: 05/27/03
Posts: 612
Not by me, I've been too busy.
 Quote

All times are EDT. The time is now 02:22 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content