The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Details »» | |||||||||||||||||||||||||
my first hack, enjoy...
Today's Events on Main Forum Page Hack Version: 4 Description: Lists today's events on the main page, under the Online Users & Birthdays (both public, and private events). *Version 2 adds the ability to list either bulleted or linear *Version 3 uses the users timezone adjusted date, rather than the servers date *Version 4 fixes a type-o on line 47ish, and adds one bit of instruction if using the bulleted list, rather than linear Files to Add: todaysevents.php Files to Edit: index.php Templates to Edit: forumhome_loggedinusers Templates to Add: calendar_privateevent_linear, calendar_publicevent_linear Demo: Bulleted: Linear: upgrade from version 2: 0) backup necessary files 1) upload new todaysevents.php 2) done upgrade from version 2: 0) backup necessary files 1) upload new todaysevents.php 2) done upgrade from version 1: 0) backup necessary files 1) upload new todaysevents.php 2) add 2 templates (NOTE: there is an important space after the comma at the end, and an extra space in {calpubliccolor } and {calprivatecolor }) calendar_publicevent_linear PHP Code:
PHP Code:
4) done First Time Installation: 0) backup everything, just in case 1) upload todaysevents.php to your main vbulletin directory 2) edit index.php after this: PHP Code:
PHP Code:
change this: PHP Code:
to this: PHP Code:
(NOTE: there is an important space after the comma at the end, and an extra space in {calpubliccolor } and {calprivatecolor }) calendar_publicevent_linear PHP Code:
PHP Code:
6) All done. one person downloaded version 4, i didnt test my change, and forgot to comment out a line. line 10 needs comments for that one person who downloaded the bad version 4 this one is fixed, fyi (its at the bottom somewhere) https://vborg.vbsupport.ru/showthrea...943#post141943 Show Your Support
|
Comments |
#77
|
||||
|
||||
First of all, great hack!, thanks Mister..
I modified the hack to display events for the next two weeks by modifying the SQL query to this: Code:
SELECT eventid, subject, eventdate, public FROM calendar_events WHERE (eventdate >= '$today' AND eventdate <= DATE_ADD('$today', INTERVAL 14 DAY)) AND ((userid = '$bbuserinfo[userid]') OR (public = 1)) ORDER BY eventdate Im running into 2 problems. (1) The function designed to remove the trailing commas does not seem to work. The code is this: Code:
$todaysevents = substr($todaysevents,0,strlen($todaysevents)-2); (2) The other problem is based on a further modification of this hack. I wanted to separate Todays Events from Upcoming Events so I made separate variables to represent todays events and events from today+1 until today+14days. The problem is that it doesnt work. All the code makes sense to me except I can't figure out where $caltitlelength comes from. Im reusing that variable in both If/then statements. That may be the problem, but I dont understand the variables source or purpose so I cant modify it to suit my needs. Any help there would be greatly appreciated. I'd be happy to post the modified code if that will help. Thanks |
#78
|
||||
|
||||
I just realized another problem with modifying this hack to display events in the near future. Birthdays aren't stored in the calendar_events table. So to display ALL events in the near future (for whatever time period) you will have to query calendar_events AND users and concantenate events from both queries. I'm afraid this is beyong my PHP abilities, I still can't figure out how to concantenate two simple string values much less two recordsets.
I could probably throw a poor hack together reusing Mister's code if I can figure out what $caltitlelength is. |
#79
|
|||
|
|||
Kyrnel,
If you finally get this working, let me know. I've been wanting to display events ahead of time on my own forums. |
#80
|
||||
|
||||
Quote:
What I can;t get it to to is show 2 separate lines of events, one for todays events and another for upcoming events, and this hack does not show birthdays at all, because they are not stored in the calendar_events table but rather just in the user's profile. I am working on figuring this out. I think I can make it work if I can figure out what $caltitlelength is. I'm planning on adding some more features to it too, like an option in the user's options to display upcoming events or not and maybe how long into the future they want them to be displayed (just today, 1 week, 2 weeks, 1 month). I'll post as soon as I have something. |
#81
|
|||
|
|||
Awesome! Thanks!
|
#82
|
|||
|
|||
Don't write anything from the php files.
Use the vbulletin template system. Put the html you want in 'forumhome_loggedinusers' template. |
#83
|
||||
|
||||
Mister,
What is the purpose of this code: Code:
if ($caltitlelength != 0 and isset($caltitlelength)!=0) { if (strlen($eventsubject) > $caltitlelength) { $eventsubject = subst($eventsubject,0,$caltitlelength) . "..."; } } Also, Im close to finishing my mod to this hack. I have successfully combined member's birthdays to upcoming events using a SQL UNION query. I am going to add the following options to the User CP: "Display Today's Events on Home Page: (Checkbox: Yes/No)", "Display Upcoming Events: (no, one week, two weeks, one month)". These settings will be used to determine if/what to display on the main page. Still trying to make the substr function work. Anyone have any ideas why it is NOT removing the trailing commas? Is it working for anyone else? Thanks, Kyrnel |
#84
|
||||
|
||||
ROFL
I just figured out why the substr function wasn't removing the trailing commas. I had the "Add template name in comments" option set to Yes. So the substr function was trimming the last two characters of the HTML comment showing the template name. This is potentially dangerous becasue the close comment tag was altered expanding how much HTML was commented out. If you tried this hack with Template names enabled and a section of your page disappeared, now you know why. heh |
#85
|
|||
|
|||
Quote:
Can you show a screen shot or url of your events hack? I really want to implement this on my site. Thanks! |
#86
|
|||
|
|||
Nice job!
Very useful hack! |
#87
|
||||
|
||||
Quote:
The rest of it works fine though. Here are a couple of screenshots and instructions for my modified version of the hack: This is what happen when there are no upcoming events: This is what happens when there are, notice that I can only show todays birthdays and it is separate from the events. I want to combine them: I don't want to post instructions until I have finished this hack. I am still planning on incorporating Birthdays into the upcoming events and putting two options in the user control panel: One to select yes/no whether to display upcoming events at all, another to select how far into the future they want events displayed (1week, 2 weeks, 1 month). Once I have those things finished I will post instructions.. |
#88
|
|||
|
|||
Progress?
|
#89
|
||||
|
||||
none.. I have tried every combination of syntax I can think of to form a UNION query to combine the Events with the Birthdays. No Luck.. and I have been unsuccessful in getting anyone to help.
Im not a php mysql programmer but I do program in SQL so I figured it shouldnt be too difficult... I was wrong I guess.. PLEASE HELP, SOMEONE.... I need to figure out how to combine events from calendar_events with birthdays from the users table. and sort them all by date... thx |
#90
|
|||
|
|||
I wouldn't mind seeing this either.
Anybody? |
#91
|
|||
|
|||
What about showing a weeks worth of "Upcoming Events" ?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|