vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   php include(?) - items from the forum (https://vborg.vbsupport.ru/showthread.php?t=59892)

accyroy 01-08-2004 05:45 AM

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!

rkettner 01-26-2004 04:49 AM

I am looking for this too. Is there any solution for news grabbing that doesn't require a full "portal" system?

Zachery 01-26-2004 04:59 AM

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

rkettner 01-26-2004 06:10 PM

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.

Zachery 01-26-2004 06:12 PM

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?

vbmechanic 01-26-2004 06:24 PM

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)

rkettner 01-26-2004 10:09 PM

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

JacobiKenobi 03-23-2004 12:37 AM

Yeah, can you help finish it?


All times are GMT. The time now is 01:40 AM.

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.01031 seconds
  • Memory Usage 1,734KB
  • 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
  • (3)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete