The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Details »» | |||||||||||||||||||||||||
Here is the Calendar (finally) v1.03
http://www.hedgehogwheels.com/hacks/calendar1.03.zip [Features] - Users can add Private events that only they can see - Admin can set usergroups to allow those selected to post public events that everyone sees - Behaves just like a message with smilies, bbcode, etc - Months are options in Control Panel for easier language changes - Can specify 0,1, or 2 images to display above each month [demo] http://www.hedgehogwheels.com/forums/calendar.php I do need to update the birthday hack to support birthyear as it is on my forum. I am not sure if the calendar will work as is with the previous birthday hack. If not then just turn that option off in the control panel for now. [Edited by freddie on 11-18-2000 at 07:48 PM] Show Your Support
|
Comments |
#72
|
|||
|
|||
Hi Rangersfan
Great hack, great job - thank you! I do, however, have a few problems and I'll appreciate help here.
I would also like to add a couple wishes, perhaps for future release:
Thanks for your time and efforts, and I look forward to your reply. Cheers, Bira p.s. Our calendar can be found at http://www.atlasf1.com/bb/calendar.php -- I've not made it public yet. I want to fix the first 'bug' I mentioned first. [Edited by bira on 11-25-2000 at 06:20 PM] |
#73
|
|||
|
|||
I found the problem to the first 'bug' I mentioned (although I don't know the fix):
There is a discrepency between a month's value being with a leading zero (i.e. January is 01) and without a leading zero (1). So when I choose January 2001, it takes me to http://www.atlasf1.com/bb/calendar.p...th=1&year=2001 -- where nothing can be seen. But if I change that URL to http://www.atlasf1.com/bb/calendar.p...h=01&year=2001 all the events show up again... Also, except for January, when I chage the URL to include a leading Zero, the month's name at the top (like "February 2001") doesn't show (shows only "2001"). How do I fix this please? |
#74
|
|||
|
|||
(1) Bug acknowledged - I will fix it when I get a chance
(2) If you want to use $forumjump in the template put makeforumjump(); at the top of calendar.php (but after any includes) (3) If you want to add those buttons you will need to go to this line Code:
eval("echo dovars(\"".gettemplate("calendar_getinfo")."\");"); Code:
$perms=getperms($bbuserid); if ($perms[canpublicevent]==1) { eval ("\$addpub = \"".gettemplate("calendar_publiceventbutton")."\";"); } else { $addpub = " "; } eval ("\$addpriv = \"".gettemplate("calendar_privateeventbutton")."\";"); reccurring events I haven't done this because of the complex calculations it would take to figure out some days. Of course christmas is always on dec 25th but other days move about and I haven't bothered to find a source that details how to figure out where holidays go - give me a source and I may work on it. If you want to place events from the calendar onto your front page then you just need to query the tables for the information. I am sure you can figure that out |
#75
|
|||
|
|||
Oh baby, you flatter me
Yeah, I guess I can figure how to query the db... I'll figure it out... sure... * bira fidgets nervously * .... With regards to your bug: having looked at the calendar script, the problem is here, if that helps: Code:
// Load the events for the month! $events=$DB_site->query("SELECT eventid, subject, eventdate, public FROM events WHERE eventdate LIKE '$year-$month-%' AND ((userid = $bbuserid AND public = 0) OR (public = 1))"); The solution is to switch ALL month's values to two digits. I tried it and it worked EXCEPT for the following: Code:
$lm = $month - 1; $ly = $year - 1; if ($month == 1) { $premonth = "<font face='verdana' size=2><a href='calendar.php?month=12&year=$ly'>$prevmonth</a></font>"; } else { $premonth = "<font face='verdana' size=2><a href='calendar.php?month=$lm&year=$year'>$prevmonth</a></font>"; } $nm = $month + 1; $ny = $year + 1; if ($month == 12) { $nextmonth = "<font face='verdana' size=2><a href='calendar.php?month=1&year=$ny'>$nextmonth</a></font>"; } else { $nextmonth = "<font face='verdana' size=2><a href='calendar.php?month=$nm&year=$year'>$nextmonth</a></font>"; } For some reason, once the month's value is 0x, it doesn't seem to execute the +1/-1 math. If you tell me how to solve that, then I've got this bug fixed and I can open the calendar for all. As for the reccuring events: we can start off by offering the option of reccuring events with the same date. Christmas is one; birthdays (public ones, like celebrities) is another. In other word, all you need, really, is to add an option to add an event WITHOUT a year, and thus selecting events to display WITHOUT a year. I don't know enough to think up myself how to add this option, although I suspect it should not be too hard. Any idea? One last thing: I have your old birthday hack installed (no year) and it seems to work fine with this calendar hack (albeit not saying, of course, the person's age). Cheers, Bira [Edited by bira on 11-25-2000 at 08:43 PM] |
#76
|
|||
|
|||
[QUOTE]Originally posted by Mental Stamina
i have it installed here http://64.177.89.7/boards/calendar.php Ummmmm, Hello When where you planning on asking if it is alright to use my design? I am flattered that you you copied it, but it might have been nice for someone to let me know. You could at least have changed a few more of the colours. I know mine is not open yet, and it is taking me a very long time to fin it off. But I have been busy, moving house... changing jobs etc. |
#77
|
|||
|
|||
OK, Rangersfan, I solved this bug - and even though I'm not sure my fix is the best possible,
it sure does work, and I've made the calendar public! Here's the fix I did, heh: I replaced: Code:
// Load the events for the month! $events=$DB_site->query("SELECT eventid, subject, eventdate, public FROM events WHERE eventdate LIKE '$year-$month-%' AND ((userid = $bbuserid AND public = 0) OR (public = 1))"); Code:
// Load the events for the month! if (($month=="1") || ($month=="01")) { $events=$DB_site->query("SELECT eventid, subject, eventdate, public FROM events WHERE eventdate LIKE '$year-01-%' AND ((userid = $bbuserid AND public = 0) OR (public = 1))"); } elseif (($month=="2") || ($month=="02")) { $events=$DB_site->query("SELECT eventid, subject, eventdate, public FROM events WHERE eventdate LIKE '$year-02-%' AND ((userid = $bbuserid AND public = 0) OR (public = 1))"); } elseif (($month=="3") || ($month=="03")) { $events=$DB_site->query("SELECT eventid, subject, eventdate, public FROM events WHERE eventdate LIKE '$year-03-%' AND ((userid = $bbuserid AND public = 0) OR (public = 1))"); } elseif (($month=="4") || ($month=="04")) { $events=$DB_site->query("SELECT eventid, subject, eventdate, public FROM events WHERE eventdate LIKE '$year-04-%' AND ((userid = $bbuserid AND public = 0) OR (public = 1))"); } elseif (($month=="5") || ($month=="05")) { $events=$DB_site->query("SELECT eventid, subject, eventdate, public FROM events WHERE eventdate LIKE '$year-05-%' AND ((userid = $bbuserid AND public = 0) OR (public = 1))"); } elseif (($month=="6") || ($month=="06")) { $events=$DB_site->query("SELECT eventid, subject, eventdate, public FROM events WHERE eventdate LIKE '$year-06-%' AND ((userid = $bbuserid AND public = 0) OR (public = 1))"); } elseif (($month=="7") || ($month=="07")) { $events=$DB_site->query("SELECT eventid, subject, eventdate, public FROM events WHERE eventdate LIKE '$year-07-%' AND ((userid = $bbuserid AND public = 0) OR (public = 1))"); } elseif (($month=="8") || ($month=="08")) { $events=$DB_site->query("SELECT eventid, subject, eventdate, public FROM events WHERE eventdate LIKE '$year-08-%' AND ((userid = $bbuserid AND public = 0) OR (public = 1))"); } elseif (($month=="9") || ($month=="09")) { $events=$DB_site->query("SELECT eventid, subject, eventdate, public FROM events WHERE eventdate LIKE '$year-09-%' AND ((userid = $bbuserid AND public = 0) OR (public = 1))"); } else { $events=$DB_site->query("SELECT eventid, subject, eventdate, public FROM events WHERE eventdate LIKE '$year-$month-%' AND ((userid = $bbuserid AND public = 0) OR (public = 1))"); } Code:
if ($month >= 1 && $month <= 9) { $month = "0" . (string)$month; } Code:
if ($day >= 1 && $day <= 9) { $day = "0" . (string)$day; } Not very smooth, but it works and the calendar is beautiful. You can visit it at http://www.atlasf1.com/bb/calendar.php (and you can also see the members' birthdays, even though I have your old hack ) Thanks for your great work! [Edited by bira on 11-26-2000 at 08:41 PM] |
#78
|
|||
|
|||
When I get a chance I will fix it while using alot less code than you did
|
#79
|
|||
|
|||
p.s.
For future release I would suggest allowing the BB admin who is installing this, to choose whether he wants the days to appear as Sunday -> Saturday, or Monday -> Sunday. Your hack comes with the first option hard coded in the script, however for many of us a week is actually Monday -> Sunday, and I myself simply changed the order in the script and in the template. Just a suggestion |
#80
|
|||
|
|||
Quote:
When I know php scripting anywhere near your level, I'll write hacks with alot less bugs than you did (joking, heh. You know I adore you) |
#81
|
|||
|
|||
Oh, and btw, I did try - instead of an elseif for each month - to just use the if ($month >= 1 && $month <= 9) 'trick' - but for some reason, it made the months' titles (March, April, etc) disappear.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|