vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   [RELEASE v2] Today's Events on Main Forum Page (https://vborg.vbsupport.ru/showthread.php?t=21232)

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
PHP Code:

<a href="calendar.php?s=$session[sessionhash]&action=getinfo&eventid=$eventid"><smallfont color="{calpubliccolor }">$eventsubject</smallfont></a>, 

calendar_privateevent_linear
PHP Code:

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

PHP Code:

if ($displayloggedin) { 

add this:

PHP Code:

require('./todaysevents.php'); 

3) edit the 'forumhome_loggedinusers' template
change this:
PHP Code:

$birthdaybits</smallfont></td


to this:
PHP Code:

$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
PHP Code:

<a href="calendar.php?s=$session[sessionhash]&action=getinfo&eventid=$eventid"><smallfont color="{calpubliccolor }">$eventsubject</smallfont></a>, 

calendar_privateevent_linear
PHP Code:

<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/showthrea...943#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

Quote:

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 06-26-2001 12:57 PM

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

Quote:

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!


All times are GMT. The time now is 04:50 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02411 seconds
  • Memory Usage 1,838KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete