Author |
Message |
izone
Involved
![Involved Involved](modules/Forums/images/ranks/4stars.gif)
![](modules/Forums/images/avatars/Animaniacs/Animaniacs_-_Pinky.gif)
Joined: Sep 07, 2004
Posts: 354
Location: Sweden
|
Posted:
Thu Oct 07, 2004 2:39 am |
|
Hi!
I'm trying to make a module and because I'm not so good on php I can make it works. So please help me.
In this module I want to have a frontpage with a little text and a link text at the end of it to another file (file2.php). When user click on this link, I want to file2.php whit a lot of text to open. I've tried on and on but no result.
It's very easy to do this with html but for me difficult to make it works for Nuke.
Please help me.
Best regards |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spottedhog
Regular
![Regular Regular](modules/Forums/images/ranks/2stars.gif)
![](modules/Forums/images/avatars/blank.gif)
Joined: Jun 02, 2004
Posts: 88
|
Posted:
Thu Oct 07, 2004 6:58 am |
|
There is an addon called Static HTML, which uses html pages inside a PHP Nuke-like module. If you can easily do what you want with html, then this may be what you need. We have this in our Downloads at www.nukehelp.biz and it is probably on some other nuke download websites.
The code will display your header, footer, and left blocks along with your html page. You will need to hard code the link if you use original Modules Menu block.
Here is a working example:
http://www.nukehelp.biz/static.php?file=index.htm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
Site Admin/Owner
![](modules/Forums/images/avatars/45030c033f18773153cd2.gif)
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Thu Oct 07, 2004 7:07 am |
|
You can also just code a standard module and use the include() function to bring in your static html pages. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
izone
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Oct 08, 2004 3:11 am |
|
Thank you all for anwering.
Raven I don't know how to use that code (I'm really newbie with php).
A friend gave me this code:
Code:
<?php
if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
$index = 0; // 0 : do not show right blocks - 1:show right blocks
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
include("header.php");
if (file_exists("modules/$module_name/copyright.php"))
$ACCEPT_FILE['test1.php'] = 'test1.php';
$ACCEPT_FILE['test2.php'] = 'test2.php';
OpenTable();
echo "<center><img src=\"modules/$module_name/test.gif\" border=\"0\">"; // Your Image
CloseTable();
OpenTable();
$pagename = $ACCEPT_FILE[$page];
if (!isSet($pagename)) $pagename = "main.php";
include("modules/Test/$pagename");
CloseTable();
include("footer.php");
?>
|
Which I tested and it works. I want please your opinion on this. The main.php is the first page and from this page I can link to test1.php and test2.php etc.
Becuase this module will have over 400 pages I have to make 400 pages e.g. test1.php ---> test400.php (or page1 to page400.php). Do I have add the code for all of them in this file (this is index.php)? I mean do I have to add this part of code for all 400 pages:
Code:
$ACCEPT_FILE['test1.php'] = 'test1.php';
$ACCEPT_FILE['test2.php'] = 'test2.php';
|
Best regards |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spottedhog
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Oct 08, 2004 3:23 pm |
|
Here is a slight variation of what Raven described:
Code:<?
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly...");
}
if(!IsSet($mainfile)) { include ("mainfile.php"); }
$index=0;
$go_to_address1="modules/cPanel_Users_Guide/index.html";
$go_to_address=rawurldecode($go_to_address1);
include("header.php");
OpenTable();
echo "<center><h4><a href=\"index.php\">Click to close.</a></h4></center>";
echo "<iframe SRC=\"".$go_to_address."\" width=\"100%\" height=\"1000\"
framespacing=0 frameborder=no border=0 scrolling=auto></iframe>";
CloseTable();
include("footer.php");
die;
?>
|
It is the index.php page for this module:
http://www.nukehelp.biz/modules.php?name=cPanel_Users_Guide
I think that module may have more than 400 pages in it.... not sure really.
With this method you will not have to recode anything. Just make sure to have an index.html file and then have all the other pages interlinked.
To use this, change the module name to what you wish, then save the file as an index.php file in a module folder with the same name. Also, put at least the index.html in that folder. Then put all the other html pages within the folder in whatever folder format you have them all linked with.
This method will have you changing only a very few words of code and you will spend much more time uploading the files than anything. And.... you will not have to change a single thing within your 400 html pages. It may take about 1 minute to make all the changes you need to be able to display ALL of your 400 html pages. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Lithium
Hangin' Around
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Mar 30, 2004
Posts: 28
|
Posted:
Fri Oct 08, 2004 6:38 pm |
|
I just ran across this and that works great for what I need it for. I would like however for me to be able to use &index=1 on the url to make it centered and have the blocks to the right, however, that doesn't work nor can I find how to add that to the above code...
Can anyone help on this? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Lithium
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Oct 08, 2004 6:40 pm |
|
Scratch that, it was staring me right in the face. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
izone
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Oct 09, 2004 4:31 am |
|
Thank you very much Spottedhog!
I'm not able to test it right now but tonight I'll do it. As I see from your page it is great.
Regards |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
izone
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Oct 09, 2004 1:44 pm |
|
spottedhog you are the best.
It works great. Thank you very much.
But I've a question:
How can I use the same background image or colour as the choosen theme, for my htmls?
This is not only for my site and diffrent sites has diffrent theme and ....
I wonder if I could use the choosen theme's css for my htmls.
Do you think it could be possible?
Best regards |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spottedhog
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Oct 09, 2004 7:11 pm |
|
As you can see in the code, it displays the html page in an IFrame. The background would be what is the background of the html page. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
beetraham
Regular
![Regular Regular](modules/Forums/images/ranks/2stars.gif)
![](modules/Forums/images/avatars/d4f639af415ef4a5704fe.gif)
Joined: Dec 13, 2003
Posts: 94
Location: Finland (EU)
|
Posted:
Sun Oct 10, 2004 11:02 am |
|
izone wrote: |
But I've a question:
How can I use the same background image or colour as the choosen theme, for my htmls?
This is not only for my site and diffrent sites has diffrent theme and ....
I wonder if I could use the choosen theme's css for my htmls.
Do you think it could be possible?
|
Hi izone,
Please find enclosed reference to approach that I've been using for included static HTML pages to reach out the *same appearance* as what is seen with PHP-Nuke:
Let's assume, that initially your static HTML page struct is something similar to this:
Quote: |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR>
</HEAD>
<BODY>
... [body struct continued]... |-->
|
Now in order to grab out the *very-much-similar-to* form of appearance, make it look like as follows:
Quote: |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR>
<LINK REL="StyleSheet" HREF="http://www.yoursite.com/themes/subBlack3d/style/style.css" TYPE="text/css">
</HEAD>
<BODY>
... [body struct continued]... |-->
|
Legend : colour code blue == added section
So, basically all you need to do is to add *fixed pointer* to the CSS Style Sheet to be used - just before the closing HEAD tag.
Hope this helps.
BR,
-beetraham
Quote: |
[added comment after original post:]
Please note that you should not apply this approach when using the "INCLUDE" approach (i.e. including HTML pages to MODULE structs), as it would most probably be in contradiction to the CSS Style Sheet actively used by PHP-NUKE - i.e. some of the PHP-Nuke CSS declarations would get inevitably overridden by this imaginative INCLUDE associated CSS declaration.
When using with *iFramed* approach (as stated by spottedhog), you can use the approach with a-n-y CSS Style Sheet considered appropriate to meet your targets as iFramed static HTML page is totally independent from PHP-Nuke CSS Style Sheet usage.
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
izone
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Oct 12, 2004 2:25 am |
|
Thank you beetraham
It is what I am looking for almost!!!
Is there a way to write a code like this one you wrote here to use CSS which can tell the docs: U Mr. Html, go and find out which theme is just this user have choosen right now and use the CSS for just thiat theme right now! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|