PDA

View Full Version : Last XX Posts on non-vB page


Pages : [1] 2 3

tubedogg
26 Mar 2001, 02:13
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.
https://www.vbulletin.org/forum/

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).
https://www.vbulletin.org/forum/

This image shows the same as #2, except $tw is blank (allowing the table to compact and remove the empty space automatically).
https://www.vbulletin.org/forum/

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.

26 Mar 2001, 02:23
nice, congrats

time to change your signature :)

26 Mar 2001, 02:24
Thanks :) I just did :D

26 Mar 2001, 16:34
Nice hack, but a question regarding the display.

It's designed to go in a pre-determined table rather than also allowing just the passing of a variable. I like it just the way it is with the exception of it being in a table rather than having it as an option or just passing the info.

For example, I would like to put just the "last posts" only inside a table on my home page that's designed for side display on the left. If you could just pass the code variable that would solve it and let the user determine what design/table size, colors, etc. to put it in.

Thanks, let us know about any updates.

Jeff

26 Mar 2001, 19:02
Tubedogg,

As usual, very nice hack. I have it up and running on my homepage now. I did find one small bug though. On line 26:

require("$path/config.php");

Causes a parse error. Reason being, you're already specifying $path in line 5 which is the URL to your config.php. What happens is that it reads $path/config.php/config.php

No big deal though. Works great and looks awesome!

26 Mar 2001, 20:56
If you include config.php in your path, that will occur. I should have made it clearer in the instructions not to include config.php in the path.

Glad you like it! :)

27 Mar 2001, 07:38
yeah put me down for one of them !!!

nice work will install tonite !

~veedee

27 Mar 2001, 08:11
Nice hack, congrats man!

One question, can you set up so it will display new threads from a specific forum only?
That would be a great feature!

27 Mar 2001, 10:16
Done, conan. See the first thread for a new version with that and a couple other new features! :)

27 Mar 2001, 16:06
Once again, nice job!

27 Mar 2001, 17:07
tubedogg:

Do you think that you could write this so that you could get the message that was posted included?

Parker

27 Mar 2001, 19:29
Whoa great man Thanks that's very useful!
Usually on your site you will have some chit-chat forums that you don't want to be displayed on the main page ;)
Thanks a lot it's just what I needed!

28 Mar 2001, 07:50
I have released a new version with Parker's suggestion and a couple other new features. It is version 0.1.0. Enjoy! :)

See the first post in this thread to download it.

28 Mar 2001, 08:02
Great display of info about the hack, tubedogg. File info, instructions, screen shots, a .txt file for easy cut/paste, etc. We should make this a template of what all hack release threads should look like.

28 Mar 2001, 08:05
aw shucks. :) Thanks!

29 Mar 2001, 08:50
tubedogg:

I LOVE this hack.

I added this to the last10.php file to parse the bbcode in the messages that are displayed.

First off I added:

require('./global.php');

then I changed

$lastpost2 = $lastpost1[pagetext];

to

$lastpost2 = bbcodeparse($lastpost1[pagetext]);

and

lastpostshort = $lastpost2;

to

$lastpostshort = bbcodeparse($lastpost2);


This enables the vBcode to parse and show up in the displayed message. HTML (if you allow it) comes through just fine.

Also, I found if you add the global.php require in the top10.php file you don't need to use the
require("$path/config.php"); line.

Thanks again for the great hack.

Parker

29 Mar 2001, 08:58
Originally posted by Parker Clack
I LOVE this hack.

Thanks! :)

Originally posted by Parker Clack
...then I changed $lastpost2 = $lastpost1[pagetext]; to $lastpost2 = bbcodeparse($lastpost1[pagetext]);

That's a good idea! However, I wouldn't parse it right there, because then you're parsing it twice if the post is less than $lplen characters. I would parse it within the if()...else() block, because then you are only parsing it once - change
if ($query0 != "" && strlen($lastpost2) > $lplen) {
$lastpostshort = substr($lastpost2,0,$lplen);
$lastpostshort .= "...";
} else {
$lastpostshort = $lastpost2;
}
to
if ($query0 != "" && strlen($lastpost2) > $lplen) {
$lastpostshort = substr($lastpost2,0,$lplen);
$lastpostshort .= "...";
$lastpostshort = bbcodeparse($lastpostshort);
} else {
$lastpostshort = bbcodeparse($lastpost2);
}
Originally posted by Parker Clack
Also, I found if you add the global.php require in the top10.php file you don't need to use the
require("$path/config.php"); line.

Correct, because global.php calls config.php.

Originally posted by Parker Clack
Thanks again for the great hack.

You're welcome! :) I'll add your bbcodeparsing idea to it and rerelease it pronto - as soon as I finish this other hack I'm working on...;)

29 Mar 2001, 09:23
Originally posted by Parker Clack
tubedogg:

I LOVE this hack.

I added this to the last10.php file to parse the bbcode in the messages that are displayed.

First off I added:

require('./global.php');

then I changed

$lastpost2 = $lastpost1[pagetext];

to

$lastpost2 = bbcodeparse($lastpost1[pagetext]);

and

lastpostshort = $lastpost2;

to

$lastpostshort = bbcodeparse($lastpost2);


This enables the vBcode to parse and show up in the displayed message. HTML (if you allow it) comes through just fine.

Also, I found if you add the global.php require in the top10.php file you don't need to use the
require("$path/config.php"); line.

Thanks again for the great hack.

Parker

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.

29 Mar 2001, 09:26
Ah. I did not know that. Scrap that plan. Sorry guys! :) I won't be adding that to it after all.

29 Mar 2001, 09:33
Hmm... So if they are new members that just signed up on the board or they are just visiting and they aren't registered members they will get this error if they click on the link to this page, or what?

Parker

29 Mar 2001, 09:40
Originally posted by Parker Clack
Hmm... So if they are new members that just signed up on the board or they are just visiting and they aren't registered members they will get this error if they click on the link to this page, or what?

Parker

When someone visits your forum (Registered members AND guests) they are assigned a cookie.

Without this cookie your addition to Tubes hack will not work.

So if you have his hack (with your addition) on your main page, and someone visits there who has never visited your forums they will get the error above. But his hack does work fine "without" your additions for new visitors.

This is a known problem, and has caused a lot of headaches in most of the "who's online on another page" hacks also. :(

29 Mar 2001, 09:42
tubedogg:

Since you are working on hacks how about looking over the memberlist.php file to see if you can add alpha listings instead of just by page number. That is if you click on the letter A you get those members will the last name stating with A and so forth. It can get really tedious when you have over 17,000 registered members to go through page after page by the number of the page.

Thanks again for the this hack.

Parker

29 Mar 2001, 09:47
Originally posted by Sportbikeworld


When someone visits your forum (Registered members AND guests) they are assigned a cookie.

Without this cookie your addition to Tubes hack will not work.

So if you have his hack (with your addition) on your main page, and someone visits there who has never visited your forums they will get the error above. But his hack does work fine "without" your additions for new visitors.

This is a known problem, and has caused a lot of headaches in most of the "who's online on another page" hacks also. :(

Thanks for the info. That is odd that it requires a cookie to work right.

I just found when using the option to display the message that gets posted and the person has used the vbcode in their message that it will display the code as well.

Oh, well. Thanks again for the heads up on this.

Parker

29 Mar 2001, 10:12
Robert and tubedogg:

I just logged off my board and then manually deleted the cookie I had for the forum from my hard drive and got back on the board. I was not cookied for the forum then and I clicked on the link to take me to the last10.php file. I did not get the cannot add header error message from the database with using the bbparsecode for the message. In fact the page came up just fine as before.

Have you tried this on your own board to see if you get the error message?

Just thought that I would let you know.

Parker

30 Mar 2001, 03:28
Originally posted by Parker Clack
Robert and tubedogg:

I just logged off my board and then manually deleted the cookie I had for the forum from my hard drive and got back on the board. I was not cookied for the forum then and I clicked on the link to take me to the last10.php file. I did not get the cannot add header error message from the database with using the bbparsecode for the message. In fact the page came up just fine as before.

Parker

You not only need to delete the cookie to see the error pop-up, but you also need to shut down your browser and restart it. At least that's how I got the error to pop-up with this and other hacks that require global.php

31 Mar 2001, 18:39
Can anyone help with a problem I'm having with this script? I keep getting "Can't select database" error every time. All of the variables are set correct, but I still get this. In the last10.php file I see the code:

"mysql_select_db($dbname) or die("Can't select database");"

This is where the error is at and the script dies there. I havn't changed anything else other than what it said to do. Why is it having troulbe at that line?

Thanks for any input.

Jeff

31 Mar 2001, 20:58
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!

01 Apr 2001, 07:34
Both test files now say they selected database ok when called from a browser. Now, how to fix in the other to call it ok instead of the error?

Jeff

01 Apr 2001, 16:57
congrats!!!
It's just maybe too big :/
I will modify that

01 Apr 2001, 22:55
Jeff: Hmm. I was expecting those two files to fail. What doesn't make sense is if they worked, why the other one wouldn't. Or, more succinctly, why the other one fails where it does. If it's having problems connecting, it should fail at the connect step, not at the select database step.

Here's what I suggest. Since the only thing I'm pulling from the vB files for this is username, password, db host, and database name, put these up at the top of the last10.php file as so:
Find
// let's get connected
require("last10config.php");
require("$path/config.php");
and replace it with
// let's get connected
require("last10config.php");
$servername = "localhost";
$dbusername = "dbusername";
$dbpassword = "dbpassword";
$dbname = "dbname";
and change the info to your details. That should work. If it still doesn't let me know and I'll look into it some more.

:scratching head:

02 Apr 2001, 04:31
Tubedogg:

After trying what you suggested, it works ok now after I put the code above in. Also, I had to change the include for my .shtml file from include "file" to include "virtual" as well. Doing all the above now produces the active table ok. I don't know what caused this, but we found the solution. :)

Jeff

02 Apr 2001, 08:05
That's very odd. Well, in any case, I'm glad it's working now. :D

02 Apr 2001, 08:58
Originally posted by tubedogg
Jeff: Hmm. I was expecting those two files to fail. What doesn't make sense is if they worked, why the other one wouldn't. Or, more succinctly, why the other one fails where it does. If it's having problems connecting, it should fail at the connect step, not at the select database step.

Here's what I suggest. Since the only thing I'm pulling from the vB files for this is username, password, db host, and database name, put these up at the top of the last10.php file as so:
Find
// let's get connected
require("last10config.php");
require("$path/config.php");
and replace it with
// let's get connected
require("last10config.php");
$servername = "localhost";
$dbusername = "dbusername";
$dbpassword = "dbpassword";
$dbname = "dbname";
and change the info to your details. That should work. If it still doesn't let me know and I'll look into it some more.

:scratching head:

Need to correct that on my hack?

02 Apr 2001, 09:38
Nope :) Just if it isn't working. His for whatever reason wasn't working, so I had him change that.

Yours is fine. ;)

02 Apr 2001, 11:11
Originally posted by tubedogg
Nope :) Just if it isn't working. His for whatever reason wasn't working, so I had him change that.

Yours is fine. ;)

Ok thx tubedogg :)

02 Apr 2001, 22:47
Robert and tubedogg:

I have deleted the cookie from my computer, closed down the browser and rebooted my computer so that all I get when I get on the board is the nonregwelcome message and I do not get the header error message when clicking on the link to take me to the last10.php file using the bbparsecode for the message.

Just so you know that on my board the script is working great with the bbparsecode being used with no error messages at all.

Parker

03 Apr 2001, 02:00
Originally posted by Parker Clack
Robert and tubedogg:

I have deleted the cookie from my computer, closed down the browser and rebooted my computer so that all I get when I get on the board is the nonregwelcome message and I do not get the header error message when clicking on the link to take me to the last10.php file using the bbparsecode for the message.

Just so you know that on my board the script is working great with the bbparsecode being used with no error messages at all.

Parker

Where is the page you have it on?

I'll visit and see if it gives me the error message.

03 Apr 2001, 02:20
jojo: No problem. :D

Parker: I don't have first-hand knowledge of the error Sportbikeworld is talking about. But if it truly does work, I'll look into it. :)

03 Apr 2001, 02:32
Robert:

Go to http://www.hometheaterforum.com/htforum/index.php

Click on the Today's Active Topics link under the threads in total count on the left hand side at the top.

This board is still in beta and I haven't moved any posts over from UBB yet so not much is going to be seen.

Let me know if you get the error or not.

Parker

03 Apr 2001, 02:56
Originally posted by Parker Clack
Robert:

Go to http://www.hometheaterforum.com/htforum/index.php

Click on the Today's Active Topics link under the threads in total count on the left hand side at the top.

This board is still in beta and I haven't moved any posts over from UBB yet so not much is going to be seen.

Let me know if you get the error or not.

Parker

Parker,

If I visit that way I will already have visited your forum. I need a direct link to the page that you have the hack on. There error will only show up if I have never visited your forums.

03 Apr 2001, 03:24
Ok,

Go to

http://www.hometheaterforum.com/htforum/active.php

Parker

03 Apr 2001, 03:26
Ok,

I see if you go to that page directly what you are talking about. I doubt that anyone would go to the page directly like this so.............

Again, thanks for the heads up.

Parker

Robert Basil
03 Apr 2001, 16:37
Originally posted by Parker Clack
Ok,

I see if you go to that page directly what you are talking about. I doubt that anyone would go to the page directly like this so.............

Again, thanks for the heads up.

Parker

So now you see why most of us can't use it because we place the code on our front page. :(

tubedogg
04 Apr 2001, 22:13
fahad,

You must use the exclude forums variable for any forums which you wish to exclude.

Find the ID number of the forum. (Go to your main forums page (index.php) and roll your mouse over the link of the forum you wish to exclude. In the status bar at the bottom, look for forumid= and then make a note of that number.) Then, edit the last10config.php file, and find where it says
$excludeforums = "";
In between the " and the other " put the number of the forum you wish to exclude.

fahad
05 Apr 2001, 05:15
thanks tubedogg

tubedogg
07 Apr 2001, 12:11
updated (see the first post in this thread).

see this post (http://www.vbulletin.com/forum/showthread.php?postid=88134#post88134) as to why i updated it.

Jonathan@Refresh
08 Apr 2001, 18:54
I'm getting the error:
Fatal error: Call to undefined function: bbcodeparse() in /home/sites/site5/web/vb2/last10/last10.php on line 134
any ideas?

tubedogg
09 Apr 2001, 06:21
That will happen if you used the code that Parker suggested without including global.php. Keep in mind that if you are putting this on your front page, your visitors will get an error if they haven't visited your forums yet; that's why the bbcodeparse is not part of the official release in the first post in this thread.

Jonathan@Refresh
09 Apr 2001, 06:27
Originally posted by tubedogg
That will happen if you used the code that Parker

I used the code in the zip file from the first post in this thread... is there some code somewhere that doesn't have the bbcodeparse in?

I thought I tried including global.php too, though, and that didn't work.

tubedogg
09 Apr 2001, 06:34
Sorry - you're right. I don't know how it got into the official release. I replaced the zip file - try downloading it again.:o

Jonathan@Refresh
09 Apr 2001, 06:49
Thanks Tubedogg :)

Snoozy
25 Apr 2001, 23:47
Ok I found some more bugs, you can't use body tag to define the background color of a table, just use bgcolor attribute in table tag, also, you can create a variable, that lets people modify this, so that when they allow cellspacing, they can choose the border color. Also, at the very end of the code, you frogot to close the table row.


// close it all up
echo("</tr></table>");
// bye!


that way it'll be more browser friendly.

tubedogg
26 Apr 2001, 02:21
The body tag is not a bug, it was accidentally left in after testing. The missing <tr> was just an oversight.

Snoozy
26 Apr 2001, 02:31
Just trying to make it perfect!

NN hates when HTML is screwed up, just making sure that it reders correctly.

julius
26 Apr 2001, 12:57
Originally posted by tubedogg
That will happen if you used the code that Parker suggested without including global.php. Keep in mind that if you are putting this on your front page, your visitors will get an error if they haven't visited your forums yet; that's why the bbcodeparse is not part of the official release in the first post in this thread.
If I enter myhost.com in this control panel optionCookie Domain
The domain on which you want the cookie to have effect. If you want this to affect all of yourhost.com rather than just forums.yourhost.com, enter yourhost.com here. Can be left blank.
the bbcodeparse could be included?

jojo85
26 Apr 2001, 12:59
i have got a problem:

http://www.agnfr.com/portail/

The script show the [QUOTE][i] :(

Is there a way to correct that?

VAN
26 Apr 2001, 15:42
Tubedogg.....if I wasn't a 100% heterosexual male, I'd seriously consider making love to you right now.

Great work bud!!!


I'm busy over here making some changes to it and I have a few questions for you...

1) How can I modify this sucker to also display the Forum Title along with the Thread Title?

2) How can I modify this sucker to disply the users chosen post icon alongside the Thread Title?

Thanks for the great work man!

tubedogg
26 Apr 2001, 17:37
Originally posted by julius
If I enter myhost.com in the control panel option the bbcodeparse could be included?

No, because the visitor must still have gone to the forums first. That just means that once they do go to the forums, do you want the cookie to be set for your whole domain or just the forums.

tubedogg
27 Apr 2001, 01:52
Originally posted by VAN
[quote]Tubedogg.....if I wasn't a 100% heterosexual male, I'd seriously consider making love to you right now.
....trying very hard to keep my comments PG-13....:D

1) How can I modify this sucker to also display the Forum Title along with the Thread Title?
Now a standard feature :)

How can I modify this sucker to disply the users chosen post icon alongside the Thread Title?
Now also a standard feature ;)

I thought you also echoed JoJo's comments about parsing vBcode, but anyway I added that too, at least a limited version of it. I'll figure out a better way to do it down the road.

eva2000
27 Apr 2001, 16:58
can this be included on a separate domain site on the same server ?

i want to include the threads using SSI from my forums on my site at eva2000.com

tubedogg
27 Apr 2001, 19:48
hmm...I don't see why not. It may take a bit of playing to get it right, but...

You could change
require("$path/config.php");
to
require("/full/path/to/eva2000/admin/config.php");
in last10.php, then put last10.php and last10config.php into a directory in the other domain's area.

It should work. (Should being the key word there ;))

VAN
27 Apr 2001, 21:55
The changes sound great, now how bout adding 'em to the zip? :) (its still version 0.1.0 in post #1)

tubedogg
27 Apr 2001, 22:05
No it's not...:confused:

:)

VAN
27 Apr 2001, 22:23
Odd. I must be having some funky caching probs in MSIE. I can't get the new file even after clearing the cache and restarting. I fired up NN and pulled down the current zip....thanks, tubedogg.

conan
28 Apr 2001, 00:52
Amazing job tubedogg!
The update is excellent, well done man!

claypots
28 Apr 2001, 00:52
tube this is a great hack! 5 stars!

One thing I caught though, when I tried to create the same format as your last two images/examples, everyhting went great, however when I enabled the smilies ($showicon=1), they would not show. Am I missing something?

VAN
28 Apr 2001, 01:10
Tubedogg, you rule!

I made a few formatting changes. Take a look.....
www.bsboard.com/recent.php


Also, another suggestion....

How about adding a field in the user options where they can choose how many recnt posts to dispaly? I have mine set to show 30, but some people may wanna see less, while others may wanna see more.


Thanks again for the awesome work. (they need this feature in the gold version)

tubedogg
28 Apr 2001, 03:21
Van: Looks good! :) As for your suggestion, I'm not sure. I might look into it, but I might also try a separate hack for use as you are using it. I have some ideas for that one from the UBB hack that I (and apparently you) used to use :) so we'll see what happens.

Claypots: Whoops! I screwed up. I'll post the new version (1.0.1) in the first post in this thread. I overlooked something. Duh! :rolleyes:

julius
28 Apr 2001, 10:52
Thanks Tube, I like it very much!
-----------
Posts show server time (ET), while my forum is GMT +1.

How can I show the same time of the forum?
-----------
If I set to show the message, at very beginning of the table I see:
0
10
0
30
0 (If I set 5 posts)

0
10
0
30
0
20 (If I set 6 posts)

7 times 0 (if I set 7 posts) etc.

"0" if there is not icon and the other numbers are the icons number.

what could it be?

tubedogg
29 Apr 2001, 01:08
The numbers are something that was accidentally left in after testing. Sorry...I have released v1.0.2 in the first post to correct this.

I will look into the times for the future. However, you do know that any unregistered/logged-out visitors see the time on your board as GMT, right? I believe that's the closest I can get without going into member cookies, which is something I don't want to do with this script.

julius
29 Apr 2001, 10:30
Thx Tubedogg, it's perfect now. :)

For all (registered, guests and unlogged) it would be fine just something like server time +- n hours (or GMT +- n hours), without using cookies.

If in this way there are some problem with showing the correct date, it could be let it off.

eiko
29 Apr 2001, 13:36
Works great (except): When I put a forum number(s) in either (only 1 of the two) include or exclude forums, "can't select info" .

If I leave these blank, display's with no problem. Help!

Excellent hack.

tubedogg
29 Apr 2001, 22:48
Odd...I can't reproduce that problem. Make sure you are only putting numbers and commas into those two variables, and separating the numbers with commas. So it might look like:
$includeforums = "3,4,5,6";

eiko
29 Apr 2001, 23:25
That's exactly how I did it.
Would it be a good idea (or possible) to have the script automatically exclude private forums?

wajones
05 May 2001, 00:25
Nice hack tubedogg, it fit right in with what I was needing. Here is how I used it. (http://www.phpportals.com/vbportal/thelatest.php)

tubedogg
05 May 2001, 00:47
looks good, wajones! :)

wajones
07 May 2001, 02:05
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,$dbpassword) 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.

tubedogg
07 May 2001, 02:57
very cool idea. thanks, wajones! :)

Essam
07 May 2001, 06:24
tubedogg

any plans to add javascript, so that last posts can be shown in remote sites without actually accessing mysql.? I think it will be very useful for many ppl.

wajones
09 May 2001, 15:17
Originally posted by tubedogg
very cool idea. thanks, wajones! :)

I like this better...
Create another copy of the last10.php named thelatest.php so you can set different param's.
Create a new forum and name it 'The latest posts" or what ever set it to "act as forum = no and open for posts = no" now put this into the phpinclude in place of what I told you before... $forumid being that forum you created

ob_start();
if ($forumid==34){
include_once("./thelatest.php");
$thisweek= ob_get_contents();
}else{
include_once("./last10.php");
$last10 = ob_get_contents();
}
ob_end_clean();


Now in the forumdisplay template find...

$forumdisplay[forumslist]

then right above it put $thisweek

Now the last10 or $thisweek in this case will show as a forum and be in the jumpforum box for quick access :D

Let me know if you see any conflicts....

Snoozy
10 May 2001, 21:36
I am having a problem with the topic icons. The hack is posting the wrong ones!

I don't know how to explain it, check out:

http://www.juniorsailing.com/

I have the hack on the very bottom of the page. Look at the icons, then click on the forum name and look in the thread list...the icon is different?!?!

Byron
13 May 2001, 08:48
How do we show the topic starter for each thread?

Byron
13 May 2001, 09:15
I think it's better to remove the "&goto=newpost" part for the thread url. Think it's better for the reader to start from the first post.

julius
13 May 2001, 10:15
If it's the first time you connect, you go to the first post anyway (last post for you is the first post of the thread).

bbqfan
14 May 2001, 04:50
i have a question. When $showforumtitle = "1" in the last10config.php, and at the same time $includeforums = "3,4", it displays "can't select info".

If I leave $showforumtitle = "0" or $excludeforums and $includeforums blank, everything ok. Any idea?

Another request: if i want to display the threads starter, threads start time (can be ordered by this?) and the massege of the threads' first post, would you plaese add these variables into your hack?

Thanks again for the great hack.

tubedogg
14 May 2001, 05:08
bbqfan: Do me a favor and download the zip file from the first post again. I have added mysql_error() so it will give the exact error. Run that and then let me know what exactly the error is. ("Can't select info" is a generic error I put in there when I first wrote it and never changed it.)

I'll look into those requests.

tubedogg
14 May 2001, 05:10
Originally posted by Snoozy
I have the hack on the very bottom of the page. Look at the icons, then click on the forum name and look in the thread list...the icon is different?!?!

It appears to be displaying the icon minus one. So for example, if the icon's file name is icon18.gif, it is showing icon17.gif. I don't know why this is and I'm looking into it.

Edit: I just realized what the problem is and I'll post a fix in a minute.

tubedogg
14 May 2001, 05:14
Here's a fix for the problem in the previous post.

In last10.php, find
if ($postii != "0" && $postii != "") {
and right below it, add
$postii = $postii+1;
Then find
if (($postii == "0" || $postii == "") && $threads[iconid] != "0" && $threads[iconid] != "") {
and right below it, add
$threads[iconid] = $threads[iconid]+1;

Or you can just download the updated zip file in the first post in this thread, and reupload last10.php (no need to reupload last10config.php).

bbqfan
14 May 2001, 05:19
tubedogg,

this time it display:

MySQL reported this error while trying to retreive the info: Column: 'forumid' in where clause is ambiguous

tubedogg
14 May 2001, 05:42
That I can fix very easily. :) I'll post the fix in a couple minutes.

bbqfan
14 May 2001, 06:24
:(

tubedogg,

i have download your latest version release, but it still display:
"MySQL reported this error while trying to retreive the info: Column: 'forumid' in where clause is ambiguous"

and i didn't see any icons bug with the older version, but after i update to the lastest it display the wrong icons.

thank you again.

tubedogg
14 May 2001, 06:43
Sorry about the forumid thing. I missed one other place where it was. :o

The icon thing I took out since only one person had that problem and I'll look into why it's doing that again.

bbqfan
14 May 2001, 09:30
wow! it works now! thank tubedogg!

and how about my 2nd question:

"display the threads starter, threads start time (can be ordered by this?) and the massege of the threads' first post..."

is it possible?

thanks!

Snoozy
14 May 2001, 16:54
thanks, it works proplerly now. I have a suggestion:

In the main file, I made this change:



echo("<table border=0 bgcolor=$tbg cellpadding=4 cellspacing=$cs $twt><tr bgcolor=\"$hc\">\n");



and then in the config file, I added this variable:



$bc1 = "#ABABAB"; // first alt color
$bc2 = "#BCBCBC"; // second alt color
$hc = "#7C869C"; // head background color
$tbg = "#000000"; //table background color
$lc = "#ff6600"; // link color
$tc = "#FFFFFF"; // text color
$f = "Arial"; // font face



That lets people change the color of the little lines that are drawn between the cells of the table. This will only go into effect if they have the cellpadding set to 1 or more.

Just a little HTML trick you guys might want to try.

Oystein
15 May 2001, 14:01
I'm having problems when I tried to put a forumid into the $includeforums = "";

when putting in 7 (which is the ID of the wanted forum, it returns:

Can't select info

on top of table, and no content in table...

any suggestions?

tubedogg
15 May 2001, 16:09
Oystein: Please try downloading the newest version from the first post in this thread and tell me if you still have problems, and if so, what the error message is (it will give you a different message with the newest version if there is an error).

Oystein
15 May 2001, 16:10
I did, and then it worked :-)

tnx

amykhar
15 May 2001, 17:07
Bless you dear man :)

I finally got what I wanted, a hint of the content of my private board on the main page.

I used your script twice. Once to show the news and announcements forum, and once to show the most recent posts in the other forums.

I also installed your who's online hack.

http://www.epinionaddicts.com/

Finally, guests can peek at what we offer. Thank you agian. It was idiot proof.

Amy

tubedogg
15 May 2001, 17:33
You're most welcome. :)

Oystein
16 May 2001, 08:30
Since you reply so quick.. one more question:

I tried to make a summary-page where I include your script for separate forums, like setting up one table for each forum.

On top, I included the last10.php with results from all threads

then a table with last10.php placed in a subfolder of the one above, and so on for 3 more includes.

(I hope you understand what I mean)

and now the bug question:
I get the same config for all includes (the first include goes for all) instead of separate config for the separate includes.

So instead of getting listed all forums in separate tables, I get lots of tables with the same content in every one.

Strange?

tubedogg
16 May 2001, 10:26
Try renaming each of the config files to something different, such as last10config1.php, last10config2.php, etc. Then, change the name of each of the last10 files to something unique, such as last101.php, last102.php, etc. Then in the last10 files, find
require("last10config.php");
and change it to the unique name for each file. So in the last101.php file, you'd change it to
require("last10config1.php");
etc.

bbqfan
16 May 2001, 22:09
Hi tubedogg,

your hack works great for me, thx...

and i have added these:

so it will display the full vb code...:):)



ok i give up...:mad: :mad: :mad: plx see the attached file...you can find it in the next post...

Snoozy
16 May 2001, 22:12
that didn't come out very well, please try again.. I'd like to do what you did, but I can't follow it!

bbqfan
16 May 2001, 22:20
vbcode in this hack...

jarvis
19 May 2001, 22:46
I am not by any means an HTML guru, but I do have the last 10 wittled down to the size I want at www.mhogaming.com/vb/recent/last10.php so that it will fit in the left hand column at www.mhogaming.com, problem is, I cannot discern from the directions how to include this file into a regular index.htm. I've looked at some of the example sites, but I actually see html table code. Are we supposed to code the table manually?

Gawd, am I confused... (okay, I hear the snickering now) :p

RobAC
20 May 2001, 01:36
You need to use an SSI or "server side include". The code would look like this:

<!--#include virtual="/forums/online.php"-->

Substitute what's in the paretheses for the path to the file and the name of the file you're trying to "include" in the html document. Also, make sure that your hosting provider allows the use of server side includes. Some will and some won't. Some will allow you to embed the include right into the html document. Others will make you change the file designation from html to shtml. Good luck!

jarvis
20 May 2001, 01:48
<!--#include virtual="/forums/online.php"-->

That is the exact code including <!-- , --> ?

I host my web pages via IIS, but I do not see anyway to allow SSI. I'm guessing then I might just be out o' luck?

Didn't think I was this lost... :o

RobAC
20 May 2001, 01:51
yes, that is the exact code including the <! > I don't know anything about your hosting provider. Try embedding an include and see what happens or just contact them and ask.

jarvis
20 May 2001, 04:26
Whoa... I did an include statement as suggested and this is what I get

www.mhogaming.com/test.shtm

Looks like it's including the file, but then not parsing the PHP code once it does?

I am running IIS 5.0 and see where the shtm extension invokes the ssiinc.dll, but then the included file "last10.php" seems to confuse it.

Anyone running this combo?

tubedogg
20 May 2001, 10:28
If it's not a huge deal to you what your main page is named, I would rename it index.php. That way you can do a PHP include and it'll work all nice. :)

PHP include example:
<?php include("/vb/recent/last10.php"); ?>

jarvis
20 May 2001, 18:38
Nothing like showing my lack of technical abilities in a public venue...

PHP include example:

PHP:--------------------------------------------------------------------------------
<?php include("/vb/recent/last10.php"); ?>



So are you telling me that instead of my main page being index.htm or index.shtm, I should have it be index.php, which I would assume invokes the php filter. Question here is, how is the rest of the HTML handled on the page? Is it left alone by the PHP filter, and how would FrontPage handle this?

Yes, I am using FP.... :(

Thanks for everyone's help...

RobAC
20 May 2001, 18:50
I would be careful doing this. If you have registered your site with a lot of search engines and you have users that have bookmarked the index page of your site, as soon as you change the file extension to .php, you just broke all the links at all the search engines as well as any users that have bookmarked your site. If you're not registered with that many search engines, then I would be too concerned about it. Keep this in mind.

jarvis
20 May 2001, 19:06
Yeah, I was thinking about that, too...

There has got to be a reason why my normal include statement is not working right.

So everyone that has this hack working, I'm assuming their running it on some Unix-based web server, or they are just including from a PHP-parsed page?

Seems like I'm just overlooking something little here, but maybe it's not meant to be for me on my main page, lol.

Tubedogg (or anyone for that matter), have you tried the include statement on a non PHP-parsed page (shtm, etc) and if so, what web server was the provider running?

Good thing I don't smoke, this would have thrown me over the two pack a day threshold. :confused:

RobAC
20 May 2001, 19:11
This may not make a difference, but try renaming the file to .shtml instead of .shtm

Did you try embedding the include in a regular .html document?

If you have AOL Instant Messenger, log on. My screen name is CorvetteAC and I'll try and help you through it. It's a little easier than going back and forth on here.

jarvis
20 May 2001, 19:54
Thanks again RobAC for your help...

Okay we figured it is boiling down to a server config issue. I host my own pages on IIS5 and PHP 4.0.4 running as an ISAPI filter on the site. My shtm docs invoke the ssiinc.dll properly, but then as you see from the link above, my test.shtm throws out a bunch of unparsed PHP code. Short of changing my default doc to a PHP doc, or not running this hack, I wanted to see if there were any IIS gurus out there.

Thanks again! (I seem to be the Win32 guinea pig around here for some reason :) )

tubedogg
20 May 2001, 22:09
Originally posted by RobAC
I would be careful doing this. If you have registered your site with a lot of search engines and you have users that have bookmarked the index page of your site, as soon as you change the file extension to .php, you just broke all the links at all the search engines as well as any users that have bookmarked your site.

He also did that by changing it to .shtm.

Here's what I would do. Rename it to index.php, and then make index.html a page with a meta refresh tag saying "please wait" and then it auto-refreshes (with a link for those whose browsers' suck). That way the page still works, and you can still use a php page.

Also, I would imagine most of your visitors typed in (and bookmarked) mysite.com and not mysite.com/index.html. Just a thought. ;)

RobAC
20 May 2001, 22:14
Kevin,

That's a great idea. It would be a great fix until he can figure out the root cause of why it won't parse the PHP code when the extension is changed.

jarvis
20 May 2001, 23:06
Well, I've employed the help of some of my more technical buddies, but I think that the way I'm doing the web layout, I'm out of luck with this hack.

Reason being, I'd hate to redo all the FrontPage hooks just to rename the page php. Until I can figure out why the PHP wont parse in the include statement, I'll have to do without this cool hack.

Thanks for your help Rob and Kevin!

c-pr0mpt
22 May 2001, 06:42
In last10.php.

Where can I edit out so that the header does not show?
http://www.df-nation.com/solidline/see.jpg

I tried a few things and keep getting parse errors.
Thanks in advance, and very nice work.

c-pr0mpt
22 May 2001, 06:53
Nevermind. I figured it out. lol I have to stop doing this, and wait a little longer cause it always ends up being done by me anyways.

c-pr0mpt
22 May 2001, 07:11
Whoops

surfdude
04 Jun 2001, 22:10
Thank you for your code, as i used it on my front page, Surf Newquay (http://www.surfnewquay.co.uk) to generate (at the moment) last five forum submissions. It was ever so easy to implement, it worked the first time.

As great as it is, I wondered if it is possible (i know it is somehow) to display poll options on the front page of any web site so anyone can cast a vote there and than see the results in the forum page where thay could leave their comments? This would be a great feature for any webmaster. Any thoughts?

sifuhall
05 Jun 2001, 14:42
I have an interesting problem, but only with Netscape.

Take a look at the pic and notice how the text overlaps.

Does not happen with IE.

Here is a link to the test page:
http://www.dragonslist.com/test.php

sifuhall
06 Jun 2001, 08:23
I have verified this problem on serveral machines using Netscape 4.7.

Anyone have any ideas?

sifuhall
06 Jun 2001, 08:45
found it.

I removed the <nobr></nobr> tags and the text doesn't overlap.

Ed FvC
10 Jun 2001, 06:26
This works beautifully! Thanks so much for an awesome hack. :D

See it in action --> FordvsChevy.com (http://www.fordvschevy.com)

Shimms
11 Jun 2001, 03:57
First of all, just like to thank you for the script, its exactly what I was looking for.

Secondly, it seems to be generating some weird characters before the table.

To see what I mean head over to http://www.tae-mod.com its on the right hand side, below the quick contact table.

I have looked through the code, and can't see anything that should be generating these characters.

Any ideas?

Thanks

Shimms
11 Jun 2001, 03:58
The URL I posted above was incorrect... sorry, this is where it is running:

http://www.tae-mod.com/site_new/index.php

Thanks,

tubedogg
11 Jun 2001, 06:26
At the second URL you gave I see "Active Topics" under the contact links and I see the include line in the source of the page, but it does not appear to be parsing at all (e.g. it didn't show up on the page).

Try changing
<? include("http://www.tae-mod.com/forum/last10.php"); ?>
to
<?php include("http://www.tae-mod.com/forum/last10.php"); ?>
and see if that helps.

Shimms
11 Jun 2001, 06:38
Now this really is weird...

Your right it wasn't parsing it, as i didn't have <?php. When i posted this message I did have it like that, but since then we re-did the index page and I obviously screwed that bit up.

Anywy, now thats its back to <?php it should be working, the weird looking characters are gone, but now its not displaying the forum list as it should be.

THis was working a while ago... grr.

Ed FvC
11 Jun 2001, 09:47
Is there a way to remove the first 0 from the time? Right now, it's showing 05:45am and it'd look nicer without the 0. How can I change it?

Thanks!

FindSP.com
12 Jun 2001, 06:00
I have a problem

The page where I want to display the last active threads in on 1 server with a certain domain:

http://www.findsp.com

which is ASP based (windows 2000).

The forum itself is:

http://130.94.137.116

So how do I do the include?

Please note that the page where I want to include the last active threads is .ASP and is on server findsp.com


Thanks

Looking forward hearing from you.

Abbas Jaffarali
12 Jun 2001, 06:19
Hey tubedogg,

Is it possible to modify the display of this hack so that it looks like the "Latest Headlines" column on the left hand side of http://www.dw3d.com website?

I believe this site is using UBB with a hack. I really like how the text is wrapped into two or three lines if need be, and every headline is seperated by a, well, seperator

:)

Thanks

Oystein
14 Jun 2001, 09:05
It seems that the script doesn't work on post made by unregistered users... At least my 3 post when I was not logged in doesn't show, but when I log in and reply to one of them, they are ok....

I'd appreciate if this could be confirmed and mayby changed :-)

Abbas Jaffarali
16 Jun 2001, 19:13
I couldn't get this to work on an NT server.
Anybodu tried this successfully with WinNT?

Thanks

jarvis
16 Jun 2001, 19:26
I couldn't get this to work on an NT server.

Well, I guess I need to understand your question a little more. Are you saying you can't get this to work at all under NT, because this is just a standard vB (PHP-based) hack, and if you have your board running alright, you should be able to run this no problem.

Now if you are talking about trying to include this hack in a IIS-based page, you will have problems. IIS apparently doesnt handle multilevel translations well.

Your include statement will work, however IIS will not parse the PHP code, because it is looking for standard txt or html files. A microsoft limitation, no doubt.

I, too, was disappointed that I could not get this running on my IIS server, but to see how I worked around it, check out www.mhogaming.com and hold over the forums menu.

Not exactly what I wanted, but an easy way to view the last xx posts.

-Jarv

Abbas Jaffarali
16 Jun 2001, 19:49
Thanks Jarvis, I guess that's why it's messing up. I can load the PHP file directly without any problems as well but I would've loved to use this hack as the news headliner on my homepage and have it linked directly to a particular forum's list of topics.

Mr. tubedogg, would you be kind enough to release a javascript version of this hack or something that would make it run in Windows NT/2000 based server?

Thanks
Abbas

eva2000
18 Jun 2001, 12:11
hey kevin instaled your latest release of this hack but have a question similar to this one at http://vbulletin.com/forum/showthread.php?s=&threadid=20407

i included the last 10 - 15 active threads on these 2 sites

http://bubblegumcrisis2040.com/forum/
http://www.eva2000.com/forum/

as well as the online user list in the above thread.

But when you close the forum from admin control panel it will all chuck a fit and come up scrambled.

Is there some extra code i can add to the end of the scripts which can output a simple

"Forum database is down for maintenance, be back soon..."

TigerLily
18 Jun 2001, 17:58
Thanks tubedogg for this great hack! I haven't had any trouble installing it, but I do have a question. How do I include my headers and footers so the page looks like my forum pages? I would love to make it look like it's a seamless part of them.

Thanks!
TigerLily:)

Update: I worked my way around it by using an shtml page instead, but was wondering if there was a simpler way to include the default forum headers and footers.

Oystein
20 Jun 2001, 11:06
Still no reply to my question...

How can it be changed so posts made by unregistered users also are shown on the overview?

SeanD
21 Jun 2001, 00:22
This is just the hack i was looking for AND more. I read earlier about sombody wanting to get this hack to work on a differnt domain but on the same server, well I just got this puppy to work on an entirly DIFFERNT server than our MySQL db is on!

Our frontpage and our BBS are hosted on two differnt servers so I needed to find a way to do this. After having no prior experience with MySQL/PHP it took me awhile to learn how to give our frontpage server permisson to access the vBulletin db on the BBS server, but after about 30 mins of scanning the docs online I was able to do it and it works like a charm. All I had to do was add a new GRANT command and make a copy of the config.php file and toss it on the frontpage server, edit that to point to our BBS server instead of 'localhost', and that was that.

So again, wonderfull Job tubedogg. I just saw your who's online hack which im about to try out as well, im sure ill get the same success. Thanks again.

heynurse
22 Jun 2001, 07:17
I'm kinda new at this stuff, so take it easy on me ;)

using: Version 2.0.1

Here is the error I am getting when calling via ssi on an html page
SSI call: <!--#include file="last10.php" -->

Fatal error: Failed opening required 'last10config.php' (include_path='/usr/share/php') in /home/httpd/allnurses.com/htmldocs/last10.php on line 12


any ideas? Thanks

tubedogg
22 Jun 2001, 07:35
Did you upload last10config.php to the same directory as last10.php?

eva2000
22 Jun 2001, 07:42
kevin any help/ideas on this post in this thread http://vbulletin.com/forum/showthread.php?s=&postid=128172#post128172 ?

heynurse
22 Jun 2001, 07:48
Yes, both files are in the same dir.

Originally posted by tubedogg
Did you upload last10config.php to the same directory as last10.php?

tubedogg
22 Jun 2001, 07:56
Eva: Sorry I missed that the first time around. In last10.php add
$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; }
Put that right after
mysql_select_db($dbname) or die("Can't select database");

heynurse: um...you aren't by any chance on a Windows server are you?

heynurse
22 Jun 2001, 08:01
No, I am on a linux server. Thanks for your prompt responses ;)

Originally posted by tubedogg
heynurse: um...you aren't by any chance on a Windows server are you? [/B]

tubedogg
22 Jun 2001, 08:26
:( I don't know what to tell you. It should be requiring the file just fine...Well try one thing. Change
require("last10config.php");
require("$path/config.php");
to this:
include("last10config.php");
include("$path/config.php");
and see if that helps.

xdam
22 Jun 2001, 09:00
i can't set the maximum amount of characters to more than 120, as soon as i take it over i just get a blank page.

heynurse
22 Jun 2001, 09:10
kevin,

That didnt work either? I called my hosting tech support. They figured it out. They told me they modified the php.ini in the /etc dir and they needed to ad the include path or something like that. Whatever they did they got it working....Yippie!!!

Anyway, this is a great hack! I really appreciate your assistance Kevin! Thanks again!

eva2000
22 Jun 2001, 09:28
Originally posted by tubedogg
Eva: Sorry I missed that the first time around. In last10.php add
$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; }
Put that right after
mysql_select_db($dbname) or die("Can't select database");

heynurse: um...you aren't by any chance on a Windows server are you? thanks kevin that worked, can i borrow you over in this thread too http://vbulletin.com/forum/showthread.php?s=&threadid=20407 :) i tried doing the same in that online.php code but it didn't work :(

tubedogg
22 Jun 2001, 10:19
eva, heynurse: glad you both got them working. :)

xdam: There's no reason it should be doing that. Is everything else about it working?

xdam
22 Jun 2001, 10:25
Yea, everything else works perfect, i have edited alot though maybe i screwed the code somewhere? Have you tried to take the max characters over 120 in your script?

* now sorted, the problem was i removed the <nobr> tags *

tubedogg
22 Jun 2001, 10:43
I just tried it out with max chars set to 300 and it worked fine...

xdam
22 Jun 2001, 10:50
ok thanks for testing, another thing you code help me off if your willing to is that i want to display the posts as news, i've kinda converted this script into a news script, take a look at:

http://digital-forums.com/clan/clan.php

I have displayed it as news, now my problem is that whenever someone replies the 'news article' jumps to the top and there replie appears is there anyway i can make it so the script only see's new topics?


excellent script btw, just what the doctor prescribed :)

tubedogg
22 Jun 2001, 10:56
You mean so it only shows threads with no replies? Sure - just change this$query = "SELECT thread.lastpost,thread.title,thread.lastposter,thread.replycount,thread.views,us er.userid,thread.threadid,thread.forumid$fsel,thread.iconid FROM thread,user$ftitle $wheresql ORDER BY thread.$ob $obdir LIMIT $maxthreads";to this$query = "SELECT thread.lastpost,thread.title,thread.lastposter,thread.replycount,thread.views,us er.userid,thread.threadid,thread.forumid$fsel,thread.iconid FROM thread,user$ftitle $wheresql AND thread.replycount=0 ORDER BY thread.$ob $obdir LIMIT $maxthreads";

xdam
22 Jun 2001, 11:04
http://digital-forums.com/clan/clan.php

didn't work

xdam
22 Jun 2001, 11:22
it's gone abit weird now a news article was posted and its gone into 7 articles (and this is without your code change)

jdebler
24 Jun 2001, 01:23
First of all, I just want to say thanks to tubedogg for this great hack. I am very new to most of this, but I am starting to learn a lot. Thanks! :D

Now for my error...

I downloaded file last10-102.zip today and started playing with it.

Everything works great, but if I leave the $tw variable blank ("") the font style and size in the resulting table is exactly what I have specified in the $f and $fs variable. If I change the $tw variable to either a pixel number or a percentage, the font in the resulting table is the default font style and size of my browser and doesn't hold the $f and $fs variable information at all. Everything else (colors, etc.) is just fine. This happens when implementing this hack using an PHP-parsed page and server-parsed page.

[EDIT-I just noticed that this only happens when using Netscape 4.77. When viewed in IE it looks fine.]

Any clues? If this is just a strange way that Netscape shows the file, should I just override the $f and $fs variable in the last10.php file? If so, what code do I change? :confused:

I scanned through this entire thread looking for an answer to this problem, but didn't find an answer but it is a pretty big thread so please forgive me if the answer is indeed in here somewhere and I missed it.

Thanks in advance!!

Jason

Grover
24 Jun 2001, 15:22
Tubedogg,

(I won't start by saying: 'thanks for this great hack'..... ;)

Just to let you know that I discovered a little 'issue' in the output of the text in the tables.
The following thing happens:

- If a user uses the character ["] in the subjectline, for example :

Tips van beginnende "gebruikers", (it's Dutch btw) then the output in the last_post hack is:

Tips van beginnende &quo...


Well...a picture says more than......:

http://www.haarweb.nl/Documenten/last_post.gif


I hope that this remark will be helpfull to you, to improve this hack more and more.

(So I will END by saying: 'thanks for this great hack'..... ;)

Grover.

TigerLily
24 Jun 2001, 20:00
Jason- I'm having that problem too, and only in Netscape. The pages look GREAT in IE 5, but downright frightening in Netscape. I even upgraded my Netscape browser (I never use it, hate that program!) to see if that would fix it, but it didn't. The tables look all strange and don't go all the way across, plus the fonts are messed up. They will look fine in one post and messed up on the next. Really weird! I wonder if Netscape doesn't like the style settings in the table tags? Not sure!
TigerLily:)

jdebler
25 Jun 2001, 00:27
Originally posted by TigerLily
Really weird! I wonder if Netscape doesn't like the style settings in the table tags? Not sure!
TigerLily:)

Well, Netscape likes the style settings until you specify a width of the table. This is what is confusing to me.:confused:

Also, I notice that when I load the page in either Netscape or IE, it takes about 10 seconds to load the table with the information, but loading just the forum itself is lightning quick. Does it have to first parse it in the forum, and then does the hack have to parse it again?

I am not criticizing the hack in any way because I think it is very cool, but like I said earlier, I am just learning this stuff and would like to know why things work the way they do. Troubleshooting is one of the best ways to learn something, I think. :)

Jason

dost
25 Jun 2001, 22:31
xdam: Using this hack as a news script! Great idea, thanks man, I'll do the same thing.

tubedogg: As I told before, I'll use this wonderful hack as a news script. I don't know anything about php so I'll beg for a few customizations:
1)*Please answer this one, it's the most important one* How can I sort order of the list by "date posted" ?
2) This is not so important but I'll appreciate if you can answer. How can I display different messages by the number of replies? Like "Go Reply" if there are no replies, "1 Reply" if there is 1, "X Replies" if there are more ... I think you get the idea.
3) This is also not important. Don't answer if you don't have time. Is there any way to display the date once for the threads that are opened at the same day? Like:
26 June 2001
Thread 1
Thread 2
27 June 2001
Thread 1 ...

Thanks for the great hack!

jarvis
26 Jun 2001, 15:27
Great hack... Finally got it working on my IIS homepage at www.mhogaming.com . Darn all you Unix guys. ;)

Thanks for the awesome hack!!

Oystein
28 Jun 2001, 10:52
tubedog:

the hack is nice... but as I've said some times now, it doesn't display posts made by unregistered users. The thread doesn't become visible in the hack until a registered user replies.

Any fix for this, and I'd be greatful!

gmyachtsman
29 Jun 2001, 14:44
I am having problems getting the last 10 to show up on my web page from my include file into the first page of my website harborsailing.com . I am hosted on an apache server at hostrocket.

I tried to include the last20.php file in a .shtml file, .shm file, and a .php file, all without complete success.


.htaccess

I was concerned that part of my problems could be due to .htaccess: I saw on a thread elsewhere that I could edit the .htaccess file to include the following:

AddType text/html .shtml .shtm .html .htm
AddHandler server-parsed .html .shtml .shtm .htm

and that maybe that would work for adding .php too.

See: http://forums.hostrocket.com/showthread.php?s=&threadid=555&highlight=htaccess

My past experience with .htaccess indicated to me that as soon as it is loaded onto the website by ftp, it disappears. But I was able to set my Leap ftp going to options-->preferences-->view to show hidden files.

I created a .htaccess file with the prescription above and put it in my public_html folder (there had been none there).



What I tried:

1. In .shmtl type files

When I used

<!--#include file="last10/last10.php"-->

or

<!--#include virtual="last10/last10.php"-->

(with or without a first "/") and
placed them in files with a .shtml ending I got unparsed included files showing up as raw php code.

With .stm I got a directory index and when I clicked on the index file, I got the same as above.

Incidentally, this is the same thing I get when I try to access to included page directly:

http://www.harborsailing.com/last10/last10.php


2. In .php type files

Then I tried changing my own main index file name to end in .php (the include was on the first page). And I tried this code:

<?php include("last10/last10.php"); ?>

But when I did that nothing showed up for the include (with or without a first "/").

I also tried including the full http:// address with the same result of not showing up.

I tried putting the include in the header, in the body, and after the body. Did I need to call it? If so, maybe that is why I saw nothing.

gmyachtsman
29 Jun 2001, 22:50
OK -- I've figured out why I was getting the raw code showing up on my .shtml pages. It was the .htaccess file. The clue was that the Vbulletin forum wasn't being parsed either:

After I had named my index file index.php, I noticed that the .htaccss file in my public_html folder was preventing my VBulletin board from being evaluated. Instead all you saw on the forums page was a jumble of writing in the browser.

Deleting the .htaccess file solved that. Remembering that I had seen the same thing at the bottom of my .shtml page, I converted back to using that page (without the .htaccess fiel this time.)

The result was that the file was properly included in my browser with the <!--#include virtual="last10/last10.php"--> line as previously used above.

Now why were people saying to use the .htaccess file again?

One other change I had to make was because I was getting an error from the parsing of the included php file where it needed to access the config file.

I had to change the path to "../discussion/admin" since I had to go up one step from my last10 folder before going down.

Now it is all working fine. And it also works if I switch the index file to a .php ending. What a problem this .htaccess stuff caused me and somehow it seems that I did it all to myself!!!

Thanks for the cool hack!!

tubedogg
30 Jun 2001, 04:59
Originally posted by DoST
1)*Please answer this one, it's the most important one* How can I sort order of the list by "date posted" ?Not sure what you mean by date posted. If you mean the date the thread was started, then you would use
thread.dateline
for the $ob variable. Otherwise I'll need a bit more explanation. :)
2) This is not so important but I'll appreciate if you can answer. How can I display different messages by the number of replies? Like "Go Reply" if there are no replies, "1 Reply" if there is 1, "X Replies" if there are more ... I think you get the idea.Findwhile ($threads = mysql_fetch_array($tr)) {
// are we going to show the message too?
and replace it withwhile ($threads = mysql_fetch_array($tr)) {
if ($threads[replycount] == 0) {
$replyword = "Go Reply";
} elseif ($threads[replycount] == 1) {
$replyword = "One Reply";
} elseif ($threads[replycount] > 1) {
$replyword = $threads[replycount]." Replies";
}
// are we going to show the message too?

NORRITT
01 Jul 2001, 21:39
Hi,

is it possible to set the subboards you want to show in this hack?

tubedogg
02 Jul 2001, 05:59
Originally posted by tubedogg
$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.

P45
02 Jul 2001, 08:09
http://www.p45rant.com is where i;m using this to pull threads from our forums.... version 2.01 vbb....

interesting glitch... it shows everu thread twice except when i havbe made the final post on a thread when it shows it once....

ever seen this before?

NORRITT
02 Jul 2001, 09:22
thanks tubedogg
:)

dost
03 Jul 2001, 11:56
Thanks for the help tubedogg! I appreciate it.

One last thing: Is there a way to save the output of the script to a .txt file everytime it's executed?

Thanks

Oystein
03 Jul 2001, 15:07
Originally posted by Oystein
tubedog:

the hack is nice... but as I've said some times now, it doesn't display posts made by unregistered users. The thread doesn't become visible in the hack until a registered user replies.

Any fix for this, and I'd be greatful!


Why can't I get an answer to this?
It's quite irritating to see replies to all other questions except mine... :-(

Alien
03 Jul 2001, 16:59
Originally posted by P45
http://www.p45rant.com is where i;m using this to pull threads from our forums.... version 2.01 vbb....

interesting glitch... it shows everu thread twice except when i havbe made the final post on a thread when it shows it once....

ever seen this before?

Yeah, I get this glitch too on a client's site.

Hmm... I'd like to get that looked at! :)

tubedogg
03 Jul 2001, 22:54
Originally posted by Oystein
tubedog:

the hack is nice... but as I've said some times now, it doesn't display posts made by unregistered users. The thread doesn't become visible in the hack until a registered user replies.

Any fix for this, and I'd be greatful! What are guests called in the lastposter column in the thread table? Is it blank or is it "Guest" or...?

Oystein
04 Jul 2001, 07:41
My board is in norwegian, so the word for the unregistered users are "Uregistrert bruker" which is a direct translation.

Do I have to put that phrase somewhere in the script?

tubedogg
04 Jul 2001, 13:48
No, but I don't allow guests to post on my board and I'm trying to determine what gets put into the username column in the post table when a guest posts since there is no username. I assume it's either blank or it's "Unregistered" or "Guest".

nannoman
04 Jul 2001, 13:52
hello tubedogg!
how can I include this hack in a HTML file?

Oystein
04 Jul 2001, 14:00
Originally posted by tubedogg
No, but I don't allow guests to post on my board ...

IF you could make a way so guests could be included, I'd be most thankful. Isn't it possible just to skip a check on the userid?

from my tables I see that in table user, the registered users have value 1 and unregistered have the value 0

I don't know about the rest though.

Mail me if you need to :-)

tubedogg
04 Jul 2001, 14:08
OK but what about the post table? There's a username column - what's in that column for posts by unregistered users?

Oystein
04 Jul 2001, 14:13
in table post, username is either:
1. registered username (like mine "Oystein")
2. unregistered username (always "Uregistrert bruker")

The unreg. username is the same as I've edited in the file where it was written as "Unregistered" originally.

tubedogg
04 Jul 2001, 14:38
OK I think I have it figured out. Try the one attached to this message and see if it works.

Rename it to last10.php. The config file hasn't changed so you can just upload this one.

dareen
04 Jul 2001, 22:26
it was working great until a imported my ubb posts i got this error
-----------------------------
MySQL reported this error while trying to retreive the info: The table 'SQL3c86e_0' is full
----------------------------

any help?

Oystein
05 Jul 2001, 08:01
Originally posted by tubedogg
OK I think I have it figured out. Try the one attached to this message and see if it works.

Rename it to last10.php. The config file hasn't changed so you can just upload this one.

Whatever you did, it worked... just tested, and now the unregistered users posts are shown..

but (!) Replies are not shown :p I guess you changed a bit too much :-)

Edit: Forget this last one... but you had written $replyword instead of $threads[replycount]. But I just changed it, so now it works.

Thanks a lot for helping out. Actually it means a lot :-)

JJR512
08 Jul 2001, 04:38
Can someone help me with some adjustments to this hack...Here's what I'd like. Instead of showing the Last Poster, I'd like to see the Thread Starter...and instead of showing the text of the last reply, I'd like to see the text of the first (opening) message of the thread. And I'd like for the output to be sorted in order of when the threads were originally posted, not by when the last reply was.

Thanks in advance!

dost
08 Jul 2001, 13:19
You are lucky JJR512 :D, I did all the changes you wanted eventhough I know nothing about php and mysql because I guess tubedogg was a little bit busy :rolleyes:

// the base WHERE statement
$wheresql = "WHERE thread.lastposter=user.username AND thread.open!='10'";

to

// te base WHERE statement
$wheresql = "WHERE thread.postusername=user.username AND thread.open!='10'";
and

// ooh a query!
$query = "SELECT thread.lastpost,thread.title,thread.lastposter,thread.replycount,thread.views,us er.userid,thread.threadid,thread.forumid$fsel,thread.iconid FROM thread,user$ftitle $wheresql ORDER BY thread.$ob $obdir LIMIT $maxthreads";

to

// ooh a query!
$query = "SELECT thread.dateline,thread.title,thread.postusername,thread.replycount,thread.views, user.userid,thread.threadid,thread.forumid$fsel,thread.iconid FROM thread,user$ftitle $wheresql ORDER BY thread.$ob $obdir LIMIT $maxthreads";
and

$fd = date($fdt,$threads[lastpost]);

$fd = date($fdt,$threads[dateline]);
Also in the config file, don't forget to change $ob to dateline. Like:
$ob = "dateline"
I hope that helps. Please remind me if I have forgotten some parts because I modified the code a lot so it's hard to track the changes I have made.

gmyachtsman
09 Jul 2001, 23:24
I have this hack working nicely on my front page, and I am trying to also ad the hack to a page (citysailor.com) on a different server that doesn't support PHP.

I tried using the full path to the last10.php and last10config.php files in my include statement like this:

<!--#include virtual="http:// www.harborsailing.com/public_html/last10/last10_ny.php"-->

But I am getting this error:

[an error occurred while processing this directive]

I might be missing something really simple --- any ideas how to make it work?

Steve Machol
10 Jul 2001, 04:52
I just installed this for testing and it's absolutely great! Good job Kevin!

One slight problem though. Some of the message icons show broken images, although the images are fine in the actual forum and thread displays. Here's the URL:

http://130.94.168.29/last10/last10.php

Any idea how to fix?

P.S. It appears the last10 script is adding icon15.gif and icon16.gif whch don't exist. Where did it get these icons from? They're not in the messages or forumdisplay. :confused:

Steve Machol
10 Jul 2001, 19:57
I've determined that the problem with the message icons occurs whenever an icon is used that was not part of the orginal distribution (icons 1-14.)

Steve Machol
11 Jul 2001, 03:38
Just a followup to say that I've kludged a 'fix' for this. I went into the Admin Control Panel, found the iconids of each of the icons above icon14, and copied each GIF to the corresponding iconxx.gif file. Now all of the message icons appear as they should.

Steve Machol
11 Jul 2001, 18:28
Has anyone noticed just has badly this looks in Netscape. Here's a screenshot of the Last 10 hack with NS 4.72.

Any ideas on how to fix this?

JJR512
12 Jul 2001, 03:22
DoST, thanks for your help! All seems well, except for one detail: the $showmessages option. It's still showing the text of the last reply. I was wondering, how can I fix it to show the text of the first message, the original message in the thread?

And again, thanks!

Steve Machol
13 Jul 2001, 02:23
*Bump*

I'd still like to see if anyone has an idea how to fix the problem with how this hack displays with Netscape.

N.B.
13 Jul 2001, 10:27
I do have a problem with your script :)
Or should I say: with PHP ...

www.cdrsoft.cc/test.shtml
It already works fine, and so I tried to add to my main site:
www.cdrsoft.cc/indes.php with the <? include("last10.php"); ?>
And nothing apears, I use PHP Nuke for the site, and it doesn´t parse the data from the skript, it just enters the line as it is ..
Do you know how to get this work ?

Thx for your help !
Cya !

Rostor
13 Jul 2001, 12:03
There is a way to make it works on IIS5 ?

Or do you now if there are other hacks do the same of last10 ?

maverick1236
13 Jul 2001, 12:56
Fatal error: Failed opening required 'http://ftpcentral.dyndns.org/upload/admin/config.php' (include_path='') in e:\nusphere\apache\htdocs\upload\last10.php on line 13


anyone know how to fix this?
tx!

tubedogg
14 Jul 2001, 20:12
Rastor: There's no reason why it shouldn't work on IIS5. Have you tried it?

Steve (smachol): http://www.vbulletin.com/forum/showthread.php?postid=122043#post122043

Steve Machol
14 Jul 2001, 20:33
Thanks Kevin. That fixes some of the problem but there's still more. For instance, NS also does not display the correct font colors and the tables don't line up. Plus there's still some overlapping. Here's the pic:

Steve Machol
14 Jul 2001, 20:35
And here's the same images as viewed with IE. (Note also that both IE and NS display the [ SIZE=4] instead of the actual font size.)

Steve Machol
14 Jul 2001, 20:36
Sorry - forgot the IE p ic:

Rostor
14 Jul 2001, 21:05
Originally posted by tubedogg
Rastor: There's no reason why it shouldn't work on IIS5. Have you tried it?

Yes I test it as you can see here:
www.swzone.org/main_home.php

It works but gives out many errors.

And I don't know how to solve it.

jarvis
15 Jul 2001, 07:11
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

gmyachtsman
15 Jul 2001, 09:08
Kevin and Steve,

I am having the same problem on Netscape 4.7 with the overlapping of the end of the thread title at www.citysailor.com

I removed the <nobr> tags, but it did not help.


A guess a Kludgy solution might be to specifically limit the number of letters printed, depending on the space allocated.

[By the way, if anyone reading this knows how to make the background image on Netscape just x-repeat, instead of repeating down the whole page, please let me know]

Love&amp;Hate
17 Jul 2001, 18:11
First of all- I would like to thank tubedogg for ths wonderful hack! It is a great traffic builder! Thanks tubedogg!
Now on to my (stupid) concern:
I don't know a thing about "Parsed", never heard of the term. But I WAS able to follow the "Last XX Post" instructions up until the point of having the "last10.php" work :) . The problem I am having is incorperating this into some sort of HTML (or similar) document.

How EXACTLY is this accomplished?

Thanks in advance...

Rostor
18 Jul 2001, 09:29
Hi Jarvis thx for your help but i take a different way to solve the problem :)
Last Week I bought 2 books about PHP and started to study it !!!
After 3 days i make little modify to lastXX so now the hack works fine with IIS5.

First:
In the lastxxconfig.php file I add this lines:
// by rostor
$counter = "";
// fine inserimento rostor

So a problem with undefined constant has been solved.

Second:
In the lastxx.php I defined this line with " " :)

// 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"]);

That's All

RobAC
18 Jul 2001, 14:48
Has anyone else included this hack into a non VB page (HTML document) and then looked at it in Netscat? It's not pretty.....and this particular line of code really confuses me...:

<td bgcolor=\"$bc\" style=\"font-family:$f; font-size:$fs; color:$tc;\" align=\"center\">

Is defining style = font-family: font size......etc. within a table cell tag a valid argument???

Steve Machol
18 Jul 2001, 17:25
Yep - this doesn't look good in Netscape 4.7x at all. I wish I knew how to fix the HTML so it works with NS as well.

Love&amp;Hate
18 Jul 2001, 18:57
I wish I knew how to put it in HTML period! Can't anyone help me with this?

gmyachtsman
18 Jul 2001, 19:33
try changing the name of your file to .shtml from .html and put this code in where you want the last 10 to show up on your page:

Your choice of

<!--#include virtual="last10/last10.php"-->

or

<!--#include file="last10/last10.php"-->

If folder your.shtml file is in is not above the last10 folder in your directory, you need to do "../last10/last10.php" instead (note the "../" ) That tells it to look up one folder before looking down for the last10 folder .

Devels
19 Jul 2001, 16:25
You want to introduce the information from a forum in other pages?
Whether more easy to create 1 ( one) file in $bburl the catalogue, to get access to all functions and to use them? Introduction then should look as

<? include " http: //full.address.to.site/vbforum_dir/this_file.php ";? >

we create a file this_file.php and we write in him(it) something such as

//-------------------------------------------
<?
require("./global.php");
if ($ac == "header") {
eval (" \ $headinclude = \ " " .gettemplate ('headinclude.' " \ ";");
eval (" \ $header = \ " " .gettemplate ('header.' " \ ";");
echo replace_var ("{ htmldoctype }<html><head><title>$vbtitle </title>$headinclude</head><body>$header<br>");
}
// -- Function replace_var is taken that it was possible to alter only top of a window, not creating new template. --
function replace_var ($text) {
global $DB_site, $replacementsetid;
$vars = $DB_site->query ("SELECT findword, replaceword FROM replacement WHERE replacementsetid IN (-1, '$replacementsetid') ORDER BY replacementsetid DESC, replacementid DESC ");
while ($var = $DB_site->fetch_array($vars)) {
if ($var ['findword'! = " ") {
$text=str_replace ($var ['findword'], $var ['replaceword'], $text);
}
}
$DB_site-> free_result ($vars);
return $text;
}
?>

it is introduced

<? include "http://full.address.to.site/vbforum_dir/this_fi le.php?ac=header";? >

On an output we shall receive normal heading for use in other pages.....
Laziness to write footer and other functions?
We add in our file of a line

<?
if ($ac == "footer") {
eval (" dooutput (\ " " .gettemplate (" footer "). " \ "); ");
}
if ($ac == "login") {
echo makelogincode ();
exit;
}
if ($ac == "forumjump") {
makeforumjump ();
echo $forumjump;
exit;
}
?>

All!!!
For introduction of your example (the last 5 sent) the following

<?
if($ac=="lastpost") {
if ($getlastpost=$DB_site->query("SELECT postid,username,dateline FROM post WHERE post.visible=1 ORDER BY dateline DESC LIMIT 0,5")) {
$i=1;
while ($getlast=$DB_site->fetch_array($getlastpost)) {
$color = iif((($i/2)==round($i/2)),"{ firstaltcolor }","{ secondaltcolor }");
$lastpost .= "<tr bgcolor=$color><td><a href=showthread.php?s=$session[sessionhash]&postid=$getlast[postid]#post$getlast[postid]>$getlast[username]</a></td><td>".vbdate($dateformat,$getlast[dateline])."</td></tr>";
$i++;
}
$DB_site->free_result($getlastpost);
unset($getlastpost);
echo replace_var("<table cellpadding={ tableouterborderwidth } cellspacing=0 border=0 bgcolor={ tablebordercolor } { tableouterextra } width={ tablewidth } align=center><tr><td><table cellpadding=4 cellspacing={ tableinnerborderwidth } border=0 { tableinnerextra } width=100%>$lastpost</table></table>");
exit;
}
}
?>

Include in other page

<? include "http://full.address.to.site/vbforum_dir/this_file.php?ac=lastpost";? >

Successes in work

aurelius
19 Jul 2001, 20:42
Great script!

Having some problems to have the script to correct for the time difference between the server time and my local time. How can this be set?

Sorry for the posting in the wrong forum earlier.

dost
21 Jul 2001, 04:01
I'd also appreciate a way to fix the time difference problem between the server and local client.

Thanks

Steve_S
22 Jul 2001, 03:07
Dr. tubedogg!

Thank you for writing this great script :)

Like a knife through hot butter

Edit: New url: http://66.33.83.213/last_25_posts.html

:)

eva2000
22 Jul 2001, 06:41
Originally posted by Steve_S
Dr. tubedogg!

Thank you for writing this great script :)

Like a knife through hot butter

http://66.33.83.213 looking good Steve :D

gmyachtsman
22 Jul 2001, 16:21
Steve,

Your site is showing up fine on Netscape 4.7.

My site (see above) isn't. I am not sure if that is because I fixed the width to a certain number of pixels, because I am including the number of views and replies and you are not, or for some other reason.

Did you do try anything specially to make it work on Netscape?

Steve_S
22 Jul 2001, 19:41
Mucho thanks for the look see :)

I haven't touched the code yet but will :) I have to wait till George is sleeping :)

I just changed some settings and ran some tests:

All of these look/work fine

IE 5
IE 5.5
N 4.75
N 6.01

New link: http://66.33.83.213/last_25_posts.html

BTW, I just read every post in this thread. After I name my next born child "tubedogg" I have another thought. The "Community Spirit" in this thread is really outstanding. My thnaks to others for the great comments. Especially the tips on creating another variable via phpinclude :)

My Best :)

aldamon
23 Jul 2001, 17:01
Woohoo! Thanks tubedogg. Awsome hack!

mADmAX`
24 Jul 2001, 04:41
How would you get it to link to a different server. I have my forums on one server and want this on my main site which is on a different server.

aldamon
24 Jul 2001, 11:57
Originally posted by aurelius
Great script!

Having some problems to have the script to correct for the time difference between the server time and my local time. How can this be set?

Sorry for the posting in the wrong forum earlier.

I am also having problems with this. Our shared server is one hour behind us.

aurelius
27 Jul 2001, 21:23
Help, please?

*b*
01 Aug 2001, 07:25
I run a VERY high traffic site. I love the idea of including recent content from my message boards on my homepage.

However, running another query to the DB can be a system resource "eater." Has anyone thought of creating a version of this hack that would query ever "X" minutes and write the results to a txt file?

This way, the same effect is achieved (basically), and connections to the database is reduced.

Give me your thoughts. If enough people are interested, I may look into doing it (with my limited skillset).

Thanks,

*b*

chilliboy
08 Aug 2001, 07:33
Hi,

I really like the script - Thanks.

However, when mySQL is down it can bring normal page loading to a standstill - If there anything that I could add which would only exectue the script if mySQL was working ok.

Thanks in advance.

Evoir
18 Aug 2001, 02:05
Tubedogg,

your script is, um, really nice. :D

I am concerned that I cannot change the font size/color, or type. It just doesn't show any changes in Netscape 4.7 for mac and minumal changes in IE (cannot change font color, but can change font size and type in IE)

Is there some solution for this? Otherwise, it is a really cool script, and I'd really like to use it.

mjames
25 Aug 2001, 18:04
Kevin,

I configured everything and followed your instructions, but I couldn't get it to work. When I used <!--#include file="/community/boards/admin/last10.php"-->, it said "there has been an error in processing this directive". So I tried <!--#include virtual="/community/boards/admin/last10.php"--> and it says:
Fatal error: Failed opening required 'community/boards/admin/config.php' in /home/mjames86/sports-central-www/community/boards/admin/last10.php on line 13
I am trying to run this on a .shtml page with SSI. I have had to use .htm to get my other SSIs to work, what can I do here? :(

tubedogg
25 Aug 2001, 21:26
Where are you actually calling it from? Like what directory does it reside in? The admin directory?

Assuming yes, you should leave $path blank since config.php is in the same directory.

mjames
25 Aug 2001, 21:49
Yes, both .php files are in the /admin folder, with the config.php file. What do I need to do?

tubedogg
25 Aug 2001, 21:52
Just set
$path="";
in last10config.php. :)

mjames
25 Aug 2001, 22:00
Maybe we misunderstood each other, but it didn't work:
Fatal error: Failed opening required '/config.php' in /home/mjames86/sports-central-www/community/boards/admin/last10.php on line 13

Steve_S
28 Aug 2001, 17:24
tubedogg and all,

This is a marvelous hack and works like a charm :) Thank you.

Maybe I missed it in this long thread.

Could this script be modified to insert topics/threads and such on another server? My vB is on one dedicated server and I would like to use this script to insert topics/threads on my other site which is on another dedicated server?

I don't want to be a mooch so if you would prefer to do this for money I understand and respect that. Just email me with a quote.

Natch, their would be a performance/load hit but I can live with that.

Evoir
05 Sep 2001, 18:38
Tubedogg,

great hack!! I finally got it to work. (was having netscape troubles, but it seems to be cool now.)

I do have a question/suggestion.

I noticed that you gave us the option of having the table header color be different than the alt 1 and alt 2 columns. I changed the text in the table header be a different color than the text within the rest of the table.

I defined another variable in last10config.php:
$htc = "#FFFFFF";// head text color

Then in last10.php I simply changed the font color (for the header fonts to:
color:$htc;

worked like a charm.
Thanks Kevin. :)

p.s. I also changed (in last10.php)
$fs .= "pt";
$hfs .= "pt";

to

$fs .= "px";
$hfs .= "px";

so it works better in netscape. :)

Evoir
05 Sep 2001, 19:18
Ok, I tested this and it worked great (see above post) and when I went to put it into my home page, I go a weird output (like it isn't reading the font tags)

Here is the page (it is a test page) http://www.curvemag.com/index2.html

What happens is that if I put the include in the right hand column, it doesn't work properly, but anywhere else on the page, it works great.

p.s. it "works" in both places, just the styles don't work in the right hand column.

The text in question says:

"Join the conversation
thread one
thread two
thread three"

(I changed some of the language to suit our site.)

Can anyone explain what is wrong in my html that is making this happen in the right hand column? Please? :)

Evoir
09 Sep 2001, 01:16
Just to let whoever is interested know: for whatever reason, it was stuff about the column that effected this formatting problem.

<td valign="top" height="215" width="147">
The column was defined with a width of 147, which the script didn't like. It output weird formatting of the text in Netscape on a mac.

Eventually, I figured out a solution, weird as it may be - was to change the width attribute by a few numbers, and it worked. I had tried this also on another page, and the wisth of 147 was the problem. Perhaps the numbers didn't add up... I donno. It's a weird thing, but it is now solved, by using:
<td valign="top" height="215" width="150">

That in combination with removing a <nobr> in line 226 of last10.php fixed it.

:)

john2k
10 Sep 2001, 23:30
I've been trying for short while today to get this script working using the <!--#include file="last10.php"--> call from within an SSI file on Windows 2000 Server / IIS 5. All this does is inserts the text of the last10.php script directly into the SSI file, instead of parsing the php script first. I read this entire thread looking for a solution to this, but only found that other people using Win2k / IIS5 were having similar problems.

I did finally figure it out, though. This is what worked for me, instead of using <!--#include file="last10.php"--> to call the script I'm using <!--#exec cgi="last10.php"--> & it is working fine now.

Tubedog, I haven't had a chance to really play around with this script but it does look like it will be very useful - thanks in advance! You may also want to add a note for Win2k / IIS 5 users in your installation directions about the <!--#exec cgi="last10.php"--> command as there seems to be a number of other people who have this similar problem.

Best,

- John

Russell
11 Sep 2001, 12:11
It's great dude.. easy to setup.

Only problem is.. sometimes people might want a different text colour for the heading.. may I suggest a heading text colour param. That and a cellspacing one, because... I didn't want a HUGE gap between my posts and had to edit the last10.php file.

So yes, thanks heaps... mine's at http://www.buffydownunder.com

Cheers.

VAN
14 Sep 2001, 00:57
Well, I am reinstalling this hack since i recently upgraded.

I am going to be using this hack on its own page, rather than included in a small portion of an existing page.

Can anyone tell me how to get this to utilize a users chosen style set?

BaD-b0y
16 Sep 2001, 01:27
Hi,

There is what i got when i enter last10.php...


Warning: Unable to access /config.php in /last10.php on line 13

Warning: Failed opening '/config.php' for inclusion (include_path='.') in /last10.php on line 13

Fatal error: Failed opening required '/config.php' (include_path='.') in /last10.php on line 13

What do i have to do ??

Plz Help me

Thx in Advance

dxb
19 Sep 2001, 11:29
thanks Kevin for this hack

I hope I'm not too late to get an answer for my question

anyway this is what I'm looking for

how can I show only one thread from the forums I included

...................................................

the problem I'm facing is I included 10 forums and my $maxthreads is set at 10 one of the forums is the most active forum I get 7 threads from that forum only where I want a thread from each forum

and thanks in advance :)

J Wahl
21 Sep 2001, 23:10
awesome hack!

one question tho - when a user have included a smilie they dont show up.. im just getting the "X"..

this is how the url to the image looks: http://www.mysite.com/forum/http://www.mysite.com/forum/images/smilies/up.gif

i have pointed the imagepath to the correct image folder but it just wont work

also if possible - how do i make the links open up in a new window?? ive got the script in an iframe...

any ideas??

Jamie-UK
26 Sep 2001, 12:56
I installed the last10.php easily and it works. But, there seems to be a problem when an unregistered user posts a reply to a new discussion.

When the new thread has been submitted, it appears on the front page. When an unregistered user replies to that thread, then the link disappears from the front page.

Using it on this site :

http://www.bbfc.org.uk/

Regards,

Jamie.

Jamie-UK
27 Sep 2001, 11:11
Ok, I sorted out the problem with unregistered users not showing up, by searching through this thread for a similar problem.

One more thing I need to change is on the news section of my website. I require that the initial thread posting is shown on the news page, but subsequent replies to that thread are not shown, apart from the amount of replies.

www.bbfc.org.uk right hand column.

Is this possible ?

regards,

Jamie.

stryke
01 Oct 2001, 07:27
Help!

While using last10 post, all of a sudden I'm getting this error:

--------------------------------------------------------

MySQL reported this error while trying to retreive the info: The table 'SQL28cd73b_0' is full

--------------------------------------------------------


Please help. Thanks

YourHostSucks
01 Oct 2001, 09:05
<<edit>> sleepy.. need sleep *oo*
\ - /

goku2k
04 Oct 2001, 19:51
can you show me how to put this active thread into the phpnuke?

thanks

inetd
05 Oct 2001, 19:33
Whether it is possible to make so that messages from the certain category were displayed only?

Abbas Jaffarali
17 Oct 2001, 20:19
I believe there's a bug in the script:

If you setup a forum where only moderators are allowed to Post new topics (or a post has to be validated by a moderator), then if someone posts a topic on that forum, the topic doesnt show up in vBulletin (which is how its supposed to be).

However, the topic DOES show up if this hack is being used to display the topics from that forum.

-Abbas

Silviu
18 Oct 2001, 16:53
Tried to include it into footer.php (im using myPHPNUKE), worked ok, but showed this error:

1146: Table 'vb114.mpn_stories' doesn't exist

and also didnt shows me the stories that was supposed to show :P

Any idea?

cihangir
20 Oct 2001, 18:19
the html tags between [code] are included as html tags, which means i get often errors when displaying the pages. i think the problem will be solved, when lines between [code] are with &lt; and &gt; displayed, not with "<" and ">" ?

Lt.Christy
29 Oct 2001, 22:59
What do I need to do so instead of having the smileys before the subject, I could have the on/off.gif pics to show wether that post has been updated or not

aldamon
30 Oct 2001, 19:12
tubedogg, will this work with 2.2.0???