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

Quote:

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

Quote:

Originally posted by mister
mess with the where clause of the sql query, and possibly $today.

:)


mmm

PHP Code:

$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

PHP Code:


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

Quote:

Originally posted by mister
check out calendar.php

you'll need to do something like this

PHP Code:


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

PHP Code:

   $birthdays $DB_site->query_first("SELECT template FROM template WHERE title='birthdays' and templatesetid = -2"); 

its a few lines under the new stuff......
PHP Code:

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

PHP Code:

if ($displayloggedin) { 

add this:

PHP Code:

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

Quote:

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/showthrea...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:

PHP Code:

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/attachmen...&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:
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.
Im running into 2 problems. (1) The function designed to remove the trailing commas does not seem to work. The code is this:
Code:

$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

Quote:

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


All times are GMT. The time now is 11:34 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.01385 seconds
  • Memory Usage 1,837KB
  • 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
  • (2)bbcode_code_printable
  • (8)bbcode_php_printable
  • (5)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