Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #31  
Old 03-18-2002, 06:28 PM
Daderin Daderin is offline
 
Join Date: Mar 2002
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Could you let us know how you solved that problem Webmasta please ? I remember getting the same errors when I was trying something and I gave up after it
Reply With Quote
  #32  
Old 08-21-2003, 05:13 AM
Clegg Clegg is offline
 
Join Date: Dec 2001
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am not a programmer or anything cool like that. I am a geek who just knew how to read a SQL DB and get this thing working under vB3

So here is the code: (EDIT - Corrected a major error in the code date setup due to vb3)

PHP Code:
$events $DB_site->query ("SELECT UNIX_TIMESTAMP() AS dateline, dateline_from, eventid, title 
                           FROM event
                           WHERE calendarid = 1 AND dateline_from > dateline
                           ORDER BY dateline_from LIMIT 4"
); 
dateline_from is the vb3 variable for the starting date of the event, and am defining the field dateline for the current date and getting a unix timestamp to so the comparison in the where is more reliable ( had some issue with YYYY-DD-MM formats). Then later with a string like this:
PHP Code:
$timestring=$event['dateline_from']; 
$dateevent=date("M j,Y",$timestring); 
I convert the dateline_from into a readable format.


works like a freaking charm
Reply With Quote
  #33  
Old 09-25-2003, 08:20 AM
roxics's Avatar
roxics roxics is offline
 
Join Date: Jan 2002
Location: Detroit Area
Posts: 177
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there anyway to get this to show up easily on any VB (really a webtemplates) page via an $events tag or something?

Thanks
Reply With Quote
  #34  
Old 01-15-2004, 05:49 PM
offlead's Avatar
offlead offlead is offline
 
Join Date: Jul 2003
Location: Dallas, Tx
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, does anyone have the full code for this for vb3, that they could share? I've managed to get, well, something, pulling into the non-forum page, and I have it linking to the calendar, but I'm only getting one event, and the link isn't quite correct (it links to the calendar okay, but not to the event). I'm all confused.
Reply With Quote
  #35  
Old 01-29-2004, 02:16 AM
filmhobbit filmhobbit is offline
 
Join Date: Jan 2003
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Right so this doesn't work even a little or is just to complex for me to understand. Probably both.
Reply With Quote
  #36  
Old 01-29-2004, 02:37 AM
filmhobbit filmhobbit is offline
 
Join Date: Jan 2003
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ah there it goes! kicked in with some tinkering. Nice little script guys! Good work.
Reply With Quote
  #37  
Old 01-29-2004, 02:43 AM
krit krit is offline
 
Join Date: Jan 2004
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi guys.

I too would love someone to simply post the php coding they are using for vB3. I presume most are creating a file, say eventlist.php, and calling it into their page via include statements? If someone could post the code in the php file that would be appreciated greatly!

Cheers
Krit
Reply With Quote
  #38  
Old 02-05-2004, 06:18 AM
offlead's Avatar
offlead offlead is offline
 
Join Date: Jul 2003
Location: Dallas, Tx
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I actually managed to get this working, eventually, but just discovered that it's showing old events that are already past. Eep! I've checked over the code, and it looks like it should be working correctly, but I'm definitely getting old events.

I checked the sql query in phpmyadmin, and I get the same results. The query is:
Code:
SELECT UNIX_TIMESTAMP( ) AS dateline, dateline_from, eventid, title
FROM event
WHERE calendarid = 1 AND dateline_from > dateline
ORDER BY dateline_from
LIMIT 5
and in phpmyadmin when I run this I get the same events as I do in the script. Here are the dateline and dateline_from values from the five events returned:

Code:
dateline   	      dateline_from   	  eventid   	  title
1075968522 	1074603600 	    1 	               Hernando Beach Blast III
1075968522 	1074704400 	    3 	               HBBIII 2004
1075968522 	1077840000 	    11 	              Hinkster's Birthday
1075968522 	1082246400 	    12 	              Michigan NCRS Swap Meet
1075968522 	1083283200           7  	       New England Chapter Event
I can see that the dateline value being returned appears correct...it's the same for each row returned. But event 1 and event 3 were in January, and clearly their dateline_from values are less than the dateline values. So why are they being returned?

*confused*
Reply With Quote
  #39  
Old 02-23-2004, 04:43 AM
offlead's Avatar
offlead offlead is offline
 
Join Date: Jul 2003
Location: Dallas, Tx
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I still need some help with this. I managed to finally get it posting only upcoming events, and not events which have already past. However, now I'm getting the wrong dates displaying on the events. If an event is in the calendar for Feb 30, it displays on the non-vb page as being on Feb 29. All events are dated one day early.

Here's what I currently have.

PHP Code:
 <?php
 chdir
("/home/vettehea/public_html/forums");
 
 include(
'./global.php');
   
 
$events $DB_site->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"
); 
 
$vh_upcomingevents "";
 if (
$DB_site->num_rows($events)) {
     while (
$event $DB_site->fetch_array($events)) {
         
$timestring=$event['dateline_from'];
         
$dateevent=date("M j, Y",$timestring);
         
$vh_upcomingevents .= "$dateevent: <a href=\"/forums/calendar.php?$session[sessionurl]do=getinfo&amp;day=$day&amp;e=$event[eventid]&amp;c=$event[calendarid]\">$event[title]</a><br />";
     }
 } else {
     
$vh_upcomingevents .=  " -- no events currently listed -- ";
 }
 
 
?>
I'd greatly appreciate any help clearing up this last issue to this for me.

Reply With Quote
  #40  
Old 02-25-2004, 03:12 PM
offlead's Avatar
offlead offlead is offline
 
Join Date: Jul 2003
Location: Dallas, Tx
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by offlead
I still need some help with this. I managed to finally get it posting only upcoming events, and not events which have already past. However, now I'm getting the wrong dates displaying on the events. If an event is in the calendar for Feb 30, it displays on the non-vb page as being on Feb 29. All events are dated one day early.

Here's what I currently have.

PHP Code:
 <?php
 chdir
("/home/vettehea/public_html/forums");
 
 include(
'./global.php');
   
 
$events $DB_site->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"
); 
 
$vh_upcomingevents "";
 if (
$DB_site->num_rows($events)) {
     while (
$event $DB_site->fetch_array($events)) {
         
$timestring=$event['dateline_from'];
         
$dateevent=date("M j, Y",$timestring);
         
$vh_upcomingevents .= "$dateevent: <a href=\"/forums/calendar.php?$session[sessionurl]do=getinfo&amp;day=$day&amp;e=$event[eventid]&amp;c=$event[calendarid]\">$event[title]</a><br />";
     }
 } else {
     
$vh_upcomingevents .=  " -- no events currently listed -- ";
 }
 
 
?>
I'd greatly appreciate any help clearing up this last issue to this for me.

*bump*

Anyone?
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 12:07 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.05840 seconds
  • Memory Usage 2,297KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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