Location: PHPKode > projects > net2ftp > help_files/04-developer.html
<title>net2ftp help</title>
<link rel="stylesheet" type="text/css" href="../skin1-blue.css">

<body style="margin-left: 70px; margin-right: 70px;">

<div class="header21">Participate in the development!</div>

Never worked on an open source software project before? Read Havoc Pennington's article <a href="http://www106.pair.com/rhp/hacking.html">Working on Free Software</a> to find out what it's like. <br /><br />

If you're interested in helping with the development of net2ftp, feel free! <br />
Even if you can't code, there are plenty of other things to do, such as:<br /><br />
<li> design the user interface</li>
<li> create new logos and icons </li>
<li> test new versions </li>
<li> translate messages </li>
<li> write reviews </li>
<li> write documentation (for end users and developers)</li>
<li> maintain the downloadable zip files </li>

Post a message on the forum or send an email to david AT net2ftp DOT com.<br />

<br /><br />

<div class="header21">Overview of the code</div>

net2ftp uses one script file (index.php) for all screens: login, browse, copy, ... <br /><br />

The functions are stored in different include files according to what they do:
<li> <u>homepage.inc.php</u> contains functions to print the login page and net2ftp homepage </li>
<li> <u>manage.inc.php</u> contains the high-level functions to print the screens (copy, upload,...) </li>
<li> <u>filesystem.inc.php</u> contains the low-level functions that execute FTP commands or local filesystem commands </li>
<li> <u>browse.inc.php</u> contains all functions related to the Browse Screen (requesting the ftp_rawlist, parsing it, showing the output) </li>
<li> <u>authorizations.inc.php</u> contains functions to check the authorizations </li>
<li> <u>html.inc.php</u> contains functions which print the HTML header and footer </li>
<li> <u>httpheaders.inc.php</u> contains the code that is related to sending HTTP headers (needed for example to trigger the Save As popup of your browser, when you want to download a file) </li>
<li> <u>registerglobals.inc.php</u> registers the variables and does some preliminary checking </li>

Two state variables (state and state2) determine which screen is shown.<br />
Below is some sample code taken from index.php.<br />

<textarea cols="70" rows="15" wrap="off">

----- sample code from index.php -----

switch ($state) {
// When $state is not defined, it is set to "login" to show the Login Screen

	case "login":
		// Show the login screen
	case "browse":
		// Browse screen
		browse($state2, $directory, $FormAndFieldName, $browse_details);
	case "manage":
		// Actions: copy, upload, rename, ...
		// Almost all actions have 2 screens: a form and a result screen.
		// Both are handled by the same function.
		manage($state2, $directory, $entry, $selectedEntries, $newNames, $dirorfile, $formresult, $chmodStrings, $targetDirectories, $copymovedelete, $text, $wysiwyg, $uploadedFilesArray, $uploadedArchivesArray, $use_folder_names, $command, $to, $message);
	case "bookmark":
		// Bookmark screen
		bookmark($directory, $url, $text);
	case "logout":
		$resultArray['message'] = "Unexpected state string. Exiting."; 
		printErrorMessage($resultArray, "exit", "");


<br /><br />

The login information and state variables are passed from screen to screen via forms. <br />
There is a function to print the login information in an HTML form: printLoginInfo(). <br />

<br /><br />

<div class="header21">Sessions and cookies</div>

For the moment net2ftp doesn't use sessions. 
This was to avoid session timeouts after 20 or 30 minutes; you can work without worrying about it for as long as you want. 
In the meanwhile some users have pointed out on the forum how to avoid session timeouts, but I don't know what benefit sessions would bring. 
There isn't really any information that has to be stored during a session.

<br /><br />

Cookies are used to store the last FTP server, username and directory used.

<br /><br />

<div class="header21">Settings</div>

net2ftp can be configured using the settings.inc.php and settings_authorizations.inc.php files. 
When a function needs to access a variable, this variable is declared as global in the beginning of the function.
These variables are never changed during the execution of the program.<br />

<br /><br />

<div class="header21">Icons</div>

net2ftp uses 2 icon sets: <a href="http://www.icon-king.com">Nuvola</a> and <a href="http://www.carlitus.net">Noia</a>.
Which icon set is used depends on the skin; all the code behind icons is in the /includes/skins.inc.php file.

There are 4 kinds of icons within net2ftp:
Action icons: when you press on them, an action is triggered. 
There is an onMouseOver effect and onClick event. 
These icons are 32x32 pixels.
Mime icons: they indicate which kind of file is shown in the browse view. 
No onMouseOver effect. 
These icons are 16x16 pixels.
Settings icons (not yet in use): they indicate if a setting is on or off -- for example if the FTP transfer mode is ASCII or BINARY. 
When the mode is ASCII, the ASCII icon is shown with a border, and there is no onMouseOver effect. 
The BINARY icon is shown without a border and there is an onMouseOver effect. 
The code for this FTP transfer mode is already written but not yet in use.
Title icons (not yet in use): they will be placed next to the title on action screens.

<br /><br />

In (recent) Mozilla-based browsers, PNG images with a transparent background are shown fine. 
In Internet Explorer however they are not: the transparent regions are grey.
Microsoft has issued a note on how to fix this: <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294714">http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294714</a><br /><br />

The onMouseOver effect increases the icon size from 32x32 to 34x34 pixels.
To avoid that the rest of the content would move, there is margin of 2px when the icon is 32x32, and a margin of 0px when it is 34x34.<br /><br />

<br /><br />

<div class="header21">Requested features</div>

See the <a href="../_TODO_v0.82.txt">TO DO</a> file.

<br /><br /><br /><br />

Return current item: net2ftp