PDA

View Full Version : [RELEASE v2] Today's Events on Main Forum Page


mister
25 Jun 2001, 15:53
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:
http://www.pubarso.com/misc/todaysevents.gif
Linear:
http://www.pubarso.com/misc/todaysevents_linear.gif

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


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


calendar_privateevent_linear


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


3) edit todaysevents.php to either show bulleted or linear events (comment or uncomment the corresponding eval statement)
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:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



add this:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



3) edit the 'forumhome_loggedinusers' template
change this:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




to this:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



4) 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


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


calendar_privateevent_linear


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


5) edit todaysevents.php to either show bulleted or linear events (comment or uncomment the corresponding eval statement, and the line near the end doing the substr)

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)
http://www.vbulletin.org/forum/showthread.php?s=&postid=141943#post141943

Balbanes
25 Jun 2001, 16:09
demo??

cool hack

Martz
25 Jun 2001, 16:25
Nice concept, and I am sure a good hack also :)

@ Balbanes: what do you need a demo for? There is a screenshot and description showing that it lists todays events in the calendar in a similar fashion to online users/birthdays.

mister
25 Jun 2001, 16:26
i just added the screenshot after he requested it :)

BradC
25 Jun 2001, 16:49
Looks interesting I might have to try this out! :)

thanks!

TigerLily
25 Jun 2001, 17:11
Thank you so much for making this hack!!! I was using a piece of code from Wajones' vbportal a while back, but couldn't get it to work after upgrading to 2.0.0 (I'm now on 2.01) I'm still learning PHP, so I'm sure it was a user error on my part!

Thanks so much!
TigerLily:)

TigerLily
25 Jun 2001, 17:28
Question: Is there a way to remove the bullet and have the event on the same line as "Today's Events"? I use mine at the top of my forums, and would love to save as much space as possible.
Thanks again!
TigerLily:)

mister
25 Jun 2001, 18:13
Yea.
I just did this real quicky, and used the same template used in the calendar. I may change this for v2.0 just because it will save alot of space.

Steve Machol
25 Jun 2001, 18:22
Thanks Brandon! This is just what I've been looking for.

One question: I assume the 'private' events will only show for the owner of that event, correct?

mister
25 Jun 2001, 18:31
that is correct.

private events show only to their owner

sysmom
25 Jun 2001, 21:40
Oh, I already gushed over this in my requests thread, but let me gush here, too!

Thank you!

My only question before I try this is ...

If I don't have birthdays enabled, will it still work?

-deb

P.S. Thank you so much. I'm in awe.

*gush*

mister
25 Jun 2001, 21:42
it wont show up if you have 'show logged in users' off.

(i didnt feel liek going all out and having a separate config option...so i put it in with the 'show logged in users' option)

sysmom
26 Jun 2001, 00:00
Mister:

You had great instructions, the installation went perfect, and it's now working at our new board.

I may play around with the placement on the main page -- I'll let you know if I can't figure that out.

The only other thing I'd could possibly ask for it to do is flag a reminder for an event tomorrow.

Thanks so much, this is GREAT!!

Kudos!

Props!

Wild Cheering!

-deb

Steve Machol
26 Jun 2001, 05:54
Worked great! The only thing is that I tried to add $todaysevents to my forumhome_pmloggedin template but it doesn't show. The reason I did this is because I have the Private Messages box at the top of the forum page and would like to have Today's Events there as well. I don't really want the Currently Active Users at the top of the page though.

If you're still bored, could you tell me how to do this?

Oh and one other thing - I noticed that the event for today stopped displaying when the server's time went past midnite. It looks like this isn't tied into the users time like $birthdaybits is. (Today's birthday still displayed.)

Thanks again!

rockergrrl
26 Jun 2001, 06:09
I think I love you! ;)

I've been waiting for this... the girls on my board have been asking for this for a while...

Now I'm off to set it up.... :)

mister
26 Jun 2001, 14:24
Originally posted by smachol
Worked great! The only thing is that I tried to add $todaysevents to my forumhome_pmloggedin template but it doesn't show. The reason I did this is because I have the Private Messages box at the top of the forum page and would like to have Today's Events there as well. I don't really want the Currently Active Users at the top of the page though.

If you're still bored, could you tell me how to do this?

Oh and one other thing - I noticed that the event for today stopped displaying when the server's time went past midnite. It looks like this isn't tied into the users time like $birthdaybits is. (Today's birthday still displayed.)

Thanks again!


forumhome_pmloggedin is evaluated before the $todaysevents in the hack code is. that may have something to do with it.

if you want the $todaysevents to show up there, move the require('./todaysevents.php'); up before the pm stuff in index.php

and yes, i should fix the time problem. didn't even think about that. next version...

janw
26 Jun 2001, 14:57
Great hack! Installed it right away... :)

sysmom
29 Jun 2001, 13:57
Not content with perfection ...

I tried to move this display into the header template.

I've failed. :(

Here's what I did:

1. I moved the require statement in index.php up to the top, just under the:

require('./global.php');

2. I changed the $todaysevents in todaysevents.php to add some HTML for a boxed in announcement.

3. I added $todayseventsClose to todaysevents.php to close up said HTML, I added it right under the $todaysevents line

4. I modified the header template to add

$todaysevents
$todayseventsClose

just after the last TD of the basic template.

What did I miss? :( :( :(

I get no errors. But I don't get an event either.

-deb

mister
29 Jun 2001, 14:46
hmm.

theres an event scheduled for today, right?

sysmom
29 Jun 2001, 15:05
Yup, I put a test event in today. When I revert the files, it shows up fine.

I feel real dumb.

-deb

Steve Machol
29 Jun 2001, 23:56
Originally posted by mister
if you want the $todaysevents to show up there, move the require('./todaysevents.php'); up before the pm stuff in index.php

This worked perfectly - thanks! :)

One other slight thing - how can I change the font color to match the standard text color rather than the calendar text?

On second thoguht - that's not a big deal. I'll just change the calendar colors.

mister
30 Jun 2001, 09:44
Originally posted by smachol


This worked perfectly - thanks! :)

One other slight thing - how can I change the font color to match the standard text color rather than the calendar text?

On second thoguht - that's not a big deal. I'll just change the calendar colors.

you could make your own templates, instead of using the default calendar ones ... i just used those becuase they were there :)

Steve Machol
30 Jun 2001, 17:22
Yeah I just changed the calendar colors for all my style sets. It was something I needed to do anyway. The default Calendar colors weren't compatible with some of my styles.

Steve Machol
01 Jul 2001, 21:05
With the start of a new month, Today's Event suddenly stopped working. Nothing is showing up anymore even though there are two events on my Calendar. I haven't made any changes at all.

Any idea what could be wrong? :confused:

boatdesign
02 Jul 2001, 00:46
Would it be possible to show "This Week's Events" instead of "Today's Events"? Probably all in one group still (not by day) to save space.

sysmom
02 Jul 2001, 01:41
Ouch, my Today's events aren't working with the new month, either.

Steve Machol
02 Jul 2001, 03:25
Originally posted by SysMom
Ouch, my Today's events aren't working with the new month, either.

That confirms it. If it's happening to both of us it must be a bug.

Can you take a look at this mister? Thanks!

mister
02 Jul 2001, 04:35
yea, ill take a look at it..

EDIT: works fine for me.. got a url i can look at?

sysmom
02 Jul 2001, 18:17
Mister:

I'm sorry, the board isn't available to the public. :( Otherwise, I'd LOVE for you to look at the thing.

I'll go back and double check everything.

deb

Steve Machol
02 Jul 2001, 18:36
Originally posted by mister
yea, ill take a look at it..

EDIT: works fine for me.. got a url i can look at?

My URL is in my sig. I entered another test event for today and it still doesn't show up. In my case, I moved the Today's Events to under the Private Messaging box. It worked fine until July 1st.

sysmom
02 Jul 2001, 18:46
I just installed the version 3 todaysevents.php and all is well again.

So I don't know if I inadvertantly did something to cause it to break between Saturday and Sunday or if the new version was the fix!

But it's working fine.

I'm still trying to figure out how to get it to display in either the header template or at the top of the forumhome one.

The header file is real tempting -- I hand inserted an announcement in there today, and sort of like it showing up at the top of every page.

deb

Steve Machol
02 Jul 2001, 19:03
Wow - I didn't even notice there was a version 3, or version 2 for that matter!

I'm off to install version 3 to see if that fixes the problem.

Yep - version 3 fix the problem. However I just noticed something weird. When I use the 'bulleted list, it uses the calendar event font color. But when I use linear, it uses some a green color which I don't have in that style. Linear also adds a comma at the end of the list.

Steve Machol
02 Jul 2001, 19:32
I see what happened now. The template codes in the first message picked up this forums calendar colors rather than { calpubliccolor } and { calprivatecolor }.

mister
02 Jul 2001, 20:16
yea, i just used the default calendar template, and then made my own for the linear listing ...

if you want them to use your own colors, just make your own template and edit the todaysevents.php file...

Steve Machol
02 Jul 2001, 20:21
Originally posted by mister
yea, i just used the default calendar template, and then made my own for the linear listing ...

Actually what I meant was that when you posted the code for the linear templates, this forum converted your { calpubliccolor} (without the space) to {calpubliccolor} - the color used in this forum.

Check your first message and you'll see what I mean. :)

mister
04 Jul 2001, 09:52
ahh.... ill fix that.

TurboFC3S
09 Jul 2001, 19:01
Nice hack... what would I change to do events for this week, or events for this month?

Thanks

mister
09 Jul 2001, 20:53
mess with the where clause of the sql query, and possibly $today.

:)

Matt*is*thick
17 Jul 2001, 22:42
Thanks, this hack is just what I have been looking for! Its great :)

Artemido
19 Jul 2001, 18:17
Anyone notice that the private event color is the same as the public event color even when you've changed them to be totally different colors? Change the public color, the private color follows... I just installed this yesterday, so I assume I have the latest version. Thanks!

mister
19 Jul 2001, 18:36
Yea.. i think i copied/pasted code, and forgot to change a word when doing a gettemplate()

I'll put a new version online tonight when I get home.
It'll have 2 little fixes.

RobAC
19 Jul 2001, 18:45
Originally posted by mister
Yea.. i think i copied/pasted code, and forgot to change a word when doing a gettemplate()

I'll put a new version online tonight when I get home.
It'll have 2 little fixes.

LOL....I just installed this for the first time, and already it's getting upgraded. :D

mister
20 Jul 2001, 17:40
new release .. verison 4 -- check the first post for the attached zip

easy upgrade for v2&3 users, just upload the new todaysevents.php

mister
20 Jul 2001, 17:55
version 4

Kengan
23 Jul 2001, 08:29
Thanks for Hack the code ! Very useful !

:cool:

Dave#
23 Jul 2001, 12:22
how would one make the events be pulled from this week or even this month?

mister
23 Jul 2001, 20:53
mess with the where clause of the sql query, and possibly $today.

:)

Dave#
23 Jul 2001, 21:30
Originally posted by mister
mess with the where clause of the sql query, and possibly $today.

:)


mmm



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



How do we make this a week?

mister
24 Jul 2001, 04:52
check out calendar.php

you'll need to do something like this



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



and then loop thru $events to the current week, etc..

this hack is for the event of the day, and im pretty busy, or else i'd help further... sorry

Dave#
24 Jul 2001, 08:36
Originally posted by mister
check out calendar.php

you'll need to do something like this



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



and then loop thru $events to the current week, etc..

this hack is for the event of the day, and im pretty busy, or else i'd help further... sorry

Thanks - if you ever get the time I would really appreciate this hack to encompass more than a day as the coding is a little beyond me

Dave

Dave#
25 Jul 2001, 21:08
just a gentle bump

CCarissa
28 Jul 2001, 23:01
I tried to install this with no success. :(

When i try to access my forum I get an error on line 79 of my index.php file.

What did i do wrong?

mister
30 Jul 2001, 04:46
paste line 79 of your code into a reply, and we'll see whats happening....

CCarissa
30 Jul 2001, 05:32
Here's line 69....



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



its a few lines under the new stuff......


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



I really appreciate people looking at this for me. :)

mister
30 Jul 2001, 14:58
can you also paste the error

(and did you mean line 69 or 79?)

CCarissa
30 Jul 2001, 15:10
It was line 79......and darn it if i didnt save the error message. And i dont want to interrupt my users now.

Lets see if i can remember it. I think it was something like, "there is a parse error on line 79 of index.php"

mister
30 Jul 2001, 17:46
ok well

you pasted line 69... i'd need to see line 79 if the error was on line 79


all you have to do to index.php is

after this:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



add this:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------





my guess is either you mistyped that, or there was a problem copy/pasting it.

also, make sure that todaysevents.php is in the same directory as index.php (the main vbulletin dir)

CCarissa
30 Jul 2001, 17:57
Im still pretty sure i posted line 79. *confused*

Thanks. I'll try that tonight when the board isnt busy. :)

mister
01 Aug 2001, 21:16
Originally posted by CCarissa
Here's line 69....


i think i was confused by that

CCarissa
01 Aug 2001, 21:27
D'oh.....sorry, twas a typo

sysmom
04 Aug 2001, 17:14
Is it just me, or is there only one event allowed per date?

I don't know if it might be related to the Today's Event addition, but I suspect it isn't.

I try to add a second event to the calendar, it takes the place of the first, the previous one does not appear on either the calendar, or the Today's Events listing.

I upgraded to vb2.03 the other day, if that matters. Although I don't recall scheduling more than one thing before anyway.

-deb

mister
05 Aug 2001, 12:34
i just tested it out on my board

2.0.3 w/this todays-events hack.

worked fine.

two events.
both on calendar
both on main page

maybe re-upload calendar.php, make sure you have 2.0.3's version (not to say it isnt there already...but just in case)

Jakeman
22 Aug 2001, 02:19
just installed v4. first time using this hack. works great.

two comments:
1) it would be nice to have a condition where if there are no events for that day it says 'none', or something to that effect.
2) i too would like to have this functionality in my header. i didn't see any 'how to' things in this thread for that.

on the same note. what php file controls functionality in the header?

butty
22 Aug 2001, 03:47
what a great hack, a doddle to install and so effective

good work!!!

sysmom
22 Aug 2001, 05:56
Jakeman:

I did move it to the header, and regretted it.

Although it works FINE in displaying the event for that day, it 'breaks' your calendar, and you can only have one event per day, the last one that was entered.

I suspect a variable is being tromped on, but I haven't looked into it.

So, when I did the 2.03 update, I didn't put it back in the header, and I'm ... gonna get around to it someday, but I don't think I have the luxury of breaking two events on any day just now.

-deb

Jakeman
02 Nov 2001, 21:43
anyone else had any luck moving this functionality into the header?

TheCaver
03 Nov 2001, 22:37
Has anyone gotten this to display the next WEEKS events? or next MONTHS events?

Its a GREAT hack, but to me, telling someone that there is an event today is a bit late :)

JC

Jakeman
04 Nov 2001, 03:21
i agree.

what would be pimp is to have a stand alone hack for a calendar like vbportal's calendar. http://www.phpportals.com/

Jakeman
04 Nov 2001, 04:08
hoorj! http://www.vbulletin.org/forum/showthread.php?s=&threadid=32087

TheCaver
08 Nov 2001, 04:50
I modified this to show the next months events but when I click on an event, it does not show the date in the calendar template.

I know, this should be over at vb.com but they said come here! :mad:

Anyone know how to hack the date into the calendar template to show what day you are looking at?

Thanks much,

JC

Sascha
22 Nov 2001, 11:28
any changes in this Hack on vB 2.2.x ?

I canīt find:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



in index.php


:confused:


Sascha

jamie
23 Nov 2001, 11:16
[stupid q]

where is the link to the todaysevents.php file?

[/stupid q]

:o

god bless

mister
23 Nov 2001, 14:38
http://www.vbulletin.org/forum/attachment.php?s=&postid=141943

Thats the link to the attachment.
It was in one of my replies on page 3, i believe.
The link in the first post has been updated.
It still referenced vbulletin.com, not vbulletin.org

:)

jamie
23 Nov 2001, 16:35
:o

much appreciated! :)

Logtenberg
27 Nov 2001, 06:22
I am trying to make some slight html modifications to the code.


Unfortunately I do not know php so, I usually play around with the code until what I get what I need done. With this hack, I can't seem to figure out how to add some code after the events have been displayed.

Basically, - I want to have a "</td></tr></table>" to close up my "Today's Events"

I am used to code like

write.line "</tD></tr></table>"

What is the PHP equivalent?

I was thinking of adding this just above the last } in todaysevents.php

Thanks For your help! :)

kyrnel
29 Nov 2001, 02:46
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:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



I also modified the hack to display "None" if there are no events found. You just have to add an 'else' clause to the If/Then statement.
Im running into 2 problems. (1) The function designed to remove the trailing commas does not seem to work. The code is this:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


This doesnt seem to do anything at all because I have modified it and nothing changes. Any ideas?

(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

kyrnel
29 Nov 2001, 03:15
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.

RobAC
29 Nov 2001, 04:07
Kyrnel,

If you finally get this working, let me know. I've been wanting to display events ahead of time on my own forums.

kyrnel
29 Nov 2001, 15:33
Originally posted by RobAC
Kyrnel,

If you finally get this working, let me know. I've been wanting to display events ahead of time on my own forums. I dodnt have any trouble only displaying events from a longer period of time. See my first post, all you have to do is modify the SQL SELECT query in todaysevents.php. You can use the number 14 to display the next 2 weeks or change that number to any number of days from today.

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.

RobAC
29 Nov 2001, 15:41
Awesome! Thanks! :)

mister
29 Nov 2001, 18:28
Don't write anything from the php files.
Use the vbulletin template system.

Put the html you want in 'forumhome_loggedinusers' template.

kyrnel
30 Nov 2001, 04:05
Mister,

What is the purpose of this code:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


I can't see that $caltitlelength is ever given a value. Is it set in another php file? If so what file?

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

kyrnel
30 Nov 2001, 04:35
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

Logtenberg
03 Jan 2002, 02:31
Originally posted by kyrnel
I dodnt have any trouble only displaying events from a longer period of time. See my first post, all you have to do is modify the SQL SELECT query in todaysevents.php. You can use the number 14 to display the next 2 weeks or change that number to any number of days from today.

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.


Can you show a screen shot or url of your events hack? I really want to implement this on my site.

Thanks!

Lucky
03 Jan 2002, 11:43
Nice job!

Very useful hack!

kyrnel
03 Jan 2002, 15:20
Originally posted by Logtenberg
Can you show a screen shot or url of your events hack? I really want to implement this on my site.
Thanks!

I still havent figured out how to incorporate birthdays into upcoming events. Even though they show up on the calendar, they are not stored in the same place as calendar events.

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:
http://www.famspace.com/pics/screen1.jpg

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:
http://www.famspace.com/pics/screen2.jpg

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..

SirSteve
14 Jan 2002, 04:44
Progress?

kyrnel
14 Jan 2002, 15:00
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

Lucky
17 Jan 2002, 11:24
I wouldn't mind seeing this either.

Anybody?

SirSteve
17 Jan 2002, 14:15
What about showing a weeks worth of "Upcoming Events" ?

kyrnel
17 Jan 2002, 14:34
Originally posted by SirSteve
What about showing a weeks worth of "Upcoming Events" ? All you have to do is modify the SQL command I posted earlier replacing 14 with 7 as the number of days to display upcoming events. The problem still remains that the Upcoming events does not include birthdays becasue they are stored in a separate table than the other calendar events.

SirSteve
17 Jan 2002, 14:41
Ok, cool. I don't allow birthdays to display publicly anyway so this will work for me! :)

After looking at it, what is the code that pulls the "upcoming events" in?

tripps
18 Jan 2002, 01:44
Anyone have a version of this that works with 2.2.1?

Some of the calendaring code, it seems, was recently changed. Parts of forumhome_loggedinusers have been moved to forumhome_birthdaybit, and the hack no longer works...

kyrnel
18 Jan 2002, 05:00
what i posted was on 2.2.1 but my templates are highly modified so you are on your own there..

Steve Machol
18 Jan 2002, 05:16
Originally posted by tripps
Anyone have a version of this that works with 2.2.1?

Some of the calendaring code, it seems, was recently changed. Parts of forumhome_loggedinusers have been moved to forumhome_birthdaybit, and the hack no longer works... I had no problem with this when I upgraded to 2.2.1. it still works on my forum.

PhotoGenie
18 Jan 2002, 18:17
I have everything installed on this hack with one minor problem. I did not have this code in my forumhome_loggedinusers template,

$birthdaybits</smallfont></td>

so I put this,

$birthdaybits
$todaysevents</smallfont></td>

under,

$activeusers</smallfont>

I must have done something wrong because it works ok for events but when there is a birthday and event both together, events goes to the top of my page in a black background.

Can anyone tell me where I'm messing up?

Looks Great!!

Thanks :)

kyrnel
18 Jan 2002, 21:33
yes, when that happens it is usally becasue you opened a new <tr> flag (table row) without closing it. I modified all my templates to be much more modular. The problem is that some of the templates in vB are designed to be inside a <tr> flag and some have the <tr> flag inside them so when you rearrange the templates you have to make sure the HTML tags are nested properly. I always turn on my Template names in the Admin COntrol Panel/Options and debug my HTML source. That is the only way I can think of to make it work. I cant really post my templates because Im certain they would cause the same problem taken out of context.

PhotoGenie
18 Jan 2002, 22:10
Thank you.. I managed to get it fixed with your advice.. :up: They are both showing together and seperate now.. This is really great.. Thanks again

Shenlong
19 Jan 2002, 02:47
3) edit the 'forumhome_loggedinusers' template

I dont have that thing in my forumhome_loggedinusers, heres what my template reads:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Any suggestions?

PhotoGenie
19 Jan 2002, 06:58
I am no expert, I am just a newbie but this is what I did because when I just inserted in I had an error

In the forumhome_loggedinusers I created another table at the bottom and put the code in it like this

<tr id="cat">
<td bgcolor="{categorybackcolor}" colspan="6"><a href="online.php?s=$session[sessionhash]"><normalfont color="{categoryfontcolor}"><b>Currently Active Users</b></normalfont></a><normalfont color="{categoryfontcolor}"><b>: $totalonline</b></normalfont></td>
</tr>
<tr>
<td bgcolor="{firstaltcolor}" colspan="6"><smallfont>
<nobr>There are currently $numberregistered members and $numberguest guests on the boards.</nobr> |
<nobr>Most users ever online was $recordusers on $recorddate at $recordtime.</nobr><br>
$activeusers</smallfont></td>
</tr>
</tr>
<tr>
<td bgcolor="{firstaltcolor}" colspan="6"><smallfont>
$birthdaybits
$todaysevents</smallfont></td>

</tr>


then I went into forumhome_birthdaybits and removed it from tables like this..

<bgcolor="{firstaltcolor}" colspan="6"><smallfont>
Today's Birthdays: $birthdays</smallfont>


Mine works fine and looks right..

azork
21 Jan 2002, 00:15
what do you put in the todaysevent.phpfile?

SirSteve
21 Jan 2002, 04:24
Originally posted by kyrnel

I modified the hack to display events for the next two weeks by modifying the SQL query to this:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



I also modified the hack to display "None" if there are no events found. You just have to add an 'else' clause to the If/Then statement.

How is the "Upcoming Weeks" part pulled in? By the same $todaysevents ?

And where is that If/Then statement to change for "None" ?

Floris
03 Feb 2002, 19:03
In your instructions you say: Edit template forumhome_loggedinusers from $birthdaybits to $birthdaybits then $todaysevents then the smallfont and end tag for the cell.

This is how my 'vB 2.2.2' ORIGINAL template looks like:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



And after $activeusers it doesn't say $birthdaybits .. so that template is wrong!


I fixed this by going to that template and just add $todaysevents right below $activeusers and then edited the todaysevents.php file by replacing the original line with:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



So instead of that <hr> It now gets displayed in its own cell, why is this needed?

If either a birthday isn't there, or no event, an empty table screwup will appear with a single line that looks like an empty cell.

rishel
20 Feb 2002, 20:20
Is there a way to put this on a non VB page, where it actually lists the events? Say on the index page of a website ( in our case we use an index.php page etc )?

mondaynightmike
02 Mar 2002, 14:43
reat hack just installed, thanks.

tanster
10 Mar 2002, 00:49
This is wonderful, and your instructions were great. Thank you!

:) Jennie

Sadie Frost
02 Apr 2002, 14:48
If anyone else is having the problem where birthdays and events on the same day conflict and cause events to move to the top, what worked for me was to move $todaysevents before $birthdaybits (I have these in my forumhome).

http://www.after-darkness.com

syion
02 Apr 2002, 22:40
Is it possible to have the events show up on NON VB pages ?

I want the upcoming events to show up on my web sites main page.

Thanks, this it really a great hack !

amsch
10 Apr 2002, 20:10
Anyone having problems with 2.2.4? I ca not get mine to show up and everything is correct. I get this error,
Fatal error: Call to undefined function: vbdate() in /home/sites/20ishparents.com/web/boards/todaysevents.php on line 19

Steve Machol
10 Apr 2002, 20:32
I've used this successfully on every version from 2.0.3 to 2.2.5. Never had a problem.

Floris
30 Apr 2002, 23:28
You are not the only one smachol :) no probs here too, and integrated with vB very nice :)

geniuscrew
01 May 2002, 01:41
Is it possible to show an image, underneath the event (relating to the event, of course ;)) on the main page? That'd be cool.

Thanx

RaZor Edge
28 Jun 2002, 04:33
There's something in this hack who will not work with latest version of Vbulletin because $birthdaybits is now independant of 'forumhome_loggedinusers'. It's now on template "forumhome_birthdaybit "

So... here what I do for correct the situation (mod of the original instal instruction)

a) In step 2

you must search for

if ($showbirthdays) {

instead of

if ($displayloggedin) {

and apply the code after "if ($showbirthdays)"

In step 3

Instead of template 'forumhome_loggedinusers', you must use 'forumhome_birthdaybit '.

So, in forumhome_birthdaybit templates, change this:


<tr>
<td bgcolor="#13486D" colspan="6"><smallfont>
Today's Birthdays: $birthdays</smallfont></td>
</tr>

For this:


<tr>
<td bgcolor="#13486D" colspan="6"><smallfont>
Today's Birthdays: $birthdays $todaysevents</smallfont></td>
</tr>


All others step are the same.

You can look at the results at my 2.2.6 vBulletin board here (http://www.fnlutte.com/forum/)

ForKmaN
14 Jul 2002, 13:55
Is it possible to make it so a Calender event will popup when a user goes to the forum??

ForKmaN
14 Jul 2002, 14:18
Ok mine only shows up when I have a birthday on the same day as the event ...

BigJohnson
14 Jul 2002, 16:40
hhmm. My $birthdaybits is in the formhome template what do i do about that? Because mine is not showing up neither. Please help me out. Thanks.

BigJohnson
14 Jul 2002, 18:05
Ok it works now but i see the comma at the end. Why is that and how do i fix it?

Steve Machol
14 Jul 2002, 19:09
I put mine in the forumhome_pmloggedin and put $pminfo at the top of forumhome.

ForKmaN
15 Jul 2002, 03:00
? How did you fix it BigJohnson?

doodio
02 Aug 2002, 01:10
How do i make this to work on non-VB page? This would be great.

ForKmaN
11 Aug 2002, 03:52
make it popup!! :D

Hubsi
12 Aug 2002, 23:42
how can i make it that it shows the events when there is no birthday on that day?

Smirks
30 Sep 2002, 17:38
Originally posted by Hubsi
how can i make it that it shows the events when there is no birthday on that day?
Yes. I have that problem too...

I only get events displayed if there is a birthday on the same day. How can I get it to show events independant of b-days?

Thanks.

Hubsi
03 Oct 2002, 21:09
????

push :D

Dark_Wizard
05 Nov 2002, 13:34
Originally posted by Hubsi
????

push :D

Very simple...

Place this:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



After this:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Instead of where the instructions said.

I'm going to make some changes to this script if anyone is interested...I will be adding the following:

* List upcoming events instead of just today's events.
* List the date with the event as well.

Smirks
05 Nov 2002, 17:50
Originally posted by Dark_Wizard


Very simple...

Place this:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



After this:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Instead of where the instructions said.

I'm going to make some changes to this script if anyone is interested...I will be adding the following:

* List upcoming events instead of just today's events.
* List the date with the event as well.

That didn't work. I still had the same bahavior as before.

Please keep me (us) posted on when the changes will be available! Thanks!

lifesourcerec
15 Jan 2003, 09:28
Originally posted by kyrnel


I still havent figured out how to incorporate birthdays into upcoming events. Even though they show up on the calendar, they are not stored in the same place as calendar events.

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:
http://www.famspace.com/pics/screen1.jpg

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:
http://www.famspace.com/pics/screen2.jpg

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..

I am looking for Today's event & Upcoming Events online, so if you don't figure out the incorporating birthday thing, please post the upcoming event hack :).

kyrnel
15 Jan 2003, 14:50
The only thing keeping this from happening is that a SQL UNION query needs to be created to combine the Events from the Calendar with the Birthdays from the User Profiles. I have tried this but I keep running into a syntax issue that keeps it from working. I have not found anyone who will help.

matthew tucker
31 Jan 2003, 22:36
I'd love to install this hack but ... maybe I'm blind but I can't figure out where to get [todaysevents.php] from this thread. It doesn't appear to be linked in first post ... do I have to create a new file myself?

lifesourcerec
15 Feb 2003, 08:24
Originally posted by Dark_Wizard


Very simple...

Place this:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



After this:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Instead of where the instructions said.

I'm going to make some changes to this script if anyone is interested...I will be adding the following:

* List upcoming events instead of just today's events.
* List the date with the event as well.


Any luck on upcoming events?

Dark_Wizard
15 Feb 2003, 11:55
Originally posted by lifesourcerec


Any luck on upcoming events?

Actually yes...it is done and I have to document the changes...you can see it here (http://www.dpclan.com/forums/).

lifesourcerec
15 Feb 2003, 12:54
TIGHT! setup :)

Keep me posted.

Dark_Wizard
15 Feb 2003, 14:16
Here it is...enjoy!

/edit..
Updated this to work with Today's Events and removed the event for the current day from the upcoming events. Fixed 1 minor bug.

lifesourcerec
16 Feb 2003, 01:57
How can I have both at same time. It's doing both linear and bulleting. Looks like this:



Upcoming events:
2002-2003 Fleer Platnium (Bsb)2002-2003 Fleer Platnium (Bsb), 2003 Topps Heritage (bsb), Chat Night (7pm central time), Chat Night (7pm central time), 2002-2003 Fleer Focus Jersey edition (Bsk), 2003 Upper Deck Play Ball (bsb), Chat Night (7pm central time), 2003 Upper Deck Victory (bsb)


No break between Today's event and upcoming events and list today twice.

Dark_Wizard
16 Feb 2003, 14:32
Originally posted by lifesourcerec
How can I have both at same time. It's doing both linear and bulleting. Looks like this:



No break between Today's event and upcoming events and list today twice.

I don't see anything bulleted so you lost me there...I only see it wrapping. As for seperating todays events from the upcoming events, the easiest way would be to rename the file I sent to upcomingevents.php and create a seperate section for it in the forumhome template and add the include to the index.php file, create new templates for it and modify the code to eval the new templates and then use the original todays events in it's own section.

lifesourcerec
16 Feb 2003, 16:23
Ok, got them working great. Now trying to figure out how to make the today's events to say "NONE".

Dark_Wizard
16 Feb 2003, 20:17
Originally posted by lifesourcerec
Ok, got them working great. Now trying to figure out how to make the today's events to say "NONE".

Follow the coding that I did in upcoming events...it is very easy...

lifesourcerec
17 Feb 2003, 03:54
Originally posted by Dark_Wizard


Follow the coding that I did in upcoming events...it is very easy...

I added this:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



But still doesn't work.

matthew tucker
17 Feb 2003, 06:30
a wee typo there I think darkwizard in install.txt:

[code]<b>Upcoming events:</b></normalfont><?td></tr>[code]

change the ? to a /

also lifesourcerec, I found that changing the code a bit in todaysevent.php thusly at about line 27:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



means that if there are no events, nothing at all is displayed.

For a really minimal text result, I also removed all the <table> code around "$todaysevents" in forum home template, removed the <li> tags in the templates and terminated each line with <br/> so the result ends up as

Upcoming events:
2003-02-17: test event
2003-02-18: The ASE Animation night - Melbourne
2003-02-21: another test event

Good hack Dark_Wiz, much better than my own original version; now to get it working in vbhome(lite)!!

lifesourcerec
17 Feb 2003, 10:08
Originally posted by matthew tucker
a wee typo there I think darkwizard in install.txt:

[code]<b>Upcoming events:</b></normalfont><?td></tr>[code]

change the ? to a /

also lifesourcerec, I found that changing the code a bit in todaysevent.php thusly at about line 27:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



means that if there are no events, nothing at all is displayed.

For a really minimal text result, I also removed all the <table> code around "$todaysevents" in forum home template, removed the <li> tags in the templates and terminated each line with <br/> so the result ends up as

Upcoming events:
2003-02-17: test event
2003-02-18: The ASE Animation night - Melbourne
2003-02-21: another test event

Good hack Dark_Wiz, much better than my own original version; now to get it working in vbhome(lite)!!

I got both installed but today's events still using "bullet" instead of linear. I removed the <li> also. Still get that same thing.

lifesourcerec
17 Feb 2003, 10:23
For some reason, it's listing the first event twice (run in together).


* 2003 Topps Heritage (bsb)2003 Topps Heritage (bsb)

Dark_Wizard
17 Feb 2003, 18:40
Ok...I made some changes and have them both working on my forum home (http://www.dpclan.com/forums), Todays Events and Upcoming Events...I will post a seperate thread for this hack later today after I document it.

lifesourcerec
17 Feb 2003, 22:01
Originally posted by Dark_Wizard
Ok...I made some changes and have them both working on my forum home (http://www.dpclan.com/forums), Todays Events and Upcoming Events...I will post a seperate thread for this hack later today after I document it.

Ok. Thanks. I got the upcoming events working great. It's just now the Today's Event is messed up now.

Dark_Wizard
18 Feb 2003, 14:43
Originally posted by lifesourcerec


Ok. Thanks. I got the upcoming events working great. It's just now the Today's Event is messed up now.

I uploaded the new update...you can find it here (http://www.vbulletin.org/forum/showthread.php?postid=354306#post354306).

lifesourcerec
18 Feb 2003, 15:15
The no Events works, but from some reason, it still shows double
such as:

testtest

Dark_Wizard
18 Feb 2003, 16:09
Originally posted by lifesourcerec
The no Events works, but from some reason, it still shows double
such as:

testtest

Are you using the html I sent?

lifesourcerec
19 Feb 2003, 01:28
Originally posted by Dark_Wizard


Are you using the html I sent?

No. Just using the "$todaysevents" variable. Had an empty space on the site where I inserted it. I'll try to figure a way around it. Main page crowded, so I'm compacting a lot of stuff.

Dark_Wizard
21 Feb 2003, 13:12
I see you fixed it...I have made some changes to it as well and you can see it on my page...

lifesourcerec
22 Feb 2003, 07:54
It's not fixed. Still prints it twice whenever there is an event.

lifesourcerec
25 Feb 2003, 02:11
I just re-installed it and there is no space or commons to separate each event.

[SKR]Abe
31 Mar 2003, 14:26
Im using VB version 2.2.something.

Can someone put together a real "simple" guide for me on how to install this.

I want the next 7 days events listed in bullet format.

Remember, really simple - Im completely new to this lark. (I have dabbled in Admin CP)

MACHOBY
01 Apr 2003, 03:29
I am not too familiar with hacking and coding but would like to add this hack. I opened the todaysevents.php but don't know how to comment or uncomment. Could someone paste the linear version here?

Also, I opened forumhome_loggedinusers template but cannot find $birthdaybits</smallfont></td>

here is mine:
<tr id="cat">
<td bgcolor="{categorybackcolor}" colspan="6"><a href="online.php?s=$session[sessionhash]"><normalfont color="{categoryfontcolor}"><b>Currently Active Users</b></normalfont></a><normalfont color="{categoryfontcolor}"><b>: $totalonline</b></normalfont></td>
</tr>
<tr>
<td bgcolor="{firstaltcolor}" colspan="6"><smallfont>
<nobr>There are currently $numberregistered members and $numberguest guests on the boards.</nobr> |
<nobr>Most users ever online was $recordusers on $recorddate at $recordtime.</nobr><br>
$activeusers</smallfont></td>
</tr>



Any help would be very appreciated!

MACHOBY
04 Apr 2003, 21:54
Is there any way to put this hack on my index.htm page?

dawn
18 Apr 2003, 00:32
Ive no idea whats going on with my process. It shows nothing.

Im using vb 2.3

Ive looked for $showbirthdays or $$displayloggin at index.php and there were not there.

I tried to install all the updated hacks and nothing.

any idea how to install it?

dawn
22 Apr 2003, 00:29
Help!!!

please... I've followed same instruction, did some changes and nothing.

vb 2.3

dawn
02 May 2003, 03:00
I fixed it, but now when I have events in todays events it makes it double, such as eventevent

It's fixed too. My problem was to have at index.php the require(/todaysevents) double, one at the top then the other one below to $displayloggedin.

Im done.

RetroDreams
17 Aug 2003, 07:30
How can you modify this so that the $eventdate can be in a different format like M-D-Y?