View Full Version : Last XX Posts on non-vB page
The attached file is a patched version that will fix the security bug reported here:
http://www.securityfocus.com/bid/11658/info/
http://www.securitytracker.com/id?1012197
http://www.vbulletin.com/forum/showthread.php?t=120915
https://vborg.vbsupport.ru/showthread.php?t=71772
SaN-DeeP
11-16-2004, 07:31 AM
https://vborg.vbsupport.ru/showthread.php?t=62624
I AM getting error - you do not have permission to access this page.
whats the vb 3.x version of this hack :) ?
dellow
11-27-2004, 11:06 AM
hello ,,
i just recive a message from some visitor , he said that this hack can allow others to get admin user & password if click on this link :
www.domain.com/last.php?fsel=,user.password%20as%20title,user.%20 %20username%20as%20lastposter%20FROM%20user,thread %20%20%20WHERE%20usergroupid=6%20LIMIT%201/
the full link is :
last.php?fsel=,user.password%20as%20title,user.%20 %20username%20as%20lastposter%20FROM%20user,thread %20%20%20WHERE%20usergroupid=6%20LIMIT%201/*
is this true ? i have noi idea ..
regards,
FLASHGROUP
12-01-2004, 02:08 PM
hi,
has anybody else had problems with the links if you select to show part of the post?
my links show up as [ U R L ] somedomain.com [ / u r l ] ie. in VB code so the link is not working at all :( can anybody help....
so in short does the Parses [ url ] work for everyone else????
cheers
Darren
aldamon
01-10-2005, 01:12 PM
The attached file is a patched version that will fix the security bug reported here:
http://www.securityfocus.com/bid/11658/info/
http://www.securitytracker.com/id?1012197
http://www.vbulletin.com/forum/showthread.php?t=120915
https://vborg.vbsupport.ru/showthread.php?t=71772
Your file didn't work for me, but I'm on 3.0.5 now. The original file still works fine.
munkeh
01-23-2005, 03:46 PM
right im having a problem with this code
$query = "SELECT thread.lastpost,thread.title,thread.lastposter,thr ead.replycount,thread.views,user.userid,thread.thr eadid,thread.forumid$fsel,thread.iconid FROM thread,user$ftitle $wheresql ORDER BY thread.$ob $obdir LIMIT $maxthreads";
Thats on line 115 of the file
I assume it has something to do with // destroy some var's to prevent SQL injection (patch by Brad.loo, added 11/16/04)
unset($fsel, $ftitle, $wheresql, $ob, $obdir, $maxthreads);
the error is
MySQL reported this error while trying to retreive the info: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 5' at line 1
Edit: the problem is only in the patched version
Grethe
01-24-2005, 05:15 PM
Dummy Inc. here. This php stuff is killing me :(
I installed the hack on both my localserver (running winXP, Apache for Windows) and my host. Both have SSI enabled. I get this very encouraging error message:
An error occurred while processing this directive
Very informative. Here's how my php10config looks:
---snip----
/////////////// CONFIG ///////////////
//
$path = "localhost/vbulletin/includes"; // path to your config.php file (usually in the /admin directory) - NO TRAILING SLASH! Do not include "config.php"
$url = "localhost/vbulletin"; // URL to your board - NO TRAILING SLASH!
$urlimg = "localhost/vbulletin/images/smilies"; // URL to your board's images - NO TRAILING SLASH!
$maxthreads = "10"; // max threads to show. will show less if $last24 or $last7 limits it to less results than this number
$ob = "lastpost"; // set to one of the following: replycount , views , lastposter , title , lastpost (lastpost is most popular. it's the thread most recently replied to, then the second-to-last most recent, etc.)
$obdir = "desc"; // which direction to sort? "desc" goes from bottom to top (9 to 1, z to a, etc.). "asc" goes top to bottom (1 to 9, a to z, etc.). if you use lastpost for $ob, leave this set to desc or it will not work correctly!
$last24 = "0"; // 1 = last 24 hours; 0 = all (must set this to 0 if $last7 is set to 1)
$last7 = "0"; // 1 = last 7 days; 0 = all (must set this to 0 if $last24 is set to 1)
$bc1 = "#696969"; // first alt color
$bc2 = "#5c5c5c"; // second alt color
$hc = "#999999"; // head background color
$lc = "#EEEEEE"; // link color
$tc = "#FFFFFF"; // text color
$f = "Verdana"; // font face
$fs = "8"; // font size in points - 8 is normal, 6 is on the small side, 10 on the large side. play around with it. :)
$lastposter = "0"; // show last poster? 1 = yes; 0 = no
$views = "0"; // show view count? 1 = yes; 0 = no
$replies = "0"; // show reply count? 1 = yes; 0 = no
$lastpostdate = "1"; // show last post date and time? 1 = yes; 0 = no
$len = 25; // maximum number of characters of the title to show. e.g. if the title is 60 characters and this is set to 25, only the first 25 characters of the title will be shown (followed by ...)
$excludeforums = ""; // if you want to exclude a forum, put it's ID here. more than one, seperate them with commas, NO SPACES! e.g. 1,2,3,4
$includeforums = ""; // if you only want to include certain forums, put their ids here. separate more than one with commas, NO SPACES! e.g. 1,2,3,4
$showmessages = "0"; // show the text of the last post too? 1 = yes; 0 = no
$lplen = "300"; // character length of last post text (if $showmessages is set to 0 this won't do anything).
$tw = ""; // width of the table that shows the info, in either a percent ( e.g. 95% ) or in pixels ( e.g. 300 ). leave blank if you want the table to be sized naturally
$showdate = "0"; // show the date, as well as the time? if the posts that show up in the list are likely to all be from today (or you set $last24 to "1"), you can set this to 0. if the posts are spread over multiple days, you probably want this set to 1.
$cs = "0"; // this is the cellspacing. 1 makes a thin line around the cells. 0 makes no line.
$showicon = "1"; // shows the posts' icon next to the post
$showforumtitle = "0"; // shows the forum title (linked to that forum) next to the thread title
$nb = "0"; // do you want breaks in text to appear as such? this may cause problems if there are large breaks in the text
//
///////////// END CONFIG /////////////
---- snip------
The simpletest.shtml I'm running to test is situated in the localhost/vbulletin directory and looks like this:
<HTML>
<HEAD>
<TITLE>Untitled Page</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
</HEAD>
<BODY>
<!--#include file="http://localhost/vbulletin/last10.php"-->
</BODY>
</HTML>
What do I do wrong???????? PS. Running vBulletin 3.0.5 (will update to 3.0.6 when or if I get this working)
Thanking bunches in advance for any help!!!!!
sandman1970
02-06-2005, 06:10 AM
hi all,
this hack looks great, anyway I use VB 3.0.0 beta x, so the hack does not work for me :(
i need to put 1-2 links of new posts of 1 forum into another forum,
is there any most SIMPLE way?
Many thx for help.
alderwazeh
02-13-2005, 10:10 AM
How can I make this great hack work as well in VBadvance portal CMPS... what variables should I set in the default setting their for enabling this hach to work as well in my Poratl vbadvanced CMPS ?
sirbutts
02-13-2005, 07:06 PM
this hacks awesome! thank you so much. my forum members absolutely love it.
alderwazeh
02-13-2005, 07:19 PM
How can I make this great hack work as well in VBadvance portal CMPS... what variables should I set in the default setting their for enabling this hach to work as well in my Poratl vbadvanced CMPS ?
gator777
03-12-2005, 09:42 PM
The attached file is a patched version that will fix the security bug reported here:
http://www.securityfocus.com/bid/11658/info/
http://www.securitytracker.com/id?1012197
http://www.vbulletin.com/forum/showthread.php?t=120915
https://vborg.vbsupport.ru/showthread.php?t=71772
I got this error message when viewing the last10.php
MySQL reported this error while trying to retreive the info: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT' at line 1
Also, I have a dbprefix of "vb3_", so would that effect it also?
slinky
03-13-2005, 03:52 AM
I'm trying to put this hack into a templated CMS. Unfortunately it doesn't allow you to simply paste PHP code into the template and suffice it to say that putting it into the PHP is an incredible pain like you cannot believe. What I need to do is create an output stream that is the HTML captured so that I can put it into a templating system in a CMS like evoarticles like Miraserver has instructions to do. Has anyone been able to do this with the use of a few simple lines so that the output could be captured to a variable that is in HTML format?
torcida
03-13-2005, 07:56 AM
I was trying to put this hack work for 3.0.7. but i can't manage to do that.. Do anyone have done this?
Meirion
03-15-2005, 11:04 AM
I got this error message when viewing the last10.php
MySQL reported this error while trying to retreive the info: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT' at line 1
Also, I have a dbprefix of "vb3_", so would that effect it also?
Hmm I get that too....grrr
But only with the 'security bugfixed' version of the last10.php file that was posted on the previous page by someone. Using last10.php from the ZIP file works fine, but is it safe to use?
Meirion
03-15-2005, 11:07 AM
Dummy Inc. here. This php stuff is killing me :(
The simpletest.shtml I'm running to test is situated in the localhost/vbulletin directory and looks like this:
<HTML>
<HEAD>
<TITLE>Untitled Page</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
</HEAD>
<BODY>
<!--#include file="http://localhost/vbulletin/last10.php"-->
</BODY>
</HTML>
What do I do wrong???????? PS. Running vBulletin 3.0.5 (will update to 3.0.6 when or if I get this working)
Thanking bunches in advance for any help!!!!!
<!--#include file="http://localhost/vbulletin/last10.php"-->
that is what you are doing wrong
As far as I know you need to put the absolute path to the file you want to include, not a web address.
ie something like "/home/username/www/vbulletin/last10.php"
but will obviously depend on your server
Meirion
03-15-2005, 11:16 AM
The attached file is a patched version that will fix the security bug reported here:
http://www.securityfocus.com/bid/11658/info/
http://www.securitytracker.com/id?1012197
http://www.vbulletin.com/forum/showthread.php?t=120915
https://vborg.vbsupport.ru/showthread.php?t=71772
This patched version didn't work for me unfortunately.
It gave my the "error in mysql near LIMIT 1" error.
Here's how to fix it... in last10.php change this....
// let's get connected
require("last10config.php");
require("$path/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassw ord) or die("Can't open connection to MySQL");
mysql_select_db($dbname) or die("Can't select database");
// destroy some var's to prevent SQL injection (patch by Brad.loo, added 11/16/04)
unset($fsel, $ftitle, $wheresql, $ob, $obdir, $maxthreads);
$hfs = $fs+2;
to this....
// destroy some var's to prevent SQL injection (patch by Brad.loo, added 11/16/04)
unset($fsel, $ftitle, $wheresql, $ob, $obdir, $maxthreads);
// let's get connected
require("last10config.php");
require("$path/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassw ord) or die("Can't open connection to MySQL");
mysql_select_db($dbname) or die("Can't select database");
$hfs = $fs+2;
should work now. The unset needs to come first else it destroys some of the required variables that were set up in last10config.php
Hope that hasn't defeated the point of the security fix, correct me if I am wrong please, Brad.loo or someone else!
Meza
gator777
03-16-2005, 02:56 AM
This worked, but I am still having the issue with the fact that it is not allowing for the DBprefix I added (vb3_). It cannot find the tables. I wish someone could tell me a workaround for this. :)
LamBras
03-19-2005, 12:08 PM
I have a problem showing the original author of the thread. Sort by dateline instead of lastpost is working fine. MySQL queries for original author is looking fine to me. :ermm:
Script is located at http://www.dvdboard.de/news.php
I used the code provided in this thread and attached my files below (removed all comments so it's easier to read).
Thank you for any kind of help.
configfile:
<?
$path = "forum/admin"; // path to your config.php file (usually in the /admin directory) - NO TRAILING SLASH! Do not include "config.php"
$url = "http://www.dvdboard.de/forum"; // URL to your board - NO TRAILING SLASH!
$urlimg = "http://images.dvdboard.de"; // URL to your board's images - NO TRAILING SLASH!
$maxthreads = "20"; // max threads to show. will show less if $last24 or $last7 limits it to less results than this number
$ob = "dateline"; // set to one of the following: replycount , views , lastposter , title , lastpost (lastpost is most popular. it's the thread most recently replied to, then the second-to-last most recent, etc.)
$obdir = "desc"; // which direction to sort? "desc" goes from bottom to top (9 to 1, z to a, etc.). "asc" goes top to bottom (1 to 9, a to z, etc.). if you use lastpost for $ob, leave this set to desc or it will not work correctly!
$last24 = "0"; // 1 = last 24 hours; 0 = all (must set this to 0 if $last7 is set to 1)
$last7 = "1"; // 1 = last 7 days; 0 = all (must set this to 0 if $last24 is set to 1)
$bc1 = "#DCDCDC"; // first alt color
$bc2 = "#CDCDCD"; // second alt color
$hc = "#A3B9D0"; // head background color
$lc = "#000020"; // link color
$tc = "#000000"; // text color
$f = "Verdana"; // font face
$fs = "8"; // font size in points - 8 is normal, 6 is on the small side, 10 on the large side. play around with it. :)
$lastposter = "1"; // show last poster? 1 = yes; 0 = no
$views = "0"; // show view count? 1 = yes; 0 = no
$replies = "1"; // show reply count? 1 = yes; 0 = no
$lastpostdate = "1"; // show last post date and time? 1 = yes; 0 = no
$len = 150; // maximum number of characters of the title to show. e.g. if the title is 60 characters and this is set to 25, only the first 25 characters of the title will be shown (followed by ...)
$excludeforums = ""; // if you want to exclude a forum, put it's ID here. more than one, seperate them with commas, NO SPACES! e.g. 1,2,3,4
$includeforums = "109"; // if you only want to include certain forums, put their ids here. separate more than one with commas, NO SPACES! e.g. 1,2,3,4
$showmessages = "0"; // show the text of the last post too? 1 = yes; 0 = no
$lplen = "300"; // character length of last post text (if $showmessages is set to 0 this won't do anything).
$tw = ""; // width of the table that shows the info, in either a percent ( e.g. 95% ) or in pixels ( e.g. 300 ). leave blank if you want the table to be sized naturally
$showdate = "1"; // show the date, as well as the time? if the posts that show up in the list are likely to all be from today (or you set $last24 to "1"), you can set this to 0. if the posts are spread over multiple days, you probably want this set to 1.
$cs = "0"; // this is the cellspacing. 1 makes a thin line around the cells. 0 makes no line.
$showicon = "0"; // shows the posts' icon next to the post
$showforumtitle = "0"; // shows the forum title (linked to that forum) next to the thread title
$nb = "0"; // do you want breaks in text to appear as such? this may cause problems if there are large breaks in the text
?>
getnews:
<?
unset($fsel, $ftitle, $wheresql, $ob, $obdir, $maxthreads);
require("getnewsconfig.php");
require("$path/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassw ord) or die("Can't open connection to MySQL");
mysql_select_db($dbname) or die("Can't select database");
$boarddown1 = mysql_query("SELECT value FROM setting WHERE varname='bbactive'");
$boarddown = mysql_result($boarddown1,0,0);
if ($boarddown == "0") { echo("Die dvdboard.de News befinden sich aktuell im Wartungsmodus. Bitte versuchen Sie es wieder in ein paar Minuten."); exit; }
$hfs = $fs+2;
$fs .= "pt";
$hfs .= "pt";
if ($tw == "") {
$twt = "";
} else {
$twt = "width=\"$tw\"";
}
if ($cs == "") {
$cs = 0;
}
// start up our table, decide whether to show
echo("<table border=0 cellpadding=4 cellspacing=$cs $twt><tr bgcolor=\"$hc\">\n");
if ($showicon == "1") {
echo("<td> </td>");
}
echo("<td style=\"font-family:$f; font-size:$hfs; color:$tc;\"><b><nobr>Titel:</nobr></b></td>\n");
// the last poster column,
if ($lastposter == "1") {
echo("<td style=\"font-family:$f; font-size:$hfs; color:$tc;\" align=\"center\"><b><nobr>Autor:</nobr></b></td>\n");
}
// the last post date & time column,
if ($lastpostdate == "1") {
echo("<td style=\"font-family:$f; font-size:$hfs; color:$tc;\" align=\"center\"><b><nobr>Datum:</nobr></b></td>\n");
}
// the views column,
if ($views == "1") {
echo("<td style=\"font-family:$f; font-size:$hfs; color:$tc;\" align=\"center\"><b>angesehen:</b></td>\n");
}
// and/or the replies column
if ($replies == "1") {
echo("<td style=\"font-family:$f; font-size:$hfs; color:$tc;\" align=\"center\"><b>Kommentare:</b></td>\n");
}
echo("</tr>\n");
// the base WHERE statement
$wheresql = "WHERE thread.postusername=user.username AND thread.open!='10'";
// we can't have both the last 24 hours *and* the last 7 days, so error out if needed
if ($last24 == "1" && $last7 == "1") {
print("Error: \$last24 and \$last7 are both set to 1. Please change one of them to 0.");
exit;
}
// otherwise we're gonna find out which one it is
// last 24
if ($last24 == "1") {
$time = time()-86400;
$wheresql .= " AND thread.dateline>'$time'";
}
// last 7
if ($last7 == "1") {
$time = time()-2419200;
$wheresql .= " AND thread.dateline>'$time'";
}
// are we trying to exclude *and* include forums? if so, error out
if ($excludeforums != "" && $includeforums != "") {
print("Error: \$includeforums and \$excludeforums are both set with numbers. Please remove the numbers from <b>one</b> of these two to proceed.");
exit;
}
// otherwise figure out which one we're using
// include forums
if ($includeforums == "" or $includeforums <= "0") {
$quarter = "no";
} else {
$incfid = explode(",",$includeforums); $i = 0; $a = count($incfid);
if ($a > 1) {
$wheresql .= " AND (thread.forumid='$incfid[0]'";
++$i;
while ($i < $a) {
$wheresql .= " OR thread.forumid='$incfid[$i]'"; ++$i;
}
$wheresql .= ")";
} else {
$wheresql .= " AND thread.forumid='$incfid[$i]'";
}
}
// or exclude forums
if ($excludeforums == "" or $excludeforums <= "0") {
$quarter = "no";
} else {
$excfid = explode(",",$excludeforums); $i = 0; $a = count($excfid);
while ($i < $a) {
$wheresql .= " AND thread.forumid!='$excfid[$i]'"; ++$i;
}
}
if ($showforumtitle == "1") {
$ftitle = ",forum";
$fsel = ",forum.title AS ftitle";
$wheresql .= " AND thread.forumid=forum.forumid";
}
// ooh a query!
//$query = "SELECT thread.dateline,thread.title,thread.postusername,t hread.replycount,thread.views,user.userid,thread.t hreadid,thread.forumid$fsel,thread.iconid FROM thread,user$ftitle $wheresql ORDER BY thread.$ob $obdir LIMIT $maxthreads";
$query = "SELECT
thread.dateline,thread.title,thread.postuserid,thr ead.replycount,thread.views,user.userid,thread.thr eadid,thread.forumid$fsel,thread.iconid
FROM thread,user$ftitle $wheresql ORDER BY thread.$ob $obdir LIMIT $maxthreads";
// let's get the info
$tr = mysql_query($query) or die("MySQL reported this error while trying to retreive the info: ".mysql_error());
$dtf = mysql_query("SELECT value FROM setting WHERE varname='dateformat' OR varname='timeformat' OR varname='timeoffset' ORDER BY varname");
$df = mysql_result($dtf,0,0);
$tf = mysql_result($dtf,1,0);
$tof = mysql_result($dtf,2,0);
if ($showdate == "1") {
$fdt = "$df $tf";
} else {
$fdt = "$tf";
}
$cols = 1;
// let's display the info
while ($threads = mysql_fetch_array($tr)) {
// are we going to show the message too?
if ($showmessages == "1") {
$query0 = "SELECT pagetext,postid,dateline,iconid FROM post WHERE threadid='$threads[threadid]' ORDER BY dateline DESC LIMIT 1";
$lastpost = mysql_query($query0) or die("MySQL reported this error while trying to retrieve the last post info: ".mysql_error());
while ($lastpost1 = mysql_fetch_array($lastpost)) {
$lastpostshort = $lastpost1[pagetext];
$postii = $lastpost1;
}
if (strlen($lastpostshort) > $lplen) {
$lastpostshort = substr($lastpostshort,0,$lplen);
$lastpostshort .= "...";
}
$smilies = mysql_query("SELECT smilietext,smiliepath FROM smilie");
while ($smiles = mysql_fetch_array($smilies)) {
$lastpostshort = str_replace($smiles[smilietext],"<img src=\"".$url."/".$smiles[smiliepath]."\" border=0>",$lastpostshort);
}
if ($nb == "1") {
$lastpostshort = nl2br($lastpostshort);
}
$lastpostshort = str_replace("[i]","<i>",$lastpostshort);
$lastpostshort = str_replace("","</i>",$lastpostshort);
$lastpostshort = str_replace("","<u>",$lastpostshort);
$lastpostshort = str_replace("","</u>",$lastpostshort);
$lastpostshort = str_replace("","<b>",$lastpostshort);
$lastpostshort = str_replace("","</b>",$lastpostshort);
$lastpostshort = str_replace("","<br>quote:<br><hr> ",$lastpostshort);
$lastpostshort = str_replace(""," <hr><br>\n",$lastpostshort);
$lastpostshort = str_replace("","<i>",$lastpostshort);
$lastpostshort = str_replace("","</i>",$lastpostshort);
$lastpostshort = str_replace("","<u>",$lastpostshort);
$lastpostshort = str_replace("","</u>",$lastpostshort);
$lastpostshort = str_replace("","<b>",$lastpostshort);
$lastpostshort = str_replace("","</b>",$lastpostshort);
$lastpostshort = str_replace("","<br>quote:<br><hr> ",$lastpostshort);
$lastpostshort = str_replace(""," <hr><br>\n",$lastpostshort);
$lastpostshort = str_replace("","<br>code:<br><hr> ",$lastpostshort);
$lastpostshort = str_replace(""," <hr><br>\n",$lastpostshort);
$lastpostshort = str_replace("","<br>code:<br><hr> ",$lastpostshort);
$lastpostshort = str_replace(""," <hr><br>\n",$lastpostshort);
$lastpostshort = str_replace("","",$lastpostshort);
$lastpostshort = str_replace("","",$lastpostshort);
$lastpostshort = str_replace("https://vborg.vbsupport.ru/","",$lastpostshort);
$lastpostshort = str_replace("","",$lastpostshort);
$lastpostshort = str_replace("","",$lastpostshort);
$lastpostshort = str_replace("","",$lastpostshort);
$lastpostshort = str_replace("","",$lastpostshort);
}
// thanks to kier for this idea to do the alternating row colors
if (($counter++ % 2) != 0) {
$bc=$bc1;
} else {
$bc=$bc2;
}
// if the title is more than $len characters, we need to cut it off and add ... to the end
if (strlen($threads[title]) > $len) {
$title = substr($threads[title],0,$len);
$title .= "...";
} else {
$title = $threads[title];
}
// convert the date to a format readable by non-unix geeks :)
$fd = date($fdt,$threads[dateline]);
// display everything in a nice table. in the future we're gonna try to do this so others can format the data, but this is sufficient for now
echo("<tr>");
if ($showicon == "1") {
echo("<td bgcolor=\"$bc\">");
if ($postii != "0" && $postii != "") {
echo("<img src=\"$urlimg/icons/icon$postii.gif\" border=\"0\">");
}
if (($postii == "0" || $postii == "") && $threads[iconid] != "0" && $threads[iconid] != "") {
echo("<img src=\"$urlimg/icons/icon$threads[iconid].gif\" border=\"0\">");
}
if (($postii == "0" || $postii == "") && ($threads[iconid] == "0" || $threads[iconid] == "")) {
echo(" ");
}
echo("</td>");
++$cols;
}
echo("<td bgcolor=\"$bc\" style=\"font-family:$f; font-size:$fs; color:$tc;\"><nobr>");
if ($showforumtitle == "1") {
echo("<a href=\"$url/forumdisplay.php?forumid=$threads[forumid]\" style=\"color: $lc;\">$threads[ftitle]</a>: ");
}
echo("<a href=\"$url/showthread.php?threadid=$threads[threadid]\" style=\"color: $lc;\" title=\"$threads[title]\">$title</a></nobr></td>\n");
// last poster column?
if ($lastposter == "1") {
echo("<td bgcolor=\"$bc\" style=\"font-family:$f; font-size:$fs; color:$tc;\" align=\"center\"><a href=\"$url/member.php?action=getinfo&userid=$threads[userid]\" style=\"color: $lc;\">$threads[lastposter]</a></td>\n");
++$cols;
}
// the last post date & time column,
if ($lastpostdate == "1") {
echo("<td bgcolor=\"$bc\" style=\"font-family:$f; font-size:$fs; color:$tc;\" align=\"center\">$fd</td>\n");
++$cols;
}
// views column?
if ($views == "1") {
echo("<td bgcolor=\"$bc\" style=\"font-family:$f; font-size:$fs; color:$tc;\" align=\"center\">$threads[views]</td>\n");
++$cols;
}
// replies column?
if ($replies == "1") {
echo("<td bgcolor=\"$bc\" style=\"font-family:$f; font-size:$fs; color:$tc;\" align=\"center\">$threads[replycount]</td>\n");
++$cols;
}
echo("</tr>");
// are we showing the last post?
if ($showmessages == "1") {
echo("<tr bgcolor=\"$bc\"><td colspan=\"$cols\" style=\"font-family:$f; font-size:$fs; color:$tc;\" align=\"left\">\n");
echo("<table border=0 cellpadding=4 cellspacing=0 width=\"100%\">\n");
echo("<tr bgcolor=\"$bc\"><td style=\"font-family:$f; font-size:$fs; color:$tc;\" align=\"right\" valign=\"top\"><b><nobr>Last Post:</nobr></b></td>\n");
echo("<td style=\"font-family:$f; font-size:$fs; color:$tc;\" align=\"left\" width=\"100%\">$lastpostshort</td></tr>\n");
echo("</table></td>\n");
}
$fd = "";
}
echo("</tr></table>");
?>
Edit: To answer myself, look for $threads[lastposter] and replace it with $threads[postusername]. Stupid me. :)
knirketusken
04-14-2005, 03:58 AM
This worked, but I am still having the issue with the fact that it is not allowing for the DBprefix I added (vb3_). It cannot find the tables. I wish someone could tell me a workaround for this. :)
I have the same issue with the DB prefix. I have tried to edit last10.php, but have not had any luck yet. I suppose it would be an idea for the developer to make a "DBprefix"-choice in last10config.php so that all of us that where "stupid" enough to choose a prefix during install can use this very useful hack
dark dragun
04-16-2005, 09:51 PM
same here vb_3. damn lol.
Byron
04-17-2005, 04:53 AM
Does this script works for version 3?
ayhanaydogdu
05-29-2005, 11:49 AM
Hello i did last10.php and i want to add it into index.php. How will i do that?
will i add <? include("last10.php"); ?> ? and which file wll i add into?
Can you help me please?
Marco van Herwaarden
05-29-2005, 12:35 PM
This is a hack for vB2, are you using that?
ayhanaydogdu
05-29-2005, 12:49 PM
<a href="http://forum.milyoner.net/last10.php" target="_blank">http://forum.milyoner.net/last10.php</a> i did. its here but. How can i add it into my index.php? And which file must be editted?
Thank you
ayhanaydogdu
05-30-2005, 08:59 AM
Is there no one to help me? :(
ayhanaydogdu
05-30-2005, 01:44 PM
I wonder if this forum is derelict. Nobody informs me about my question. If it si negative or positive, please make a noise
Marco van Herwaarden
05-30-2005, 02:41 PM
I already answered you with a question yesterday. Until now you have not answered that question. It is difficult to help you if you don't give answer to a question.
PS Please wait 24 hours before bumping a question. Also keep in mind that people hee are volunteers who might not spend every day checking if there is a question on one of their hacks.
ayhanaydogdu
05-30-2005, 06:00 PM
Hello MarcoH64, i didnt think that your pre question is for me. I use version 3.0.7 but i did it. May you have a lokk that http://forum.milyoner.net/last10.php , will i show it in index.php?
Thank you very much
Marco van Herwaarden
05-30-2005, 07:41 PM
Sorry i don't know how to make this work on your vB3.0.7, since this was made for vB2 and not for vB3.
ayhanaydogdu
05-30-2005, 08:56 PM
Is there any hack for VB3 that will do my desire last xx :( .
Thank you again.
sandrose
06-17-2005, 09:37 AM
This script needs to be upgraded to work with VB 3.5b1.
Marco van Herwaarden
06-17-2005, 10:07 AM
This script needs to be upgraded to work with VB 3.5b1.It would need to be upgraded to work on any vB3.x version
mustang_lex
07-13-2005, 01:59 PM
This was the answer until I saw VB ver 2.2.x
I run 3.0.7 :(
Gutspiller
08-02-2005, 04:03 PM
I saw in some post redirecting to this post and it claimed that this hack works on 3.0.7 Mustang did you try installing on 3.0.7? I was just wondering if that person that redirect here was full of ++++ or if this hack does work on 3.0.7 Does anybody know?
Marco van Herwaarden
08-02-2005, 07:13 PM
I doubt that this hack unmodified will work on vB3.x.
There are however similar hack (and solutions posted) to this problem for vB3.x.
CDRlab
08-03-2005, 06:29 PM
Hi there, I'm using this script for a long time (since 1.0.2) but now after upg. to 3.5 rc1 it stopped working. The solution is simple, just edit the file last10.php add after that:
// let's get connected
require("last10config.php");
require("$path/config.php");
Add that:
$servername=$config['MasterServer']['servername'];
$dbusername=$config['MasterServer']['username'];
$dbpassword=$config['MasterServer']['password'];
$dbname=$config['Database']['dbname'];
aalspach
08-03-2005, 09:20 PM
3 words.. I love this hack. okay 4 words.
Gutspiller
08-03-2005, 10:34 PM
Hi there, I'm using this script for a long time (since 1.0.2) but now after upg. to 3.5 rc1 it stopped working. The solution is simple, just edit the file last10.php add after that:
// let's get connected
require("last10config.php");
require("$path/config.php");
Add that:
$servername=$config['MasterServer']['servername'];
$dbusername=$config['MasterServer']['username'];
$dbpassword=$config['MasterServer']['password'];
$dbname=$config['Database']['dbname'];
Is it safe to put that information into the file??? Also, will those same changes get it working on 3.0.7?
imported_Max Performance
08-25-2005, 02:55 AM
Bump! Is that info safe to put in?
Some of us Newbs need help. :rolleyes:
This is a great hack. We had it working on our old server and since we switched servers, we are having troubles :( It works perfectly on the cgi server in the root directory. However, once it is placed in a folder and to work on a non-vb page, it isn't recognized. We use this to update our features pages. For example if we place the last10config, naming it last107config in the root, the page works the way it should. http://cgi.cacfriends.com/ed.shtml. However, if we place it in a folder,naming that folder Ed, it doesn't seem to be able to find it, no matter what we try. We have even played with the config name and it makes no difference...it just doesn't see the folder!
The coding for Ed.shtml (which works properly) is as follows: <!--#include file="last107.php"-->
However, once it's placed inside a folder http://cgi.cacfriends.com/ed/ed.shtml and using that coding, we get an error.
If we use the following coding: <?php
include ('http://cgi.cacfriends.com/ed/last10.php'); ?> we don't get an error but it also isn't recognized. We have tried everything and nothing seems to work.
HELP!!
Thanks,
Kath
psoexplorer
09-09-2005, 07:41 AM
...so does this not work with the latest VB3, then? I hope it does because it seems to be the only hack out there that does what I need!
Can anyone point me in the direction of another similar hack? I just want to show the most recent updated 5-10 threads on my main homepage!
mark99
09-14-2005, 07:37 AM
It doesn't work with vB3.5.0 RC3 from what I have tried, can't find anything similar either and I'd really rather not use the External vB3 feed system due to how laggy it can make my front page.
Andreas
09-14-2005, 08:07 AM
This is a vBulletin 2 Hack and for sure won't work with vBulletin 3.0 or 3.5
lowlight
10-05-2005, 08:20 PM
Someone update this hack!
heynurse
10-10-2005, 01:37 PM
I would also love to see this hack ported over the 3.5! I've used it for years, I just upgraded to 3.5 and I miss it :)
I just posted a request on 3.5 miod request forum for this one, if you'd like to see it ported over, please visit: https://vborg.vbsupport.ru/showthread.php?p=791923#post791923
and post your support!
lordofgun
10-14-2005, 05:58 PM
Actually, it worked fine on 3.0 for me, but will not work on 3.5.
Would LOVE to see this ported to 3.5. :D
lordofgun
10-14-2005, 06:05 PM
Hi there, I'm using this script for a long time (since 1.0.2) but now after upg. to 3.5 rc1 it stopped working. The solution is simple, just edit the file last10.php add after that:
$path/config.php");
Add after that:
$servername=$config['MasterServer']['servername'];
$dbusername=$config['MasterServer']['username'];
$dbpassword=$config['MasterServer']['password'];
$dbname=$config['Database']['dbname'];
This worked perfectly for me on VB3.5.0 Gold
twitch
10-14-2005, 06:48 PM
hrmm, this could come in handy
Mireade
10-14-2005, 07:05 PM
lordofgun
Thanks lordofgun,
I'll try it tomorow
Michel
MissKalunji
10-14-2005, 09:20 PM
Hi there, I'm using this script for a long time (since 1.0.2) but now after upg. to 3.5 rc1 it stopped working. The solution is simple, just edit the file last10.php add after that:
// let's get connected
require("last10config.php");
require("$path/config.php");
Add that:
$servername=$config['MasterServer']['servername'];
$dbusername=$config['MasterServer']['username'];
$dbpassword=$config['MasterServer']['password'];
$dbname=$config['Database']['dbname'];
works like a charm! thanks
heynurse
10-15-2005, 02:19 AM
That rocks, works great! Thanks!!!
Mireade
10-15-2005, 10:59 AM
I had complete success modifying the last10.php as described above. The news are displayed ok :-)
I'm now with vB 3.5.2
Thanks a lot for this advice !
Michel
Parker Clack
10-18-2005, 12:47 PM
Can anymore make the changes to the navbar so that it is a popup menu that lists todays posts, todays threads and the top xx posts instead of it saying New Posts?
GT2.0
10-19-2005, 10:03 PM
Oh thank God it's fixed :)
aflax045
10-24-2005, 04:23 PM
MySQL reported this error while trying to retreive the info: Table 'twizted_vb3.thread' doesn't exist
Any thoughts?
Ryan McBain
11-02-2005, 07:47 AM
I have had this hack for a while. It has worked for me in vb 3.00 and so on. Today I upgraded to 3.5.1 and now I get this message on my home page. "Can't select database"
How can I fix this?
MissKalunji
11-02-2005, 11:02 AM
I have had this hack for a while. It has worked for me in vb 3.00 and so on. Today I upgraded to 3.5.1 and now I get this message on my home page. "Can't select database"
How can I fix this?
https://vborg.vbsupport.ru/showpost.php?p=748579&postcount=537
lazyseller
11-20-2005, 06:41 PM
<a href="https://vborg.vbsupport.ru/showthread.php?t=62823&highlight=lastposts3" target="_blank">https://vborg.vbsupport.ru/showt...ght=lastposts3</a>
twitch
11-20-2005, 09:20 PM
So, I am guessing that this works with 3.5.1 ? Would be cool if someone could put this together with all fixes and release it in the 3.5 section for modifications. I am not the guy for the job since I couldn't even get it to work in the first place. Another script that does the same thing and has an admin interface can be found over at ep-dev.com and it even posts news from your vbulletin forum. Use the headlines output for latest threads
Marco van Herwaarden
11-21-2005, 03:02 AM
This is a vB2 modification. Please use a mod for the version you are using.
MamboCube
05-02-2006, 08:09 PM
i get this error
MySQL reported this error while trying to retreive the info: Table '****_database.thread' doesn't exist
anyone know how to fix it?
sbardy
06-04-2006, 10:22 AM
i get this error
MySQL reported this error while trying to retreive the info: Table '****_database.thread' doesn't exist
anyone know how to fix it?
me too!!! please help us!!:bunny:
MamboCube
06-04-2006, 10:49 AM
is it because of the table prefix?
maybe it should be ****_database.vb3_thread
i will try it now
MamboCube
06-04-2006, 11:05 AM
ok, i seem to have ap roblem connecting to my database now,
i get the error message
"Can't select database"
anyone know why this is?
___________________________________________
nevermind that, just looked at the thread and found the link at the top,
but now i get this error message:
"MySQL reported this error while trying to retreive the info: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1"
MamboCube
06-04-2006, 11:30 AM
yeh, it was the prefix,
i had to go through last10.php adding my table prefix to all the mysql stuff, is there a quicker way to do this that i have missed?
sbardy
06-04-2006, 01:51 PM
is it because of the table prefix?
maybe it should be ****_database.vb3_thread
i will try it now
I have the same problem...have you solved it?
peterska2
06-04-2006, 01:56 PM
This modification DOES NOT work with vBulletin 3.5.4
Please locate an alternative modification for use with versions 3.0.0 - 3.5.4
Thank you.
sbardy
06-04-2006, 01:59 PM
ok....:( please help me here https://vborg.vbsupport.ru/showthread.php?t=117349
MamboCube
06-05-2006, 06:29 AM
This modification DOES NOT work with vBulletin 3.5.4
Please locate an alternative modification for use with versions 3.0.0 - 3.5.4
Thank you.
seems to be working fine for me, and im running 3.5.4, i just had to go through last10.php and add my table prefix to the mysql info
e.g.
// the base WHERE statement
$wheresql = "WHERE thread.lastposter=user.username AND thread.open!='10'";
i have now changed to
// the base WHERE statement
$wheresql = "WHERE vb3_thread.lastposter=vb3_user.username AND vb3_thread.open!='10'";
i did that for everything in last10.php and it worked
sbardy, im pretty sure this is all u have to do to get urs working
MamboCube
06-05-2006, 07:42 AM
ok, u know the last post date & time, well i want the time to be in a different class,
how would i do this?
---------------------------------------------
no matter, done it
sbardy
06-05-2006, 09:41 AM
nothing...same problem I tried :(
twitch
06-05-2006, 01:26 PM
<a href="https://vborg.vbsupport.ru/showthread.php?t=113214" target="_blank">Just use this</a>, its much easier
sbardy
06-05-2006, 04:55 PM
I want also forum title near latest forum threads, I'm trying invain to build my own script please help me http://www.vbulletin.com/forum/showthread.php?t=187171&goto=newpost
Ryan McBain
09-20-2006, 03:40 AM
fixed it
ben07
10-30-2006, 05:02 AM
Is there a preview of one with the title and message?
MissKalunji
10-30-2006, 10:41 AM
Is there a preview of one with the title and message?
i run mine with just the title
BUT YOU can customize this to look THE WAY you want
www.dancehallareaz.com here you can see it with just the title
www.dhazlinkup.com (using rss feed using title as well) but you're the one who customize to look and retrieve whateva you want date...member name..etc etc
ben07
10-31-2006, 04:39 AM
I was hoping if it was possible to modifty in this way
http://img213.imageshack.us/img213/8639/helppleasefn4.jpg (http://imageshack.us)
Including the messages the post content contains? I've been looking at samples and they are all title based.
MissKalunji
10-31-2006, 12:32 PM
Read the description of the hack....
$lastposter > show the "last poster" column? 1 = yes; 0 = no
$views > show the view count for each thread? 1 = yes; 0 = no
$replies > show the reply count for each thread? 1 = yes; 0 = no
You can customize it easily just a little html!
and you can also use a portal that will do that automatically
or like i told you before rss feed
http://www.vbulletin.com/forum/showthread.php?t=159044
A simple research usually answers ALL of your questions Good Luck
letsjoy
01-08-2007, 06:13 PM
thanksssssssssss
I had recently upgraded PHP to version 5.1 when i started getting this error : Fatal error: Call to a member function unlock_tables() on a non-object in /home/xbhp1/public_html/talkies/includes/functions.php on line 4998
Page : http://www.xbhp.com/last10re.php
Please help!
djjeffa
01-25-2007, 10:48 AM
can this be used on a page on a domin othere then the one you have vb on?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.