Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Seeking applications ...
Author Message
postal
New Member
New Member



Joined: Dec 07, 2005
Posts: 2

PostPosted: Thu Dec 15, 2005 6:22 pm Reply with quote

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.
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Thu Dec 15, 2005 9:32 pm Reply with quote

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
 
View user's profile Send private message
postal







PostPosted: Fri Dec 16, 2005 3:01 am Reply with quote

Thanks Raven, I'll let you know how I get on :>

Regards
Postal.
 
dcasmr
Worker
Worker



Joined: Feb 06, 2004
Posts: 147

PostPosted: Fri Dec 30, 2005 2:26 am Reply with quote

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?
 
View user's profile Send private message
Raven







PostPosted: Fri Dec 30, 2005 2:32 am Reply with quote

You learn by trying Wink. 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







PostPosted: Fri Dec 30, 2005 10:31 am Reply with quote

Cool, we will have him working in PHP/MySQL. When he is done, we will check here again.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Seeking applications ...

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©