PHP-Nuke
  Strona głównaDownloadForumFAQ Zaloguj się  
 Menu
 Home :
 Strona główna
 Demo PHPNuke
 Archiwum
 Użytkownicy :
 Ekipa phpnuke.org.pl
 Lista Użytkowników
 Prywatne wiadomości
 Online
 Menu :
 Regulamin
 Kontakt
 Linki
 Download
 Dokumentacja :
 FAQ
 Idiots Guide
 Polecamy
» domy drewniane
 Tools
 Module Creator
 Block Creator
 HTML to PHP
 HTML to Javascript
 Online HTML Editor
 Meta Tag Creator
 Popup Creator
 Scrollbar Creator
 Hex Colors
 Previewer
 HTML Encoder
 URL Encoder
 Rot-13 Encoder
 DB Generator
 MD5 Calculator
 Top Themes
1.Tesko1123
2.BLock759
3.ICGstation595
4.Dw-Advance487
5.Fiblack3d467
6.ZoneBlue434
7.Cobalt361
8.Aeolus349
9.PH2BLUE332
10.XPMidnight315
The Complete Idiots Guide to Nuke  v.3.2

Idiots Guide Home Page
About PHP-Nuke
Installation
The Administration panel
Add-On types
Forums
Developers Guide to Nuke
Troubleshooting
Useful Links
Development Home
Globals and Common Functions
Modules Development
Theme Development
Blocks Development
Admin Section Development
Database Integration

Globals and Common Functions

When you program, there are quite a few globals and functions that can be called by the block, module or theme that you're creating. This section is here to list the most commonly used and what they're for.

Common Globals

$bgcolor1First Background Color as defined in the themes. Normally matches the background color of the tables the module use.
$bgcolor2Second background color. Many purposes for this color, normally as a darker color for tables etc. Again, defined in the theme.
$textcolor1Primary text color used in the theme
$textcolor2Secondary text color used in the theme
$dbThis calls the database functions, as talked about in the Database Integration section of this developers guide
$prefixThis is so you can allow for users who don't use nuke as a prefix to their database tables
$user_prefixSame as $prefix except that it is specific to the Users table (in case it's different from the rest of the database).
$userinfoThis is used to call the information about the user currently browsing the page. It's an array using variables like user_id, username, user_email and the like.
$ThemeSelThis is used in themes so that the theme's directory can be renamed without causing problems with image paths etc.
$module_nameName of the modlue currently being viewed - must be defined at the beginning of the module file
$module_dirDirectory relative to the site root directory that the module is in. Again, needs to be defined at the top of the module
$userUser Cookie. Used in the isuser function (see below)
$adminAdmin cookie. Used in the isadmin function (see below)


This doesn't account for all of the globals. There are dozens more, but you won't use or need most of them.

Common Functions

These are the functions found in Nuke that can be called from any module etc.

get_lang($module_name); This is used to initialise the language files of the module you are viewing. Blocks have their language definitions in the main /language/lang-$language.php files
isuser($user) This is used to check to see if the person currently viewing the page is a logged in member of the site. Normally it's encased in an if statement
isadmin($admin)Admin version of the isuser function. Again, normally used to check if user is a logged in admin and normally encased inside an if statement
title($title);This is to define the title for your module. It opens a full-width table which displays the title in the center of the box in a heading font
OpenTable();Opens a full-width table in the theme's colors. Normally used to contian pages for modules.
CloseTable();Closes a table opened with OpenTable();
OpenTable2();Opens a table which matches the width it's contents require (no width set). In the theme's colors. Normally contains any information within an OpenTable(); table which needs to be seperate, but still contained within the large table.
CloseTable2();Closes the smaller table opened in OpenTable2();



Last Updated: July 6th 2003
 

Copyright © 2004-2009 by phpnuke.org.pl :: PHP-Nuke Copyright © 2004 by Francisco Burzi.
Zdjęcia ślubne
Tworzenie strony: 0.16 sekund
Zapytań: 10