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

Reply
 
Thread Tools Display Modes
  #1  
Old 02-04-2002, 01:40 PM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #2  
Old 02-04-2002, 07:22 PM
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Location: Glasgow, Scotland
Posts: 1,199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 02-05-2002, 12:09 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 02-05-2002, 01:23 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 02-05-2002, 06:08 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #6  
Old 02-06-2002, 05:13 PM
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Location: Glasgow, Scotland
Posts: 1,199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 02-07-2002, 12:21 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
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 03:00 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.05615 seconds
  • Memory Usage 2,242KB
  • Queries Executed 13 (?)
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
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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_postinfo_query
  • fetch_postinfo
  • 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