UBB.Dev
Posted By: Max Fisch Calendar v 3.0 - 07/13/2002 6:47 PM
Hi all, here's the beta Calendar upgrade, the old version was on this thread

Please note that this is a beta... the calendar is working fine for me, but I had to play around with the installation instructions a lot, and there is a chance for error.

Hold on to your old files, backup your database, etc etc... you may want to hold off from installing this in a production installation until some other users give us some feedback.

Max

[PS - oops, I forgot to clarify, at the end of the installation instructions, that you should also upload your new showthreaded.php ]

Attached File
52455-instructions.txt  (111 downloads)
Posted By: Ian_W Re: Calendar v 3.0 - 07/13/2002 7:04 PM
Thanks Max - is there a demo anywhere of this running?

Ian
Posted By: RTM_dup1 Re: Calendar v 3.0 - 07/13/2002 8:58 PM
posted by Max Fisch:
Hi all, here's the beta Calendar upgrade


This is great, Max. Thank you for sharing your work. Is this Beta Calendar hack in use at your site, in the Events forum at The Hang?

Thanks,

Rob
Posted By: Max Fisch Re: Calendar v 3.0 - 07/13/2002 10:51 PM
Yes it is.
Posted By: msula Re: Calendar v 3.0 - 07/14/2002 3:50 AM
I want to see it in action, where is it?
Posted By: AllenAyres Re: Calendar v 3.0 - 07/14/2002 7:23 AM
muchas gracias. will be installing here soon
Posted By: msula Re: Calendar v 3.0 - 07/14/2002 4:34 PM
Looks great! Thank you.
Posted By: AllenAyres Re: Calendar v 3.0 - 07/15/2002 1:49 AM
you got a demo link?
Posted By: omegatron Re: Calendar v 3.0 - 07/16/2002 12:05 AM
To really clean up this whole installation of the calendar one could attach the new files created to save time and then we simply would have to do a few basic steps to install this thing. Templates could also be made. I have updated the instructions a bit for those who want a simpler install and attach the neccesary files that are created which take alot of the work. Great work Max looks great.


Attached File
52556-calandar.zip  (18 downloads)
Posted By: Max Fisch Re: Calendar v 3.0 - 07/16/2002 12:46 AM
Agreed Omega, but Infopop has objections to posting complete modified scripts. That's what I did when I released V2, and Allen was kind enough to change it to a "differential" version.

Max
Posted By: omegatron Re: Calendar v 3.0 - 07/16/2002 1:21 AM
Ah so things are different that UBB for UBBThreads???

When one downloads a hack at UBBDEV.com the file contains the new files which are not normally a infopop file. I did not include modified UBBThreads files. I just included in the above post a modified install file and addevent.php and newevent.php. These are not infopop files. I figured from the rules I have read this is allowed. It is done in the UBB forum all the time. Oh well if I am mistaken my bad. Download any hack over at UBBDEV and the non infopop files are included in the distribution. I just thought this would save people time hacking as I installed your hack and it works good. It took along time creating addevent.php and newevent.php hense my post above.

Allen: If I am mistaken on the rules simply remove my attachment. The three files included in the attachment are an updated install and the two files created which are addevent.php and newevent.php
Posted By: Aglavalin Re: Calendar v 3.0 - 07/16/2002 2:31 AM
This calendar works great for me, thanks Max
Posted By: Max Fisch Re: Calendar v 3.0 - 07/16/2002 6:05 AM
You're welcome, enjoy
Max
Posted By: AllenAyres Re: Calendar v 3.0 - 07/16/2002 8:09 AM
I haven't yet looked at the files, but if they don't contain Infopop code, then they should be fine.

We can share templates and language files, but no php files (with IP's code).

Thanks for asking
Posted By: omegatron Re: Calendar v 3.0 - 07/16/2002 11:37 AM
Well based on your thinking then remove the attachment. Because any modified file even hacked and discombobulated contains still IP work. Weird the rules must have changed in the last 6 months or rather stricter in enforcement . Oh well my bad.
Posted By: Pappy Re: Calendar v 3.0 - 07/16/2002 9:50 PM
Hi Max
I installed the Calendar update for 6.02 and it went in like a dream. Very Easy. Thanks a Million, My users apreciate it.
Posted By: Max Fisch Re: Calendar v 3.0 - 07/17/2002 1:02 AM
You're welcome, good to hear - sorry it took me so long.
Max
Posted By: msula Re: Calendar v 3.0 - 07/17/2002 1:46 AM
Hey Max, just a question or two. My users have been dying without a calendar, so I really want to get it running. But knowing it is still in the working stages, how easy is it going to be to upgrade to newer versions/fixes you come out with?

I just wonder because it is a very in-depth hack, and just wondering what it will take to make any changes, or if your updated instructions for the new releases will specifically address upgrade issues?
Posted By: Max Fisch Re: Calendar v 3.0 - 07/17/2002 2:32 PM
Hello msula,

It shouldn't be too hard to upgrade once you install it: I don't anticipate any database changes, and if you look at it, the only file that's changing from the standard code is postlist.php (the rest of the files are new). So re-installing an upgraded version shouldn't be particularly hard.

Regards,
Max


Posted By: msula Re: Calendar v 3.0 - 07/17/2002 5:44 PM
Thanks, sounds great then!
Posted By: WrÅith Re: Calendar v 3.0 - 07/17/2002 5:48 PM
Max:

Can you provide a link to a demo so we can see how this works?
Posted By: msula almost working - 07/17/2002 10:21 PM
Hey max, or anyone? I installed the hack, everything works great, except my posts for new events don't show up in the calendar itself, only below it as a post What could be the problem?

Check it out
http://www.michiganjeepers.com/forums/postlist.php?Cat=&Board=calendar

Also, I know the arrow images don't work, that's fine for now
Posted By: Lisa_P Re: almost working - 07/18/2002 12:44 AM
I had the same problem -- not showing up in the calendar, but in the list. Before I had a chance to really pour over it and see what I missed, omegatron posted the attachment above, I used that to check what I'd missed, and there was a whole section I missed in addevent I believe. I really wish I could tell you what it was, but I don't think I have a copy of what I had before I fixed it. I'll look though, I have Beyond Compare set to automatically backup things I change. Heaven knows I don't ever remember.

I have a working version here:
http://www.fishingfordeals.com/forums2/postlist.php?Cat=&Board=calendar

if anyone wants to try it. It's just an empty testboard, and you should be able to post anonymously.
Posted By: Gardener Re: almost working - 07/18/2002 12:48 AM
I get access denied with that link, and the calendar doesn't show up in the main index.
Posted By: Lisa_P Re: almost working - 07/18/2002 12:57 AM
I'm sorry, please try again. It should work now.
Posted By: msula Re: almost working - 07/18/2002 1:05 AM
I used omega's attachment and uploaded the two add*.php files and it works fine now I followed those instructions perfectly I thought and went very slow. Hmm... but anyway, its working
Posted By: Lisa_P Re: almost working - 07/18/2002 1:09 AM
I thought I followed them pretty closely too. There is either an error in the original instructions, or something that's confusing and caused me to put it in the wrong spot.
Posted By: msula Re: almost working - 07/18/2002 1:19 AM
I'm just wondering if any existing hacks had originally edited the files that were used to create those two new ones.. don't see anything missing yet, but I can't remember half the hacks I installed
Posted By: Max Fisch Re: almost working - 07/18/2002 2:15 AM
If you figure it out, please let me know so I can edit the instructions.

Regards,
Max
Posted By: AllenAyres Re: almost working - 07/18/2002 5:11 AM
looks very good on your site, and I must say, your whole site really has improved over the last few months nice work.
Posted By: Pappy Re: almost working - 07/18/2002 5:21 AM
Hi Max,
one problem I had is when I delete an event it does not delete from the main database? is there an updated editpost? or did I miss something?
Posted By: msula Re: almost working - 07/18/2002 5:39 AM
posted by AllenAyres:
looks very good on your site, and I must say, your whole site really has improved over the last few months nice work.


Who's site were you commenting on? I was hoping mine, but I doubt it.. lol

Just wondering
Posted By: AllenAyres Re: almost working - 07/18/2002 6:09 AM
Yours, someone I know is outgrowing ubb, I pointed them to your site as an example of a good threads site
Posted By: msula Re: almost working - 07/18/2002 6:18 AM
Oh yay! I just got tingles, I'm so happy. haha j/k

But for real, thanks. It is growing fast, but threads is keeping up just fine. A few issues to work out with my header and everything will almost be set. Oh, and IIP 5.0 will be nice too
Posted By: Ian_W Re: Calendar v 3.0 - 07/19/2002 12:44 AM
Just one thought - how complicated would it be to display today's date in a different colour so that it stood out?

Ian
Posted By: msula Re: Calendar v 3.0 - 07/19/2002 2:02 AM
Max, or Dave, any thought on making this work for a pal box Basically, just a box that contained a mini-calendar with numbers, but the days that had something planned those boxes are a different color and when clicked on take you to the associated event?
Posted By: Max Fisch Re: almost working - 07/19/2002 2:14 AM
Pappy,
see the notes in the instructions starting on line 14.
When you delete a post, it does get deleted from the main w3t_Posts table as usual, but not from the new "Events" table. The idea is that unless you're deleting hundreds of events, I judged that the tradeoff between modifying an additional script and just leaving a few "dead" entries in the Events database wasn't worth it.

Having said that, see the "Additional note" in the instructions starting on line 30 - if you really want to delete entries in the Events database, you could adapt/update from this old thread

Regards,
Max
Posted By: Max Fisch pretty easy - 07/19/2002 2:20 AM
That's pretty easy... in postlist.php, find

if (($d == $thisDay) && ($mon == $thisMon)) {
echo " class="darktable"><table width="100%" cellpadding="0" cellspacing="0"><tr><td>$d.</td>";

This prints the starting point for today's cell. It shows up in "darktable" colors, and other days show up in "lighttable" colors. You can either modify these in the stylesheet you use, or you can modify the above lines to your liking. The $d prints today's day of the month, so you could replace it with <font=red>$d.</font> or something like that.

Regards,
Max
Posted By: Max Fisch Re: Calendar v 3.0 - 07/19/2002 2:23 AM
That would be pretty cool
Maybe Dave would consider building it... He could steal the formatting from the box on http://ubbdesign.com/

Max

Posted By: omegatron Re: Calendar v 3.0 - 07/19/2002 2:31 AM
One suggestion though. It would be nice to post an event one time with a beginning and end date one time instead of having to post it all say 3 days. An example lets say would be a 3 day convention. If one wants to post this it would have to be posted 3 times on every day instead of one post which would then fill the corresponding days correctly on the calendar.
Posted By: msula Re: Calendar v 3.0 - 07/19/2002 2:35 AM
agreed.. since some events we have are weekend long events. Maybe have the starting day a full descript in the box, and in concurrent boxes it just says part of the event title and says "cont..." or something just to show it continues on.
Posted By: Stefan_dup1 Re: Calendar v 3.0 - 07/19/2002 4:22 AM
Max,

i'm just playing with this really nice hack ... any chance to get the displayed time in postlist.php changed to 24h - format?

Should be anwhere at

$h = strtolower(strftime ("%I", $tm));

(I've removed the am/pm correction successfully before)
Posted By: paulf Re: Calendar v 3.0 - 07/19/2002 6:31 PM
Dave had written a PAL box for this in his first release of IIP for ubbt 5.5. It displays any upcoming events for the next week. I still use this pal box on my 6.0.2 board.

Since the table structure for the events table has not changed, the old pal code works just fine.

It dosent display a "mini calendar" but it does list all current upcoming events.
Posted By: paulf Re: almost working - 07/19/2002 7:04 PM
Hiya Max.

Just FYI.
That code that JustDave wrote to delete the data from w3t_Events works fine with v6.

Also. I noticed in the w3t_Events table there are fields for recurring events, and Duration. Any plans to make use of these features in the future?

Thanks!
Posted By: Max Fisch Re: Calendar v 3.0 - 07/20/2002 12:51 AM
Sorry Stefan, over my head, maybe someone else can help.
Max
Posted By: AllenAyres Calendar v 3.0 - xhtml instructions - 07/24/2002 8:24 AM
Nice one Testing here right now.. I redid the instructions to fix the xhtml in the code:

https://www.ubbdev.com/mods/6/52455-instructions.txt

It runs fine, if I find some more xhtml bugs, I'll update the file and post here
Posted By: AllenAyres Re: Calendar v 3.0 - xhtml instructions - 07/24/2002 9:00 AM
File updated with lots of little fixes The only thing not 100% xhtml is bordercolor and I am too sleepy to fix it right now I think I transferred all the changes from our files here to the instructions, if you see something different, please let me know and I'll update it
Posted By: paulf Re: Calendar v 3.0 - xhtml instructions - 07/25/2002 1:48 AM
posted by AllenAyres:
File updated with lots of little fixes


Allan, all of your changes had to do with the xhtml compliency correct?
Posted By: AllenAyres Re: Calendar v 3.0 - xhtml instructions - 07/25/2002 5:02 AM
Yes, I didn't change anything else
Posted By: casper_dup1 Re: Calendar v 3.0 - xhtml instructions - 07/25/2002 2:15 PM
Suggestion:

In UBB.classic's calendar it automatically adds an event for a registered users birthday.

It would be great if we could get this calendar to do the same.
You could add an optional field inside the w3t_users table.
Posted By: AllenAyres Re: Calendar v 3.0 - xhtml instructions - 07/25/2002 9:45 PM
That might be good to co-ordinate with anything Rick might be working on regarding coppa, and the ubb.classic import script, as birthdays are already required there.
Posted By: AllenAyres Re: Calendar v 3.0 - xhtml instructions - 07/26/2002 7:42 AM
OK, it should be a bit easier to install now. I believe it is 100% xhtml compliant as well.

https://www.ubbdev.com/mods/6/calendar.zip

I included the template files pre-done and updated the instructions so that you are requiring the templates into the posting pages instead of adding the contents to the .php files. We are using these same files here.

Next up will be pulling the text out to make a language file... I'll work on it this weekend or so unless someone else wants to jump in there

Max feel free to do with this how you want, thank you for your work in getting it to v6 status
Posted By: Billster2K Re: Calendar v 3.0 - 07/29/2002 11:10 PM
MAX,

This is AWESOME

I have one problem...?
I attempted your step nine(after I made sure everything else was working ok) and I CANNOT get the date and location to show up in the Subject line?

Nothing is breaking, it's just not showing up?

Any ideas, I have double checked the edits.

Cheers, Bill
Posted By: Ian_W Re: Calendar v 3.0 - 07/30/2002 10:41 AM
Thanks Max,

Was a piece of cake to install some 15 calendars on my forums, for the various clubs that I have. Now they can all have their own calendar, and not all have to share one.

Thanks again.

Ian
Posted By: Billster2K Re: Calendar v 3.0 - 07/30/2002 5:23 PM
I would change the UPDATE to be using the "Keyword" instead of the "Title".

I ran into problems with this because of multiple forums in different categories which have the same title!

I know this is just in your instructions and I simply used the Keyword to avoid any problems...but just an FYI nonetheless.

REALLY enjoying your work

Cheers, Bill
Posted By: MattyJ Re: Calendar v 3.0 - 08/02/2002 3:24 PM
Just got this IIP integration working with IIP4.3 and .threads 6.0.2... Wasn't hard at all, so if anyone needs the code, let me know and I can post it (with instructions) here.
Posted By: caymuc Week starts Monday instead of Sunday - 08/03/2002 3:33 AM
For European users, i tried this in postlist.php:

// get what weekday the first is on
$tempDate = getdate(mktime(0,0,0,$mon,1,$year));
$firstwday= $tempDate["wday"]-1; //HACK: Monday starts week instead of Sunday: '-1' added
if ($firstwday==-1) {$firstwday=6;} //HACK: Monday starts week instead of Sunday: first day should not be -1


And here: (update the header namings...)
<tr class="tdheader"><th>Montag</th><th>Dienstag</th><th>Mittwoch</th><th>Donnerstag</th><th>Freitag</th><th>Samstag</th><th>Sonntag</th></tr>
Posted By: caymuc Translation - 08/03/2002 3:41 AM
If you want to translate the calendar,
some code needs to be added after this:

if ($action = "findDate") {
$theDate = getdate(mktime(0,0,0,$mon,1,$year));
$month = $theDate["month"];
}

Add this:

//Hack im hack translation


switch($month) {
case "January":
$month2 = "Januar";
break;
case "February":
$month2 = "Februar";
break;
case "March":
$month2 = "März";
break;
case "May":
$month2 = "Mai";
break;
case "June":
$month2 = "Juni";
break;
case "July":
$month2 = "Juli";
break;
case "October":
$month2 = "Oktober";
break;
case "December":
$month2 = "Dezember";
break;
default:
$month2 = $month;
}
$month = $month2;
//Hack im hack ende

This is an example for German, you can change that after your needs for your language. Note that only Month names are changed in this example that are different in English than German.

Posted By: caymuc Re: Calendar v 3.0 - 08/03/2002 3:52 AM
> $h = strtolower(strftime ("%I", $tm));

maybe:

$h = strtolower(strftime ("%H", $tm));

But I am still working to catch all those time-things myself, for example in addevent.php, this format change needs to be done, i think:

$date_string = date("j. n. Y, G:i",mktime ($hour_convert,$min,0,$mon,$day,$year)); //HACK AMPM

Posted By: caymuc What does that >>> and »»»mean? - 08/03/2002 4:21 AM
What does that >>> and »»» mean?
I did not find out when what symbols are displayed.

if ($i > 0) {
$events .= "<hr width=95% align=center><font color=red><b>&#8250;&#8250;&#8250;</b></font> $Evnt<br>";
}
else {
$events .= "<font color=red><b>»»»</b></font> $Evnt<br>";
}


By the way: those >>> needs to be changed to that &#8250;&#8250;&#8250; code, or the MAC displays messy gremlins.
Posted By: caymuc Re: Calendar v 3.0 - 08/03/2002 10:58 AM
Since I converted the Calendar somehow into German (not finished yet), I really start liking the idea of having one.

Thanks Max for your great work.

One thought: Do you think it is useful of having all the calendar entries also listed underneath?
The more entries the calendar has the more double information the page will have. I think I would prefer not showing the entries underneath but to have only the calendar displayed. - Other oppinions?
Posted By: msula Re: Calendar v 3.0 - 08/03/2002 2:50 PM
posted by caymuc:
One thought: Do you think it is useful of having all the calendar entries also listed underneath?
The more entries the calendar has the more double information the page will have. I think I would prefer not showing the entries underneath but to have only the calendar displayed. - Other oppinions?



That is kind of my concern. After getting some use on my site I find people seeing a new post and they reply to it thinking today is the day of the event and such. I think it would be better t force users to just click the boxes and then be taken to the post info and replies.
Posted By: AllenAyres Re: Calendar v 3.0 - 08/03/2002 10:01 PM
Hey Caymuc, if you can share your German files, it would make it easier for me to finish the language file for the calendar

Pretty please...
Posted By: caymuc Re: Calendar v 3.0 - 08/05/2002 10:47 AM
Hi, send me your email address to info @ chrom.de
I would mail you the code, as it is right now.

I prefer not to post my stuff online, it is translated but far from beeing finished. Also I changed this and that. So normal users would be rather confused than inspired by the hacks, but you will know what ro pick from it.

Greetings
Posted By: JustDave Re: Calendar v 3.0 - 08/05/2002 7:12 PM
posted by paulf:
It dosent display a "mini calendar" but it does list all current upcoming events.


The next one does.
Posted By: MattyJ Re: Calendar v 3.0 - 08/09/2002 5:43 AM
posted by JustDave:
posted by paulf:
It dosent display a "mini calendar" but it does list all current upcoming events.


The next one does.


tease! how close are you nowadays?
Posted By: JustDave Re: Calendar v 3.0 - 08/09/2002 6:50 AM
hehehe I should have my test site open to public preview before this month is over with. I'm working on putting in a few extra rabbits to pull out of the hat for everyone's amusement... lol

This next version will be easier to set up but there will be alot of setting up to do... lol
Posted By: Max Fisch Re: Calendar v 3.0 - 08/18/2002 1:58 PM
Hi Caymuc,
It's relatively easy to hide the entries... that's how I had it at first, but my readers complained about not being able to easily identify new replies. This was the compromise I came up with, but other ideas are welcome.
Regards,
Max
Posted By: kcweb Re: Calendar v 3.0 - 08/22/2002 2:22 AM
I can't wait, JustDave.

the users on my board were very tickled with your world class IIP add-on that we're running with UBBT v5.5.1 at www.retailflorist.com.

I want to install the calendar add on etc but I'm thinking of waiting til the end of the month once you have it as a pal box.

would it be better to install it now and tiptoe up to your next release when it comes out or is it better to wait do it all in one big shot?

thanks,
Posted By: JustDave Re: Calendar v 3.0 - 08/22/2002 2:51 AM
I would venture to say that you will be glad you waited.
Posted By: kcweb Re: Calendar v 3.0 - 08/22/2002 3:25 AM
posted by JustDave:
I would venture to say that you will be glad you waited.


okay, so you're saying I should wait and do it all in one big shot then?

what will you be releasing?

I haven't been keeping that up to date on features.

thanks,
Posted By: msula Re: Calendar v 3.0 - 08/22/2002 4:09 AM
He's been working on the new IIP 5 for quite some time, what has it been, 6 months? lol j/k

But yeah, he's made some tremendous changes (or so I've heard) and like he said, it will be worth the little while to wait to do that.
Posted By: kcweb Re: Calendar v 3.0 - 08/22/2002 4:24 AM
great thanks,

but this suspense is killing me.

what are some of the new features it will have?
Posted By: Aglavalin Re: Calendar v 3.0 - 09/14/2002 8:51 AM
Here are updated instructions for 6.1

Attached File
56605-calendar-3.1beta.txt  (85 downloads)
Posted By: Datal Re: Calendar v 3.0 - 09/20/2002 11:00 PM
You forgot in the directions how to create a forum to be a calendar. How do I do this??
Posted By: Aglavalin Re: Calendar v 3.0 - 09/20/2002 11:06 PM
Hmm, it's not mentioned in the original directions. If memory serves, I think you just make a normal forum. I called mine 'calendar' in the keyword, and used that in the script where you put in your forum's keyword.
Posted By: Pappy Re: Calendar v 3.0 - 09/21/2002 8:05 AM
In the table w3t_boards (or prefix_Boards) set Bo_Calendar to Y in the calendar forum (s). I think?
Posted By: omegatron Re: Calendar v 3.0 - 09/21/2002 12:02 PM
Aglavalin and Pappy are both right

First you set a special forum up named Calendar. Now when you first did this hack you did an SQL command. This inserted Bo_Calendar under W3T_Boards. Simply make sure any forum you want a calendar in mark Y. In my case I have one forum named Calendar like above. I have ALL forums marked N and only one forum marked Y. This will create the desired effect of one special place for a calendar like here at Threadsdev etc.
Posted By: JustDave Re: Week starts Monday instead of Sunday - 09/22/2002 2:13 AM
Just checking..

The only difference between the calendar week from western > european is that Monday starts off the european week?

Posted By: Ian_W Re: Week starts Monday instead of Sunday - 09/22/2002 2:32 AM
Yes...

Doesn't it in most countries?

Posted By: JustDave Re: Week starts Monday instead of Sunday - 09/22/2002 2:38 AM
LoL I don't know...


When I was stationed in Germany I never noticed... (was there for 2 years) LoL



In the US Sunday is the first day of the week, not Monday.
Posted By: caymuc Re: Week starts Monday instead of Sunday - 09/22/2002 10:26 AM
yes, and hours count 0:00-23:59 instead of 0.00 AM - 23.59 PM, thats all the difference I think.

Greetings Carl

Posted By: JustDave Re: Week starts Monday instead of Sunday - 09/22/2002 10:51 AM
Thanks

I hadn't thought about allowing for the 24 hour format (military time) but I'll get it in.

Switching from European to Western calendar weeks is configurable. I wan't to place an extra setting in users prefs so they can chose what type they see but if they haven't chosen a calendar week type it falls back on what ever the default is set to.
Posted By: caymuc Re: Week starts Monday instead of Sunday - 09/22/2002 11:31 AM
Sounds pretty cool! I am very curious now.

In case you need help with German language files, let me know.
Posted By: JustDave Re: Week starts Monday instead of Sunday - 09/22/2002 11:35 AM
IIP 6.0's text has been completely moved to seperate language files and is stored in the same manor as .threads' is.

This last version was just something I threw together from the pieces parts I had laying around. LoL I just wanted to give everyone something to kill time with.
Posted By: Ian_W Re: Week starts Monday instead of Sunday - 09/22/2002 12:09 PM
posted by caymuc:
yes, and hours count 0:00-23:59 instead of 0.00 AM - 23.59 PM, thats all the difference I think.



No - we prefer to use 0:00am to 11:59pm - oh and don't forget to allow for the fact that we drive on the left, still use our own currency and rule the world Okay the last one might not be true these days
Posted By: Datal Re: Calendar v 3.0 - 09/23/2002 7:09 PM
Ohh I figured that out... The problem or thing that needs adding is... When you "Create" a forum. You should add a Radio Button on "Is this forum a Calendar?" If yes it does the Y and no it does the N... Just my 2 cents...

Also a bug... I put in an event. Then I went to delete it and it gave me some weird error (cant remember it) and the stats for the forum still show the message being there but it isn't... Any suggestions...
Posted By: Aglavalin Re: Calendar v 3.0 - 09/23/2002 7:16 PM
It does not remove the event name and date from the w3t_events table, you need to manually remove it. phpmyadmin works great for this.
Posted By: Datal Re: Calendar v 3.0 - 09/23/2002 7:20 PM
Well shouldn't we make it so it does??
Posted By: Aglavalin Re: Calendar v 3.0 - 09/23/2002 7:22 PM
Yeah, that would be a good idea. Also having it show the event date and title in the post body would be good so ya know when the event is from the post info.
Posted By: Datal Re: Calendar v 3.0 - 09/23/2002 7:33 PM
Yeah that would be nice also Especially for the Calendar's that are Moderated...
Posted By: Wando Re: Calendar v 3.0 - 09/26/2002 2:44 PM
when I run-

CREATE TABLE w3t_Events (
E_ID int(9) DEFAULT '0' NOT NULL auto_increment,
E_CalendarID int(9) unsigned DEFAULT '0' NOT NULL,
E_Number int(9) DEFAULT '0' NOT NULL,
E_Date int(11) unsigned DEFAULT '0' NOT NULL,
E_Time int(11),
E_Duration int(11) DEFAULT '0' NOT NULL,
E_Recurring char(1) DEFAULT 'N' NOT NULL,
E_Recurtype varchar(10),
E_End int(11),
E_Frequency int(11),
E_Days varchar(7),
E_Location text,
PRIMARY KEY (E_ID),
KEY E_CalendarID (E_CalendarID)
);



I get-

Results from your SQL command

Here are the results of your command: "CREATE TABLE w3t_Events ( E_ID int(9) DEFAULT '0' NOT NULL auto_increment, E_CalendarID int(9) unsigned DEFAULT '0' NOT NULL, E_Number int(9) DEFAULT '0' NOT NULL, E_Date int(11) unsigned DEFAULT '0' NOT NULL, E_Time int(11), E_Duration int(11) DEFAULT '0' NOT NULL, E_Recurring char(1) DEFAULT 'N' NOT NULL, E_Recurtype varchar(10), E_End int(11), E_Frequency int(11), E_Days varchar(7), E_Location text, PRIMARY KEY (E_ID), KEY E_CalendarID (E_CalendarID) ); ".
SQL ERROR: Unable to do_query: CREATE TABLE w3t_Events ( E_ID int(9) DEFAULT '0' NOT NULL auto_increment, E_CalendarID int(9) unsigned DEFAULT '0' NOT NULL, E_Number int(9) DEFAULT '0' NOT NULL, E_Date int(11) unsigned DEFAULT '0' NOT NULL, E_Time int(11), E_Duration int(11) DEFAULT '0' NOT NULL, E_Recurring char(1) DEFAULT 'N' NOT NULL, E_Recurtype varchar(10), E_End int(11), E_Frequency int(11), E_Days varchar(7), E_Location text, PRIMARY KEY (E_ID), KEY E_CalendarID (E_CalendarID) );
You have an error in your SQL syntax near '; ' at line 16 row(s) affected by your query.


Posted By: Aglavalin Re: Calendar v 3.0 - 09/27/2002 12:38 AM
Hmm, I didn't change that create table command when I updated the directions to 6.1, so they should still work. It looks like you have a space after the ; from your quote of '; ' so perhaps it got added on from a copy and paste?
Posted By: Pappy Re: Calendar v 3.0 - 10/16/2002 12:30 PM
anyone know if this hack works with 6.1.1?

Thanks!
Posted By: dimopoulos Re: Calendar v 3.0 - 10/17/2002 1:23 AM
It works just fine with 6.1.1 Pappy. I am glad that I installed it.

One question though from me: Until we wait for Rick to do some magic with the birthdays etc., I noticed that on the events table there are some fields like E_Duration, E_Recurring, E_Recurtype, E_End and E_Frequency

Can we set those fields and if yes to what, so that if I enter someone's birthday (say 12/12/1980) it will appear every year on the 12/12th?

That will save loads of input for the admins.

Thanks in advance

Warm regards

Nikos
Posted By: Aglavalin Re: Calendar v 3.0 - 10/17/2002 11:10 AM
The events table is part of the calendar 3.0 addon, and I think those fields were never implemented by Max.

Birthdays should go in the user table along with the other user information.
Posted By: Charles Re: Calendar v 3.0 - 10/18/2002 2:21 PM
does this version of calendar work with 6.1 ?
Posted By: RTM_dup1 Re: Calendar v 3.0 - 10/19/2002 10:51 PM
Charles,

Dimipoulous indicated (in a few posts above yours) that it seemed to work in 6.1.1 so I presume it would work in 6.1 - YMMV, since I haven't had the opportunity to try it myself.

Cheers,

Rob
Posted By: Aglavalin Re: Calendar v 3.0 - 10/21/2002 8:50 PM
Yes it works in 6.1, I posted updated instructions above somewheres...
Posted By: dimopoulos Re: Calendar v 3.0 - 10/22/2002 1:19 AM
An optional note:

When you specify a board to be a calendar, it shows at the top of the screen and below it you can see the list of all the entries you made - as events.

If you do not wish this to be shown - only the calendar to be visible you need to do the following:

Open postlist.php
Go to the end of the file and find:
code:

if (!$debug) {
include ("$thispath/templates/$tempstyle/postlist.tmpl");
}


and change it to
code:

if($Calendar != "Y")
{
if (!$debug) {
include ("$thispath/templates/$tempstyle/postlist.tmpl");
}
}



Warm regards

Nikos
Posted By: Datal Re: Calendar v 3.0 - xhtml instructions - 10/31/2002 10:59 PM
Make Note... You forgot the making of the templates
Here are 2 suggestions for the calendar incase you guys haven't thought of it. If you have please ignore it:

1. Edit Event so that we can change the information about the event.
2. Put the Event information into the original subject line of the original post.
Another one....

Add a date that it goes under for the actual thread listings. If you put new posts at the top and someone inputs something for a date a few months ahead, there is no decent way to figure it out.
2 more suggestions.
1. Add an option for All Day Events.
2. Set it so that if you change the time offset in the display settings it also changes on the calendar as well.
Posted By: Lunatik Proposed fix for timeoffset for Calendar 3.0 - 11/07/2002 7:34 PM
Here is a proposed change for the calendar to fix timeoffset issues.

In postlist.php:
Look for
$h = strtolower(strftime ("%I", $tm));

Add Above it:
$tm = strtotime($html -> convert_time($tm, $user['U_TimeOffset']));

There should only be 2 entries.

------------------------
In AddEvent.php

Look For
$user = $userob -> authenticate("U_Username, U_Password,U_Signature,U_Picture,U_Groups,U_Display,U_Language,U_Totalposts,U_Title,U_Color,U_TempRead,U_TextCols,U_TextRows,U_EReplies,U_Preview,U_Number");

Change it to
$user = $userob -> authenticate("U_Username, U_Password,U_Signature,U_Picture,U_Groups,U_Display,U_Language,U_Totalposts,U_Title,U_Color,U_TempRead,U_TextCols,U_TextRows,U_EReplies,U_Preview,U_Number, U_TimeOffset");

Look for:
$ETime = mktime ($hour_convert, $min, 0, 0, 0, $year);

Change it to:
$ETime = mktime ($hour_convert - $user['U_TimeOffset'], $min, 0, 0, 0, $year);

And that's it. Then Timeoffset will work properly.
Is this mod compatible with 6.2?
I don't believe it will be. Since this works off of the information stored in the w3t_Posts table which has been changed for 6.2 it will probably break this mod. I haven't seen the code for 3.0 and can't remember if Max went with a table join between the events table and the posts table to grab the information. If so this will also be a problem since .threads 6.2 uses a table join between the Users table and the Posts table and adding an additional table will most likely impact speed. (without a lot of work in streamlining things)
About adding an extra table join to the Users table:

This only seems to apply to postlist.php (and I'm not even sure if the username is needed there). So wouldn't the additional overhead only occur when viewing the calendar? Is so, I wouldn't think that would be a big deal.
I've modified the version of this hack in this post to work with 6.2dev4.

I can upload it after 6.2 public beta is available, if there's interest. I'm not sure who's currently maintaining this hack, and I'm not really interested in maintaining it.

Questions:

1) What version # should this be called?

2) I know that Max Fisch and Allen Ayers have worked on the hack. Is there anyone else, so that I can list the authors?
I haven't looked at 3.0's code so I couldn't say for sure but I know you know your stuff Dave so I'm sure it's all good.

Yeah the extra overhead should only occur during calendar viewing. The last time I seen it running here I recall a good 30-40 queries being needed when there was a few events listed. Is there a way to cut them down? Just a thought.
GameJag ? I believe started things rolling. Max picked it up from him and moved it forward. Then Allen got the templates/xhtml into working order and some fixes too, I believe. I would say those are the 3 main authors prior to your update. Anyone else have some input on this?
30-40 queries

This is probably what you were seeing:

code:
// loop through all the days of the month
while ( $d <= $lastday) {
...
select E_ID,E_Date,E_Time,E_Location,B_Subject, B_Number, B_Replies
FROM w3t_Events, w3t_Posts
WHERE E_Date >= '$lowdate'
AND E_Date < '$highdate'
AND B_Number = E_Number
AND B_Board = '$Board_q'
...
}




(This query originally was also selecting U_Username, but the username wasn't used anywhere, so I simply took it out, and there was no need to add a join to the users table.)

Maybe that's what dimopoulos was talking about in his Fetching data in an array post.

I suppose the query could be done before the loop, extracting the data for the whole month, and storing it in an associative array. Do you think it would make sense to do that?
Yeah I think it would be much better done that way. I'm not much for calendars but those that use them alot will have a lot less load on their servers.
I am really not too sure about the Load issues but I used a version 3.1 and redid some of the tags so that it would display properly on all the stylesheets. (IE month and other text areas that used the default black text. Also I added some stuff to change the border color on the current day for stylesheets that had light table and dark table using the same or similar backgroud colors. My server is at www.greatlakesalliance.com and our Calendars are used fairly often and have events for most days. I am really a newbie when it comes to actually writing any code that works. Lots of trial and error here and I am not sure if any of the stuff I have done is "optimized" I would be very interested in any new stuff done with this. Also Dave, I really apreciate all the effort you and the other Users here have done over the past couple years here and at wwwthreads when it was still live.

Justdave, you used to have a Calendar pal in one of the older IIP versions (3.x I believe?) is there any way I can get a copy of that one from you so I can modify it to work with the current version of threads/IIP?

Thanks a million everyone!!

Pappy
The calendar pal is laying around here somewhere. I'll dig it out this coming week and put in to the next minor upate for IIP. I have IIP working with the upcoming release of .threads and will post the updated IIP when .threads 6.2 is pubicly available.

As far a server load with the calendar addon I don't think smaller sites will have much of an issue with it. I was considering the "what if" when a site has 10 or 20 users browsing the calendar and possibly creating 300 - 800 queries in that area alone.

I think Dave_L will have this problem resolved though.
Ok, I've moved the query out of the loop. The events are now stored in an array. Here's the header comment for the function that stores the data:

// Get all the events for the specified month.
//
// The events are extracted from the database Events table, and stored in the
// array $events_for_month, which is indexed by the day of the month.
//
// Events are stored in ascending order of date (E_Date).
//
// Examples:
// $events_for_month[5] is an array containing the events for the fifth day of the month.
// $events_for_month[5][2] is an array containing the third event for the fifth day of the month.
// $events_for_month[5][2]['E_Location'] is a scalar containing the E_Location column for the third event
// for the fifth day of the month.

function get_events_for_month($month, $year) {

Does this look reasonable? It seems to work correctly.
I don't see any problems with that at all. I bet that dropped the query count considerably too.
I didn't notice the query count before, but it's about 11 now. The number of queries has been reduced by one less than the number of days in the month.

I was wondering if that three-dimensional array might take up a lot of memory, if there were a large number of events for the month.
As far as using the array for storage untill it's sent to the browser I don't think it will be a problem since .threads does the same thing for it's displays before being sent to the templates.
Thanks Dave,

That was exactly what I wanted to do = reduce the number of queries.

Warm regards

Nikos
Re: fixing the time offset

I assume this refers to making the date/times for events always display in the user's time zone, while being stored in the database in the server's time zone?

If so, there are a number of changes required in addition to the above.

But I'm wondering if it's desirable to make these time zone adjustments.

Scenario 1:

I'm using the calendar to announce a meeting in an IRC chatroom on Jan 15 at 6PM my time. In this case, the time zone adjustment is appropriate, since I want other users to see the date/time displayed in their time zone.

Scenario 2:

Same as above, except I'm going to be in another city in another time zone on Jan 15. Hmmm ... this gets trickier. I'll have to take into account the difference between the time zone I'm in now, and the one I'll be in on Jan 15.

Scenario 3:

I'm using the calendar to announce a rock-climbing event at Devil's Tower, Wyoming on July 7 at noon. Obviously, everyone attending the event will be in the same time zone, and the date/time should be displayed in the time zone for Devil's Tower, regardless of what time zone users are in now. So in this case, it's preferable that no time zone conversion be done.

Any suggestions? Should this hack be left as it is now, with no time zone corrections?
If it's a local event then I would venture to say that all users of the site have their time offset set accordingly and the correct time will be displayed no matter what. I think the offset time should be carried over to match .threads.
This is how it works and it has been working since I made these changes. When it get stored into the database it gets stored as the server time. Whever a user goes in and changes their offset it will display the time in their timezone. If you notice when you post a new event it adjusts it to the server time and when you view it it adjusts it to the user time.

The proposed changes have not made and major impact as far as I can tell.

Your Senarious make a valid point and a simple soulution to it is to go into your user settings and change it to the timezone you are in.
I guess it depends on what the calendar is being used for.

JustDave's and your opinions sound reasonable, so I'll leave the time zone adjustments in when I upload the 6.2-compatible version.
Thanks. Less work for me to do.
Did someone make a PAL for IIP to show a mini-calendar?
Not that I'm aware of. I had made an "upcoming events" pal a while back that simply displayed a list of events that were coming up. I will be adding this to IIP's zip file at some point.
Ah, the list of events would be nice. Thanks!
Posted By: Gardener New version - 01/04/2003 1:41 AM
I'm closing this thread and refer to the new version in this thread which is updated for UBB.threads 6.2.
© UBB.Developers