PDA

View Full Version : Outputting Threads Onto Non-vB Page


ULTIMATESSJ
09-04-2003, 03:58 PM
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/showgallery.php?thumb=1&stype=2&sort=1&cat=500&si=$1 [R,L]

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

to http://pictures.bonsaitalk.com/showgallery.php?thumb=1&stupe=2&sort=1*cat=500*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
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
ermmmmmm.....help?

* SpeedStreet hates the ignorant
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/showthread.php?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

//+----------------------------
// 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
}
?>

assassingod
10-16-2003, 08:57 PM
Trigunflame, that is a very complex way of doing it - you are using so much unnessacary code there.

If you were to require global.php, you could use a query to extract the last x threads, then eval a template in a while loop.:)

Trigunflame
10-16-2003, 10:11 PM
Yes but, I was taking into account the forum might have been on another server (which is often), so making my own small mysql class works for a persons benefit.

Ive been coding for nearly 7 years and have been contracted on big projects in excess of $500 for a script. My knowledge of coding need not be questioned by you.

ps. I dont like using eval :) why use another function when i can simply <?php and ?> around things.

Thanks

assassingod
10-17-2003, 07:15 AM
Yes but, I was taking into account the forum might have been on another server (which is often), so making my own small mysql class works for a persons benefit.

Ive been coding for nearly 7 years and have been contracted on big projects in excess of $500 for a script. My knowledge of coding need not be questioned by you.

ps. I dont like using eval :) why use another function when i can simply <?php and ?> around things.

Thanks
I did not mean to offend by my post. I was merely suggesting that a more efficient way to it was to use something like (this is code from my portal, it wont work with vB2 so dont try it)


$news = $DB_site->query("
SELECT thread.threadid,thread.title,thread.replycount,thr ead.postusername,thread.postuserid,thread.dateline ,thread.views,thread.iconid,post.pagetext
FROM " . TABLE_PREFIX . "thread
LEFT JOIN post ON (post.threadid = thread.threadid AND post.dateline = thread.dateline)
WHERE forumid = '$vboptions[ap_news_forumid]'
ORDER BY thread.dateline DESC
LIMIT $vboptions[ap_news_numofnews]
");
while ($newss = $DB_site->fetch_array($news))
{
$newss['dateline'] = vbdate($vboptions['dateformat'], $newss['dateline'], 1);
$newss['pagetext'] = parse_bbcode($newss['pagetext']);
eval('$portal_news .= "' . fetch_template('portal_news') . '";');
}


Its almost the same with vB2, although I do believe it will require editing newreply.php but thats it.

ULTIMATESSJ
11-03-2003, 10:17 PM
that would be for showing the last x threads though, right?

hell, i can't do this so i'm just not gonna bother, helps way out of my reach for this, and i don't feel like paying someone a load of money for something thats easily done

Sylvus
11-04-2003, 07:00 PM
There is hope! Someone is putting the finishing touches on an article review system for vBulletin. There was a thread about it just posted recently on this site from what I can recall.

Patience!

Syl...

ULTIMATESSJ
11-04-2003, 08:43 PM
There is hope! Someone is putting the finishing touches on an article review system for vBulletin. There was a thread about it just posted recently on this site from what I can recall.

Patience!

Syl...

I know about that, but by that time, the web will be plastered with article systems meaning originality in that factor will be dead, making my system pretty pointness. I don't care for anyone elses system, all i want is to output my threads, i have my own article system made on my forums, i just need to know how to output the threads, and before someone releases an Article System and it gets plastered all over the net

EDIT: I used TrigunFlames code, worked perfectly, so thanks to TrigunFlame for solving a problem i've had for months