php forum
php mysql forum
php mysql smarty
 
Topic Options
#216480 - 05/07/02 05:12 AM Creating new pages
Sat4all Offline
Member

Registered: 04/30/02
Posts: 151
Loc: The Netherlands
I have been expirimenting with PHP for the first time and came up with this: <br /> <br />I create a new page called html2ubbt.php and drop it in the root of my threads dir. <br /> <br />In this page I put this code: <br /><pre><font class="small">code:</font><hr><? <br />// Require the library <br /> require ("main.inc.php"); <br /> <br />// --------------------- <br />// Send the page to them <br /> $html = new html; <br /> $html -> send_header("testpage",$Cat,0,0,0,0,$user); <br /> $html -> table_header("testpage"); <br /> <br /> $phpurl = $config['phpurl']; <br /> $html -> open_table(); <br /> readfile("{$config['path']}/html/test.html"); <br /> $html -> close_table(); <br />// ------------- <br />// Send a footer <br /> $html -> send_footer();</pre><hr> <br /> <br />Then I create a folder "html" in the threads root <br /> <br />In there I upload my test.html file which contains just plain html: <br /> <br /><br> <br />this is just a test<br> <br /><br> <br />this is just a test<br> <br /><br> <br />this is just a test<br> <br /><br> <br /> <br />If you go here you can see the result: <br /> <br />www.sat4all.com/board/html2ubbt.php <br /> <br />What I want to do now is give the background of the table a variable which can be found in the stylesheets so the standard background color can be set to the same background color used on the forum summery page. <br /> <br />Then most importantly, I want to replace "testpage" with a varible called "name" which must be defined by the way you call the html2ubbt.php page. <br /> <br />example: yourdomain.com/ubbthreads/html2ubbt.php?name=tespage or something like that. <br /> <br />Then I would like to replace "test.html" with a variable "file" which calles the required file. <br /> <br />Example: yourdomain.com/ubbthreads/html2ubbt.php?name=tespage&file=test.html or something like that. <br /> <br />Can someone help me with this. It could be a nice addition to ubbthreads. <br /> <br />Regards, <br /> <br />Ron.


Edited by Toxicq (05/07/02 05:40 AM)
_________________________
Those who fail to read ask many questions:-)

Top
#216481 - 05/07/02 04:54 PM Re: Creating new pages [Re: Pomegranate]
Sat4all Offline
Member

Registered: 04/30/02
Posts: 151
Loc: The Netherlands
I managed to do some changes by myself even though I am a absolute PHP rookie:<br /><br />http://www.sat4all.com/board/html2ubbt.php?name=test&file=html/test.html<br /><br />The code now looks like this:<br /><pre><font class="small">code:</font><hr><br /><?<br />// Require the library<br /> require ("main.inc.php");<br /> <br />// ---------------------<br />// Send the page to them<br /> $html = new html; <br /> $html -> send_header("$name",$Cat,0,0,0,0,$user);<br /> $html -> table_header("$name");<br /><br /> $phpurl = $config['phpurl'];<br /> $html -> open_table();<br /><br /> if(substr($file,-4)!=".htm" && substr($file,-5)!=".html" ){<br /> echo "Sorry, only HTML is allowed here!"; <br /> $html -> close_table();<br /> $html -> send_footer();<br />}<br /> else {<br /> if( substr($file,0,5)!="./../" && substr($file,0,7)!="http://" ){<br /> include ($file);<br /> $html -> close_table();<br /> $html -> send_footer();<br />}<br /> else {<br /> echo "Sorry, you can not use this script for a page which does not belong to this website"; <br /> $html -> close_table();<br />}<br />}<br />?><br /></pre><hr> <br /><br />I just don't know how to point the background color of the table (now it's blue) to the grey color in my the stylesheet!<br /><br />I NEED HELP!<br /><br />regards,<br /><br />Ron.
_________________________
Those who fail to read ask many questions:-)

Top
#216482 - 05/07/02 05:19 PM Re: Creating new pages [Re: Pomegranate]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
Looking good <img src="/forum/images/icons/smile.gif" alt="" /><br /><br />Right after $html -> open_table(); add this:<br /><br />echo "<TR><TD class=\"lighttable\">";<br /><br />and just before $html -> close_table(); add this:<br /><br />echo "</TD></TR>";<br /><br /><br />Also you may want to specify the value 1 when opening the table if you want to open it at 100% width. open_table(1)<br /><br />I think that should work though <img src="/forum/images/icons/smile.gif" alt="" />
_________________________
~Dave
ChattersOnline.com

Top
#216483 - 05/07/02 05:47 PM Re: Creating new pages [Re: sjsaunders]
Sat4all Offline
Member

Registered: 04/30/02
Posts: 151
Loc: The Netherlands
Ok I made those changes and it workes as advertised:-)<br />Can you also tell me what changes I need to make to replace the the location of the html directory with a variable wich can be changed in the script itself?<br />Is it also possible to display this without the menu bar?<br /><br />Regards,<br /><br />Ron.
_________________________
Those who fail to read ask many questions:-)

Top
#216484 - 05/07/02 06:01 PM Re: Creating new pages [Re: Pomegranate]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
Unfortunately all requests to send_header include the menu bar. <img src="/forum/images/icons/frown.gif" alt="" /><br /><br />Could you specify the location of the directory as you do with the file name?<br /><br />Example: yourdomain.com/ubbthreads/html2ubbt.php?name=tespage&file=test.html or something like that.<br /><br />changed to<br /><br />Example: yourdomain.com/ubbthreads/html2ubbt.php?name=tespage&file=test.html&location=myfolder or something like that.
_________________________
~Dave
ChattersOnline.com

Top
#216485 - 05/08/02 03:56 AM Re: Creating new pages [Re: sjsaunders]
Sat4all Offline
Member

Registered: 04/30/02
Posts: 151
Loc: The Netherlands
That is not what I meant:) <br />I would like to include the location of the HTML directory in the php file itself but use a varible in the top of the file to specify the directory. <br />I tried to do that but a was getting parse errors all the time. <br />I short: I would like the html/ out of here: <br />http://www.sat4all.com/board/html2ubbt.php?name=test&file=html/test.html <br />and into the php file as a variable to be set in top of the file for configuration. <br />I really a rookie, I just managed to get this working by looking at a lot of other scripts and just copy and paste it togethet untill it worked, sorry:-)) <br /> <br />It would be bether to take the variable "name" from the name of the HTML file. <br />If you call the html file Testpage.html the name wich appears in the table would be Testpage as well, but I don't know if that is possible. <br /> <br />Regards, <br /> <br />Ron.


Edited by Toxicq (05/08/02 03:58 AM)
_________________________
Those who fail to read ask many questions:-)

Top
#216486 - 05/21/02 01:31 PM Re: Creating new pages [Re: Pomegranate]
casper_dup1 Offline
Member

Registered: 03/10/02
Posts: 175
Loc: Boston, MA
<blockquote><font class="small">In reply to:</font><hr><br /> It would be bether to take the variable "name" from the name of the HTML file <br /><br /><hr></blockquote> <br /><br />Anyone come up with a way to do this yet?<br /><br />Goal: <br />1. Pull the title of the displayed page from a variable called from the data file.<br />2. Use that variable or another to display that title in the header bar.<br /><br />Is it possible to pull that variable from the data file if it is declared as a variable? <img src="/forum/images/icons/crazy.gif" alt="" />
_________________________
http://www.unnecessaryroughness.com

Top



Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks