Author |
Message |
postal
New Member


Joined: Dec 07, 2005
Posts: 2
|
Posted:
Thu Dec 15, 2005 6:22 pm |
|
What I'm after is a module / block that will let me paste in text and also images (I'm starting a car tech site so need the images to direct the readers)
Anyone know of something that could do this please?
Kind Regards
Postal. |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Thu Dec 15, 2005 9:32 pm |
|
The code inside a block and/or a module is html code. Whether written in PHP, ASP, Java, etc., the compiler translates it into HTML code and sends it to the browser. Here would be a couple of different ways to do what you're asking.
One of the simplest ways is to just create your page using pure html and save it somewhere, like my.html. Remember that nuke already supplies the <html>, <head>, and <body> tags (and the closing ones too). So, build your page assuming that skeleton is already there. So, in out example, you could build a simple page with the text, css, javascript, html, etc. Then, in your nuke module, you would have something like this. I have hilighted the special code in red.
Module template
//Begin Module Code
if ( !defined('MODULE_FILE') ) {
die("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$pagetitle = "- $module_name";
include("my.html");
include("footer.php");
//End Module Code
There are other ways to do this, but hopefully this will get you started.
A block can be just as easy.
//Begin Block Code
if ( !defined('BLOCK_FILE') ) {
Header("Location: index.php");
die("You cannot access this file directly...");
}
$content = file_get_contents("my.html");
//End Block Code |
|
|
|
 |
postal

|
Posted:
Fri Dec 16, 2005 3:01 am |
|
Thanks Raven, I'll let you know how I get on :>
Regards
Postal. |
|
|
|
 |
dcasmr
Worker


Joined: Feb 06, 2004
Posts: 147
|
Posted:
Fri Dec 30, 2005 2:26 am |
|
Raven,
We found a volunteer who is skilled in PHP, Mysql and Java to help us develop scripts for our nonprofits organization running PHPNuke. He does not know PHPNuke.
One of the "scripts" will be a Project catalog. (To store projects that need funding - Photos, descriptions, beneficiaries, donate, etc...)
We would like to transform that script into a Nuke module. Would your above example work? |
|
|
|
 |
Raven

|
Posted:
Fri Dec 30, 2005 2:32 am |
|
You learn by trying . That is a "wrapper" and will work 95% of the time. Since it is so easy to test, just one include statement, try it out, see where the bugs are, and just work them out. |
|
|
|
 |
dcasmr

|
Posted:
Fri Dec 30, 2005 10:31 am |
|
Cool, we will have him working in PHP/MySQL. When he is done, we will check here again. |
|
|
|
 |
|