vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Last XX Posts on non-vB page (https://vborg.vbsupport.ru/showthread.php?t=12324)

Steve Machol 07-14-2001 07:36 PM

Sorry - forgot the IE p ic:

Rostor 07-14-2001 08:05 PM

Quote:

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 07-15-2001 06:11 AM

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 07-15-2001 08:08 AM

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&Hate 07-17-2001 05:11 PM

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 07-18-2001 08:29 AM

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 07-18-2001 01:48 PM

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...:

PHP Code:

<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 07-18-2001 04:25 PM

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&Hate 07-18-2001 05:57 PM

I wish I knew how to put it in HTML period! Can't anyone help me with this?

gmyachtsman 07-18-2001 06:33 PM

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 07-19-2001 03:25 PM

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
PHP Code:

<? 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
PHP Code:

//-------------------------------------------
<?
 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
PHP Code:

<? 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
PHP Code:

<?
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
PHP Code:

<?
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
PHP Code:

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

Successes in work

aurelius 07-19-2001 07:42 PM

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 07-21-2001 03:01 AM

I'd also appreciate a way to fix the time difference problem between the server and local client.

Thanks

Steve_S 07-22-2001 02:07 AM

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 07-22-2001 05:41 AM

Quote:

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 07-22-2001 03:21 PM

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 07-22-2001 06:41 PM

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 07-23-2001 04:01 PM

Woohoo! Thanks tubedogg. Awsome hack!

mADmAX` 07-24-2001 03:41 AM

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 07-24-2001 10:57 AM

Quote:

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 07-27-2001 08:23 PM

Help, please?

*b* 08-01-2001 06:25 AM

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-08-2001 06:33 AM

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 08-18-2001 01:05 AM

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 08-25-2001 05:04 PM

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:
Quote:

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 08-25-2001 08:26 PM

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 08-25-2001 08:49 PM

Yes, both .php files are in the /admin folder, with the config.php file. What do I need to do?

tubedogg 08-25-2001 08:52 PM

Just set
$path="";
in last10config.php. :)

mjames 08-25-2001 09:00 PM

Maybe we misunderstood each other, but it didn't work:
Code:

Fatal error: Failed opening required '/config.php' in /home/mjames86/sports-central-www/community/boards/admin/last10.php on line 13

Steve_S 08-28-2001 04:24 PM

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 09-05-2001 05:38 PM

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 09-05-2001 06:18 PM

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-09-2001 12:16 AM

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 09-10-2001 10:30 PM

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 09-11-2001 11:11 AM

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 09-13-2001 11:57 PM

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 09-16-2001 12:27 AM

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 09-19-2001 10:29 AM

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 09-21-2001 10:10 PM

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:
Code:

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 09-26-2001 11:56 AM

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.


All times are GMT. The time now is 11:58 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02010 seconds
  • Memory Usage 1,852KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (7)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete