Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by mister mister is offline
Developer Last Online: May 2015 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 06-24-2001 Last Update: Never Installs: 72
 
No support by the author.

my first hack, enjoy...

Today's Events on Main Forum Page
Hack Version: 4

Description:
Lists today's events on the main page, under the Online Users & Birthdays (both public, and private events).
*Version 2 adds the ability to list either bulleted or linear
*Version 3 uses the users timezone adjusted date, rather than the servers date
*Version 4 fixes a type-o on line 47ish, and adds one bit of instruction if using the bulleted list, rather than linear

Files to Add: todaysevents.php
Files to Edit: index.php
Templates to Edit: forumhome_loggedinusers
Templates to Add: calendar_privateevent_linear, calendar_publicevent_linear
Demo:
Bulleted:

Linear:


upgrade from version 2:
0) backup necessary files
1) upload new todaysevents.php
2) done

upgrade from version 2:
0) backup necessary files
1) upload new todaysevents.php
2) done

upgrade from version 1:
0) backup necessary files
1) upload new todaysevents.php
2) add 2 templates
(NOTE: there is an important space after the comma at the end, and an extra space in {calpubliccolor } and {calprivatecolor })

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

Show Your Support

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

Comments
  #92  
Old 01-17-2002, 12:34 PM
kyrnel's Avatar
kyrnel kyrnel is offline
 
Join Date: Nov 2001
Location: Houston, TX
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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.
Reply With Quote
  #93  
Old 01-17-2002, 12:41 PM
SirSteve SirSteve is offline
 
Join Date: Oct 2001
Posts: 382
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #94  
Old 01-17-2002, 11:44 PM
tripps tripps is offline
 
Join Date: Jan 2002
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #95  
Old 01-18-2002, 03:00 AM
kyrnel's Avatar
kyrnel kyrnel is offline
 
Join Date: Nov 2001
Location: Houston, TX
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what i posted was on 2.2.1 but my templates are highly modified so you are on your own there..
Reply With Quote
  #96  
Old 01-18-2002, 03:16 AM
Steve Machol's Avatar
Steve Machol Steve Machol is offline
 
Join Date: Nov 2001
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[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...
Reply With Quote
  #97  
Old 01-18-2002, 04:17 PM
PhotoGenie PhotoGenie is offline
 
Join Date: Jan 2002
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #98  
Old 01-18-2002, 07:33 PM
kyrnel's Avatar
kyrnel kyrnel is offline
 
Join Date: Nov 2001
Location: Houston, TX
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #99  
Old 01-18-2002, 08:10 PM
PhotoGenie PhotoGenie is offline
 
Join Date: Jan 2002
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #100  
Old 01-19-2002, 12:47 AM
Shenlong's Avatar
Shenlong Shenlong is offline
 
Join Date: Nov 2001
Location: Manhattan, New York
Posts: 167
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
3) edit the 'forumhome_loggedinusers' template
I dont have that thing in my forumhome_loggedinusers, heres what my template reads:

PHP Code:
<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?
Reply With Quote
  #101  
Old 01-19-2002, 04:58 AM
PhotoGenie PhotoGenie is offline
 
Join Date: Jan 2002
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
  #102  
Old 01-20-2002, 10:15 PM
azork azork is offline
 
Join Date: Dec 2001
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what do you put in the todaysevent.phpfile?
Reply With Quote
  #103  
Old 01-21-2002, 02:24 AM
SirSteve SirSteve is offline
 
Join Date: Oct 2001
Posts: 382
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by kyrnel

I modified the hack to display events for the next two weeks by modifying the SQL query to this:
Code:
SELECT eventid, subject, eventdate, public
FROM calendar_events
WHERE (eventdate >= '$today' AND eventdate <= DATE_ADD('$today', INTERVAL 14 DAY)) AND ((userid = '$bbuserinfo[userid]') OR (public = 1))
ORDER BY eventdate
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" ?
Reply With Quote
  #104  
Old 02-03-2002, 05:03 PM
Floris Floris is offline
 
Join Date: Jan 2002
Posts: 1,898
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Code:
$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.
Reply With Quote
  #105  
Old 02-20-2002, 06:20 PM
rishel's Avatar
rishel rishel is offline
 
Join Date: Jan 2002
Location: Florida :)
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 )?
Reply With Quote
  #106  
Old 03-02-2002, 12:43 PM
mondaynightmike's Avatar
mondaynightmike mondaynightmike is offline
 
Join Date: Jan 2002
Location: Northamptonshire
Posts: 123
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

reat hack just installed, thanks.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:40 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05667 seconds
  • Memory Usage 2,395KB
  • Queries Executed 30 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (9)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (16)post_thanks_box
  • (16)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (16)post_thanks_postbit_info
  • (15)postbit
  • (16)postbit_onlinestatus
  • (16)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete