Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-08-2004, 05:45 AM
accyroy accyroy is offline
 
Join Date: Nov 2003
Location: Moscow
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default php include(?) - items from the forum

I'd like to be able to include things like the latest news, users online, latest topics on my front page, login box. I don't want a portal I just want to be able to do a php include (or whatever) to insert the item i want into a page that isn't the forum. I have recently upgraded from YaBB and with that I just used SSI to get this info. Is there likely to be a hack for this written? I know about the javascript external data provider but can't get it to do all the things I want. I have looked at the vbAdvanced mod and that would be exactly what I need if it just inserted one of the boxes at a time using php include.
Hope I'm making sense!
Reply With Quote
  #2  
Old 01-26-2004, 04:49 AM
rkettner rkettner is offline
 
Join Date: Oct 2001
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am looking for this too. Is there any solution for news grabbing that doesn't require a full "portal" system?
Reply With Quote
  #3  
Old 01-26-2004, 04:59 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by rkettner
I am looking for this too. Is there any solution for news grabbing that doesn't require a full "portal" system?
just look at thow the portals do it and adapt it for your own uses
Reply With Quote
  #4  
Old 01-26-2004, 06:10 PM
rkettner rkettner is offline
 
Join Date: Oct 2001
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Faranth
just look at thow the portals do it and adapt it for your own uses
I suppose that would work, I just wanna make sure I don't put unecessary calls to the DB. It would just be nice if someone put something simple together that does exactly what we need.
Reply With Quote
  #5  
Old 01-26-2004, 06:12 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by rkettner
I suppose that would work, I just wanna make sure I don't put unecessary calls to the DB. It would just be nice if someone put something simple together that does exactly what we need.
your going to use the php include tempalates? or somthing differnt?
Reply With Quote
  #6  
Old 01-26-2004, 06:24 PM
vbmechanic vbmechanic is offline
 
Join Date: Jan 2004
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Set variables:
PHP Code:
$newsforumid="6"// Forum ID to pull the news from
$items="5"// How many news threads to pull 
Connect to DB:
PHP Code:
$db_connection mysql_connect("host","username","password") or die ("No DB Connection");
$db mysql_select_db("dbname",$db_connection) or die ("Couldn't select DB"); 
Fetch the threads:
PHP Code:
$query="SELECT title,threadid,forumid,replycount,views,firstpostid,dateline  
        FROM thread 
        WHERE forumid='
$newsforumid
        ORDER BY dateline DESC
        LIMIT 0,
$items";

$newsitems=mysql_query($query,$db_connection);

while (
$news=mysql_fetch_array($newsitems)) {

$query="SELECT pagetext,postid  
        FROM post 
        WHERE postid='
$news[firstpostid]
        "
;

    
$posts=mysql_query($query,$db_connection);

    while (
$post=mysql_fetch_array($posts)) { 
Export your HTML with the info.. voila! (oh yea add in stuff like parse_bbcode, etc)
Reply With Quote
  #7  
Old 01-26-2004, 10:09 PM
rkettner rkettner is offline
 
Join Date: Oct 2001
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by vbmechanic
(oh yea add in stuff like parse_bbcode, etc)
How would I do that? I'm sorry, I'm no PHP expert :P
Reply With Quote
  #8  
Old 03-23-2004, 12:37 AM
JacobiKenobi JacobiKenobi is offline
 
Join Date: Mar 2004
Location: Florida, USA
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, can you help finish it?
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:20 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.04201 seconds
  • Memory Usage 2,236KB
  • 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
  • (3)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete