PDA

View Full Version : How to Insert Last post Vbulletin Fourm


llorens
04-14-2008, 06:41 PM
Hi,

I write this post here because i would like know how to INSERT last post Vbulletin Forum in my Main Page of Vivvo 4.02.

I member from 2 month, and i hope someone can help me.

I already know how to insert the View Last Posts from the forum (Vbulletin) and i have the script, but i dont know how to insert it with the TPL files.

I want that Script works, because is nice to see in the main page the Last posts from the Forum.

HERE is the SCRIPT: (It works with .php files)

<?php

#########################
## LAST X POSTS v3.1 ##
## PHASE(1) MEDIA ##
## PHASE(1) MEDIA, LLC. | Creativity + Innovation = Endless Possibilities ##
## TRE@PHASE1MEDIA.COM ##
#########################

/* This script shows the last X numbers of posts (titles) posted last on a non-vBulletin page.
You may customize it in any way you wish. If you have any problems with it, you can
post them at vBulletin.org or send me an email to tre@phase1media.com.

Enjoy!
*/

## CUSTOMIZE SETTINGS FOR YOUR SITE ##
$db_host = "localhost"; // Change this if your MySQL database host is different.
$db_name = ""; // Change this to the name of your database.
$db_user = ""; // Change this to your database username.
$db_pw = ""; // Change this to your database password.

$forum_url = ""; // Change this to reflect to your forum's URL.
$forum_id = ""; // If you wish to display the posts from a specific forum, enter the forum id here. Otherwise, leave it blank.
$limit = "07"; // Number of posts displayed.
$titlecolor = "#3366FF"; // This is the color of the title.
$postedcolor = "#404040"; // This is the color of the bottom text.
$txtlimit = "100"; // This is the character limit.
#######################################

// Connecting to your database
mysql_connect($db_host, $db_user, $db_pw)
OR die ("Cannot connect to your database");
mysql_select_db($db_name) OR die("Cannot connect to your database");

// Below is the beginning of a table. If you feel you don't need it, you may remove it.
echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">";

if ($forum_id) {
$forumid = "AND forumid=$forum_id";
}

if ($limit) {
$limited = "LIMIT $limit";
}
$thread_sql = mysql_query("SELECT threadid,title,lastpost,lastposter FROM thread WHERE visible=1 AND open=1 $forumid ORDER BY lastpost DESC $limited");

while($thread_get=mysql_fetch_array($thread_sql))
{
$lastpost = $thread_get['lastpost'];
$poster = $thread_get['last??????????g??<?php

#####################poster'];
$tid = $thread_get['threadid'];
$psql = mysql_query("SELECT postid FROM post WHERE threadid=$tid ORDER BY postid DESC");
$getp=mysql_fetch_array($psql);
$pid = $getp['postid'];
$date2 = date ("m/d/y h:i A" ,$lastpost);
$title = $thread_get['title'];
$title = substr($title,0,$txtlimit);
echo "<tr><td><font size=\"2\" face=\"arial,verdana,geneva\"><a href=\"$forum_url/showthread.php?p=$pid#post$pid\" ><FONT SIZE=\"2\" COLOR=\"$titlecolor\" face=\"arial,verdana,geneva\">$title</FONT></a></f ont><br /><font color=\"$postedcolor\" face=\"arial,verdana,geneva\" size='1'>$poster <i>$date2</i></FONT></td></tr>";
}
echo "</table>";

?>


So... Someone can tell me how to insert that Script and used it with TPL files... or how i can insert LAST POST vBULLETIN to my MAIN PAGE.

Hope answer soon, VIVVO TEAM,

REGARDS

boccio
04-14-2008, 09:54 PM
http://www.vivvo.net/forums/showthread.php?t=1726
http://www.vivvo.net/resources/how-to/vbulletin-latest-post.html
http://www.vivvo.net/doc/v4/plugin_manual/vBulletin_integration.php

llorens
04-16-2008, 08:36 PM
Hi Boccio,

Thanks for u anwser, but i still have problems,, i see the box but i dont see the last posts.

I try a couple of times but... it not working. Maybe is something that i have to change in the control panel but im not sure.

<vte:param name="url" value="http://www.pokerfacil.com/foro/external.php?type=RSS2" />
<vte:param name="limit" value="10" />
<vte:param name="time" value="2" />

Here is how i have it in the SCRIPT u gave me,, and also i show u 2 images where u see the details of my Vbulletin Forum and the image that shows that i cant see the the box but i cant see the last posts...

When u write, http://www.pokerfacil.com/foro/external.php?type=RSS2 u will see its working fine, but why i cant see make it work that scrpit ??

Just let me know, what i can do, and how u can help me,

Regards