Main | Search

Question
Sort: Ascending / Descending
What happened to modules.php?
What are $mainindex and $adminindex?
So, what is getlink() and how can I use it?
What about adminlink()?

Answer
What happened to modules.php?

While developing CPG-Nuke, we moved all functions from modules.php to index.php. Thus, the call for a module changed from modules.php?name= to index.php?name=.

However, we left modules.php in place for compatibility with third party addons and themes.


What are $mainindex and $adminindex?

$mainindex is a new variable that we created for use in config.php. A default value of index.php is assigned to this variable, and acts as the main index page. Perhaps you wish to use cms.php instead of index.php for your homepage and calls to modules. Simply change the value of $mainindex in config.php and rename the file index.php to the name of your choice.

Read more on $mainindex here


$adminindex serves the same purpose, just for the administration menu.

Read more on $adminindex here


So, what is getlink() and how can I use it?

getlink() is a function we created for ease of writing URLs. Using getlink() is a much better alternative to using $mainindex when writing URLs.

To convert a URL using modules.php, follow this example:

modules.php
PHP:
echo '<a href="modules.php?name=Search">Search</a>';

getlink()
PHP:
echo '<a href="'.getlink('Search').'">Search</a>';

Read more on function getlink() here


What about adminlink()?

The same concept applies for adminlink().

To convert a URL using admin.php, follow this example:

admin.php
PHP:
echo '<a href="admin.php?op=logout">Logout</a>';

adminlink()
PHP:
echo '<a href="'.adminlink('logout').'">Logout</a>';

Read more on function adminlink() here


stopsoftwarepatents.eu petition banner
User Info [x]

Welcome Anonymous

Nickname
Password
(Register)

Languages [x]

Community [x]

Support for DragonflyCMS in a other languages:

Deutsch
Español

X-links [x]
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

Preview theme [x]
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.


You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
This page generated in 0.1587 seconds with 11 DB Queries in 0.2227 seconds
Memory Usage: 1.49 MB
Interactive software released under GNU GPL, Code Credits, Privacy Policy