Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 11-07-2000 Last Update: Never Installs: 0
 
No support by the author.

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #72  
Old 11-25-2000, 09:10 PM
Guest
 
Posts: n/a
Default

Hi Rangersfan

Great hack, great job - thank you!

I do, however, have a few problems and I'll appreciate help here.
  • 1. I added public events to the calendar. However only the 2000 events are showing. If you move to 2001, no event is showing up. (I checked the database - they are there).

    2. I would like to add $forumjump to the bottom of the calendar and calendar_getinfo templates. Just sticking $forumjump there doesn't do anything. (right now I've just placed the actual html code for it, until I get help from you).

    3. I would like to add the "add public event" and "add private event" buttons to the calendar_getinfo templates as well. just putting the $addpub/$addpriv for them (copied from the calendar template) does not work. Any suggestion, other than to put the html itself there?

    4. Call me an idiot, but how does the calendar add the AGE of the BB members based on the birthday hack, when the birthday hack does not include a year??? Am I missing something here?

I would also like to add a couple wishes, perhaps for future release:
  • PLEASE add the option of reccuring event. Must I add holidays (Christmas, Thanksgiving, etc) EVERY year again?
  • Also, if I could add BIRTHDAYS -- not of BB members. This is a reccuring event, indeed, however in this case I will want it to tell the date (and therefore add a year for every year). In my case, I am referring to birthdates of racing drivers (this is what my forum's about).
  • It would be great if I could place "today's events" on the front page of the BB as well (i.e., those links that appear in the box of Today's date, could also be seen on the BB's front page)

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]
Reply With Quote
  #73  
Old 11-25-2000, 09:36 PM
Guest
 
Posts: n/a
Default

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?
Reply With Quote
  #74  
Old 11-25-2000, 10:59 PM
Guest
 
Posts: n/a
Default

(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")."\");");
Add this code before the above line

Code:
   $perms=getperms($bbuserid);
        if ($perms[canpublicevent]==1)
        {
                eval ("\$addpub = \"".gettemplate("calendar_publiceventbutton")."\";");
        }
        else
        {
                $addpub = " ";
        }
        eval ("\$addpriv = \"".gettemplate("calendar_privateeventbutton")."\";");
(4) The calendar hack won't put the age of anyone, just their birthday. On my board it shows the age except I haven't updated the birthday hack to handle the ages yet. The calendar as is works with my updated version of the birthdays with ages but I don't think it works with the version I released. I have meant to update the hack for ages so you can use the two together but I haven't the time lately. It will come soon, after my paying work is done.

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
Reply With Quote
  #75  
Old 11-25-2000, 11:15 PM
Guest
 
Posts: n/a
Default

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))");
Since the date in the db is in the format of 0000-00-00 and it's looking for, say 2001-3-%, it won't find any events at all.

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>";
	}
Which affects the < $premonth | $nextmonth > links at the bottom of the calendar (and they're rather important).
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]
Reply With Quote
  #76  
Old 11-26-2000, 08:14 PM
Guest
 
Posts: n/a
Default

[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.
Reply With Quote
  #77  
Old 11-26-2000, 11:39 PM
Guest
 
Posts: n/a
Default

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))");
With:

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))");
	}
And I added

Code:
      if ($month >= 1 && $month <= 9)
      {
         $month = "0" . (string)$month;
      }
under

Code:
      if ($day >= 1 && $day <= 9)
      {
         $day = "0" . (string)$day;
      }
(around line 380)


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]
Reply With Quote
  #78  
Old 11-26-2000, 11:43 PM
Guest
 
Posts: n/a
Default

When I get a chance I will fix it while using alot less code than you did
Reply With Quote
  #79  
Old 11-26-2000, 11:44 PM
Guest
 
Posts: n/a
Default

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
Reply With Quote
  #80  
Old 11-26-2000, 11:46 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by freddie
When I get a chance I will fix it while using alot less code than you did
Hey, cut me some slack! That I actually found a fix to it at all is a miracle in itself

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)
Reply With Quote
  #81  
Old 11-26-2000, 11:48 PM
Guest
 
Posts: n/a
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:13 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.12849 seconds
  • Memory Usage 2,300KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (8)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete