View Full Version : [RELEASE v2] Today's Events on Main Forum Page
mister
06-24-2001, 10:00 PM
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
<a href="calendar.php?s=$session[sessionhash]&action=getinfo&eventid=$eventid"><smallfont color="{calpubliccolor }">$eventsubject</smallfont></a>,
calendar_privateevent_linear
<a href="calendar.php?s=$session[sessionhash]&action=getinfo&eventid=$eventid"><smallfont color="{calprivatecolor }">$eventsubject</smallfont></a>,
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:
if ($displayloggedin) {
add this:
require('./todaysevents.php');
3) edit the 'forumhome_loggedinusers' template
change this:
$birthdaybits</smallfont></td>
to this:
$birthdaybits
$todaysevents</smallfont></td>
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
<a href="calendar.php?s=$session[sessionhash]&action=getinfo&eventid=$eventid"><smallfont color="{calpubliccolor }">$eventsubject</smallfont></a>,
calendar_privateevent_linear
<a href="calendar.php?s=$session[sessionhash]&action=getinfo&eventid=$eventid"><smallfont color="{calprivatecolor }">$eventsubject</smallfont></a>,
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)
https://vborg.vbsupport.ru/showthread.php?s=&postid=141943#post141943
Balbanes
06-25-2001, 02:09 PM
demo??
cool hack
Martz
06-25-2001, 02:25 PM
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
06-25-2001, 02:26 PM
i just added the screenshot after he requested it :)
BradC
06-25-2001, 02:49 PM
Looks interesting I might have to try this out! :)
thanks!
TigerLily
06-25-2001, 03:11 PM
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
06-25-2001, 03:28 PM
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
06-25-2001, 04:13 PM
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
06-25-2001, 04:22 PM
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
06-25-2001, 04:31 PM
that is correct.
private events show only to their owner
sysmom
06-25-2001, 07:40 PM
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
06-25-2001, 07:42 PM
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
06-25-2001, 10:00 PM
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
06-26-2001, 03:54 AM
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
06-26-2001, 04:09 AM
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
06-26-2001, 12:24 PM
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...
Great hack! Installed it right away... :)
sysmom
06-29-2001, 11:57 AM
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
06-29-2001, 12:46 PM
hmm.
theres an event scheduled for today, right?
sysmom
06-29-2001, 01:05 PM
Yup, I put a test event in today. When I revert the files, it shows up fine.
I feel real dumb.
-deb
Steve Machol
06-29-2001, 09:56 PM
[QUOTE]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
mister
06-30-2001, 07:44 AM
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
06-30-2001, 03:22 PM
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
07-01-2001, 07:05 PM
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
07-01-2001, 10:46 PM
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
07-01-2001, 11:41 PM
Ouch, my Today's events aren't working with the new month, either.
Steve Machol
07-02-2001, 01:25 AM
[QUOTE]Originally posted by SysMom
Ouch, my Today's events aren't working with the new month, either.
mister
07-02-2001, 02:35 AM
yea, ill take a look at it..
EDIT: works fine for me.. got a url i can look at?
sysmom
07-02-2001, 04:17 PM
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
07-02-2001, 04:36 PM
[QUOTE]Originally posted by mister
yea, ill take a look at it..
EDIT: works fine for me.. got a url i can look at?
sysmom
07-02-2001, 04:46 PM
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
07-02-2001, 05:03 PM
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
07-02-2001, 05:32 PM
I see what happened now. The template codes in the first message picked up this forums calendar colors rather than { calpubliccolor } and { calprivatecolor }.
mister
07-02-2001, 06:16 PM
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
07-02-2001, 06:21 PM
[QUOTE]Originally posted by mister
yea, i just used the default calendar template, and then made my own for the linear listing ...
mister
07-04-2001, 07:52 AM
ahh.... ill fix that.
TurboFC3S
07-09-2001, 05:01 PM
Nice hack... what would I change to do events for this week, or events for this month?
Thanks
mister
07-09-2001, 06:53 PM
mess with the where clause of the sql query, and possibly $today.
:)
Matt*is*thick
07-17-2001, 08:42 PM
Thanks, this hack is just what I have been looking for! Its great :)
Artemido
07-19-2001, 04:17 PM
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
07-19-2001, 04:36 PM
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
07-19-2001, 04:45 PM
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
07-20-2001, 03:40 PM
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
07-20-2001, 03:55 PM
version 4
Kengan
07-23-2001, 06:29 AM
Thanks for Hack the code ! Very useful !
:cool:
Dave#
07-23-2001, 10:22 AM
how would one make the events be pulled from this week or even this month?
mister
07-23-2001, 06:53 PM
mess with the where clause of the sql query, and possibly $today.
:)
Dave#
07-23-2001, 07:30 PM
Originally posted by mister
mess with the where clause of the sql query, and possibly $today.
:)
mmm
$today = vbdate("Y-m-d",time());
How do we make this a week?
mister
07-24-2001, 02:52 AM
check out calendar.php
you'll need to do something like this
// Load the events for the month!
$events=$DB_site->query("SELECT eventid, subject, eventdate, public
FROM calendar_events
WHERE eventdate
LIKE '$year-$doublemonth-%' AND ((userid = '$bbuserinfo[userid]' AND public = 0) OR (public = 1))");
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#
07-24-2001, 06:36 AM
Originally posted by mister
check out calendar.php
you'll need to do something like this
// Load the events for the month!
$events=$DB_site->query("SELECT eventid, subject, eventdate, public
FROM calendar_events
WHERE eventdate
LIKE '$year-$doublemonth-%' AND ((userid = '$bbuserinfo[userid]' AND public = 0) OR (public = 1))");
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#
07-25-2001, 07:08 PM
just a gentle bump
CCarissa
07-28-2001, 09:01 PM
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
07-30-2001, 02:46 AM
paste line 79 of your code into a reply, and we'll see whats happening....
CCarissa
07-30-2001, 03:32 AM
Here's line 69....
$birthdays = $DB_site->query_first("SELECT template FROM template WHERE title='birthdays' and templatesetid = -2");
its a few lines under the new stuff......
$birthdays = gettemplate('birthdays',0,0);
$btoday = explode('|||',$birthdays);
$today = vbdate("Y-m-d",time());
I really appreciate people looking at this for me. :)
mister
07-30-2001, 12:58 PM
can you also paste the error
(and did you mean line 69 or 79?)
CCarissa
07-30-2001, 01:10 PM
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
07-30-2001, 03:46 PM
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:
if ($displayloggedin) {
add this:
require('./todaysevents.php');
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
07-30-2001, 03:57 PM
Im still pretty sure i posted line 79. *confused*
Thanks. I'll try that tonight when the board isnt busy. :)
mister
08-01-2001, 07:16 PM
Originally posted by CCarissa
Here's line 69....
i think i was confused by that
CCarissa
08-01-2001, 07:27 PM
D'oh.....sorry, twas a typo
sysmom
08-04-2001, 03:14 PM
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
08-05-2001, 10:34 AM
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
08-22-2001, 12:19 AM
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
08-22-2001, 01:47 AM
what a great hack, a doddle to install and so effective
good work!!!
sysmom
08-22-2001, 03:56 AM
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
11-02-2001, 07:43 PM
anyone else had any luck moving this functionality into the header?
TheCaver
11-03-2001, 08:37 PM
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
11-04-2001, 01:21 AM
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
11-04-2001, 02:08 AM
hoorj! https://vborg.vbsupport.ru/showthread.php?s=&threadid=32087
TheCaver
11-08-2001, 02:50 AM
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
11-22-2001, 09:28 AM
any changes in this Hack on vB 2.2.x ?
I can?t find:
if ($displayloggedin) {
in index.php
:confused:
Sascha
jamie
11-23-2001, 09:16 AM
[stupid q]
where is the link to the todaysevents.php file?
[/stupid q]
:o
god bless
mister
11-23-2001, 12:38 PM
https://vborg.vbsupport.ru/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
11-23-2001, 02:35 PM
:o
much appreciated! :)
Logtenberg
11-27-2001, 04:22 AM
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
11-29-2001, 12:46 AM
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:
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
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:
$todaysevents = substr($todaysevents,0,strlen($todaysevents)-2);
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
11-29-2001, 01:15 AM
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
11-29-2001, 02:07 AM
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
11-29-2001, 01:33 PM
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
11-29-2001, 01:41 PM
Awesome! Thanks! :)
mister
11-29-2001, 04:28 PM
Don't write anything from the php files.
Use the vbulletin template system.
Put the html you want in 'forumhome_loggedinusers' template.
kyrnel
11-30-2001, 02:05 AM
Mister,
What is the purpose of this code:
if ($caltitlelength != 0 and isset($caltitlelength)!=0)
{
if (strlen($eventsubject) > $caltitlelength)
{
$eventsubject = subst($eventsubject,0,$caltitlelength) . "...";
}
}
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
11-30-2001, 02:35 AM
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
01-03-2002, 12:31 AM
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
01-03-2002, 09:43 AM
Nice job!
Very useful hack!
kyrnel
01-03-2002, 01:20 PM
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:
https://vborg.vbsupport.ru/
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:
https://vborg.vbsupport.ru/
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
01-14-2002, 02:44 AM
Progress?
kyrnel
01-14-2002, 01:00 PM
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
01-17-2002, 09:24 AM
I wouldn't mind seeing this either.
Anybody?
SirSteve
01-17-2002, 12:15 PM
What about showing a weeks worth of "Upcoming Events" ?
kyrnel
01-17-2002, 12:34 PM
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
01-17-2002, 12:41 PM
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
01-17-2002, 11:44 PM
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
01-18-2002, 03:00 AM
what i posted was on 2.2.1 but my templates are highly modified so you are on your own there..
Steve Machol
01-18-2002, 03:16 AM
[QUOTE]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...
PhotoGenie
01-18-2002, 04:17 PM
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
01-18-2002, 07:33 PM
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
01-18-2002, 08:10 PM
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
01-19-2002, 12:47 AM
3) edit the 'forumhome_loggedinusers' template
I dont have that thing in my forumhome_loggedinusers, heres what my template reads:
<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 suggestions?
PhotoGenie
01-19-2002, 04:58 AM
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
01-20-2002, 10:15 PM
what do you put in the todaysevent.phpfile?
SirSteve
01-21-2002, 02:24 AM
Originally posted by kyrnel
I modified the hack to display events for the next two weeks by modifying the SQL query to this:
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
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
02-03-2002, 05:03 PM
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:
<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>
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:
$todaysevents = "<tr><td bgcolor='{firstaltcolor} colspan='6'><smallfont>Today's Events: ";
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
02-20-2002, 06:20 PM
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
03-02-2002, 12:43 PM
reat hack just installed, thanks.
tanster
03-09-2002, 10:49 PM
This is wonderful, and your instructions were great. Thank you!
:) Jennie
Sadie Frost
04-02-2002, 12:48 PM
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
04-02-2002, 08:40 PM
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
04-10-2002, 06:10 PM
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
04-10-2002, 06:32 PM
I've used this successfully on every version from 2.0.3 to 2.2.5. Never had a problem.
Floris
04-30-2002, 09:28 PM
You are not the only one smachol :) no probs here too, and integrated with vB very nice :)
geniuscrew
04-30-2002, 11:41 PM
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
06-28-2002, 02:33 AM
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
07-14-2002, 11:55 AM
Is it possible to make it so a Calender event will popup when a user goes to the forum??
ForKmaN
07-14-2002, 12:18 PM
Ok mine only shows up when I have a birthday on the same day as the event ...
BigJohnson
07-14-2002, 02:40 PM
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
07-14-2002, 04:05 PM
Ok it works now but i see the comma at the end. Why is that and how do i fix it?
Steve Machol
07-14-2002, 05:09 PM
I put mine in the forumhome_pmloggedin and put $pminfo at the top of forumhome.
ForKmaN
07-15-2002, 01:00 AM
? How did you fix it BigJohnson?
doodio
08-01-2002, 11:10 PM
How do i make this to work on non-VB page? This would be great.
ForKmaN
08-11-2002, 01:52 AM
make it popup!! :D
Hubsi
08-12-2002, 09:42 PM
how can i make it that it shows the events when there is no birthday on that day?
Smirks
09-30-2002, 03:38 PM
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
10-03-2002, 07:09 PM
????
push :D
Dark_Wizard
11-05-2002, 11:34 AM
Originally posted by Hubsi
????
push :D
Very simple...
Place this:
require('./todaysevents.php');
After this:
require('./global.php');
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
11-05-2002, 03:50 PM
Originally posted by Dark_Wizard
Very simple...
Place this:
require('./todaysevents.php');
After this:
require('./global.php');
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
01-15-2003, 07:28 AM
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
01-15-2003, 12:50 PM
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
01-31-2003, 08:36 PM
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
02-15-2003, 06:24 AM
Originally posted by Dark_Wizard
Very simple...
Place this:
require('./todaysevents.php');
After this:
require('./global.php');
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
02-15-2003, 09:55 AM
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
02-15-2003, 10:54 AM
TIGHT! setup :)
Keep me posted.
Dark_Wizard
02-15-2003, 12:16 PM
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
02-15-2003, 11:57 PM
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
02-16-2003, 12:32 PM
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
02-16-2003, 02:23 PM
Ok, got them working great. Now trying to figure out how to make the today's events to say "NONE".
Dark_Wizard
02-16-2003, 06:17 PM
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
02-17-2003, 01:54 AM
Originally posted by Dark_Wizard
Follow the coding that I did in upcoming events...it is very easy...
I added this:
if ($DB_site->num_rows($events)>0) {
(start addition) $noevents = "No Events Today";
$todaysevents .="<smallfont color=\"{ calpubliccolor}\">$noevents</smallfont></a></li>\n";
} else {(end addition)
while ($event=$DB_site->fetch_array($events)) {
But still doesn't work.
matthew tucker
02-17-2003, 04:30 AM
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:
if ($DB_site->num_rows($events) < 1) {
} else {
$todaysevents = "Upcoming events: <br/>";
while ($event=$DB_site->fetch_array($events)) {
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
02-17-2003, 08:08 AM
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:
if ($DB_site->num_rows($events) < 1) {
} else {
$todaysevents = "Upcoming events: <br/>";
while ($event=$DB_site->fetch_array($events)) {
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
02-17-2003, 08:23 AM
For some reason, it's listing the first event twice (run in together).
* 2003 Topps Heritage (bsb)2003 Topps Heritage (bsb)
Dark_Wizard
02-17-2003, 04:40 PM
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
02-17-2003, 08:01 PM
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
02-18-2003, 12:43 PM
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 (https://vborg.vbsupport.ru/showthread.php?postid=354306#post354306).
lifesourcerec
02-18-2003, 01:15 PM
The no Events works, but from some reason, it still shows double
such as:
testtest
Dark_Wizard
02-18-2003, 02:09 PM
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
02-18-2003, 11:28 PM
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
02-21-2003, 11:12 AM
I see you fixed it...I have made some changes to it as well and you can see it on my page...
lifesourcerec
02-22-2003, 05:54 AM
It's not fixed. Still prints it twice whenever there is an event.
lifesourcerec
02-25-2003, 12:11 AM
I just re-installed it and there is no space or commons to separate each event.
[SKR]Abe
03-31-2003, 12:26 PM
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
04-01-2003, 01:29 AM
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-04-2003, 07:54 PM
Is there any way to put this hack on my index.htm page?
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?
Help!!!
please... I've followed same instruction, did some changes and nothing.
vb 2.3
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
08-17-2003, 05:30 AM
How can you modify this so that the $eventdate can be in a different format like M-D-Y?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.