Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
thundarfoot
Regular
Regular


Joined: Jan 16, 2008
Posts: 75

PostPosted: Mon Jan 21, 2008 5:25 am Reply with quote

I am a noob. Here is my sign

I have written a small script in php that has a drop down select and displays the output of a mysql table. which is a huge victory for me.

I want to turn this into a module or block but I am not sure where to begin.

Can anyone point me to any good tutorials or have any advice for me?

Thanks in advance!
 
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9453
Location: Arizona

PostPosted: Mon Jan 21, 2008 6:08 am Reply with quote

In its most simplest form, here would be a model module: let us call the module Sample_Module. Create the following file:

modules/Sample_Module/index.php

Now, the basic structure of that index.php file could be:

Code:


<?php
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 = '- You Module Name'; // If you need this to be multi-lingual then you will have to use language defines
include_once 'header.php';
OpenTable();

//your code goes here

CloseTable();
include_once 'footer.php';
?>


That should at least get you started in the right direction. Use other module's code as your "guide".

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Mon Jan 21, 2008 1:22 pm Reply with quote

Also google the PHP-Nuke How-To. It has some old info, but should get you started if you study it and existing modules.

There is also a book called "Building Websites with PHP-Nuke" by Paterson which discusses building modules, blocks, and modifying themes.

_________________
Only registered users can see links on this board! Get registered or login! - An Event Calendar for PHP-Nuke
Only registered users can see links on this board! Get registered or login! - A Google Maps Nuke Module 
View user's profile Send private message
thundarfoot
PostPosted: Mon Jan 21, 2008 3:56 pm Reply with quote

thank you both
 
Gremmie
PostPosted: Mon Jan 21, 2008 4:58 pm Reply with quote

Forgot that book is also available as a pdf download.
 
thundarfoot
PostPosted: Mon Jan 21, 2008 6:00 pm Reply with quote

Cool I will google for it, using the above example, and adding my script I have it working quite nice...

Except it is showing a active but invisible, and only seems to display for admin.
any ideas?

thanks for the example!
 
fkelly
Former Moderator in Good Standing


Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Mon Jan 21, 2008 6:45 pm Reply with quote

You need to go into the admin control panel, select modules and edit that module to make it visible.
 
View user's profile Send private message Visit poster's website
thundarfoot
PostPosted: Mon Jan 21, 2008 11:57 pm Reply with quote

ty
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

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 ©