PHP Web Host - Quality Web Hosting For All PHP Applications Clan Themes! We make clans look good!!
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
thundarfoot
Regular
Regular


Joined: Jan 16, 2008
Posts: 75

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

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: 9136
Location: Arizona

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

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".
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 Back to top

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


Joined: Jan 16, 2008
Posts: 75

PostPosted: Mon Jan 21, 2008 3:56 pm Reply with quote Back to top

thank you both
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


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

PostPosted: Mon Jan 21, 2008 4:58 pm Reply with quote Back to top

Forgot that book is also available as a pdf download.
View user's profile Send private message
thundarfoot
Regular
Regular


Joined: Jan 16, 2008
Posts: 75

PostPosted: Mon Jan 21, 2008 6:00 pm Reply with quote Back to top

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


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

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

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
Regular
Regular


Joined: Jan 16, 2008
Posts: 75

PostPosted: Mon Jan 21, 2008 11:57 pm Reply with quote Back to top

ty
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum