Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Details »»

Version: 1.00, by Mutt Mutt is offline
Developer Last Online: Mar 2013 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 01-17-2002 Last Update: Never Installs: 15
 
No support by the author.

Here's something quick and easy. I haven't been contributing lately but this was so easy and so cool, I figured I better share.

I wanted to be able to enter calendar events once which happen every year like Christmas and have them show up year after year.


edit template - calendar_enterevent

find
<option value="2004" $year2004selected>2004</option>

right after it add
<option value="0000" $year0000selected>every year</option>



edit calendar.php

find in (action==display)
PHP Code:
WHERE eventdate
LIKE 
'$year-$doublemonth-%' AND ((userid '$bbuserinfo[userid]' AND public = 0) OR (public = 1))"); 
and replace it with
PHP Code:
WHERE (eventdate LIKE '$year-$doublemonth-%' OR eventdate LIKE '0000-$doublemonth-%') AND ((userid '$bbuserinfo[userid]' AND public = 0) OR (public = 1))"); 

find in (action==update)
PHP Code:
if (!checkdate($month,$day,$year)) 
replace it with
PHP Code:
if ($year=="0000") {
$testyeardate("Y");
} else {
$testyear=$year;
}
if (!
checkdate($month,$day,$testyear)) 

jump to ($action == "getday")
under
PHP Code:
$eventdate explode("-",$info[eventdate]); 
add
PHP Code:
if ($eventdate[0]=="0000") {
      
$eventdate[0]=$year;


thats it. Now enter a calendar event and when you pick the year, choose the new option 'every year'. the event will show up this year, next year, the year after. hell it will even show up last year.

I just did it and haven't tested it really well, but it sure looks like it works. let me know what ya think

Show Your Support

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

Comments
  #2  
Old 01-18-2002, 06:14 PM
Shenlong's Avatar
Shenlong Shenlong is offline
 
Join Date: Nov 2001
Location: Manhattan, New York
Posts: 167
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yay first to try this out, 1 sec i am just uploading files
Reply With Quote
  #3  
Old 01-18-2002, 06:22 PM
Shenlong's Avatar
Shenlong Shenlong is offline
 
Join Date: Nov 2001
Location: Manhattan, New York
Posts: 167
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works like a charm! thanx so much! Now I can add all the yearly events and not have to readd them!
Reply With Quote
  #4  
Old 01-18-2002, 06:43 PM
Mutt's Avatar
Mutt Mutt is offline
 
Join Date: Nov 2001
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

here's another calendar addition

it automatically changes the day select options when you change the month or year so that days like Feb 31 aren't available choices

https://vborg.vbsupport.ru/showthrea...threadid=34242
Reply With Quote
  #5  
Old 01-18-2002, 06:49 PM
Shenlong's Avatar
Shenlong Shenlong is offline
 
Join Date: Nov 2001
Location: Manhattan, New York
Posts: 167
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I went there but the instructions for the 2nd part weren't clear, so I just left a message, go and check it plz
Reply With Quote
  #6  
Old 01-21-2002, 04:30 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

when you select the every year option, it does not display the event on front page at all!
Reply With Quote
  #7  
Old 01-23-2002, 01:21 AM
Mutt's Avatar
Mutt Mutt is offline
 
Join Date: Nov 2001
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It would be a the same update for the homepage as in calendar.php. I'll have to look at it and tell you exactly what to change.

I have a request. does anybody have a db of holidays? since we can have re-occurring events, I thought it would be nice to add the holidays to the calendar but I don't want to type them all in. if someone has a txt file listing holidays and dates (maybe even holiday descriptions) I'll make a little improt script and post it with the db.

I've been looking and just not findding anything.

thanks
Reply With Quote
  #8  
Old 01-23-2002, 01:28 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My holidays are non Americans.

I still have it installed but cannot use it as the db does not seem to see "every year" and therefore not displaying event in front page (from hack to display event same like birthday). Once I reverted from recurring to 2002 it showed.
Reply With Quote
  #9  
Old 01-23-2002, 02:08 PM
KevinG KevinG is offline
 
Join Date: Dec 2001
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great post but I already did something similiar for annual events. I used the year 1900 instead Year 0000 gave me problems.

I just never got around to posting it here. Too busy setting up the site.


Quote:
Originally posted by Lionel
My holidays are non Americans.

I still have it installed but cannot use it as the db does not seem to see "every year" and therefore not displaying event in front page (from hack to display event same like birthday). Once I reverted from recurring to 2002 it showed.
I think I know which hack you are referring to.

This is a section from that original hack.

Find:
PHP Code:
$today vbdate("Y-m-d",time());

$events=$DB_site->query("SELECT eventid, subject, eventdate, public FROM calendar_events WHERE eventdate='$today' AND ((userid = '$bbuserinfo[userid]') OR (public = 1))"); 
Replace with:
PHP Code:
$todayactual vbdate("Y-m-d",time());
$today vbdate("m-d",time());      

$events=$DB_site->query("SELECT eventid, subject, eventdate, public FROM calendar_events WHERE ((eventdate LIKE '1900-$today') OR (eventdate = '$todayactual')) AND ((userid = '$bbuserinfo[userid]') OR (public = 1))") ; 
and in another original section of that hack
Find:
PHP Code:
while ($event=$DB_site->fetch_array($events)) {
   
$eventsubject htmlspecialchars($event[subject]); 
Replace with:
PHP Code:
while ($event=$DB_site->fetch_array($events)) {
   
$annualevent '';
   if (
substr($event[eventdate],0,4) == '1900') {
      
$annualevent '*';
   }
   
$eventsubject $annualevent htmlspecialchars($event[subject]); 
This just precedes the event subject with an '*'.

Note again that I used 1900 instead of the mentioned 0000. A year of 0000 gave me troubles.
Reply With Quote
  #10  
Old 01-24-2002, 05:43 PM
Mutt's Avatar
Mutt Mutt is offline
 
Join Date: Nov 2001
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I like the little asterix addon and thanks for the help with the forum homepage hack.

looks like I missed a spots. probably should have posted this in the beta forum. anyway, here's a little more so they show up on all pages.

I added it to the original post

Now re-occuring events will show un on the getday page
Reply With Quote
Reply

Thread Tools

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:31 AM.


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.07303 seconds
  • Memory Usage 2,318KB
  • Queries Executed 23 (?)
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
  • (10)bbcode_php
  • (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
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • postbit_imicons
  • 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