PDA

View Full Version : HTML, TXT, JAVA Integrator 2.0 Automatically display any HTML, TXT or JAVA file in vB


Erwin
26 Sep 2002, 06:00
vB HTML, TXT, JAVA Integrator 2.0 - Automatically display any HTML, TXT or JAVA file integrated into vB - by Erwin

Upgraded for vB3:
http://www.vbulletin.org/forum/showthread.php?t=66084

Hack updated - made it even easier to install - upload 1 file, and you're done! Just change the URL parameters as needed. No need to add templates or edit files.

As the name suggests, this hack allows you to display any HTML file as integrated into your forums. No need to make a new template or PHP file. Easy way to incorporate rules, messages, web pages etc. into your forums.

All you need to do is to run this URL:
http://www.your-forums/forums/html.php?file=xxx.html

Where xxx.html is the HTML file you want to integrate into your forums. The file extension can be HTML, HTM, SHTML or even TXT (text files). You can add more file extensions by modifying html.php

This is also a quick way to integrate java applets into your forum (for example, java chat applets). Just copy and paste the java applet code into a HTML file, and then put the HTML file name into the URL above. Instant java integration!

For HTML files in subdirectories, use this URL:
http://www.your-forums/forums/html.php?file=directory/xxx.html

By default, the title is the filename. To make a custom title in your forum page, use this URL:
http://www.your-forums/forums/html.php?file=xxx.html&title=Your Title

You can have spaces in your custom title. :)

I have disabled remote file integration - this way other people cannot use this link to integrate offensive pages into your site. :)

Installation

1) Upload html.php into your forum directory.

2) Done!

3) Upload any HTML file or TEXT file into your forums directory, or sub-directory, and run the command line URL as listed above, and you'll see the file integrated into your forums automatically!

If you like this and want to receive updates, do press the "Install" link at the bottom of the thread.

Enjoy! :)

This version here is lets ALL users see the integrated HTML page. To let members only see the page, make the modifications listed in the next post.

Updates:

Version 1.1 - Added ability to add a custom page title to the integrated HTML forum page! :)

Version 2.0 - Removed the need to add a template. Just upload the file, and you're done.


Download:

Erwin
26 Sep 2002, 06:20
If you only want to give registered members and staff to have access to the HTML integrated page, then:

In html.php find:


require("global.php");


Add BELOW:


if (!in_array($bbuserinfo['usergroupid'], array(2,5,6,7))) show_nopermission();


Unregistered guests, banned members and email confirmation members will get the no permission page.

Erwin
26 Sep 2002, 06:24
And, if you do install this hack, and like it, please post your feedback and comments here. :D

Erwin
26 Sep 2002, 06:27
Another tip:

You can add more file extensions to be integrated using this hack.

Open html.php:

Find:


$exts = "html, htm, txt, shtml";


You can add "asp, cgi" etc. to the list in that line - there's no reason why it wouldn't work. Mind you, I haven't tried it, but it should work. :)

Brad
26 Sep 2002, 06:40
so basicly this is like the webtemplates hack only it dosent store things in the DB and inserts your header and footer templates around a html page?

Erwin
26 Sep 2002, 06:42
I've never used the webtemplates hack, so I don't know how that works.

With this hack, the HTML files are not stored in the db. You upload them to your forums directory, then use the file to integrate them into your forums, with the header and footer around it. Once this hack is installed, all you need to do is "point and shoot" at the HTML file, and it will show up as integrated into your forums.

Brad
26 Sep 2002, 06:47
ah i see, it works kinda like it then, calling files via a .php file. nice hack, wont be using it myself tho, well mabey.

Brad
26 Sep 2002, 06:55
Tip:

if you want to add a custom header or footer to this hack, for say building a whole website around it do this.

add two new templates, webheader, and webfooter. put whatever you want to show up as the header and footer in the respected templates.

open global.php

find:

// parse other global templates

below it add


eval("\$webheader = \"".gettemplate('webheader')."\";");
eval("\$webfooter = \"".gettemplate('webfooter')."\";");

open the html template (created in hack install)

change the template to:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>$bbtitle - $file</title>
$headinclude </head>
<body>
$webheader
<!-- breadcrumb -->
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%"><br>
<normalfont><b><a href="index.php?s=$session[sessionhash]">$bbtitle</a>
&gt; $file</b></normalfont></td>
</tr>
</table>
<!-- /breadcrumb -->
<br>
<table cellpadding="0" cellspacing="0" border="0" bgcolor="#000000" width="95%" align="center">
<tr>
<td> <table cellpadding="4" cellspacing="1" border="0" width="100%">
<tr>
<td bgcolor="#F1F1F1" align="left" valign="top" background="http://www.vbulletin.org/forum/greentek/back.gif"><normalfont>
<br>
</div>
<center>
$content
</center>
</td>
</tr>
</table></td>
</tr>
</table>
$webfooter
</body>
</html>

Erwin
26 Sep 2002, 07:04
Thanks for the tip, Anime-Loo. My hack works with the standard header and footer of your forum, but if you want a different set of headers and footers, then your tip would help with that. :)

blackice912
26 Sep 2002, 10:28
I still want to see a preview dangit :p

Erwin
26 Sep 2002, 10:55
Imagine any HTML file, then imagine it inside your forums, with your forum header and footer...

How can I give a screenshot? I could show you anything, since the HTML file can be anything you want it to be.

Erwin
26 Sep 2002, 11:30
Minor update - version 1.1

By default, the title is the filename. To make a custom title in your forum page, use this URL:

http://www.your-forums/forums/html.php?file=xxx.html&title=Your Title

You can have spaces in your custom title. :)

To upgrade from previous versions, just download the new ZIP, and upload the new html.php - there is no change to the template.

Brad
26 Sep 2002, 11:34
example:

heres the html as it would be if called directly:

http://www.kousetsu.net/down/down.htm

and called via the hack:

http://www.kousetsu.net/kan/html.php?file=down.htm

ps: i know the images are broken, i dont have the time to edit the html right now, this is not a bug in the hack ;)

Erwin
26 Sep 2002, 11:38
Anime-loo - download the new html.php file, and you can have a custom title, instead of the filename as the title.

The URL would be:

http://www.kousetsu.net/kan/html.php?file=down.htm&title=We are down

Note: You must download and upload the new html.php (version 1.1)

Also - make sure the image paths are relative to where the html.php file is, or use full paths - otherwise you get broken image links.

Brad
26 Sep 2002, 11:41
Originally posted by Erwin
Anime-loo - download the new html.php file, and you can have a custom title, instead of the filename as the title.

The URL would be:

http://www.kousetsu.net/kan/html.php?file=down.htm&title=We are down

Note: You must download and upload the new html.php (version 1.1)


i know ;), its the file i have on the server ATM, i only posted the link to show a example, i dont really have a use for the hack ATM :)

Erwin
26 Sep 2002, 11:44
Thanks for helping. :) If you make it a good demo, I will link to it in my first post. ;)

Brad
26 Sep 2002, 11:48
click me (http://www.kousetsu.net/kan/html.php?file=down.htm&title=We%20are%20down)

fixed the images and added the title

Erwin
26 Sep 2002, 11:50
Great! Demo added to the first post!

Erwin
26 Sep 2002, 12:02
DEMO

Thanks to Anime-Loo for volunteering his site! :)

This is the normal HTML file that you normally have for a website without automatic integration:
http://www.kousetsu.net/kan/down.htm

This is the SAME HTML file integrated with this hack just by using the command line URL with NO custom title (the title automatically is the file name):
http://www.kousetsu.net/kan/html.php?file=down.htm

This is the SAME HTML file integrated with this hack WITH A CUSTOM TITLE:
http://www.kousetsu.net/kan/html.php?file=down.htm&title=We are down

kmfdm_kid2000
26 Sep 2002, 13:55
Wow, yet another amazingly useful, yet simple hack by Erwin...Thank you very much for this...

/me Installs

Erwin
26 Sep 2002, 16:35
Thanks for the kind words. :) Hope it is truly useful for you! :)

Goldknight
26 Sep 2002, 17:36
Unique hack :)

/me install since this hack is support

8ball
26 Sep 2002, 17:46
thanks Erwin ;) very good and useful hack :D

Erwin
26 Sep 2002, 17:56
Thanks for the comments and feedback! :) If you like it and use it, don't forget to click the install link at the bottom of the thread! ;)

Velocd
27 Sep 2002, 03:51
Pro hack, I'm actually not going to use it for my forums..but in another site of mine I'm working on :-D

/me kicks install

TECK
27 Sep 2002, 04:35
not to be picky erwin... but isnt alot easier to add a file like that:
<?php
error_reporting(7);

$templatesused = 'error_nopermission, your_template';
require('./global.php');

$permissions = getpermissions();
if (!$permissions['canview']) {
show_nopermission();
}

eval("dooutput(\"".gettemplate('your_template')."\");");

?>??

Erwin
27 Sep 2002, 05:11
TECK, using your way, you need to add every single HTML file you have on your site as a new template, and then have a different PHP file to call each of this template.

My way, the html.php file automatically takes any HTML file on your file server and inserts it into the site. There is no need to add the HTML file into a vB template.

Using my hack, adding HTML files into your forums is as easy as changing the URL filename. :)

Your PHP code doesn't work for automatically including HTML files into vB. Trust me. There is not even a $file variable to get the HTML filename. :)

Erwin
27 Sep 2002, 05:17
Originally posted by TECK
not to be picky erwin... but isnt alot easier to add a file like that:
<?php
error_reporting(7);

$templatesused = 'error_nopermission, your_template';
require('./global.php');

$permissions = getpermissions();
if (!$permissions['canview']) {
show_nopermission();
}

eval("dooutput(\"".gettemplate('your_template')."\");");

?>??

Also, a friendly tip.

There's no point including 2 templates into $templateused if each template is mutually exclusive. The templateused uses 1 query. Without it, when you either call error_nopermission OR the other template, it's 1 query each - it's never 2 queries. So you don't save any queries using $templateused if the templates are mutually exclusive and never run together. :)

And looking at your code, you completely misunderstand this hack. This hack doesn't require anyone to save their HTML file into the template database, and have multiple PHP files.

All you need is the html.php file. Then, just change the filename in front of it like this : html.php?file=index.html or html.php?file=anything.html, and the HTML will automatically be integrated as though it is in the template, but it's not.

It actually is harder to do than it looks. It's not a simple include() function. It's not even a simple eval() function. I had to look up PHP manuals and do a tricky array type code to make the HTML file parsed into the forum. :)

Try it and have a look at my code. Your code will never work for what I intend this hack to do.

TECK
27 Sep 2002, 05:50
Thanks for explaining Erwin. at a glance i thought you are trying to include a custom file onto vbulletin.
about the error_nopermission, is just a habit... :)
i add it to all my files as a reflex... since most of them cache multible templates. so i kind of got used to write it automatically, as well as the IF permission...

Erwin
27 Sep 2002, 06:09
Originally posted by TECK
Thanks for explaining Erwin. at a glance i thought you are trying to include a custom file onto vbulletin.

No problems. With this hack, you can include ANY custom HTML file "on the fly" without need for any template or php file mods. :)


about the error_nopermission, is just a habit... :)
i add it to all my files as a reflex... since most of them cache multible templates. so i kind of got used to write it automatically, as well as the IF permission...

No point caching 2 templates, if the file only would use 1 of them at a time. :) Each method uses only 1 query, but cacheing just slows down the page and wastes memory, albeit only by a tiny fraction, and does not save a query at all.

Thanks for the input though, TECK. :)

Mone'
27 Sep 2002, 06:31
This is great and so easy :)
well done i'm going to test it later tonight.

Mone'

MarkB
27 Sep 2002, 10:58
Great hack!! :) Installed :)

Dean C
27 Sep 2002, 19:02
what a fantastic idea Erwin !

- miSt

Erwin
28 Sep 2002, 01:43
Originally posted by Mist
what a fantastic idea Erwin !

- miSt

Thanks! Useful for those HTML files that are lying around, or to integrate java applets into your forums, with only a URL. :)

Dean C
28 Sep 2002, 20:01
exactly ^! ;)

- miSt

MalaK_3araby
28 Sep 2002, 23:59
Great job Dr. :)

... this should heal wonds and i can really use it.

Thanks

/me clicks install

jbear6
29 Sep 2002, 04:10
Very Nice :)
Thanks for sharing your work.

Jbear6

Erwin
29 Sep 2002, 09:13
Thanks for all the kind words.

As a tip:

This is also a quick way to integrate java applets into your forum (for example, java chat applets). Just copy and paste the java applet code into a HTML file, and then put the HTML file name into the URL above. Instant java integration!

So for quick and easy java chat applet integration, or any java applet or other code that can be put into HTML, use this hack.

:)

Chris M
29 Sep 2002, 13:05
Thanks:) I will try it:D

Satan

ALbuquerque27
01 Oct 2002, 00:30
Would this hack work on my vB 2.2.6?

Thanks
-AL

Erwin
01 Oct 2002, 02:33
Originally posted by ALbuquerque27
Would this hack work on my vB 2.2.6?

Thanks
-AL

100%. It will work for ALL versions of vB, since it works externally, and only integrates the HTML/ Java code into the template. :)

FASherman
03 Oct 2002, 02:28
How difficult would it be to modify this to support a cgi perl script as a source file?

Erwin
03 Oct 2002, 03:36
Originally posted by FASherman
How difficult would it be to modify this to support a cgi perl script as a source file?

It should work. Open up "html.php" and add the extension ".cgi" or ".pl" to the list of extensions you want this to work with.

FASherman
03 Oct 2002, 03:37
I tried that. Didn't work.

Erwin
03 Oct 2002, 03:46
Well, in that case, it probably doesn't. Sorry, I just assumed it would, but I never tested it. The aim of this hack is primarily to integrate HTML, TXT or JAVA applets. :)

MacKenzie
31 Oct 2002, 18:02
Excellent hack, my good doctor!

Of all the hacks and add-ons I've views so far here, I would say this one offers the most value to my forums :-D Thank you for your efforts.

MacKenzie
The Asylum:Gathering Of Souls Team.

Julio
13 Nov 2002, 01:28
Erwin: Excellent hack. In fact I would request it, if it wasn't done.
I tested it with some Java script and text and works great. Though... today I created a very nice games gallery, since I don't like the look of the Flash Gallery Add-on.

When I point to: "http://mydomain.com/html.php?file=games/Gamess.html"

the page will show up the text but the graphics will not show up.
Notice on the URL that I have located the html file and the graphics into a folder called games under the forum folder.

If I click a graphic on the browser (showing the X) I notice it points to http://mydomain.com/filename.ext instead of http://mydomain.com/games/filename.ext However, when I look at the html code, it points to the correct folder.

Any suggestion(s)?

Erwin
13 Nov 2002, 01:33
To play Flash, why not just use my Flash Player hack? :) Click on the link in my sig.

If you want to use subdirectories with the HTML integrator, then in your html file, all links to images and Flash files must be ABSOLUTE paths (htttp://www.yourforums.com/images/test.gif) NOT RELATIVE paths (images/test.gif). Othewise it won't work.

Julio
13 Nov 2002, 01:38
Still doesn't work. :(

the absolute path is: http://mydomain/forums/games.filename.gif

when I "call" as stated in the instructions "http://www.your-forums/forums/html.php?file=directory/xxx.html"

the missing files properties shows: "http://mydomain/forums/filename.gif instead

Erwin: Just tested it locally... it works with full absolute path, but it doesn't work on-line. I just noticed that there seems to be a DNS problem with my domain, however I can access it via IP, and it still doesn't work.

Erwin
13 Nov 2002, 05:45
The problem is probably because you are using a subdirectory in the ?file=*** section - can you put the HTML file in the same directory as the html.php file, and just change all the paths in the HTML file to absolute paths to point to the right places. It will work if both the html.php and the HTML file are in the same directory.

Julio
13 Nov 2002, 05:48
Yes, it works that way. Thanks! ;)

So much work around that don't know why didn't thouhgt about it! duh.

Talisman
27 Dec 2002, 06:17
What a wonderful hack! Thanks, Erwan.

Big Daddy Chemo
02 Feb 2003, 14:06
A great hack indeed but how do I enable the remote file integration? Here is my application:

A central database is shared between several forums for the purpose of tracking scammers. Instead of giving each an authorized host and login account it would be much easier for them to integrate the search page into their forum (and give the appearance to their members that they never left the sanctity of their home).

Thanks in advance for the help!

Chemo

Erwin
02 Feb 2003, 23:07
Originally posted by Big Daddy Chemo
A great hack indeed but how do I enable the remote file integration? Here is my application:

A central database is shared between several forums for the purpose of tracking scammers. Instead of giving each an authorized host and login account it would be much easier for them to integrate the search page into their forum (and give the appearance to their members that they never left the sanctity of their home).

Thanks in advance for the help!

Chemo

I made this hack to specifically NOT work for remote servers to prevent malicious people from making other pages look as though it is coming from your site, that's all. :) So think about that carefully first - do you want someone posting a URL that makes it look as though your site is serving up porn? :)

Big Daddy Chemo
03 Feb 2003, 01:12
Originally posted by Erwin
I made this hack to specifically NOT work for remote servers to prevent malicious people from making other pages look as though it is coming from your site, that's all. :) So think about that carefully first - do you want someone posting a URL that makes it look as though your site is serving up porn? :)

Very understandable ;)

In this case, however, I believe the mature nature of our membership will keep the number of incidents to a minimum. I would much appreciate your input as to how to allow remote file integration.

Thanks in advance!

Chemo

Erwin
03 Feb 2003, 01:28
It's simple - remove this line from the html.php file:


if( substr($file,0,5) != "./../" && substr($file,0,7) != "http://" ) return TRUE;


Do this at your own risk - I will not be responsible for any misuse of this by malicious visitors to your site! :)

Big Daddy Chemo
03 Feb 2003, 03:17
Thank you very much!

Last question...what is the syntax for the file name if I want to point it to a specific file? I have tried listing the file name as http:// and without with an error on both. Any ideas?

Chemo

Erwin
03 Feb 2003, 21:59
Actually, I'm not going to support a version that would allow the integration of remote files, as this was never the intention of this hack. It's not hard to work out, but I won't do it, as it is too easily abused. Sorry. :)

GuruXL
04 Feb 2003, 00:09
I am trying to remember how I can strip the extention from the file.

so the URL looks like:

http://www.server.com/html.php?page=filename

rather than:

http://www.server.com/html.php?page=filename.extention

umm...i think you use...erg_replace...i am confused though, so any help would be greately appreciated! :bunny:

Intex
09 Feb 2003, 09:21
V. nice hack Erwin.

sptechzone
14 Feb 2003, 19:04
easy install, works with inside and outside page calls, I even have it running an .asp page that's running a access data base search. I had installed webtemplate hack but it was not doing the authentication for me as the site is a company forum with manuals and service bulletins in pdf, some confidential.

Thanks again for the work you put in.

Erwin
15 Feb 2003, 05:24
Glad you like it. :)

Wayne2k1.com
17 Feb 2003, 11:29
Demo-Screenshot? :paranoid:

The above URLs dont' work :bored:

Erwin
17 Feb 2003, 18:53
Imagine your HTML page.

Imagine your forum header and footer.

Imagine then, your HTML page, in betweem your forum header and footer automatically.

;)

The demo page was put up by Anime-Loo, who must have taken it down - it's been a while.

msimplay
16 Mar 2003, 22:17
Another question on will this hack be released for Vb3
:D
i;'m worried about moving up but as long as the hacks are going to be there i will upgrade with no hesitation

Nikhil Nayak
26 Mar 2003, 06:33
Erwin, nice hack!

BTW I commented out the <center> tags in the "html" template. This ofcourse depends on the file you're including so no big deal ... just a note.

** Clicked Install **

Erwin
29 Mar 2003, 04:14
Hack Update = Version 2.0 - Just upload and run!

I've made this hack even easier to install.

Just upload html.php, and you can instantly integrate any HTML, TXT file or JAVA into your forums.

Now, you don't even need to add a template or edit any files.

If you are already using this, no need to upgrade. I just made it easier for new installers. :)

There will be no screenshots - just imagine a HTML page, embedded inside your forums. This hack can integrate ANY HTML page.

GuruXL
03 Apr 2003, 01:27
how can I strip the extentions so that the .html .htm .php doesn't show? I am trying to do it but, am so far unsuccessful.

Mr L
06 Apr 2003, 00:37
Erwin,

Great hack! Thank you... <<<CLICKS INSTALL>>>

...how would it be possible to make this open using "_self" as a target rather then opening a new frame?

Cheers.

Harvey.

Erwin
06 Apr 2003, 00:46
Today at 11:37 AM HLodder said this in Post #69 (http://www.vbulletin.org/forum/showthread.php?postid=378074#post378074)
Erwin,

Great hack! Thank you... <<<CLICKS INSTALL>>>

...how would it be possible to make this open using "_self" as a target rather then opening a new frame?

Cheers.

Harvey.

??? What do you mean?

If you mean open into self, just edit the <a href="URL" target="_self"> bits.

If you mean make other links open into the forum, then keep using the URL command line to do it.

Mr L
06 Apr 2003, 01:02
Ah ok, didn't explain myself fully, sorry!

I am generally happy with other links opening in new windows, however this hack is great to have stuff appear to be an intergrated part of the board. To pull this illusion off fully, it'd need to open in the same target windows as the URL that the user clicks on rather then a launch a new window.

Would this be possible?

Either way, thanks for the quick response! :D

Erwin
06 Apr 2003, 01:05
To make the illusion full, you need to make all links go through the Command URL with target="_top".

eg.

all links have this format:

<a href="http://www.yoursite.com/forums/html.php?file=new.html" target="_top">

or something like that...

esfron
08 Apr 2003, 03:29
Test it on 2.3.0 final.

The file test.html is integrated into my forum with the header and footer around it but it's integrated in the vbulletin message box. Is it correct ?

Erwin
08 Apr 2003, 03:48
That's correct. That happens because we are not using any of our own custom templates - version 2 of this hack which is the quick "1 PHP file upload and work" version. (version 1 of this hack had a custom template).

You can always insert your own custom template. Make up a new template (easiest way is to copy the template "standarderror" and modify it). Place $errormessage anywhere you like where you want the contents of the HTML page to show up.

Then in html.php, find and change standarderror to the name of your new template.

esfron
08 Apr 2003, 05:56
I used your version 2 with your version 1: $content into the custom html template and eval("\$content = \"$buffer\";"); into html.php. It's working.

It will use only one template. Exact ? I have to format (font, size, css, etc) each external html file. Exact ?

thanks

(Install)

Erwin
08 Apr 2003, 06:28
Correct. :)

esfron
16 May 2003, 06:46
Hi,

I set up the hack so that unregistered guests, banned members and email confirmation members will get the no permission page but the the html file can be called directly from another websites i.e. to be linked from another websites : http://www.domainname/page.html

Any idea ?

alesis404
23 May 2003, 20:11
Great hack Erwin! just wondering now if it is possible if I have a directory with 100's of pages is there some way to search for just those pages instead of coming up with the normal .html file without the VB graphics wrapped around it?

For instance I would like to search and possibly index all pages like

http://mysite.com/forums/html.php?file=data/whatever.html

and not get

http://mysite.com/forums/data/whatever.html

So that users could see all pages in the default directory perhaps in an index page instead of pulling up the normal .html pages?

*Thanks again for something that might solve my problem....100's of pages I would like to have the VBB look and be searchable somehow

Erwin
24 May 2003, 05:46
Today at 06:11 AM alesis404 said this in Post #78 (http://www.vbulletin.org/forum/showthread.php?postid=399062#post399062)
Great hack Erwin! just wondering now if it is possible if I have a directory with 100's of pages is there some way to search for just those pages instead of coming up with the normal .html file without the VB graphics wrapped around it?

For instance I would like to search and possibly index all pages like

http://mysite.com/forums/html.php?file=data/whatever.html

and not get

http://mysite.com/forums/data/whatever.html

So that users could see all pages in the default directory perhaps in an index page instead of pulling up the normal .html pages?

*Thanks again for something that might solve my problem....100's of pages I would like to have the VBB look and be searchable somehow




I see what you mean.

Make up a .htaccess file, with the contents:


RewriteEngine on
RewriteRule ^data/([^$]*).html$ html.php?file=data/$1.html
RewriteRule ^[ft]([0-9]+)/s([^/]*)/(.+)$ /$3 [L]


Upload it to your forum directory. This only works if you are running an Apache server. See if that works.

Calling http://mysite.com/forums/data/whatever.html will automatically make you get integrated pages.

alesis404
24 May 2003, 09:03
Thank you for the quick reply Erwin...will try this in the a.m after some sleep...appreciated :)

alesis404
24 May 2003, 19:47
Hello again Erwin, just thought to mention I have Apache/1.3.24 and made a .htaccess with the code below and uploaded to

http://www.mysite.com/forums/.htaccess

*When i tried to access any page including my index I get "Internal server error"


**Thanks anyway for taking the time, if i can't get this to work will look for alternate method but was just looking for some way to integrate the VBB search engine and way to index all my extra file's in /data even if not possible with the VBB search engine

Thanks Erwin

Erwin
25 May 2003, 04:54
Weird - your server may not have .htaccess enabled or something like that.

Sorry, not much I can do to get around this without using redirection like that...

alesis404
25 May 2003, 13:59
Nah .htaccess is enabled...I have on other directorys...cool enough erwin I'll get it figured and appreciate your help :)

Erwin
26 May 2003, 01:35
Try my .htaccess file again, but remove the last line. See if that works. :)

alesis404
26 May 2003, 01:52
Tried again last line removed but get internal error again, just to be sure and this may be stupid question...The contents of the .htaccess file should just be the code correct? and not the standard .htaccess contents like

AuthUserFile /home/whatever/info/.htpasswd
AuthGroupFile /dev/null
AuthName "Hello"
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>


*I have simply made a file named .htaccess and inserted just your code and none of the usual .htaccess code like above...is this correct?

RewriteEngine on
RewriteRule ^data/([^$]*).html$ html.php?file=data/$1.html
RewriteRule ^[ft]([0-9]+)/s([^/]*)/(.+)$ /$3 [L]

**And then tried the second time with the contents of .htaccess being

RewriteEngine on
RewriteRule ^data/([^$]*).html$ html.php?file=data/$1.html

skorzguy
05 Jun 2003, 04:10
I used the hack and it worked but I don't understand how to make the VB DB work with it? Any info how to make this work? Here's what it looks like so far.

http://www.allstarchat.com/forums/html.php?file=index.html

Erwin
05 Jun 2003, 04:12
What do you mean make the vB Db work with it? Please explain, or use some examples.

skorzguy
06 Jun 2003, 00:59
The only instructions are:

RealChat can be easily integrated with any user profile ( membership ) system. There is a set of parameters which allow you to pass additional information from an user profile database to client applet. You pass these parameters by using dynamically generated HTML code. You can use any server-parsed HTML tools such as ASP, PHP, Perl, or whatever you like.

Tip: The easiest way is to do this is to use any of your existing site login scripts as a template, and modify it so after a successful login the script dynamically generates the applet page.

In the example below parameters have been added to pass the user's nickname, real name, age, and favorite drink. The user is also prohibited from changing his/her profile once logged in.

There is detaied explanation for what each parameter does in the Configuration directives reference section.


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


<applet
codebase = "."
archive = "RealChat.jar"
code = "rcs.client.RealChatClient.class"
name = "ChatClient"
width = "300"
height = "100"
MAYSCRIPT>

<param name="nick" value="BadJohn">

<param name="pValue1" value="John Doe">
<param name="pValue2" value="35">

<param name="pLabel3" value="Favorite drink:">
<param name="pValue3" value="beer">

<param name="canChangeProfile" value="no">

</applet>


I don't know how to get these tags to use the information from VB. I tried putting "$bbuserinfo[joindate], [joindate],and "post$[joindate] in the value field as an example and it was blank when I opened the page. What should I put in the value field, I don't have a clue.

dontpanic
06 Jun 2003, 21:16
This is a great hack, but how can I have the "vBulletin Message" which seems to be some sort of default actually be the title of the document.

An example of what I am refering to:
http://www.spamsession.com/1/vb1/html.php?file=library/wxp.htm&title=WXP

Thanks!
:)

dontpanic
06 Jun 2003, 21:28
Never mind, I figured it out after scratching my head a bit more.

Open your "standarderror" template and search for this code:
<b>vBulletin Message</b></normalfont></td>

Just replate with this:
<b>$title</b></normalfont></td>

And save the file with a new name.

In the html.php file, search for this code:
eval("dooutput(\"".gettemplate('standarderror')."\");");

And replace "standarderror" with the name of your new template.

Make sure you upload the html.php file after you finished.

You can see the final results here (for now at least):
http://www.spamsession.com/1/vb1/html.php?file=library/wxp.htm&title=An%20Introduction%20to%20EFS%20in%20Widnows%202000/Windows%20XP

:banana:

Erwin
07 Jun 2003, 01:35
Well done! :) Looks great. Yes, instead of using the standarderror template (which I use to make this hack extremely easy to use) you can use your own template, as long as you make the appropriate changes in the PHP file. :)

alesis404
11 Jun 2003, 21:02
I understand how this could be used for one page to get rid of "Vbulletin message" and replace with lets says "WinXP help"...but is it possible to have hundreds of pages with custom titles where it says "Vbulletin message"

Thanks again

**Not a custom title but what I mean is replacing "Vbulletin message" with something different lots of pages

For instance if you have 3 page's

WinXP help.htm
WinXP tuning.htm
Winxp tweak.htm

**Eg; replace "Vbulletin mesage" with

"WinXP help"
"WinXP tuning"
"Winxp tweak"

**Would it be possible all these pages could have there own message or title where the "Vbulletin message" text usually appears?

**I do not want them all the same, I would like them to all be different if this is at all possible, thanks for the help yet again :)

Erwin
12 Jun 2003, 04:44
Make a new template called "html". Copy and paste the contents of "standarderror" into it.

Replace "vBulletin message" in the template "html" with $title.

Then, use this format for your URLs:

http://www.your-forums/forums/html.php?file=xxx.html&title=Your Title

It should work. :)

alesis404
12 Jun 2003, 05:01
Thank you again Erwin for the quick reply, will try this later tonight when I have some free hours...appreciated :)

Intex
14 Jun 2003, 17:42
Erwin - the board I run is on an Intranet. There are various other servers that have html pages on them. Can you let me know how to include using the remote capability. I know you've mentioned you specifically created this hack without that functionality, but I'm not personally concerned about abuse as all board members are known / trusted.

If you're against posting here for general consumption, I'd really appreciate it if you could send me a private message.

Thx :).

childfun
20 Jun 2003, 13:34
This is a great idea, and it wa sjust what I was looking for, but I don't think it works with vb 3.0. I get this error :

Fatal error: Call to undefined function: gettemplate() in /home2/mychildf/public_html/html.php on line 48

Erwin
23 Jun 2003, 06:06
Obviously it wouldn't work with vB3 - if you note the title, it says vB 2.3.0 - :) - vB 2 hacks will not work for vb 3 because of the totally different code.

Intex
23 Jun 2003, 17:47
Erwin - I'm using your hack heavily now for a lot of my external pages. Can you tell me how to include a who's online location for an individual page. I'm using Firefly's Who's Online hack, but I'm pretty sure this goes by the filename, in your case html.php and therefore would show the same location for each different html file.

I'm happy to do this manually in who's online, but just wanted some of your expertise / guidance beforehand and how I might go about it.

Thx.

ImportPassion
30 Jun 2003, 19:09
this is awesome, i just stumbled upon this from this thread
http://www.vbulletin.org/forum/showthread.php?s=&threadid=54875

I hope I can include cfm files. Gonna try.

D

ImportPassion
30 Jun 2003, 19:19
ahh....only works with static pages... :(

DarkSavior
25 Jan 2004, 16:21
Is there a way to make it call different template by the file extension? As like if I open a HTML file, it calls the html template, and for txt files it calls the txt template.

Erwin
12 Jun 2004, 01:27
Upgraded for vB3:
http://www.vbulletin.org/forum/showthread.php?t=66084

Rastus
11 Oct 2005, 15:55
Will this work with 3.5.0 ?