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

Quote:

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

Quote:

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

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.

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

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?

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

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" ?

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:

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.

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

Quote:

if ($showbirthdays) {
instead of

Quote:

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:

Quote:

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

Quote:

<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

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.


All times are GMT. The time now is 07:08 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.01587 seconds
  • Memory Usage 1,841KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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