vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   forum invisible on main page, with content pulled by external script? (https://vborg.vbsupport.ru/showthread.php?t=34775)

TECK 02-04-2002 01:40 PM

is it possible to have a forum made invisible (create a table with all info necessary) on the forum main page, but to be viewable by pulling the info about this forum and the threads with a script (for example review.php) that will grab the information and allow you to make comments on the specific review?

my goal is to have an external script that will show all the forum thread infos into review.php (sort of pluhnews.php) but the forum is not available on the main page area. anonymous users could post comments, as well as the registered members.

so basically is like this:
a. you have your index.php main page (not the forum main page), where you can read the review (pulled from the invisible forum)
b. people can make comments on the review (review.php)
c. the admin can post a new review using the newthread.php

let me know what should i start with. ty for taking the time to read this post.

Scott MacVicar 02-04-2002 07:22 PM

thats easier than you think

as your not going to be bothering about permissions and probably not going to use the vB global file.

PHP Code:

<?
//forum which holds reviews
$reviewforum = 3;
mysql_connect("localhost", "user", "pass");
mysql_select_db("forumdb");
if(isset($r)) {
  $getreview = mysql_query("SELECT * FROM post WHERE threadid='$r' AND forumid='$reviewforum'");
  while($reviewcontent = mysql_fetch_array($getreview)) {
    if($reviewcontent['title']) {
      echo "$reviewcontent[title]<br>\n";
    }
    echo "$reviewcontent[pagetext ]";
  }
}
else {
  $review = mysql_query("SELECT * FROM thread WHERE forumid='$reviewforum'");
  while ($reviews = mysql_fetch_array($review)) {
    echo "Review: <a href=\"$PHP_SELF?r=$reviews[threadid]\">$reviews[title]</a>";
  }
}
?>

thats the getting of the titles then the review content, all you'll need to do it handle the comment reply and the output o fit.

TECK 02-05-2002 12:09 AM

is amasing how simple it is.. :)

anyway, i wanted to thank you. that should get me started. but i have a quick question:
if i create an invisible forum, will this script you posted there, still grab the info, because is connecting to the database and access it's info, right?

also, i want to show only the last 3 reviews that i post on the forum. i will make it visible only to admins. do you have any ideas? thanks alot.

TECK 02-05-2002 01:23 AM

ok.. here what i did:
i customized the news in any forum script to make it the main page of the web site (click here to view the mod). on that page on top of the news i want add the reviews, that will show only the latest 3 of them published on the invisible forum. so i have the global.php file inserted, because i dont like to have the database, username and password included on a simple file.

now i will insert ur code and make a template to grab the actual review html code for each review. i will post it here so other people can use it for their sites. :)

if u have any other ideas, let me know. ty

TECK 02-05-2002 06:08 AM

ok PPN... here it is what i did:
PHP Code:

$templatesused "home_newthisweek";

chdir("/your/path/to/forum");
require(
"./global.php");

$newforum="1";
$newposts="3";

$newsql=$DB_site->query("SELECT * FROM thread WHERE forumid='$newforum' ORDER BY dateline DESC LIMIT $newposts");
while (
$new=$DB_site->fetch_array($newsql)) {
  
$newthreadid=$new[threadid];
  
$newtitle=$new[title];
  
$newtime=vbdate($timeformat,$getnew[dateline]);
  
$newdate=vbdate($dateformat,$getnew[dateline]);
  
$getnewsql=$DB_site->query("SELECT * FROM post WHERE threadid='$newthreadid' ORDER BY postid ASC LIMIT 1");
  while (
$getnew=$DB_site->fetch_array($getnewsql)) {
    
$newpagetext=$getnew[pagetext];
    
$newpagetext=bbcodeparse($newpagetext);
    eval(
"\$newthisweek = \"".gettemplate('home_newthisweek')."\";");
  }


i went with the logic. this code should grab the title and content from forum 1 and display only the last 3 threads. for some reasons, it will show ony the latest thread, not the 3 of them. can you tell me why?

Scott MacVicar 02-06-2002 05:13 PM

PHP Code:

$templatesused "home_newthisweek";

chdir("/your/path/to/forum");
require(
"./global.php");

$newforum="1";
$newposts="3";

$newsql=$DB_site->query("SELECT * FROM thread WHERE forumid='$newforum' ORDER BY dateline DESC LIMIT 0,$newposts");
while (
$new=$DB_site->fetch_array($newsql)) {
  
$newthreadid=$new[threadid];
  
$newtitle=$new[title];
  
$newtime=vbdate($timeformat,$getnew[dateline]);
  
$newdate=vbdate($dateformat,$getnew[dateline]);
  
$getnewsql=$DB_site->query("SELECT * FROM post WHERE threadid='$newthreadid' ORDER BY postid ASC LIMIT 0,1");
  while (
$getnew=$DB_site->fetch_array($getnewsql)) {
    
$newpagetext=$getnew[pagetext];
    
$newpagetext=bbcodeparse($newpagetext);
    eval(
"\$newthisweek = \"".gettemplate('home_newthisweek')."\";");
  }


You need to tell it what number to start at i believe so its in the format 0,Number to View

TECK 02-07-2002 12:21 AM

ty PPN, i got i found the little mistake.. :) firefly open my eyes.. hehe. istarted a new thread in the right forum. you can read all about it in my signature. click on "can you help" link. thanks for taking the time do sort it out the matter.


All times are GMT. The time now is 03:17 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.01000 seconds
  • Memory Usage 1,753KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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