vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Outputting Threads Onto Non-vB Page (https://vborg.vbsupport.ru/showthread.php?t=56773)

ULTIMATESSJ 09-04-2003 03:58 PM

Outputting Threads Onto Non-vB Page
 
For my site i am trying to make a review system using the base of vBulletin, so i thought the easiest way would be to just add fields to the New Thread thing, now i got more fields added, but one thing i would like to be able to do would be to do would be to be able to output the threads onto a Non-vB PHP File, something like this

http://localhost/forums/showthread.php?s=&threadid=1168

would become

http://localhost/showreview.php?s=&threadid=1168
(preferably shorter, i'm not sure how far i can go with shortening the url, although once i get it sorted out i would like to output it into static html files)

What would i have to put into a PHP file to be able to call this stuff out?

ULTIMATESSJ 09-08-2003 10:56 PM

bump

ULTIMATESSJ 09-09-2003 09:07 PM

please don't ignore yet ANOTHER of my pleas for help......

memobug 09-09-2003 09:30 PM

1) I probably have no clue what you are doing, but could you copy showthread.php to shortreview.php and start making your own templates to format the information how you want?

2. If you want REALLY short urls, you can use HTACCESS to create a referer that will pipe

http://www.whatever.com/reviews/38123

into

http://localhost/forums/showreview.php?s=&threadid=1168

For example, in terms of htaccess redirects, the redirect I used at my site was to create an .htaccess file in a subfolder http://pictures.bonsaitalk.com/user containing the following:

RewriteEngine On
RewriteRule (.+) http://pictures.bonsaitalk.com/showg...=1&cat=500&si=$1 [R,L]

That sent traffic from http://pictures.bonsaitalk.com/user/WHATEVER

to http://pictures.bonsaitalk.com/showg...00*si=WHATEVER

3. They have a pretty nice reviews system for sale over at photopost. http://www.photopost.com. May have to navigate your way to their other products.

Regards,

Matt

ULTIMATESSJ 09-11-2003 05:33 AM

Quote:

Originally Posted by memobug
1) I probably have no clue what you are doing, but could you copy showthread.php to shortreview.php and start making your own templates to format the information how you want?

Doing that will work but i would still have to edit more to get it to appear on the mainpage, and in the end it would just be easier to do it another way

ULTIMATESSJ 10-07-2003 10:09 PM

*cough* help *cough*

ULTIMATESSJ 10-15-2003 11:56 AM

ermmmmmm.....help?

/me hates the ignorant

SpeedStreet 10-16-2003 06:53 PM

Quote:

Originally Posted by ULTIMATESSJ
ermmmmmm.....help?

[high]* SpeedStreet hates the ignorant

[/high]
Just a guess, but if noone has responded it is because:

a) these boards have slowed down productivity since the release of vBulletin Beta. Expect activity to increase once vB3 hacks are allowed.

b) nobody has a decent solution for you...including me :)

assassingod 10-16-2003 07:01 PM

I would do it myself, but try this:
https://vborg.vbsupport.ru/showthrea...threadid=12324

Trigunflame 10-16-2003 08:54 PM

I worked on this for about 15 minutes, lots of stuff could be added/changed/improved/tweaked etc.. but this is a basic of how you would display posts within a topic.

ie. review.php?t=X (Where X = thread number)
Btw: I do recommend using / modifying the CSS tags even if you use your own header/footer.

PHP Code:

<?php

//+----------------------------
// Define Connection Variables
//+----------------------------

$site['name'] = "TF Topic View";    // Site Title

$db['host'] = "localhost";        // Server Host
$db['user'] = "root";            // Connect Username
$db['pass'] = "";            // Connect Password
$db['db'] = "forum";            // Database Name

$db['limit'] = 0;            // Show ONLY 1st Post | [0 = Off] [1 = On]

$layout['status'] = 1;            // Use Built In Template? [0 = Off] [1 = On]
$layout['bg'] = "#D2D2D2";        // Table BG Color
$layout['row1'] = "#EAEAEA";        // Row Alternate 1
$layout['row2'] = "#F2F2F2";        // Row Alternate 2

//+----------------------------
// Build MySQL Query Class
//+----------------------------

class mysql
{
    
//---------------------------
    // MySQL Initiation Function
    //---------------------------

    
function init ()
    {
        global 
$db;

        
mysql_connect($db['host'],$db['user'],$db['pass']);
        
mysql_select_db($db['db']);
    }

    
//---------------------------
    // Perform MySQL Query now..
    //---------------------------

    
function query ($sql)
    {
        static 
$i 0;
        if (!
$sql)
        {
            echo 
$i;
            return;
        }
        
$i++;

        return 
mysql_query ($sql);
    }

    
//---------------------------
    // MySQL Retrieval Functions
    //---------------------------

    
function fetch_result ($sql)
    {
        if (empty(
$sql))
        {
            die (
"No query supplemented : (Fetch Result)");
        }
        else
        {
            return 
mysql_result($sql,0);
        }
    }
    
    function 
fetch_array ($sql)
    {
        if (empty(
$sql))
        {
            die (
"No Query Supplemented : (Fetch Array)");
        }
        else
        {
            return 
mysql_fetch_array($sql);
        }
    }
}

//+------------------------------
// Initiate Everything MYSQL Now
//+------------------------------

$do = new mysql;
$do->init();

//+------------------------------
// Now Lets Begin Initialization
//+------------------------------

$thread $_GET['t'];            // Grab $_GET Variable


######################################################################
######################################################################
#include_once("./header.inc");
######################################################################
# If you want to use your own template uncomment the "Include_once"
# directive above, otherwise feel free for the script to use its
# own built in template.            -- Trigunflame
######################################################################
######################################################################

if ($layout['status'] == 1)
{

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><?php echo $site['name']; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 
{
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-weight: bold;
    font-size: 14px;
}

.style2 
{
    font-family: Arial, Helvetica, sans-serif;
    font-size: 9px;
}

.style4 
{
    font-family: Verdana, Arial, Helvetica, sans-serif; 
    font-size: 10px; 
}

.style5 
{
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-style: italic;
    font-weight: bold;
    font-size: 14px;
}

.style8 
{
    font-family: Verdana, Arial, Helvetica, sans-serif; 
    font-size: 10px; 
    font-weight: bold; 
}

.style9 
{
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
}

.style10 
{
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 1px;
}
-->
</style>
</head>
<body>

<?php
}

if (
$db['limit'] == 1)
{
    
$limit "LIMIT 1";
}
else
{
    
$limit NULL;
}

$topic $do->fetch_array($do->query("    SELECT * FROM thread
                    WHERE threadid=\""
.$thread."\"
                    LIMIT 1"
));

$query $do->query("    SELECT * FROM post
            WHERE threadid=\""
.$thread."\"
            ORDER BY postid
            ASC 
$limit");
?>

<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#D2D2D2">
  <tr>
    <td colspan="3"><span class="style1"><?php echo $topic[title]; ?></span></td>
  </tr>

<?php

$i 
1;
while (
$show $do->fetch_array($query))
{

?>

  <tr>
    <td width="20%" align="center" bgcolor="#E0E0E0"><span class="style4"><?php echo date("m.d.y"$show[dateline]);; ?></span></td>
    <td width="40%" bgcolor="#E0E0E0" class="style8"><?php echo $show[title]; ?></td>
    <td width="40%" align="right" bgcolor="#E0E0E0" class="style8">Post: <?php echo $i?>&nbsp;</td>
  </tr>
  <tr>
    <td align="center" valign="top" bgcolor="#F0F0F0"><span class="style5"><?php echo $show[username].'</span><br /><span class="style4">User ID: '.$show[userid]; ?></span></td>
    <td colspan="2" bgcolor="#F0F0F0"><table width="100%"  border="0" cellspacing="1" cellpadding="4">
      <tr>
        <td valign="top"><span class="style9"><?php echo str_replace("\n","<br />",$show[pagetext]); ?></span></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td align="center" bgcolor="#F0F0F0"><span class="style4">&nbsp;</span></td>
    <td colspan="2" bgcolor="#F0F0F0">&nbsp;<span class="style8">Button1 Button2 Button3 Button4 Button5</span></td>
  </tr>
  <tr>
    <td width="20%" align="center" bgcolor="#D2D2D2" class="style10">&nbsp;</td>
    <td width="40%" bgcolor="#D2D2D2" class="style10">&nbsp;</td>
    <td width="40%" align="right" bgcolor="#D2D2D2" class="style10">&nbsp;</td>
  </tr>

<?php
    $i
++;
}

?>

  <tr>
    <td colspan="3"><span class="style2"><a href="#">Return to Top</a></span></td>
  </tr>
</table>

<?php

######################################################################
######################################################################
#include_once("./footer.inc");
######################################################################
# If you want to use your own template uncomment the "Include_once"
# directive above, otherwise feel free for the script to use its
# own built in template.            -- Trigunflame
######################################################################
######################################################################

if ($layout['status'] == 1)
{    

?>

</body>
</html>

<?php
}
?>



All times are GMT. The time now is 02:00 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.01175 seconds
  • Memory Usage 1,806KB
  • 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
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete