Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Calendar events on non-VB pages Details »»
Calendar events on non-VB pages
Version: 1.00, by wbear wbear is offline
Developer Last Online: Oct 2013 Show Printable Version Email this Page

Version: 3.5.2 Rating:
Released: 01-12-2006 Last Update: Never Installs: 29
Is in Beta Stage  
No support by the author.

This extension allows you to pull calendar events to display on a non-VB page. You'll need to change the first few lines to reflect your current site information, and look within the code for the site URL to change to your own. In this script, it occurs three times (DOMAIN.COM/FORUM_ADDRESS).

Needs to be on a page that is parsed for PHP content, either by way of naming the page '.php', or by using .htaccess to add it to the list of files that are parsed by PHP. [AddType application/x-httpd-php .html]

I've seen lots of requests for this, but couldn't locate anyone that had released one, so here goes (mods, if there is one like this, feel free to remove mine..I couldn't find it). The code was gathered from a number of sources long ago and slapped together by me. I don't know the full origin of each bit, so if you wrote any of this and want credit, go for it. In it's current (unpolished) state, it's been heavily adapted by me anyway, and there's room for improvement, certainly. It's inelegant code (an understatement), but works AFAIK.

Show Your Support

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

Comments
  #12  
Old 01-23-2006, 04:48 PM
Dave-G Dave-G is offline
 
Join Date: Oct 2001
Location: Cornwall, UK
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone please! this is driving me mad, lol.
Reply With Quote
  #13  
Old 01-24-2006, 05:40 AM
LBmtb LBmtb is offline
 
Join Date: Jan 2006
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does anybody have a screenshot or demo page? I keep getting this error, no matter what I try.
Code:
Unable to add cookies, header already sent.
File: /home/myusername/public_html/test.php
Line: 10
Reply With Quote
  #14  
Old 01-24-2006, 11:41 PM
wbear wbear is offline
 
Join Date: Jan 2005
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here's a screen shot of the site I made this for. Maybe it'll help you.
Reply With Quote
  #15  
Old 01-24-2006, 11:49 PM
wbear wbear is offline
 
Join Date: Jan 2005
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave-G
Been trying to get this to output only from my Calander 2 without any luck. I've changed the references from 1 to 2 but it just says No events, even though there are. Changing it all back from 2 to 1 and it works.

Anyone get this working with calanderid 2 ?
Just tested with id 2 and it works perfectly. Can you check that calendar 2 has publicly viewable permissions?
You might also make sure that the calendar you're choosing is actually id 2...if you've made more than one in the past it might be a different number.
Reply With Quote
  #16  
Old 01-24-2006, 11:59 PM
wbear wbear is offline
 
Join Date: Jan 2005
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by LBmtb
How can I use this in a forum page? I want to display this in the header. I suppose delete the chdir lines and simply have 'global.php'?

I tried that and got this printed out on the page
Code:
= UNIX_TIMESTAMP() ORDER BY dateline_from LIMIT 10"); if (()) { echo ""; while ( = ()) { #=,false,true,false,true; = vbdate("M j, Y", ,false,true,false,true); echo " "; } //} } else { echo "
Upcoming Events
(click here for full month)
	
"; } echo "
Upcoming Events
No Events Upcoming Currently
"; ?>
As a guess, you left in the starting <? tag, and it's confusing the forum's parsing of the code? Start with the line: $events = $db->query ...and leave off the closing ?> as well. Make sure you're placing it somewhere not inside some other code block..(if , else, or what have you.)
Reply With Quote
  #17  
Old 01-25-2006, 12:43 AM
LBmtb LBmtb is offline
 
Join Date: Jan 2006
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by wbear
As a guess, you left in the starting <? tag, and it's confusing the forum's parsing of the code? Start with the line: $events = $db->query ...and leave off the closing ?> as well. Make sure you're placing it somewhere not inside some other code block..(if , else, or what have you.)
You're right I did leave that there. I'll try it once I get home.

Wbear, thanks a lot of the screenshot - that looks awesome!

edit: Got home and still no luck.
I get a lot of this
Code:
$events = $db->query ("SELECT UNIX_TIMESTAMP() AS dateline, dateline_from, eventid, title FROM event WHERE calendarid = 1 AND dateline_from >= UNIX_TIMESTAMP() ORDER BY dateline_from LIMIT 10"); if ($db->num_rows($events)) { echo ""; while ($event = $db->fetch_array($events)) { #$timestring=$event[dateline_from],false,true,false,true; $dateevent= vbdate("M j, Y", $event[dateline_from],false,true,false,true); echo " "; } //} } else { echo "
Upcoming Events
(click here for full month)
$dateevent 	$event[title]
"; } echo "
Upcoming Events
No Events Upcoming Currently
";
Here's the page code
Code:


$events = $db->query ("SELECT UNIX_TIMESTAMP() AS dateline, dateline_from, eventid, title

                           FROM event

                           WHERE calendarid = 1 AND dateline_from >= UNIX_TIMESTAMP()



                           ORDER BY dateline_from LIMIT 10");

if ($db->num_rows($events)) {

echo "<table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"1\">

<tr>

<td COLSPAN=2 align=\"center\" width=\"100%\" bgcolor=\"#FFFFFF\"><font face=\"arial, helvetica\" color=\"000000\"><b><a href='http://www.socaltrailriders.org/forum/calendar.php?c=1&do=displaymonth'>Upcoming Events <br>(click here for full month)</a></b></font></td>

</tr>

";

    while ($event = $db->fetch_array($events)) {



#$timestring=$event[dateline_from],false,true,false,true;

$dateevent= vbdate("M j, Y", $event[dateline_from],false,true,false,true);

    echo "

<tr>

<td align=\"center\" width=\"80\" bgcolor=\"FFFFFF\"><font size=\"-1\" face=\"arial, helvetica\" color=\"000000\">$dateevent</font></td>

<td align=\"left\" bgcolor=\"FFFFFF\" width=\"183\"><font size=\"-1\" face=\"arial, helvetica\"><b><a href='http://www.socaltrailriders.org/forum/calendar.php?do=getinfo&e=$event[eventid]&c=1'>$event[title]</a></b></font></td>

</tr>

<tr>

  <td colspan=\"2\" bgcolor=\"FFFFFF\"></td>

</tr>

";

  }

//}

} else {

  echo "<table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"1\">

<tr>

<td COLSPAN=2 align=\"center\" width=\"100%\" bgcolor=\"#FFFFFF\"><font class=\"heading\" face=\"arial, helvetica\" size=\"1\"  color=\"000000\"><b><a href='http://www.socaltrailriders.org/forum/calendar.php?c=1&do=displaymonth'>Upcoming Events</a></b></font></td>

</tr>

<tr>

<td COLSPAN=2 align=\"center\" width=\"100%\" bgcolor=\"#FFFFFF\"><font size=\"-1\" face=\"arial, helvetica\" color=\"000000\"><b>No Events Upcoming Currently</b></font></td>

</tr>

<tr>

  <td colspan=\"2\" bgcolor=\"FFFFFF\"></td>

</tr> ";

}

echo "</table>";
Here's the link.

$10 bucks to whoever helps me get this working. Wbear, what version of vBulletin are you using? I installed event forums mod btw, not sure if that matters.

Thanks!
Reply With Quote
  #18  
Old 01-25-2006, 11:36 AM
Dave-G Dave-G is offline
 
Join Date: Oct 2001
Location: Cornwall, UK
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by wbear
Just tested with id 2 and it works perfectly. Can you check that calendar 2 has publicly viewable permissions?
You might also make sure that the calendar you're choosing is actually id 2...if you've made more than one in the past it might be a different number.
Still driving me mad. Checked the database and it is ID2, checked the permissions and they are all identical to ID1. Even if they were not, login in as admin I still should see all.

The links to ID2 work just not the top code to display the events

Code:
WHERE calendarid = 2 AND dateline_from >= UNIX_TIMESTAMP()
If its 1 it works, 2 it does not... Now I'm lost -- HELP please
Reply With Quote
  #19  
Old 01-25-2006, 12:06 PM
wbear wbear is offline
 
Join Date: Jan 2005
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by LBmtb
Here's the link.
$10 bucks to whoever helps me get this working. Wbear, what version of vBulletin are you using? I installed event forums mod btw, not sure if that matters.
On that test page, you don't have the opening and closing PHP tags. In order for PHP to parse it, that has to be there...I thought you were trying this on a forum page, and that was why I'd suggested removing them. Sorry.

Include the entire script on the test page (with <? and ?>, and change the paths in the top to your site.
chdir("forum/");
require('./global.php');
chdir("../");
This switches to the forum directory, grabs the config file and switches back. Make sure the closing PHP tag is present as well.

I'm using 3.5.2 on this, but had it working (with a small change) on 3.07/8.
Reply With Quote
  #20  
Old 01-25-2006, 12:08 PM
wbear wbear is offline
 
Join Date: Jan 2005
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave-G
Still driving me mad. Checked the database and it is ID2, checked the permissions and they are all identical to ID1. Even if they were not, login in as admin I still should see all.

The links to ID2 work just not the top code to display the events

Code:
WHERE calendarid = 2 AND dateline_from >= UNIX_TIMESTAMP()
If its 1 it works, 2 it does not... Now I'm lost -- HELP please
Can you provide the link to the board in question? The basic board link would do, if guests can view both calendars. A link to the test page may help too. PM if you don't want this public.
Reply With Quote
  #21  
Old 01-25-2006, 05:24 PM
LBmtb LBmtb is offline
 
Join Date: Jan 2006
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by wbear
On that test page, you don't have the opening and closing PHP tags. In order for PHP to parse it, that has to be there...I thought you were trying this on a forum page, and that was why I'd suggested removing them. Sorry.

Include the entire script on the test page (with <? and ?>, and change the paths in the top to your site.
chdir("forum/");
require('./global.php');
chdir("../");
This switches to the forum directory, grabs the config file and switches back. Make sure the closing PHP tag is present as well.

I'm using 3.5.2 on this, but had it working (with a small change) on 3.07/8.
Thanks for your time. I added
Code:
chdir("forum/");
require('./global.php');  
chdir("../");
and <? at the beginning and ?> at the end but got a databse error message. The email I received said a table that it's looking for doesn't exist.
Code:
Invalid SQL:
SELECT UNIX_TIMESTAMP() AS dateline, dateline_from, eventid, title
                           FROM event
                           WHERE calendarid = 1 AND dateline_from >= UNIX_TIMESTAMP()

                           ORDER BY dateline_from LIMIT 10;

MySQL Error  : Table 'socaltra_vbforum.event' doesn't exist
Error Number : 1146
Date         : Wednesday, January 25th 2006 @ 02:14:42 PM
Script       : http://socaltrailriders.org/test.php
Referrer     : 
IP Address   : 134.139.107.72
Username     : Unregistered
Classname    : vb_database
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 09:37 PM.


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.04635 seconds
  • Memory Usage 2,324KB
  • Queries Executed 25 (?)
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
  • (8)bbcode_code
  • (7)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
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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