View Full Version : Last XX Posts on non-vB page
TigerLily
11-03-2001, 03:12 AM
I love this hack, but Netscape has been giving me headaches with this one for a WHILE. I finally got really fed up and kept tinkering until I found some solutions! Here is what I did, you can find a zip of the last10 files I changed here if you want to see them:
http://frugal-moms.com/last10NSfix.zip
Note: I am using vBulletin 2.0.3, getting ready to install 2.2, will let you know if there are any problems!
In last10.php (I called mine active.php):
1) Getting rid of that funky town text!
I took all style tags (such as style=\"font-family:$f; font-size:$fs; color:$tc;\") out of the table tags (mostly td) and put them in font tags right after those tags.
For example:
echo("<td style=\"font-family:$f; font-size:$fs; color:$tc;\" align=\"center\"><b>Last Poster</b></td>\n");
I changed to this:
echo("<td align=\"center\"><font style=\"font-family:$f; font-size:$fs; color:$tc;\"><b>Last Poster</b></td></font>\n");
2) Getting rid of the jagged table edges on the right side:
I added an extra td cell at the end of each row so that the full length of the table rows (particularly the colored ones) would show up correctly in Netscape. There are two places that need this- in the top bar that defines each field and then again in the column that actually displays them- thread title, replies, etc. Here is where to find them:
a) In top bar (the one that says Thread Title, Last Poster, etc)- which has displays your $hc color (right after the "Replies" column around line 50). Replace this:
echo("</tr>\n");[CODE]
with this:
[CODE]echo("<td bgcolor=\"$hc\"> </td></tr>\n");
b) Directly beneath the top bar, in the row that displays the actual title of the thread, # of replies where your $hc2 color is. In the echo tag above "// are we showing the last post?" around line 228 replace this:
echo("</tr>");
with this:
echo("<td bgcolor=\"$hc2\"> </td></tr>");[CODE]
3) Sprucing up the table:
a) Message text tables- I hardcoded the colspan in line 231, replacing this:
[CODE]echo("<tr $twt bgcolor=\"$bc\"><td colspan=\"$cols\" style=\"font-family:$f; font-size:$fs; color:$tc;\" align=\"left\">\n");
with colspan=5 so that the message tables were all the same length (you can make it as wide as you like):
echo("<tr $twt bgcolor=\"$bc\"><td colspan=5><font style=\"font-family:$f; font-size:$fs; color:$tc;\" align=\"left\">\n");
b)Getting the dark lines to show up around the table-I added an extra table in my shtml page with the background color I wanted. I dropped the include tags into the middle of this table:
<table width="600" bgcolor="000080" border="0" cellspacing="0" cellpadding="0"><tr><td>
<!--#include file="last10.php"--></td></tr></table>
It's late- I hope I remembered everything I did, LOL. Feel free to use my upload files as a template or something to compare too. You can see the results here:
http://frugal-moms.com/boards/active5.shtml
I use this script to show forums within certain categories since I have so many boards. It comes in handy, and I'm glad that our Netscape uses can finally see this page correctly. I would still love to have the page show up to match the user-selected style of the boards rather than hardcoded, but I'm not sure how to make that work-yet!
Kim:)
Mobile
11-03-2001, 01:18 PM
when i reply to a thread, i get the last post as my 'post subject' anyone got the same problem?
-Mobile
tweak
11-05-2001, 02:13 AM
Woot Nice
This hack worked great quick install also. Another great one!
Suprascene.com - See it here (http://www.suprascene.com)
inetd
11-24-2001, 07:16 PM
The given script under vb2.2.1 works? And whether it can show messages only from the defined category?
Steve_S
11-24-2001, 11:19 PM
Originally posted by inetd
The given script under vb2.2.1 works?
Yes :) see:
http://www.geekvillage.com/last_25_posts.html
And whether it can show messages only from the defined category?
just set up the config file to use the forums you want in a given cat. Each Forum has a unique id and you would specify them each like this:
$includeforums = "1,2,3,4"; // 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
inetd
11-25-2001, 09:12 AM
error:
Fatal error: Failed opening required 'http://boltalka.com.ua/admin/config.php' (include_path='.:') in /boltalka/last10.php on line 13
petemay
12-02-2001, 04:10 PM
Originally posted by jarvis
Rostor,
I, too, was getting your exact same error. I went round and round for days wondering what the heck was going on in my little NT world. :(
I have found that IIS appears to have problems with filtering or parsing included files. The IIS include is looking for a txt or HTML file, and thus I could not get it working with a plain SHTM(L) include statement.
What I did as a work around, is I set up my SHTM pages to be parsed by the PHP Isapi filter versus the ssinc.dll that is default. Basically my homepage is now PHP parsed, but still mostly HTML-based. Have I confused you yet? :)
Now that my page is PHP-parsed, I can just just the standard <? include("last10.php"); ?> statement in my code and everything works fine. I was a bit nervous about doing this as I wondered if any of my FP extensions would not function, but all seems to working well. (knock on wood)
You can view how I implemented the hack on my site at www.mhogaming.com
Hope that helps...
-Brian
Jarvis,
How did you "set up my SHTM pages to be parsed by the PHP Isapi filter versus the ssinc.dll that is default."? I'm also a hopeless IIS user and this sounds like it will work for me. I'm not familiar with PHP though. Is this an IIS configuration change, a PHP change, or a registry tweak?
Thanks
jarvis
12-03-2001, 02:14 AM
How did you "set up my SHTM pages to be parsed by the PHP Isapi filter versus the ssinc.dll that is default."?
Well, I am no IIS guru by any means... But, that being said :)
It IS an IIS configuration change, so just go into your management console and select the 'Home Directory' tab, then hit the 'Configuration' button. From here you will see all of the available extensions. Just click on the extension(s) that you want to PHP parse. I selected .sHTML. Assuming you have the basic install of PHP, just point the executable line to \Winnt\system32\sapi\php4sapi.dll and allow all verbs.
Hopefully that helps!!
-Brian
www.mhogaming.com
petemay
12-04-2001, 06:27 AM
Thanks for the additional details...
It appears that I do not have a
Winnt\system32\sapi\php4sapi.dll
in fact the 'sapi' directory does not even exist under system32?!
I figured I must have an incomplete install of PHP, so I re-installed PHP V4.0.6. Even after that install I do not have that directory or .dll??
When I run the last10.php script directly, I get several of the following 'warning' messages:
Warning: Undefined variable: fsel in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 108
Warning: Undefined variable: ftitle in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 108
Warning: Undefined variable: counter in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 172
Warning: Use of undefined constant title - assumed 'title' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 178
Warning: Use of undefined constant title - assumed 'title' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 182
Warning: Use of undefined constant lastpost - assumed 'lastpost' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 185
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 190
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 190
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 193
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 193
Warning: Use of undefined constant iconid - assumed 'iconid' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 193
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 196
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 196
Warning: Use of undefined constant iconid - assumed 'iconid' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 196
HOWDY 12:51 AM
Warning: Use of undefined constant title - assumed 'title' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 178
Warning: Use of undefined constant title - assumed 'title' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 182
Warning: Use of undefined constant lastpost - assumed 'lastpost' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 185
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 190
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 190
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 193
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 193
Warning: Use of undefined constant iconid - assumed 'iconid' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 193
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 196
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 196
Warning: Use of undefined constant iconid - assumed 'iconid' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 196
test 10:18 PM
Warning: Use of undefined constant title - assumed 'title' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 178
Warning: Use of undefined constant title - assumed 'title' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 179
Warning: Use of undefined constant lastpost - assumed 'lastpost' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 185
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 190
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 190
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 193
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 193
Warning: Use of undefined constant iconid - assumed 'iconid' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 193
Warning: Use of undefined constant iconid - assumed 'iconid' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 193
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 196
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 196
Warning: Use of undefined constant iconid - assumed 'iconid' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 196
Warning: Use of undefined constant iconid - assumed 'iconid' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 196
How do I use the makeuser... 08:55 AM
Warning: Use of undefined constant title - assumed 'title' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 178
Warning: Use of undefined constant title - assumed 'title' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 182
Warning: Use of undefined constant lastpost - assumed 'lastpost' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 185
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 190
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 190
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 193
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 193
Warning: Use of undefined constant iconid - assumed 'iconid' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 193
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 196
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 196
Warning: Use of undefined constant iconid - assumed 'iconid' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 196
just a test 08:29 AM
Warning: Use of undefined constant title - assumed 'title' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 178
Warning: Use of undefined constant title - assumed 'title' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 182
Warning: Use of undefined constant lastpost - assumed 'lastpost' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 185
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 190
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 190
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 193
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 193
Warning: Use of undefined constant iconid - assumed 'iconid' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 193
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 196
Warning: Undefined variable: postii in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 196
Warning: Use of undefined constant iconid - assumed 'iconid' in D:\My Documents\My Webs\fieldengineering\vbforum\last10.php on line 196
this is another test 03:53 PM
The process appears to be running from PHP directly, but generating all those Warning messages... as you can see in the text bolded in the quote "this is another test" is the title of one of my test posts... Seems like something is seriously misconfigured to me, but I don't know where to start to figure it out.
I'm pretty fresh to PHP - but willing to learn - no matter how painful it may be right now....
Thanks.
OutlawCowboy
12-04-2001, 10:14 PM
In your PHP.INI file in the Winnt dir. You should change the showwarnings to OFF That way you will not get all those warning messages for undeclared variables. I lot of scripts use undeclared variables. Its the lazy way to initiate variables instead of declaring them outright :)
Gutspiller
12-15-2001, 03:48 PM
After putting the code on a non vb page and loading it where I put the code I get this error:
Fatal error: Failed opening required 'forumz/admin/config.php' (include_path='') in /home/theforum/public_html/forumz/last10.php on line 13
Any ideas on how to fix that or why I am getting that error?
Prince
12-19-2001, 08:59 PM
No matter what I do I get this error:
Fatal error: Failed opening required '/admin/config.php' (include_path='.:/usr/local/lib/php') in /home/ironmag/public_html/forum/admin/last10.php on line 13
anyone???
Originally posted by Prince
No matter what I do I get this error:
in /home/ironmag/public_html/forum/admin/last10.php on line 13
anyone??? You might want to move last10.php from the admin directory to the forum directory.
Michael2
12-22-2001, 02:06 PM
Sorry if this has been asked but 18 pages is a lot to read through. ;)
I have required registration but I still want to pull the 10 newest posts out to the main page. I would assume when people click the link they get the page stating they must log in or register. Is that correct?
inetd
12-23-2001, 10:50 AM
Someone can answer as struggle with this error?!
Fatal error: Failed opening required 'http://domai.com/admin/config.php' (include_path='.:') in /boltalka/last10.php on line 13
PLZ!!!!
Jonathan
12-23-2001, 08:37 PM
I'm sorry if I should have posted this in the Support forum, but it's relating to this hack. You can move it if it's a problem here.
Here's my question:
I'm running my vB and site on seperate servers, and I'm having touble with the paths, can someone help?
I have last10config.php at:
http://www.yeswebmasterforums.com/last10config.php
I have last10.php at:
http://www.yeswebmaster.com/last10.php
I get errors when I go to http://www.yeswebmaster.com/last10.php
Can someone please tell me what the following need to be?
On last10.php (? indicates where I'm toally lost:
require("?")
require("$path/config.php");
On last10config.php:
$path = "/admin"; // path to your config.php file (usually in the /admin directory) - NO TRAILING SLASH! Do not include "config.php"
$url = "http://www.yeswebmasterforums.com"; // URL to your board - NO TRAILING SLASH!
The above are lines that I'm not sure what I need to put in.
If someone knows, please help. I really appreciate it.
Thanks,
Jonathan P.
Owner/Webmaster
http://www.yeswebmaster.com
http://www.yeswebmasterforums.com
Jonathan
12-24-2001, 01:24 AM
Can someone please help me?
TheCaver
12-25-2001, 11:59 PM
Has anyone figured out the GMT offset thing yet?
Driving me (and the users) crazy :)
JC
voogru
12-26-2001, 10:38 PM
i keep getting cant select db errors. the paths are coreect too :confused:
I think I have read every of the 270 posts here and still cant figure out how to make this work across servers.
How about the last10.php generating a text file on the forums server which I could then pick with javascript on the main site server?
If possible I suppose it could be automated to run every xx mins but I need this for "latest breaking news" for a community site so my "news people" could run the utility after posting to the news section.
Please please please is this a viable way of handling the different servers problem a lot of people are asking about?
So, I'm guessing this doesn't work with 2.2.1?
mikeB
12-31-2001, 06:18 PM
ok, I got this working perfectly on http://www.highradiation.com on a php page... however... is there a way to get this on an ASP or HTML page with out SSI or PHP/MYSQL?
Is there an asp tag that will work?
hope I didn't repeat anything, thanks so much
Bitmap
01-04-2002, 06:24 AM
Originally posted by Ali
So, I'm guessing this doesn't work with 2.2.1? works perfectly for me :)
Gutspiller
01-04-2002, 04:16 PM
Anybody know if this hack works with 2.0.3?
And no, I am not upgrading. :p
boatdesign
01-07-2002, 02:55 AM
I originally installed this on vB 2.0.3 and it worked great. I upgraded to 2.2.0 and 2.2.1 and it still works great!
One question - has anyone modified the formatting to exactly match the default vBulletin New Posts or Todays' Active Topics formatting?
EJMack
01-12-2002, 03:50 PM
how can i get this to span the width of an entire table, is there a way to specify the width of this?
boatdesign
01-12-2002, 06:03 PM
how can i get this to span the width of an entire table, is there a way to specify the width of this?[I'm not sure I understand your question exactly, but if you just want the width of the whole table to span the page, look for this section in the last10config.php file:
$tw = "100%"; // 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
And just change the pixel number to 100% there.
eva2000
01-13-2002, 04:21 AM
tubedogg remember the issue with this hack when a forum is closed the non-vb pages have all this gibberish displayed when the forums were closed ? and how you gave me a fix for that ? well for some reason it no longer works and nothing really changed
your fix before allowed me to close my forum and the last10 topics hack on non-vB pages would just display closed for maintenance message..
but now it just calls and displays my vB forums entire closed forum message page... screen cap below
the fix you gave me was to add the code in bold below to last10.php file
$boarddown1 = mysql_query("SELECT value FROM setting WHERE varname='bbactive'");
$boarddown = mysql_result($boarddown1,0,0);
if ($boarddown == "0") { echo("Sorry the forums are down for maintenance"); exit; }
just under
// 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");
but for some strange reason that doesn't work anymore ????? :(
any help is appreciated since my server is being moved and i need to close my forums a day before hand but my normal non-vb sites have this hack being called
RSliker
01-13-2002, 07:05 PM
Any way to display this stuff no in a table? Or have it better, easier to modify?
pdatoon
01-14-2002, 02:33 PM
Hi Guys,
Do you know how it can be used to make some syndication?
I want other sites to display that info.
Steve Machol
01-14-2002, 02:34 PM
There is a syndicated news hack somewhere in these forums. I use it on my site and it works great. Search for 'syndicated news'.
Gutspiller
01-16-2002, 05:17 PM
Does this hack work on other urls too? Or does it only work on one url? Is there a way to make it work on two urls, but one forum?
Gutspiller
01-18-2002, 04:55 PM
If the thread is multiple pages, it still only links to page 1 of the thread. Is it possible to get it to link to the last page of the thread so they don't think the system is screwed up? If this could be changed it would really help me out.
I would really appreciate it if this modification could be made. :)
discussfitness
01-27-2002, 09:06 PM
Is there anyway of displaying the "last x" posts on another domain and on a .html page? Maybe there is some javascript that you could use? Please help.
LanciaStratos
01-28-2002, 02:00 AM
Well, is there any way I can use this on another site? My forums are at http://forums.gtplanet.net, but I want to show the last 10 threads on my homepage, http://www.gtplanet.net. I've tried all kinds of little tricks, but none of them work. Can anyone help?
Lionel
01-28-2002, 06:02 AM
Originally posted by LanciaStratos
Well, is there any way I can use this on another site? My forums are at http://forums.gtplanet.net, but I want to show the last 10 threads on my homepage, http://www.gtplanet.net. I've tried all kinds of little tricks, but none of them work. Can anyone help?
have you tried that:
<?
$fd= fread(fopen("http://www.site.com/forum/page.php", "r"), 100000);
if ($fd)
echo $code;
?>
this code grabs any info from any site and can be used with a starting point and an end point, making you grab only what you need, but I don't think that you need that in your case. My experience with that, it slows things down a bit, because it has to go and read from another site.
Gutspiller
01-28-2002, 04:51 PM
Can you please make it so that if the thread is two pages, that the link links to the second page, instead of the first? Great hack Tube. If you want to see how I modified it, check out this link:
http://www.theforumz.com/forumz/showthread.php?s=&postid=47239
-=dm=-
01-28-2002, 07:39 PM
Hi
I runing postnuke on my server can I also use this hack?
thanx for any information:)
LanciaStratos
01-28-2002, 10:44 PM
Originally posted by Lionel
have you tried that:
<?
$fd= fread(fopen("http://www.site.com/forum/page.php", "r"), 100000);
if ($fd)
echo $code;
?>
this code grabs any info from any site and can be used with a starting point and an end point, making you grab only what you need, but I don't think that you need that in your case. My experience with that, it slows things down a bit, because it has to go and read from another site. Thanks Lionel, but I'm using SSI. :( Is there still some way I can do this?
newvbuser
01-29-2002, 01:02 PM
Hi I want a simple listing in a table that is 25 rows and 2 columns wide, with each topic occupying one row (topic title, with link to it in like this:
<a href="titlelinkhtml">title topic name</a>,
so 25 topics per column as follows:
. Topic 1 . Topic2
. Topic 3 . Topic 4
. Topic 5 . Topic 6
. Topic 7 . Topic 8
. Topic 9 . Topic 10
.... upto Topic 50
And so on.....25 rows, 2 columns. How the format of the table looks (width etc.) should be customizable hopefully.
It is hard for me to draw the table but I guess you guys get the idea (or so I hope!).
The hack seems to draw up one huge table one column wide and XX rows long?
Is there any way to modify this hack to display the table in 2 columns, and to be able to use style sheet being used in that non-vb page..? UBB 5.x had a very simple active thread hack that worked great and displayed a great looking table.
-=dm=-
01-29-2002, 02:12 PM
Im getting this error can someone plse help?
Im using it with postnuke.
Warning: Unable to access /forums/admin/config.php in /web/www.mydomain.dk/portal/last10.php on line 13
Fatal error: Failed opening required '/forums/admin/config.php' (include_path='.:/usr/local/lib/php') in /web/www.mydomain.dk/portal/last10.php on line 13
Originally posted by -=dm=-
Im getting this error can someone plse help?
Im using it with postnuke.
Warning: Unable to access /forums/admin/config.php in /web/www.mydomain.dk/portal/last10.php on line 13
Fatal error: Failed opening required '/forums/admin/config.php' (include_path='.:/usr/local/lib/php') in /web/www.mydomain.dk/portal/last10.php on line 13 You need to put last10.php in your web root below your forums directory. Or you need to supply the entire path to config.php if you want to put it in your portal directory. In last10config you would put something along the lines of /web/www.mydomain.dk/forums/admin as the path to you config.php file. You'll have to experiment if you don't want keep last10.php in the web root.
-=dm=-
01-29-2002, 07:05 PM
all postnuke files are in root
and I have a dir called "forums"
last10.php--->forum root right?
last10config---> in root(my server) right?
and in which file should add this?(in post nuke)
include("last10.php"); ?>
thanx in advance
dm
-=dm=-
01-30-2002, 12:13 AM
ok done:)
now I have another question.
I want the Lastxxx in the center Block how can I activate this?
Originally posted by -=dm=-
ok done:)
now I have another question.
I want the Lastxxx in the center Block how can I activate this? Put <? include("last10.php"); ?> where you want it in the center block.
-=dm=-
01-30-2002, 02:41 AM
hmm I got error when I put this code.
everything working fine but I really need this last touch:)
and then Im a happy guy hehe
Action-N
01-30-2002, 04:02 AM
Hey Guys, I use Post Nuke and tried inserting it into the post nuke code. Well I got errors, it took awhile to get it to work and even then it wasn't right. What I determined was when this hack opens the MySQL connection to the vBulletin database it's then left open and Post Nuke then tries to query the wrong database. Even though I tried closing the vB connection it still showed PN trying to access it. So bottom line, it won't work if you run a website that already has a MySQL database.
Want to know my solution to the problem? I simple downloaded my vB database data & structure and added it to my Post Nuke database. This is killing my page load times when working with the database, but I get so much out of this merge it's worth it.
Originally posted by -=dm=-
hmm I got error when I put this code.
everything working fine but I really need this last touch:)
and then Im a happy guy hehe My bad, you need to put the complete path to the file if it's not in the same directory. So it would be <? include("/web/www.mydomain.dk/portal/last10.php") ?> if it's still where it was before.
newvbuser
01-30-2002, 02:44 PM
Hi could anyone please help me modify this hack so that it displays a 2 column table instead of a 1 column table? Thanks!
newvbuser
01-30-2002, 05:38 PM
Anyone want to help with this 2 column mod to this hack? :confused:
TurboFC3S
01-30-2002, 06:22 PM
Man ... I get a headache trying to read this thread. I tried to read it, but am totally confused.
newvbuser
01-31-2002, 05:49 PM
Bump
Mireade
01-31-2002, 09:28 PM
Hello,
I did install your hack on my site and it works very good. Thank you for that !
my site (http://www.repaire.net/)
I have a question:
I noticed that new threads appear on the non vB pages BEFORE they are moderated on moderated forums... So someone (an "evil" one ;-) could bypass the authorization and pollute the home page of my site...
I wonder if you had already this issue and if something could be done for that.
Originally posted by Mireade
I wonder if you had already this issue and if something could be done for that. Find this line in last10.php:$query0 = "SELECT pagetext,postid,dateline,iconid FROM post WHERE threadid='$threads[threadid]' ORDER BY dateline DESC LIMIT 1";Add AND visible='1' just before ORDER BY. That should do the trick.
Mireade
01-31-2002, 10:49 PM
Hi !
Thanks for the quick answer ! :)
I tried to do that but an not moderate message appears though...
:stupid:
the line is like that now:
$query0 = "SELECT pagetext,postid,dateline,iconid FROM post WHERE threadid='$threads[threadid]' AND visible='1' ORDER BY dateline DESC LIMIT 1";
newvbuser
02-01-2002, 10:53 AM
Anyone want to modify this hack so that it displays a 2 column table instead of one ? :(
Lionel
02-02-2002, 11:36 AM
This is a great hack. I have been enjoying it from day 1. Can $showicon be modified to show a thumb image of an attachment instead? The thumb image will be generated at upload with the prefix tn_
-=dm=-
02-02-2002, 02:16 PM
is there anyway I can fix the size?(so its non resizeable)
it working fine but it just pushing my blocks away:(
newvbuser
02-04-2002, 01:30 PM
Hi tubedogg, I have your last10.php file of your nice Last XX topics in non-vb page. Since you are quite busy, I am trying to figure out how to display 2 columns instead of 1 for the lastXX active topics myself.
Could you please tell me where (or what counter) you are updating the counter to increment the while loop you are using in the last10.php display threads code? Is it an array of XX number of topics?? I am completely clueless about PHP or coding but I am trying to figure out things.
Anyone else want to tell me what the counter is in this while loop that is incrementing till 25? I saw the while condition but it makes no sense :confused:
Your help would be appreciated a lot!
Mireade
02-06-2002, 01:34 PM
Hello Tubedog ?
Hello FWC ?
I come back with my same question .:cry:
Is there any way to stop displaying unmoderated messages on non vB pages through your so good hack. ?
I tried the solution suggested by FWC but it did not work...
Help !!
mondaynightmike
02-13-2002, 01:07 PM
Hello, i have downloaded and installed tha hack, i have read all the pages yet i am still struggling to exclude the Admin and Mods forum from being displayed. I rolled over the link and it said forum id 29 so i tried it and it does not work.
Can anyone help????
mondaynightmike
02-13-2002, 01:10 PM
Its ok i have got it working now. I was uploading it to the wrong directory. Thanks, and great hack :)
Tungsten
02-14-2002, 04:48 PM
Got it working here (www.tennesspeed.net) and made a few slight changes to the code. Excellent hack, Tubedogg!
WOW... My eyes are tired. I read through all 21 pages... saw my problem mentioned about 4 times by different people and no one ever replied as to hos to fix it, unless I missed it.
Here it is again:
Fatal error: Failed opening required '/admin/config.php' (include_path='.:/usr/local/lib/php') in /home/virtual/rickhz/home/httpd/html/forums/last10.php on line 13
lastpost10 is in the forums directory.
Here is my path to admin:
$path = "/admin";
Does anyone have any ideas what I can do to make this work?
Thanks,
Rick
Ok got it going I had to do this:
// let's get connected
require("last10config.php");
$servername = "localhost";
$dbusername = "dbusername";
$dbpassword = "dbpassword";
$dbname = "dbname";
In the last10.php file. I saw that on page 2 or 3 of this thread.
Have you guys seen how this lays out in Netscape? The text lays over itself. I had to disable the show messages option.
Since mine is disabled use this as an example:
http://www.hometheaterforum.com/htforum/active.php
Parkers does the same thing.
I'm running NS 4.76.
Solved this one too... somewhat. I removed the <nobr></nobr> as someone had mentioned. Trouble is in Netscape the tables still don't look right. Here's a link to my attempt at this...
http://www.explorerforum.com/forums/active.php
Anyway to make it so the user can choose between going to the first post and the most recent post in a thread??
newvbuser
02-23-2002, 10:25 AM
Any probs if I change the code:
$url/showthread.php?threadid=$threads[threadid]&goto=newpost\">
to
$url/showthread.php?threadid=$threads[threadid]
So that the first post of the thread is shown instead of last?
Mireade
02-23-2002, 10:33 AM
Hello Tubedog ?
Hello FWC ?
I come back with my same question .
Is there any way to stop displaying unmoderated messages on non vB pages through your so good hack. ?
I tried the solution suggested by FWC but it did not work...
Help !!
Dez_U
03-05-2002, 12:03 PM
works great for me, thanks Tubedog :D
Question, can I add who's online on the forum in here somewhere ??
HiroshiNanami
03-05-2002, 08:56 PM
How do I put this last XX Posts on the forumhome page in my vb? I suppose I can't just stick a
<? include("forum/last10.php"); ?>
statement in the forumhome template right? If I stick it in phpinclude would it slow down page loading? If I don't choose to put it in phpinclude do I need to hack index.php? If so can someone give me some ideas as to how?
Thanks very much in advance
HiroshiNanami
03-06-2002, 08:04 PM
Anyone has any idea?
Don't feel bad no one seems to answer any of my questions at this website.
It used to be much better getting help when the hacks were on the vb.com site.
HiroshiNanami
03-06-2002, 10:10 PM
Thanks for letting me know I'm not the only one dying for an answer here.
yeah it seems questions get answered quicker in vb.com
aldamon
03-07-2002, 02:14 PM
Seems to be working fine in 2.2.3! w00t!
HiroshiNanami
03-08-2002, 12:36 AM
Originally posted by HiroshiNanami
How do I put this last XX Posts on the forumhome page in my vb? I suppose I can't just stick a
<? include("forum/last10.php"); ?>
statement in the forumhome template right? If I stick it in phpinclude would it slow down page loading? If I don't choose to put it in phpinclude do I need to hack index.php? If so can someone give me some ideas as to how?
Thanks very much in advance
Anyone got any idea??
UtilityGeek
03-12-2002, 05:40 PM
Originally posted by HiroshiNanami
Anyone got any idea??
I'm wanting to do the same thing. Can anyone give any ideas?
Jeff Bronstein
03-15-2002, 12:04 AM
Originally posted by UtilityGeek
I'm wanting to do the same thing. Can anyone give any ideas?
Ditto here on this one.... its not working for me, but I'm sure its because I just don't get it yet.
Lionel
03-15-2002, 12:12 AM
this one of the coolest hack that I have installed. Besides article and summary, I am even able to display attachments as thumbs next to article in the front page.
Oliver
03-21-2002, 03:18 PM
we have this installed on a completly different server, when, as sometimes does our vb server goes down, so does the page on the other server. Is there a check that can be done before running last10.php to see if the vb server is up and running?
cheers
oli
Sharg
03-21-2002, 04:46 PM
Great hack,
but it doesn't parse de vb code well.
For exemple, it does respect bold and italics tags, but won't parse colors or urls tag.
Is this normal and is there a way to have it translate all the vb codes ?
Thanks,
Sharg
syion
04-02-2002, 04:16 PM
I am using the last10 hack on my board and it works great. I have renamed the files a few times inorder to run it seperatly for different forums. This way I can catoragize the information on the main page by having each file show different forums. Very handy.
Thanks for the great hack !
Darren Lewis
04-03-2002, 03:40 PM
This is a great hack. I love it.
You can see it installed and working on my site (http://www.thebookforum.com) which is running vBulletin 2.2.4 and v1.0.2 of this hack.
I did have a few little problems which I managed to sort out.
I was getting this message (noticed a few others are getting this too).
Fatal error: Failed opening required 'config.php' (include_path='.:') in /loads of text here/last10.php on line 13
I think I solved the problem by sorting out the correct path to config.php in last10config.php at step "a".
I was entering the path as ../forums/admin (with two fullstops as when writing HTML).
By changing it to ./forums/admin (with one fullstop) the hack worked.
Other stuff I've done is to rename my homepage from "xxx.htm" to "xxx.php" and insert the last10.php file as<?php include("path to the file/last10.php"); ?>
The server-side-include method didn't seem to work for me.
I'm using a framed index.htm page so I can change the names of the frames without upseting bookmarks/search engines (hopefully)
Hope all that helps someone out there :)
Congrats to Tubedog for this hack.
jmosby
04-05-2002, 12:48 AM
Can someone explain the excluded forums config? Where do I get the number of the forum I want excluded? How does the numbering work? I don't see this in Control Panel where I have my forums listed. Otherwise I had no trouble at all, this is a great add-on!
Thanks.
jmosby
jmosby
04-05-2002, 01:01 AM
Is it the mysql forumid?
Darren Lewis
04-05-2002, 08:54 AM
Hi
On your forums hompeage, hover over the link for each forum (categories are classed as forums too)
In the status bar of your browser (I'm using IE6) there will be a URL.
At the very end of the URL will be somthing looking like this
&forumid=xx
the xx is the forum ID number that you can enter to include or exclude in the config script.
Darren.
jmosby
04-05-2002, 01:21 PM
Thanks Darren, this matches the mysql forumid.
Thanks.
jmosby
svoec
04-07-2002, 01:50 PM
Has anyone been able to get the ssi, or shtm, or shtml to work ??
the php include works fine, but I didn't really want to change my main page to a php
I use frontpage for quick editing on that page, and it dont like php.
My feeling is that this is a host setting ???
any thoughts?
TheCaver
04-11-2002, 10:26 PM
Originally posted by HiroshiNanami
Anyone got any idea??
What's the point? On index.php, all the user has to do is click "New Posts" and he gets this info :confused:
JC
Courage
04-14-2002, 08:52 PM
I keep getting an error
Fatal error: Failed opening required 'forum/admin/config.php' (include_path='.:/usr/local/lib/php') in /apache/sites/softnews.totalnet.ro/htdocs/forum/last10.php on line 13
My settings are:
$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.softnews.ro/forum"; // URL to your board - NO TRAILING SLASH!
$urlimg = "http://www.softnews.ro/forum/images"; // URL to your board's images - NO TRAILING SLASH!
What can I do ? :(
I need this to include on a SSI page ! :D
It looks like you might have last10.php and last10config.php in your forum directory. If you do, the path to config.php would just be /admin.
Gutspiller
04-26-2002, 08:28 PM
Tubedogg, could you help me. I am using this hack for something a little different, but it works the best out of all the hacks that are out there and was hoping to tweak it a little bit.
First off, is it possible to get two (or more) different versions to run on the same page? When I have two different ones running on the same page, different meaning they are both using different files and different config files, one of them repeats the last thread over and over for each thread. So if I say I want it to show 15 threads, it lists the latest thread 15 times.
I don't know if it has to do with pulling the latest threads from a single forum in the php files for the hack or not. I have one forum in the include forum field, and no forums in the exclude field. The weird thing is, is that one works the way it's suppost to and onedoes what I mentioned above. Is it possible to get all of them to run normally on the page?
Another question I had, was is it possible to make one of them not bump a post to the top if it gets a reply? I want it to work more like a databasing list than showing the latest threads.
If you (or anybody really) could help me I would really appreciate it.
Thanks very much.
Gutspiller
04-26-2002, 10:31 PM
Originally posted by wajones
Thought I'd share this, a few of my users wanted to include tubedogg's last10 hack on a vbulletin page and this is what I came up with...
In a copy of the last10.php script comment out or delete the following
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");
now add this to the phpinclude template
ob_start();
include_once("./last10.php");
$last10 = ob_get_contents();
ob_end_clean();
Then I was able to add $last10 into any vbulletin template to display the last10 table. Saved a lot of work trying to create templates and changing his code, plus if he changes it, it's simple to upgrade.
I tried this and when I put the $last10 in my forum header it limited the number of threads to show on a normal forum page to 10. How can I get it to show 10 in the $last10, but not limit the number of threads shown in a forum??
Please help. :(
Gutspiller
05-03-2002, 08:49 PM
tubedogg can you help me with this hack, I am trying to run a few different versions on a page and I ran into a problem. It took me quite some time to troubleshoot it, but I narrowed it down to a single problem.
OK, the problem is that when you have two or more of this hack running on the same page, one of them works fine and the other shows the first thread that is in the forums you have marked for the hack to view. It only shows the one thread, but it repleats it however many times you set the hack to show how many threads.
I narrowed the problem down to the forum title option in the hack. When I turn it off so that it doesn't show the forum that the thread is in more than one version of this hack works fine on a page, but when you turn it on, on one of the hacks on the same page, it does what I mentioned above about repeating the same thread title over and over.
Can you (somebody) help me please? I really love this hack and use it a lot on my forum and if you or anybody could help me I would really really really appreciate it. :(
Thanks for any help you can provide.
Thanks.
ixian
05-10-2002, 04:57 AM
First, thanks for a great hack! I got it working no problem on my non-vb home page (test site - hasn't gone live yet)
Second, a formatting question - What do I need to edit to "tighten up" the table? Specifically, it appears as if each link to the latest posts has a line break in between it, so that all the links look like this:
Forum: Thread
Forum: Thread
Forum: Thread
etc, etc. I would like the text spaced closer together, but I don't see where to edit this. It's not in last10config.php and I couldn't find anything in the actual last10.php script either. I'm sure it's flying right over my head.
BTW, playing with the font point size has no effect:)
Thank you for a great hack!
Sketch
05-10-2002, 06:07 PM
Originally posted by Oliver
we have this installed on a completly different server, when, as sometimes does our vb server goes down, so does the page on the other server. Is there a check that can be done before running last10.php to see if the vb server is up and running?
cheers
oli
Use the gethostbyname() (http://www.php.net/manual/en/function.gethostbyname.php) function on your page prior to calling the top 10.
Sketch
ixian
05-10-2002, 09:57 PM
Originally posted by ixian
First, thanks for a great hack! I got it working no problem on my non-vb home page (test site - hasn't gone live yet)
Second, a formatting question - What do I need to edit to "tighten up" the table? Specifically, it appears as if each link to the latest posts has a line break in between it, so that all the links look like this:
Forum: Thread
Forum: Thread
Forum: Thread
etc, etc. I would like the text spaced closer together, but I don't see where to edit this. It's not in last10config.php and I couldn't find anything in the actual last10.php script either. I'm sure it's flying right over my head.
BTW, playing with the font point size has no effect:)
Thank you for a great hack!
NM, figured it out. For those with the same issue - "show icons" is set to 1 (on) by default. I discovered that even if the thread starter didn't choose an icon for the thread the last10.php script will still leave a space for one. Turn this option off and you get nice tight spacing:)
smleg
05-19-2002, 02:48 PM
I just installed it and it's working well, great hack!
www.ramprage.com
Thanks! :beard:
ixian
05-20-2002, 06:20 PM
This is weird:
I just started noticing that this hack is repeating displays of certain threads, i.e. I'll have say "8" threads configured to show up, and two of them will be the exact same thread.
I even re-downloaded a fresh copy and re-configured it in case it was anything I did. You can see what I am talking about at http://ix.maximumgamer.com/forums/last10.php. That's the stock script, set to display 20 - notice how it repeats a couple threads. It does this consistantly.
Any ideas??
vBHackz
05-24-2002, 01:19 AM
Hey, do we keep $path etc etc in there, and just put the path or url in front of it?
Lucrecia
05-26-2002, 07:25 PM
I find that if I upload the last10 and the other one, the I just get a blank white page
ixian
05-28-2002, 12:14 AM
Originally posted by ixian
This is weird:
I just started noticing that this hack is repeating displays of certain threads, i.e. I'll have say "8" threads configured to show up, and two of them will be the exact same thread.
I even re-downloaded a fresh copy and re-configured it in case it was anything I did. You can see what I am talking about at http://ix.maximumgamer.com/forums/last10.php. That's the stock script, set to display 20 - notice how it repeats a couple threads. It does this consistantly.
Any ideas??
Doh! Turned out to be another problem not related to the script. I had a problem with one of Tubedogg's hacks - stars - on my old board and members were being double-registered. This hack just read posts from members affected by this as two threads. Once I started clearing up that problem, the one listed above went away.
I have seriously modified this hack; those who want to see what it looks like in simple form can see it at my website, top right corner. I edited a lot of the code I didn't need, like forum parent, etc, out of the script to reduce queries, took all the table-generation stuff out, and added in my own code that calls my .css layout so the script integrates perfectly with the rest of my site. Couldn't have done any of it without the original script, particularly the code to exclude certain forums - had a bear of a time trying to write it on my own and finally decided just to modify this one. Thanks again Chen!!
Anakin
05-29-2002, 03:49 PM
I have a problem at epiGamer (http://www.epigamer.com/) in that the time for the last post is according to the server time, and not to the boards time (in this case UK time). Is there anyway I can adjust this?
finkdawg5
06-12-2002, 05:19 PM
This is a great hack, nice job!!!
finkdawg5
06-30-2002, 05:11 PM
I'm trying to get it to show the first post of the 10 latest threads, not just the ten latest posts. Is there any way I can modify this hack to do that? Thanks!! Again, nice job on this hack!! Very useful!!
Mandi
07-05-2002, 04:46 PM
I attempted this hack last fall, and got a big white nothing; tried again (fresh files) and am having the same problem . . . last10.php is just a blank white page (and so, of course nothing is included on the non-vB.shtml page either.)
Because it's not generating any sort of error, I'm unsure how to begin troubleshooting this . . . my vB is pretty stock, if it matters.
http://www.cgspouses.net/community/forums/
http://www.cgspouses.net/community/forums/last10.php
...and the page I'm attempting it include it on, not public yet:
http://www.cgspouses.net/index_test.shtml
Thanks for any bright ideas :)!
ixian
07-05-2002, 04:48 PM
You need to turn on error messages in your php.ini file. That's why no errors are displaying.
If you do that, it will tell you exactly where it's having a problem - php is much better than perl in that regard.
Make sure to turn show errors back off after you are done.
Dean C
07-10-2002, 05:52 PM
hi,
i want to be able to include the last10 posts on my index.php file in a table on my index.php page outside of the forums...
how could i acheive this?
thanks in advance
wild texas
07-14-2002, 06:43 PM
Works great! I'm using vBulletin 2.2.6 and have the last (5) posts displaying on my homepage at wildtexas.com (http://wildtexas.com/).
Dean C
07-15-2002, 02:28 PM
I'm getting this error whenever i call up last10.php in my browser:
Can't select database
and that is all it says... how can i resolve this?
Thanks in Advance :D
Razgo
07-18-2002, 07:27 AM
thanks for the great hack!
is it possible to add a "reply" or "comment" button so users can click on it to reply to a post from the display?
I put this on my Xoops site. it kept returning a blank page in the block until I removed the <? and ?> , this tip might be usefull to someone putting the call "<? include("last10.php"); ?>" in an Xoops block.
thanks.
Aceman
07-24-2002, 07:19 PM
Is it possible to edit this hack to NOT show thread that are in a PRIVATE FORUM?
I've got this running on a beta site for my personal site.. but it shows threads from ALL forums...even the private ones.. which I can't have.
Please lemme know.
Aceman
http://www.scifi-meshes.com/tk421/ <--- working beta.
Travis641
07-24-2002, 07:30 PM
Put the private forum's ids in the exclude option in last10config.php
Dean C
07-24-2002, 08:24 PM
[QUOTE]Originally posted by Mist
I'm getting this error whenever i call up last10.php in my browser:
Can't select database
and that is all it says... how can i resolve this?
Thanks in Advance :D
Aceman
07-25-2002, 12:16 AM
Thanks Travis641 :)
Gutspiller
07-26-2002, 04:24 AM
Can somebody help me get this hack so that it highlights the latest threads within 24 hours a different color?
I am only using the hack 6 times on my frontpage :p but this would really really help me. I don't know much about php, but I know how to follow instructions. :D
If somebody could help me I would greatly appreciate it.
Thanks!
Riddel
07-26-2002, 05:50 AM
I'm getting the same error as MIST (Can't select database) can anyone help me?
AloneEagle
07-27-2002, 04:25 AM
so if I want to put link the latest post out in my normal html index page. I will have to put this code where I want the link to be?
<? include("last10.php"); ?>
To include it on a server-parsed page (.shtml, .shtm, .ssi, etc.):
<!--#include file="last10.php"-->
and where do I upload these files to? domain.com/forums/ ?
???
thanks
AloneEagle
07-28-2002, 04:50 PM
Helpppp
kaost451
08-03-2002, 10:36 PM
damn has any one got this to work on vb index.php? Because I got it to work but cant call the php file ? can some one help me out?
Gutspiller
08-04-2002, 01:29 AM
Does anybody know how to get this hack so that when you click on the titles it takes you to the first post in that thread and not down the page SOMEWHERE in the thread?
I know this shouldn't that hard to fix and was hoping somebody here would be kind enough to help me out on this.
Thanks for any help you can provide.
ixian
08-04-2002, 04:01 PM
Originally posted by kaost451
damn has any one got this to work on vb index.php? Because I got it to work but cant call the php file ? can some one help me out?
Yes. Firefly helped me out with this one, it's a modification to code posted a few months back here by wajones.
First, put this in your phpinclude template:
function getLast10() {
global $last10;
ob_start();
include_once('./last10.php');
$last10 = ob_get_contents();
ob_end_clean();
}
getLast10();
Now, in the last10.php script itself, comment the following out (it's near the top)
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");
Now just stick the variable $last10 wherever you want it in your templates, including the forumhome (index) and you are set.
Note that if you want to use this script in more than one place - say, one on your vb index (or it's own template, like I do) and one on your non-vb home page - you will want to use two instances of it. I renamed one last5.php and use it for my front page minus the change I outlined above.
kaost451
08-05-2002, 02:40 AM
thank you so much works GREAT!!!!!!
ForKmaN
08-10-2002, 11:50 AM
Hey tubb, nice hack but I'm using frames on the main site where I'm showing this. Is there a way I can make the links open in a new window?
ixian
08-10-2002, 02:27 PM
Originally posted by ForKmaN
Hey tubb, nice hack but I'm using frames on the main site where I'm showing this. Is there a way I can make the links open in a new window?
Edit the actual top10.php file. Look for the html code that links to showthread.php. It'll be regular html with some php code around it. Change it from <a href= to whatever you want: target_new, etc, just like you would normally. The only thing you want to make sure you do with PHP is escape your quotes - ie, do quotes like this: /"/
eva2000
08-10-2002, 05:17 PM
i've had this hack installed for ages but now on my new server with same PHP 4.1.2 version i notice these errors in my error_log
i have 2 copies of last10.php and last10chitchat.php included on the same page i.e. http://www.eva2000.com/forum/ and 1 copy included at http://bubblegumcrisis2040.com/forum/
[Sat Aug 10 14:03:23 2002] [error] PHP Warning: Use of undefined constant lastpost - assumed 'lastpost' in /home/username/public_html/last10.php on line 188
[Sat Aug 10 14:03:23 2002] [error] PHP Warning: Use of undefined constant title - assumed 'title' in /home/username/public_html/last10.php on line 181
[Sat Aug 10 14:03:23 2002] [error] PHP Warning: Use of undefined constant title - assumed 'title' in /home/username/public_html/last10.php on line 185
[Sat Aug 10 14:03:23 2002] [error] PHP Warning: Use of undefined constant lastpost - assumed 'lastpost' in /home/username/public_html/last10.php on line 188
[Sat Aug 10 14:03:23 2002] [error] PHP Warning: Undefined variable: fsel in /home/username/public_html/last10chitchat.php on line 111
[Sat Aug 10 14:03:23 2002] [error] PHP Warning: Undefined variable: ftitle in /home/username/public_html/last10chitchat.php on line 111
[Sat Aug 10 14:03:23 2002] [error] PHP Warning: Undefined variable: counter in /home/username/public_html/last10chitchat.php on line 175
[Sat Aug 10 14:03:23 2002] [error] PHP Warning: Use of undefined constant title - assumed 'title' in /home/username/public_html/last10chitchat.php on line 181
[Sat Aug 10 14:03:23 2002] [error] PHP Warning: Use of undefined constant title - assumed 'title' in /home/username/public_html/last10chitchat.php on line 182
[Sat Aug 10 14:03:23 2002] [error] PHP Warning: Use of undefined constant lastpost - assumed 'lastpost' in /home/username/public_html/last10chitchat.php on line 188
any ideas ?
ixian
08-10-2002, 06:31 PM
When in doubt, escape your variables (i.e. put '' around them). Looks like PHP is interpreting the html as php code to me.
I've edited the hell out of this hack (got it to work with my CSS styles, got rid of queries I wasn't using, etc) and that was usually the problem I had when weird errors popped up.
If you check the html output of the script in a vaildator I bet you will find the same thing. I catch a lot of minor errors that way.
Visionray
08-10-2002, 09:13 PM
Wonderful hack! Thanks! :D
FrankR310
08-11-2002, 05:50 PM
thank you this works well...I used the suggestion noted in a previous post to use vb templates to show a page called activetoday.php and it uses only 6 queries! :)
just notice one issue though; i have my board set so that unregistered users can post and it does not pull these posts...not sure if it's just anyone who's unregistered or those who dont put a name and posts as "unregistered".
any suggestions on how i might correct this?
thanks for the hack!
pdatoon
08-16-2002, 03:25 PM
is it possible to have also the name of the category beside the title?
Aaron RV
08-17-2002, 10:25 AM
Originally posted by tubedogg
UPDATED! Not a new version number, but a bug fix.
Fixed another bug with using forum titles and included forums. :o
New update: *Actually* fixed the bug with the forums this time. :)
------------------------------------------------------------------------------------
It's my best work to date (if I do say so myself :D) and I think you'll like it and like all the configuration you can do.
This image shows the script with all of the columns on, and parsing [code], smilies, and the post icon, as well as showing the forum title before the thread title.
http://www.bigdoggslair.com/vbhacks/last10/l10-1.jpg
This image shows the script with all the columns off except $lastpostdate, and the $tw (table width) set to 600, and $showdate set to 0 (to just show the last post time).
http://www.bigdoggslair.com/vbhacks/last10/l10-2.jpg
This image shows the same as #2, except $tw is blank (allowing the table to compact and remove the empty space automatically).
http://www.bigdoggslair.com/vbhacks/last10/l10-3.jpg
Hack version: 1.0.1
Changes since version 1.0.0: Fixed small bug.
Changes since version 0.1.0: Parses [ b], [ i], [ u], [ code], and [ quote] within the "last post". Displays the icon of the post, or the thread if there is no post icon. Parses smilies. New option to convert new lines to <br> so the post appears as the author wrote it (note: may cause problems if there are large breaks in posts).
Changes since version 0.0.2: New option to show the text of the last post of a thread (also option to limit the number of characters of the post displayed). New option to set the table width, as a percent, a number of pixels, or just let the table size naturally. New option to show just the time of the last post, instead of the date *and* the time. New option to show a thin line around the cells (cell spacing).
Changes since version 0.0.1: Include only specific forums, or set to allow all forums except certain excluded forums. New option to display a "Last post date" column with the last post date and time, formatted with your board's date & time setting. Fixed a bug with font and font size. Split the config into a separate file to make editing easier.
For version: v2 betas 3, 4, 5, RC1, RC2.
Files needed: last10.php, last10config.php (see attached zip file).
Files to edit: last10config.php (see attached zip file).
Possible file locations: Anywhere, as long as the relative path to config.php and the URL to your board are correct. Also, you must put last10.php and last10config.php in the same directory!
Instructions
1] Unzip the files last10.php and last10config.php to your hard drive.
2] Open last10config.php in an ASCII text editor, such as Notepad (Windows), SimpleText (Mac), EditPlus, UltraEdit, TextPad, etc. (DO NOT use WYSIWYG HTML editors such as FrontPage, HotDog, DreamWeaver, etc. They will in all likelyhood screw up the file! I will not be able to support you if you edit the file in one of these programs.)
3] Edit the variables at the top. These are:
$path > path to your config.php file (usually in the /admin directory) - NO TRAILING SLASH! and DO NOT PUT config.php at the end of it! ( e.g. forums/admin )
$url > URL to your board - NO TRAILING SLASH! ( e.g. http://www.mysite.com/forums )
$urlimg > URL to your board's images - NO TRAILING SLASH ( e.g. http://www.mysite.com/forums/images ).
$maxthreads > max threads to show. will show less if $last24 or $last7 limits it to less results than this number
$ob > determines the sort order of the list. replycount and views are numbers, lastposter is a name, title is the name of the thread, and lastpost is the last posts' date. 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 > set to "desc" or "asc". 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.)
$last24 > set to 1 to limit the possible results to the last 24 hours; 0 for no limit (must set this to 0 if $last7 is set to 1)
$last7 > set to 1 to limit the possible results to the last 7 days; 0 for no limit (must set this to 0 if $last24 is set to 1)
$bc1 > first alt color (for the alternating colored rows)
$bc2 > second alt color
$hc > head background color (title, last poster, etc.)
$lc > text link color
$tc > text color
$f > font face
$fs > font size in points. 6 is on the small side, 10 on the large side. Put only a number in this - no "pt", "pts", or anything else!
$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
$lastpostdate > show the last post date and time for each thread? 1 = yes; 0 = no
$len > 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 > List certain forums to be excluded. Best used if you have a large number of forums you *do* want included and only a few that you want excluded. List them separated by commas, but without spaces - e.g. 1,2,3,4 - and DO NOT fill in both this and $includeforums! Use one or the other.
$includeforums > List certain forums to be included. Best used if you have a small number of forums that you want included and a large number you want excluded. List them separated by commas, but without spaces - e.g. 1,2,3,4 - and DO NOT fill in both this and $excludeforums! Use one or the other.
$showmessages > If you want to show the last post of the thread as well, set this to 1. You can limit the number of characters displayed in $lplen below.
$lplen > If you specify a number here, any post that has more than $lplen number of characters will be reduced to this number and "..." added to the end of it. If you don't want to use this feature, leave it blank e.g. "" - remember though that if $showmessages is set to 0, this won't do anything.
$tw > If you want to specify the width of the table, you can set it as a percent e.g. 95% or as a number of pixels e.g. 300 or just leave it blank and the table will size itself.
$showdate > If you want to show the date *and* the time, set this to 1. If you want to just show the time, set this to 0.
$cs > If you want a thin line around your cells, set this to 1 (or higher - experiment!). Set to 0 for no line.
$nb > if you want breaks in text to appear as such, set this to 1. otherwise set it to 0 (this may cause problems if there are large breaks in the text)
$showforumtitle > if you want to show the forum title, linked to that forum, for each thread also (forum title: thread title) then set this to 1. otherwise set it to 0.
$showicon > if you want to show the icon the author chose for their post, set this to 1. otherwise set it to 0.
4] Upload both last10.php and last10config.php to your website. You can include last10.php as follows. To include it on a PHP-parsed page (.php, .php3, .phtml, etc.):
<? include("last10.php"); ?>
To include it on a server-parsed page (.shtml, .shtm, .ssi, etc.):
<!--#include file="last10.php"-->
Instructions are also included in the zip file (last10.txt).
FEEDBACK WANTED! :D Likes/dislikes/modification requests all gladly accepted!
Please DO NOT contact me via IM or PM about this hack. Post your problem/question here and I will try to help you.
No problems with 2.2.6?
Thank you.
Gutspiller
08-17-2002, 01:27 PM
Originally posted by pdatoon
is it possible to have also the name of the category beside the title?
yes, but if you have them turned on, it conflicts if you have another post hack installed on the same page. You can see it here: http://www.3dNewz.com The top links to the latest 6 threads on the forumz are the ones that cause a problem if you change the setting to show the catagory the post is in. The 6 latest posts is another hack, it's not this one, but all the ones down the side of the page are this hack.
Maddog417
08-26-2002, 06:49 PM
I think I've almost got this hack to work, but I'm being denied access to MySQL. Here is the error I'm getting:
Warning: Access denied for user: 'warfarehq@localhost' (Using password: NO) in /home/www/warfarehq/forums/admin/last10.php on line 14
Warning: MySQL Connection Failed: Access denied for user: 'warfarehq@localhost' (Using password: NO) in /home/www/warfarehq/forums/admin/last10.php on line 14
Can't open connection to MySQL
Can anyone help? Thanks.
fonzerelli_79
08-26-2002, 10:49 PM
sorry to be a pain but for some reason im getting this
X-Powered-By: PHP/4.1.2 Connection: close Content-Type: text/html
Warning: Access denied for user: 'httpd@localhost' (Using password: NO) in /../affiliate- review.com/last10.php on line 14
Warning: MySQL Connection Failed: Access denied for user: 'httpd@localhost' (Using password: NO) in /......./affiliate-review.com/last10.php on line 14
Can't open connection to MySQL
kjetilpa
08-28-2002, 05:11 PM
Is it possible to modify this for use with polls also?
Kjetilpa
Cell Block
09-07-2002, 05:59 PM
Is it possible to use this on a non-VB page on another server?
I share a board with another site. The site is hosted on their server, I'm attempting to have the last posts shown on a non-VB page on MY server.. Is this possible?
thanks.
fonzerelli_79
09-12-2002, 11:54 AM
does anyone know why im getting this
X-Powered-By: PHP/4.1.2 Connection: close Content-Type: text/html
at http://www.affiliate-review.com
i cant seem to find the code in last10.php
any help would be appreciated :):)`
Darren Lewis
09-12-2002, 07:26 PM
Originally posted by Cell Block
Is it possible to use this on a non-VB page on another server?
I share a board with another site. The site is hosted on their server, I'm attempting to have the last posts shown on a non-VB page on MY server.. Is this possible?
thanks.
Try https://vborg.vbsupport.ru/showthread.php?s=&threadid=39023
Darren Lewis
09-12-2002, 07:29 PM
fonz, looks like it may be the path to your config.php file. The scripts can't open the connection to MySQL. Try the options in the link in my previous post if you're still having probs.
Darren.
veedee
09-17-2002, 04:18 PM
Why is everyone early on in this thread set as a guest?
Odd!
~veedee
NTLDR
09-17-2002, 04:23 PM
Originally posted by veedee
Why is everyone early on in this thread set as a guest?
Odd!
~veedee
Because this thread originated from when the hacks section was over at vB.com, when the threads/posts got moved not all the users re-registered and not all the posts/threads got updated with a username. Hence many guest posts here ;)
veedee
09-17-2002, 04:39 PM
Ahh righty!!
This is my effort so far.
http://www.visordown.com/forums/last10.php
What's up..anyone know?
NTLDR
09-17-2002, 04:41 PM
you have set the path wrong, it should be ./admin/config.php for you.
veedee
09-17-2002, 04:45 PM
Ahh ok I searched for another post that said I should replace something in my last10.php file so I did it was this code
$servername="xxx"; // hostname or ip of server
$dbusername="xxx"; // username of your database server
$dbpassword="xxx"; // password of your database server
$dbname="xxx"; // name of database
It now works great - thanks for your help! :D
PiotrasG
09-26-2002, 07:21 PM
I'm new to all this hacking i get this error message what am i doing wrong
Warning: Unable to access /admin in /home/virtual/site10/fst/var/www/html/forum/last10.php on line 13
Fatal error: Failed opening required '/admin' (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site10/fst/var/www/html/forum/last10.php on line 13
Zombie-F
10-06-2002, 07:42 PM
Originally posted by veedee
Ahh ok I searched for another post that said I should replace something in my last10.php file so I did it was this code
$servername="xxx"; // hostname or ip of server
$dbusername="xxx"; // username of your database server
$dbpassword="xxx"; // password of your database server
$dbname="xxx"; // name of database
It now works great - thanks for your help! :D
Yup, I had to do this too, but now it works awesome! Let me be the 10,345,763rd person to say thanks to tube for the kick-ass script!
The only problem with it I see is it displays the post times as server time, not local time. Is there any way to fix this? I looked as much as I could through this monstrously long thread for an answer, but I didn't see one.
Thanks again, and keep up the good work.
See it in action at http://badass.icestorm.com :nervous:
a43079
10-06-2002, 09:58 PM
Fatal error: Failed opening required '/www/eroweb/admin/config.php' (include_path='.:/usr/local/lib/php') in /home/www/eroweb/last10.php on line 13
i am getting this error please help
Visionray
10-07-2002, 12:55 AM
I have a question. How do I make the Thread Titles and the number of views, replies etc. bold? What do I have to change and in what file? I think it would look much nicer if the text were bold.
Thanks!
Here it is on my site as a test www.fusionarena.com/newindex.php
fonzerelli_79
10-07-2002, 10:08 AM
ive got it sorted now - thanks for all your help :)
Visionray
10-08-2002, 08:14 AM
Originally posted by Visionray
I have a question. How do I make the Thread Titles and the number of views, replies etc. bold? What do I have to change and in what file? I think it would look much nicer if the text were bold.
Thanks!
Here it is on my site as a test www.fusionarena.com/newindex.php
Anyone? I can't figure this out for the life of me.
darker1
10-09-2002, 12:45 PM
I am not able to get this hack working using xoops.. anyone care for telling me how they pulled it off?
step by step please :)
cklaszlo
10-10-2002, 02:36 PM
Hi.
I was wondering how to modify this hack to only display the first post of a thread and not all the replies to it?
Example:
http://www.thrillnetwork.com/tripreport.php
I am using this hack for "Trip Reports." When a user posts a report in our boards (it will be in a moderator approval cue) I only want their original post of the thread to appear not all the replies.
Thanks
Visionray
10-29-2002, 03:48 PM
anyone know how to make the Thread Titles and the number of views, replies etc. bold?
Oh pretty please with sugar on top.
hi tub !
thanks for this wonderfull hack. the only problem i have is that the textformation is not equal an in the posting. Specially the <br> are missing. so the text is in one row.
This isn?t really nice for looking.
can u help me ?
Sorry about my english, but it all a long long time ago ;)
hi tub !
thanks for this wonderfull hack. the only problem i have is that the textformation is not equal an in the posting. Specially the <br> are missing. so the text is in one row.
This isn?t really nice for looking.
can u help me ?
Sorry about my english, but it all a long long time ago ;)
hi tub !
thanks for this wonderfull hack. the only problem i have is that the textformation is not equal an in the posting. Specially the <br> are missing. so the text is in one row.
This isn?t really nice for looking.
can u help me ?
Sorry about my english, but it all a long long time ago ;)
Visionray
12-03-2002, 01:39 AM
Originally posted by Logo
This isn?t really nice for looking.
I believe this thread has been abandoned. I too wish there was a way to improve the appearance, but looks like tube isn't going to respond.
i hope he can help us..
(why did i have made a tripple post ??)
Ryan McBain
12-06-2002, 03:05 AM
This hack is great. My question is how do I change it show it shows the actual date and time of the last post? You can see what I have done at http://www.ryanmcbain.com
Visionray
12-06-2002, 06:34 AM
open up last10config.php and find this code
$lastpostdate = "0"; // show last post date and time? 1 = yes; 0 = no
Change the "0" to "1"
Also, look for this code
$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.
Change that "0" to "1" as well.
Changing both of those will display both the date and time. If you only want to show the time, then just change the second code I posted to 1, and leave the first to 0.
Dude, if you can find a way to make the links bold I will give you a million dollars. It would look much nicer bold don't you think? I haven't been able to find a way.
Ryan McBain
12-08-2002, 02:49 PM
I did that and nothing happens. And also. I made a new thread just to check and see if the hack works. And the same 5 threads are up there. I must of done something wrong there, and thats why I cant get the hack to show the date and time.
DO you have any suggestions?
Originally posted by Visionray
open up last10config.php and find this code
$lastpostdate = "0"; // show last post date and time? 1 = yes; 0 = no
Change the "0" to "1"
Also, look for this code
$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.
Change that "0" to "1" as well.
Changing both of those will display both the date and time. If you only want to show the time, then just change the second code I posted to 1, and leave the first to 0.
Dude, if you can find a way to make the links bold I will give you a million dollars. It would look much nicer bold don't you think? I haven't been able to find a way.
Katman
12-09-2002, 02:38 AM
So far I love this hack but............
The smilies in the post don't show up, and I can't put forumid's in both the $excludeforums and $includeforums. If I put numbers seperated by commas without spaces into both of these I get an error: "Error: $includeforums and $excludeforums are both set with numbers. Please remove the numbers from one of these two to proceed."
$path = "forums/admin"; // path to your config.php file (usually in the /admin directory) - NO TRAILING SLASH! Do not include "config.php"
$url = "http://www.katanaplanet.com/forums"; // URL to your board - NO TRAILING SLASH!
$urlimg = "http://www.katanaplanet.com/forums/images"; // URL to your board's images - NO TRAILING
Smilies Source Code as displayed by browser with above configuration:
<img src="http://www.katanaplanet.com/forums//forums/images/smilies/cool.gif" border=0>
Web Site:
http://www.katanaplanet.com
ericsmith
12-12-2002, 10:18 PM
Could you add ability to show the Rating column in the next version.
rharbison
12-18-2002, 03:16 AM
Can this hack be installed to a regular html page? The instructions say the following:
> To include it on a PHP-parsed page (.php, .php3, .phtml, etc.)...
> To include it on a server-parsed page (.shtml, .shtm, .ssi, etc.)...
I want to install it on my index.html page. I'd really rather not change that to index.php or index.shtml etc, as it's currently listed on google etc as index.html
Can I use this without changing the page type/extension?
Originally posted by rharbison
Can this hack be installed to a regular html page? The instructions say the following:
> To include it on a PHP-parsed page (.php, .php3, .phtml, etc.)...
> To include it on a server-parsed page (.shtml, .shtm, .ssi, etc.)...
I want to install it on my index.html page. I'd really rather not change that to index.php or index.shtml etc, as it's currently listed on google etc as index.html
Can I use this without changing the page type/extension?
With an Apache server, you can use the "XBitHack on" directive in an .htaccess file and chmod the html file to be executable. This adds to server load somewhat but will parse the html files for server side includes. (If you are on a shared host, check with host staff first).
Ryan McBain
12-20-2002, 02:56 AM
I got it to work, check it out at http://www.ryanmcbain.com :)
julius
01-01-2003, 07:38 AM
I want to exclude some threads to show, but config let me only to exclude some forum.
Anyone know if is it possible?
jimmy mac
01-10-2003, 06:33 AM
i'm having a problem getting anything to show up. i am pretty sure i configured everything right but i'm adding this to a block on nuke and nothing happens when i add the code to pull up last10.php.
i even tried uploading a plain html page and trying it and still got nothing. any ideas on what i'm doing wrong? i have both the .php files uploaded to my main directory.
suzannev
01-10-2003, 01:04 PM
This was exactly what I needed!! I have this installed not only on my main page, but it is also installed throughout the site to pull up certain forums on certain pages. This made my life much. much easier.
{{bowing down}}
Just one comment - there is no option to show just the date of a post, it's either date and time or just time. It would be nice to have just the date too. I don't have a mega site like most here.
Take Care,
Suzanne
----------------------
Emotional support for the terminally ill since 1999
www.ShareaCard.org
vfxtalk
01-13-2003, 08:14 PM
hi guys,
well i didnt read all 30 pages of the beast.... :)
does this hack work for v2.2.9 ??? Also, will it work with a skin that i have purchased from vbskins.com
Cheers for your help :D
Paul
suzannev
01-13-2003, 08:21 PM
Hi Paul,
I have it installed on 2.2.9 with no problems. I have 2 instances of it running on one page in different formats by just renaming the last10config.php file to last10config2.php and editing the last10.php to reflect it.
vfxtalk
01-13-2003, 08:53 PM
hi there,
do you have an URL where i can see what it looks like with v2.2.9??
CHeers
Paul
suzannev
01-14-2003, 02:05 AM
<a href="http://www.cacfriends.com/shareacard.shtml" target="_blank">http://www.cacfriends.com/shareacard.shtml</a>
It's highly customizable.
vfxtalk
01-14-2003, 02:11 AM
thanks again!!! :D
gopherhockey
01-22-2003, 06:17 PM
I have seen many requests for information regarding running this on a server that is NOT the same as the vb server.
I even saw one user say he got it working.
Can someone quickly point out whether or not this really works accross servers, and if so how?
Step number one - the path to config.php - appears to be a show stopper right away..
I don't even want to mess with this unless someone can perhaps tell how this might be done, or a definite "no, this doesn't work that way"
THanks!
SVTBlackLight01
02-11-2003, 02:41 AM
:banana: By far the best hack for me to date. :banana:
Robink
02-20-2003, 03:21 PM
I get the time wrong in this...
Any idea why??
Jethro
02-26-2003, 03:37 AM
Nice work dude :laugh:
Installed and running on version 2.3.0 (have an early version running on 2.2.6 but think we might be changing to the latest version which rocks ... like ... er the Rocky Mountains).
Will post up urls when we upload our pages :)
Robink
02-26-2003, 03:57 PM
It displays the time wrong for me!
Can anyone help??
Jethro
03-02-2003, 03:17 AM
Nice one, just installed it live. No hassles even for a newbie like myself :glasses:
And here's a pic.....
stark427
03-06-2003, 11:35 PM
Nice hack :)
Is there any version which displays the latest XX threads, instead of posts?
thanx in advance :)
Steve_S
03-07-2003, 07:24 AM
Originally posted by gopherhockey
I have seen many requests for information regarding running this on a server that is NOT the same as the vb server.
I even saw one user say he got it working.
Can someone quickly point out whether or not this really works accross servers, and if so how?
Step number one - the path to config.php - appears to be a show stopper right away..
I don't even want to mess with this unless someone can perhaps tell how this might be done, or a definite "no, this doesn't work that way"
THanks!
Not that hard. Step by step at:
http://www.free-webmaster-tools.com/articles-vbulletin-hack.htm
D|ver
03-10-2003, 09:11 AM
thank you for this cool hack :)
but how can i display the today/yesterday text instead of the date?
thuffner
04-02-2003, 08:44 PM
It can't connect to my MySQL database for some reason, and all my info is correct...
See:
http://www.bondmovies.com/board/last10.php
Any suggestions?
mcyates
04-12-2003, 05:34 PM
My server is 7 hour behind and all the times are wrong. Can this be changed?
Haddy
04-13-2003, 07:27 PM
What do I have to edit to make the links open in a blank page...I tryed adding target="_blank" to the last10.php part where it calls the link but it gave me an error....Am I missing something?
filmhobbit
04-14-2003, 04:36 AM
03-07-03 at 10:18 AM Steve_S said this in Post #434 (https://vborg.vbsupport.ru/showthread.php?postid=362277#post362277)
Not that hard. Step by step at:
http://www.free-webmaster-tools.com/articles-vbulletin-hack.htm
Hi Steve,
The problem with this hack is that it requires a seperate file to be downloaded and installed on the remote server. I want to use this as an easy to use way to drive traffic to my site by making headlines displayable to ANYONE who wants to use them. In other words, ideally I'd like any random webmaster who comes by my site to be able to copy a simple script, insert it on his page and have our headlines displayed there without having to install anything, etc. This way is very difficult and I've had no success getting it to work, let alone making it possible for many users to use it easily.
Is there any way at all to do this?
Sharg
04-27-2003, 10:56 PM
Is there no way to have this hack extracting the firt post only (without taking care of the last post ) ?
This way, we could use it for news without having user replies bumping up the news with their comments as "last post".
Thanks,
Sharg
mark99
05-04-2003, 12:46 PM
Much like a few others have mentioned above, it appears as if the code for outputting the time is wrong. My server off-set is -1 hour and the time for posts is correct on my forum, yet on the output for this script it's +1 hour?
I can't change this because strangely the code for time 'appears' to be called from the forum, which ironically tells the correct time.
Also, how do you separate the time and date output? The time is wrong so I just want to display the date.
mcahill
05-28-2003, 11:49 AM
Okay, the hack has been running fine for 3 months and was working fine last evening. Now it is not working at all and is throwing a blank screen.
I'm checking with the host to see if they've made any changes to PHP.ini or changed versions or anything like that.
Can anyone point me at a possible reason for the blank page problem?
Problem resolved: The ISP updated PHP without telling me...had to make a change to some of the other code on the page to deal with globals turned off.
Splitfyre
06-13-2003, 01:54 AM
When I bring the php include tag into my index.php file I get the following error message:
Can't Select Database
What's up with that? Help
Splitfyre
06-13-2003, 02:34 AM
03-31-01 at 10:58 PM said this in Post #27 (https://vborg.vbsupport.ru/showthread.php?postid=84674#post84674)
If you're getting that far, then all your variables are indeed set correctly. Can you try something for me? I've attached a zip file to this message - open it, edit the username, password, database host ($dbhost), and database name ($dbname) in both files (testmysql1.php and testmysql2.php) and put both files on your server where the last10.php file is, then go to testmysql1.php in a web browser, e.g. http://www.yoursite.com/path/to/testmysql1.php and tell me what happens.
Then go to testmysql2.php e.g. http://www.yoursite.com/path/to/testmysql2.php and tell me what happens.
Sorry you're having problems. Hopefully this will solve it!
Tried this and got the same error indicating that it Cannot Select Database. :ermm:
bluecat
06-19-2003, 12:14 PM
I know they just released vb3 beta, does anyone know if this hack will work with that version? I just laid out my home page with this hack and really don't want to have to change it if it doesn't work, for now anyway. Thanks.
Ryan McBain
06-20-2003, 04:26 AM
Today at 06:14 AM bluecat said this in Post #445 (https://vborg.vbsupport.ru/showthread.php?postid=410698#post410698)
I know they just released vb3 beta, does anyone know if this hack will work with that version? I just laid out my home page with this hack and really don't want to have to change it if it doesn't work, for now anyway. Thanks.
It works fine for me. Your gonna have to edit a few things, such as the link to the admincp but i does work. Just check out how i have it on ryanmcbain.com
Splitfyre
06-21-2003, 09:32 PM
Cannot seem to get it to login to the db.
Ryan McBain
06-21-2003, 11:22 PM
Today at 03:32 PM Splitfyre said this in Post #447 (https://vborg.vbsupport.ru/showthread.php?postid=411440#post411440)
Cannot seem to get it to login to the db.
Im guessing that it is looking for the admincp folder, there is no admin folder anymore in vb3
peterjun
06-23-2003, 07:00 PM
I setup my Last10 up a few months ago and it was working very smoothly... However, recently, it just suddenly stopped working! I have it set as a template (the $last10 in the templates) and it keeps showing me the top 5 messages from a month ago (when there have been new posts made!).
When I execute last10.php, I get this message:
MySQL reported this error while trying to retreive the info: No Database Selected
Thanks for any help!
SVTBlackLight01
07-14-2003, 05:49 AM
Does anyone know what this error means?
Warning: main(): stream does not support seeking in /home/*****/public_html/last10.php on line 13
It just started showing up.
MamiRavi
07-18-2003, 03:12 PM
oh thank god!! i finally got this to work! thanks!
Psidefect
07-20-2003, 04:43 PM
Love this hack!
Wouldn't it be rather simple to make this a template? This may have been suggested, but I didn't read all 20 pages of the thread (first three or four and the last three or four and didn't see it). I would think as a template you wouldn't need to deal with the colors as it would get them from the db like every other page (and would be style specific too).
In terms of functionality, kudos. This is really a great hack.
oatmeal
07-29-2003, 04:27 PM
I've configured last10 and it works great, but I now I want to have a page that looks just like the main forum page, but with the last10 output in place of the forum listings in the "<!-- main -->" section of the templete. I don't wan't to REPLACE my main forum page, however. I created a new templet called last10 and pasted that contents of the forum_home templet into it, replacing the forum listings with a call to last10.php.
My question is... how do I access this new templet from a url?
Great hack, btw.
EVO VIII Chris
08-04-2003, 07:09 PM
I am a little confused here. I am totally new to PHP and I am wanting to use this on my sites mainpage which is non VB. My mainpage is www.vorspann.net I want to put in in the left vertical nav bar under the "Recent Discussions" cell and I did everything as it says in the readme file and I cant figure out why it wont work. Since I am using dreamweaver do I have to put a PHP include in the HTML where I want the table to appear or what? Also when I am setting up the config since my main index page is not in a folder would I just want the address to be http://www.vorspann.net/index.php?
Im lost
Logtenberg
09-03-2003, 08:24 PM
Is there a tweak that can be made that will allow you to enter a parent forum you want to include and it correspondingly will show all posts in the sub-forums of that parent?
I have over a hundred sub-forums I'd like to include and I cringe at having to write in all their numbers...
Logtenberg
09-03-2003, 11:01 PM
more importantly... is it possible to have a link that goes to the top of the forum as well as the the "...goto=newpost"?
dontpanic
09-05-2003, 06:28 PM
Instead of showing the last threads, could we instead show the last posts...even if there are multiple posts in a single thread? I think this would be a cool change.
EVO VIII Chris
09-09-2003, 02:09 PM
Why is it that this hack displays a error saying... Can not access database as Chris Jumonville@localhost using password: NO. This must mean it is not using my password at all but I know I have entered the right user name and password in the config.php file. I have two mysql users one is my name with no password and the other is my name with a password. When I try the name without a password it works. Its like this thing wont take my password... Why?
Thanks
Chris
Byron
09-13-2003, 05:56 PM
Can this hack work with Version 3?
Is there any Last XX Posts on non-vB page hack for version 3?
EVO VIII Chris
09-14-2003, 09:37 PM
Very serious question here... How can I set this up if my forums are at forums.vorspann.net and my mainpage is at www.vorspann.net?
Thanks
Chris
mark99
09-16-2003, 09:19 AM
Yeah I'd like this to work with vB3 as well, I changed the path to config.php all I get is this error message:
MySQL reported this error while trying to retreive the info: Table 'db86213033.thread' doesn't exist
The Geek
09-24-2003, 05:56 PM
Works a treat with vb3... just adjust the variables to point to the correct paths.
mark99
09-25-2003, 07:55 AM
That doesn't help =), I've already done that - hence the above error even appearing in the first place. Can you attach your version or explain EXACTLY what you changed?
mark99
09-25-2003, 08:38 AM
Ah, found the problem! It's because I'm using a prefix ($tableprefix) of 'vb3_' in the database. You have to change all the query and table calls to thus include 'vb3_' before them.
I'm not quite sure how to add '$tableprefix' before each call without it merging into one line and confusing things. Otherwise it needs to be done manually, which is a pain.
The Geek
09-25-2003, 12:55 PM
To solve the prefix problem...
Try this (I am not where I can test the script... but it should work without any problems)
All it does is add $tableprefix before each table name in the From clause of each sql statement.
* edit - Like the true doofus I am... I did this and then read your post again... which clearly points out that you know all of this... but it should also point out where you were having problems ;) *
For example....
$sql="SELECT bob FROM fred where 1=2";
to
$sql="SELECT bob FROM " . $tableprefix . "fred where 1=2";
------------------------------------------
open last10.php
find
// ooh a query!
$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";
and change to
// ooh a query!
$query = "SELECT thread.lastpost,thread.title,thread.lastposter,thr ead.replycount,thread.views,user.userid,thread.thr eadid,thread.forumid$fsel,thread.iconid FROM " . $tableprefix . "thread,user$ftitle $wheresql ORDER BY thread.$ob $obdir LIMIT $maxthreads";
find
$dtf = mysql_query("SELECT value FROM setting WHERE varname='dateformat' OR varname='timeformat' OR varname='timeoffset' ORDER BY varname");
and change to
$dtf = mysql_query("SELECT value FROM " . $tableprefix . "setting WHERE varname='dateformat' OR varname='timeformat' OR varname='timeoffset' ORDER BY varname");
find
$query0 = "SELECT pagetext,postid,dateline,iconid FROM post WHERE threadid='$threads[threadid]' ORDER BY dateline DESC LIMIT 1";
and change to
$query0 = "SELECT pagetext,postid,dateline,iconid FROM " . $tableprefix . "post WHERE threadid='$threads[threadid]' ORDER BY dateline DESC LIMIT 1";
find
$smilies = mysql_query("SELECT smilietext,smiliepath FROM smilie");
change to
$smilies = mysql_query("SELECT smilietext,smiliepath " . $tableprefix . "FROM smilie");
In theory... that should sort it out.
toodles
dontpanic
09-28-2003, 12:58 AM
Is there some way that this hack can be modified such that users who do not permissions to see a post normally cannot see them via this hack?
As an example. I have forums for my moderators that registered users cannot see. On the page this hack produces, they can see the threads...but obviously not access them. I am looking to filter the threads to remove them from displaying on this list based on user group.
Make sense?
Thanks and great hack!
Oh yeah..if I missed this somewhere in the last 31 pages, sorry! :)
Ripster
10-03-2003, 10:02 AM
Hi, thanksd for the hack - exactly what I was looking for
One request - is it possible to not display 'Thread title' in the table? My site have a graphic above the forum links so this extra text is redundant. It has probably been answered somewhere in the thread but there's alot of stuff to plough through there!
Here's an illustration of what I mean, rhs of the page...
http://www.ripnet-uk.com
TIA for any help
sabret00the
10-07-2003, 10:50 AM
everytime i try and work with this hack, i get this, someone please help me
LAST10CONFIG<?
//...........Last X Posts v1.0.2...........\\
//......by Kevin (kevin@tubescan.com)......\\ (kevin@tubescan.com)......\)
// For vBulletin version 2 (betas 3, 4, 5, RC1, RC2)
// (c) 2001 Jelsoft Enterprises, Ltd.
// vBulletin.com thread: http://www.vbulletin.com/forum/showthread.php?threadid=12324
//////// CONFIG EXPLANATION //////////
//
// a] $path > path to your config.php file (usually in the /admin directory) - NO TRAILING SLASH! ( e.g. forums/admin ) and DO NOT PUT config.php ON THE END OF THIS PATH OR THE SCRIPT WILL NOT WORK!!!!
// b] $url > URL to your board - NO TRAILING SLASH! ( e.g. http://www.mysite.com/forums )
// c] $urlimg > URL to your board's images - NO TRAILING SLASH ( e.g. http://www.mysite.com/forums/images )
// d] $maxthreads > max threads to show. will show less if $last24 or $last7 limits it to less results than this number
// e] $ob > determines the sort order of the list. replycount and views are numbers, lastposter is a name, title is the name of the thread, and lastpost is the last posts' date. 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.)
// f] $obdir > set to "desc" or "asc". 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.) leave this set to "desc" if you use lastpost for $ob or it will not work correctly!
// g] $last24 > set to 1 to limit the possible results to the last 24 hours; 0 for no limit (must set this to 0 if $last7 is set to 1)
// h] $last7 > set to 1 to limit the possible results to the last 24 hours; 0 for no limit (must set this to 0 if $last24 is set to 1)
// i] $bc1 > first alt color (for the alternating colored rows)
// j] $bc2 > second alt color
// k] $hc > head background color (title, last poster, etc.)
// l] $lc > text link color
// m] $tc > text color
// n] $f > font face
// o] $fs > font size in points - 8 is normal, 6 is on the small side, 10 on the large side. play around with it. :) just put a number here - no pt, pts, or anything!
// p] $lastposter > show the "last poster" column? 1 = yes; 0 = no
// q] $views > show the view count for each thread? 1 = yes; 0 = no
// r] $replies > show the reply count for each thread? 1 = yes; 0 = no
// s] $lastpostdate > show the last post date and time for each thread? 1 = yes; 0 = no
// t] $len > 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 ...)
// u] $excludeforums > if you want to exclude certain forums from having their threads displayed, this is the place to enter their numbers. separate more than 1 number with commas, NO SPACES! e.g. 1,2,3,4 (note: $excludeforums and $includeforums are mutually exclusive, meaning DO NOT USE BOTH AT THE SAME TIME! only fill one or the other in with numbers!)
// v] $includeforums > if you just want to use certain forums (instead of a whole list, or instead of excluding 10 of 12 forums or something similar), put their numbers here. separate more than one number with commas NO SPACES e.g. 1,2,3,4 (note: $excludeforums and $includeforums are mutually exclusive, meaning DO NOT USE BOTH AT THE SAME TIME! only fill one or the other in with numbers!)
// w] $showmessages > if you want to show the text of the last post in each thread as well, set this to "1". set this to "0" if you don't.
// x] $lplen > the maximum length of post to allow. if the post is longer than this, it will be shortened to this many characters and "..." added. if $showmessages is set to 0, this won't do anything.
// y] $tw > the width of the table holding the information. can be a percent ( e.g. 95% ) or a number of pixels ( e.g. 300 ). leave blank if you want the table to be sized naturally.
// z] $showdate > if you enable the "last post date" column and would like the date shown for each post as well as the time, set this to 1. if you have a busy board and all of posts are going to be from the current day, or if you set $last24 to 1, then you can set this to 0. if the last posts are likely to be spread over multiple days (for small boards, etc.) then you might want to set this to 1.
// aa] $cs > if you want to show a thin line around the cells (see the first example on the vBulletin.com thread referenced above) then set this to "1" (or higher - experiment with it!) otherwise set it to 0.
// ab] $showicon > if you want to show the icon the author chose for their post, set this to 1. otherwise set it to 0.
// ac] $showforumtitle > if you want to show the forum title, linked to that forum, for each thread also (forum title: thread title) then set this to 1. otherwise set it to 0.
// ad] $nb > if you want breaks in text to appear as such, set this to 1. otherwise set it to 0 (this may cause problems if there are large breaks in the text)
//
////// END CONFIG EXPLANATION ////////
/////////////// CONFIG ///////////////
//
$path = "../forums/admin"; // path to your config.php file (usually in the /admin directory) - NO TRAILING SLASH! Do not include "config.php"
$url = "http://www.ebslive.com/forums"; // URL to your board - NO TRAILING SLASH!
$urlimg = "http://www.ebslive.com/forums/images"; // URL to your board's images - NO TRAILING SLASH!
$maxthreads = "25"; // 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 = "#ECF2FA"; // first alt color
$bc2 = "#ECF2FA"; // second alt color
$hc = "#ECF2FA"; // head background color
$lc = "#4F6BAO"; // link color
$tc = "#4F6BAO"; // text color
$f = "Tahoma"; // 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 = "0"; // show reply count? 1 = yes; 0 = no
$lastpostdate = "0"; // 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 = "20,17,18"; // 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 = "95%"; // 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 = "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
//
///////////// END CONFIG /////////////
?>
and heres the last10.php i can't see nothing wrong with either
<?
//...........Last X Posts v1.0.5...........\\
//......by Kevin (kevin@tubescan.com)......\\ (kevin@tubescan.com)......\)
// For vBulletin version 2 (betas 3, 4, 5, RC1, RC2, RC3)
// (c) 2001 Jelsoft Enterprises, Ltd.
// vBulletin.com thread: http://www.vbulletin.com/forum/showthread.php?threadid=12324
// let's get connected
require("incl/last10config.php");
$db=mysql_connect($host,$user,$password) or die("Can't open connection to MySQL");
mysql_select_db($database) or die("Can't select database");
$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=3 cellspacing=$cs width=150 align=center><tr bgcolor=\"$hc\">\n");
if ($showicon == "1") {
echo("<td> </td>");
}
echo("<td style=\"font-family:$f; font-size:$hfs; color:$tc;\" width=\"75\"><b><nobr>Thread Title</nobr></b></td>\n");
// the last poster column,
if ($lastposter == "1") {
echo("<td style=\"font-family:$f; font-size:$hfs; color:$tc;\" align=\"center\" width=\"75\"><b><nobr>Last Poster</nobr></b></td>\n");
}
echo("</tr>\n");
// the base WHERE statement
$wheresql = "WHERE thread.lastposter=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.lastpost>'$time'";
}
// last 7
if ($last7 == "1") {
$time = time()-604800;
$wheresql .= " AND thread.lastpost>'$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.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";
// 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[lastpost]);
// 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]&goto=newpost\" 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 = "";
}
// close it all up
echo("</tr></table>");
// bye!
?>
sabret00the
10-07-2003, 06:26 PM
still in need of dyer help with this :happysad:
mark99
10-11-2003, 05:01 PM
Perhaps if you explained exactly what your problem is?
sabret00the
10-15-2003, 12:46 PM
sorry i figured it out, it was bad html in the hack :)
theirs <nobr></nobr> tags which feck it up :)
ChevyRacing24
11-05-2003, 08:47 PM
Will this hack work with the new vBulletin?
dennx
12-03-2003, 05:27 AM
I'm having problems including the hack into an included page.. make sense? Homepage > include page with <? include("../last10.php"); ?> to last10.php.
Is this a prob? The hack works perfectly fine when pointing the browser to last10.php.
dennx
12-03-2003, 05:41 AM
I get this error when using the include stated above...
Parse error: parse error in /var/www/html/global/last10.php on line 189
SVTBlackLight01
12-03-2003, 10:36 AM
Is there some way that this hack can be modified such that users who do not permissions to see a post normally cannot see them via this hack?
As an example. I have forums for my moderators that registered users cannot see. On the page this hack produces, they can see the threads...but obviously not access them. I am looking to filter the threads to remove them from displaying on this list based on user group.
Make sense?
Thanks and great hack!
Oh yeah..if I missed this somewhere in the last 31 pages, sorry! :)
The easiest way to do what you want is to add the ID of those forums to $includeforums in the last10config. That way it won't display any posts from those forums.
dontpanic
12-03-2003, 11:01 PM
Thats what I ended up doing some time ago...was just curious to see if it could be done using the default forums permissions like Teck's archive hacks did. It's all good.
hockyfan
12-09-2003, 03:33 AM
Will this hack work for a non vB page on a different site (ie., can a show threads from my forum on a different website)? If not, is there another way I can do it?
h
stark427
12-09-2003, 03:23 PM
My main page is HTML (as you can see by viewing the source) but it has a .php extension.
http://www.synthpopavenue.gr/
The last10.php page work perfectly (except the wrong time)
http://www.synthpopavenue.gr/last10.php
but I cannot seem to be able to include it into the main page.
I have tried all the following:
<?php require("last10.php");?>
<?php include("last10.php");?>
<!--#include file="last10.php"-->
<!--#require file="last10.php"-->
<!--#include virtual="last10.php"-->
<!--#require virtual="last10.php"-->
<?php
include ('./last10.php');
?>
<?php
include ('http://www.synthpopavenue.gr/last10.php');
?>
but nothing seems to work :(
it just doesn't show up
any ideas?
thanx in advance
Gutspiller
01-06-2004, 04:20 AM
Parker,
I like your additions, but they only work if the person viewing the page has already visited your forum in the past. If they have not they get the dreaded error:
Warning: Cannot add header information - headers already sent by (output started at /usr/local/etc/httpd/htdocs/sbw/forum/last10.php:2)
in /usr/local/etc/httpd/htdocs/sbw/forum/admin/functions.php on line 1090
I like Tube's hack, but until it parses VBCode without the error above for new users I don't think a lot of people will be able to use it.
Does this hack now parse vbcode and HTMl (if enabled)? I added it a long time ago and am trying a new way of doing things and telling the hack to display the thread contents, but it doesn't parse html links when I use the vbcode tag button. Also, does it by default only show the first thread or will it begin to show the text of the first comments to the thread? I just want it to show all of the first thread and parse it the way it looks in the forum, but not to show any text from inside the comments. Can somebody please let me know if that's how the current version of this hack is working, or help me tweak it so that it can work that way? I would be very greatful and I have some cool news posting ideas for this hack.
Thank you!
mcahill
01-06-2004, 03:00 PM
I have it running on my site and the only thing that needed to be changed to make it work was the location of the config file in the last10config.php folder must be switched to include/config.php or something like that.
Totally awesome. I'd budgeted 4 hours to get this hack working again, and it took 4 minutes.
Gutspiller
01-07-2004, 06:01 AM
I am using this hack right here: http://www.3dnewz.com/forumz/allnewspage.php but it's reporting the wrong date. Why is it doing that and how can I fix it?
gmarik
01-08-2004, 10:49 PM
Is this the dunamic scroll srcipt
Gutspiller
01-09-2004, 10:18 PM
Is this the dunamic scroll srcipt
I don't think this script scrolls at all without the help of another script inside an iframe. Are you talking in general about the hack in this thread, or to me and my post above?
Just installed it TubeD, took a bit of hacking around to get it to display the way I wanted to, but it's a brilliant script, works perfectly with VB3, and does exactly what it says on the tin.
10/10
grandeur_69
01-09-2004, 10:51 PM
in last10.php ... change line 189 from
$fd = date($fdt,$threads[lastpost]);
to
$fd = vbdate($fdt,$threads[lastpost]);
to make use of vbulletin's time
Gutspiller
01-14-2004, 04:16 AM
in last10.php ... change line 189 from
$fd = date($fdt,$threads[lastpost]);
to
$fd = vbdate($fdt,$threads[lastpost]);
to make use of vbulletin's time
Thanks grandeur_69. I have one more question, I have that hack that if it was posted today, it says "Today" and if yesterday, it says "Yesterday". The problem is, is that I have those as black text on my forums, well the black text doesn't work on where I'm putting this last10 thing. I tried changing:
echo("<td HEIGHT=\"25\" bgcolor=\"$bc\" style=\"font-family:$f; font-size:$fs; color:90959E;\" align=\"center\">$fd</td>\n");
into this:
echo("<td HEIGHT=\"25\" bgcolor=\"$bc\" style=\"font-family:$f; font-size:$fs;\" align=\"center\"><font color=90959E>$fd</font></td>\n");
but the text continues to stay black. Any ideas on how to change the color when using it in last10, yet still have it the original color it is now on my forums?
Thanks for any help, anybody can provide.
Ryan McBain
01-22-2004, 08:49 PM
I changed my password and I get this error on my front page
Warning: mysql_connect(): Access denied for user: 'ryanmcba@localhost' (Using password: YES) in /home/ryanmcba/public_html/last10.php on line 15
Can't open connection to MySQL
I changed the password in my config.php file and I still get this. Im guessing I have to change my password some where else. What do I do?
mossyuk
01-27-2004, 12:42 PM
does this work with vb3?
mossyuk
01-27-2004, 12:48 PM
and in answer to my own question, yes it does :) :D Nice 1.
tigerroar
02-02-2004, 03:02 PM
nice one, this is just what I wanted.
It's working nicely here (http://www.tigerroar.co.uk) :cool:
grandeur_69
02-02-2004, 04:15 PM
Gutspiller,
I actually had similar problems with changing the colors, so i stripped most of the other code out and manually coded the html ... be aware of the style sheets that vB uses, and it can make your life a bit easier on the recoding.
OneTake
03-30-2004, 02:37 AM
I am using this hack right here: http://www.3dnewz.com/forumz/allnewspage.php but it's reporting the wrong date. Why is it doing that and how can I fix it?How'd you get away with opening your adsense links in a new window? They won't even let me run ads on a page that opens in a new window.... grrrr ;)
Onetake
its dosnt work with vb3 gold
or jest with me the problem
its give this note
Fatal error: main(): Failed opening required '/nabdhat/includes/config.php'
and
Warning: main(/nabdhat/includes/config.php): failed to open stream: No such file or directory
but the directory is correct
sabret00the
04-03-2004, 01:25 PM
its dosnt work with vb3 gold
or jest with me the problem
its give this note
Fatal error: main(): Failed opening required '/nabdhat/includes/config.php'
and
Warning: main(/nabdhat/includes/config.php): failed to open stream: No such file or directory
but the directory is correct
i don't beleive this does work with vb3
however a similar version have been realsed for vb3 gold :)
kirupa
04-06-2004, 12:26 AM
i don't beleive this does work with vb3
however a similar version have been realsed for vb3 gold :)
Hey sabre,
I have tried searching for a similar hack for vb3, but I can't seem to find it. Would it be possible for you to provide me with a URL to the vb3 version of a similar hack?
Thanks!
Kirupa :)
sabret00the
04-21-2004, 02:07 PM
<a href="https://vborg.vbsupport.ru/showthread.php?t=62624" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=62624</a>
sbryan
06-06-2004, 01:34 PM
hi guys. for reasons i wont go into, im using an iFrame and displaying the last10.php file through as as when i tried to include it, it threw out other info on the page.
i want to set the links so that they load in the parent window. i tried adding target="_parent" to these lines..
echo("<a href=\"$url/forumdisplay.php?forumid=$threads[forumid]\" style=\"color: $lc;\" >$threads[ftitle]</a>: ");
}
echo("<a href=\"$url/showthread.php?threadid=$threads[threadid]&goto=newpost\" 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");
but it keeps giving an error. is it possible to use normal html in this code to link in a css file and apply custom classes as well as this link option?
*edit*
i worked it out :-) you cant use normal html, i had to use target=\"parent\" and then it worked :D
installed, nice hack man.. thanks.
paulmjno
10-11-2004, 05:12 PM
Thank you very much for this. :)
I required a simple list of recent postings rather than to display all that information. So, I changed all the HTML in the hack to suit my needs, maybe someone else will also find this useful?:
<?
//...........Last X Posts v1.0.5...........\\
//......by Kevin (kevin@tubescan.com)......\\
// For vBulletin version 2 (betas 3, 4, 5, RC1, RC2, RC3)
// (c) 2001 Jelsoft Enterprises, Ltd.
// vBulletin.com thread: http://www.vbulletin.com/forum/showthread.php?threadid=12324
// 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");
// the base WHERE statement
$wheresql = "WHERE thread.lastposter=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.lastpost>'$time'";
}
// last 7
if ($last7 == "1") {
$time = time()-604800;
$wheresql .= " AND thread.lastpost>'$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.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";
// 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("https://vborg.vbsupport.ru/","",$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[lastpost]);
echo("<li>");
if ($showforumtitle == "1") {
echo("<a href=\"$url/forumdisplay.php?forumid=$threads[forumid]\">$threads[ftitle]</a>: ");
}
echo("<a href=\"$url/showthread.php?threadid=$threads[threadid]&goto=newpost\" title=\"$threads[title]\">$title</a></li>\n");
// last poster column?
if ($lastposter == "1") {
echo("<li><a href=\"$url/member.php?action=getinfo&userid=$threads[userid]\">$threads[lastposter]</a></li>\n");
++$cols;
}
// replies column?
if ($replies == "1") {
echo("<li>$threads[replycount]</li>\n");
++$cols;
}
}
?>
When including the file, be sure to wrap the include in <ul>'s.
Gutspiller
10-13-2004, 09:44 PM
Maybe we can see an example of what your modifications do?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.