Jump to content

A PHP Contest, Anyone ?


Recommended Posts

PHP, Hypertext PreProcessor (or originally "Personal Homepage") is a server-side scripting language to write dynamic webpages. Our forum engine is written in php, our websites will be, too.

Basically you program your site with arrays, classes, functions, methods, variables and everything a real programming language has to offer (PHP5 will offer some more OOP stuff, so that it will be a full OOP-capable language like JAVA very soon) and send the code to your server.

Then the server generates the html and sends it back to the browser, which displays it.

An example:


<?php

echo "<table><tr><td>Hallo Leute</td></tr></table>";

?>

will put a simple table with "Hallo Leute in it" to the screen.

However, there are complex functions with classes etc.

Here is one from the Task System I made for WFG (and which i am still developing):


<?php

/*
+--------------------------------------------------------------------------
|   Wildfire Games Intranet
|   ========================================
|   by Tim [DarkAngelBGE] Koschuetzki
|   ========================================
|   Email: DarkAngelBGE@aol.com
+---------------------------------------------------------------------------
|
|   > Index module -- Manages the entire Task System
|   > Module written by Tim Koschuetzki
|   > Date started: 11th November 2003
|
|     > Module Version Number: 1.0.5
+--------------------------------------------------------------------------
*/



class cl_task_system
{

var $task_html;


//-------------------------------------------
// CONSTRUCTOR FUNCTION
//
// Decides what to do based on the url vars
// act and code, calls the Email Reminder
// func and puts up the page's title as well
// as the navbar stuff
//-------------------------------------------

function cl_task_system()
{

 global $site, $std_func, $DB, $display, $INFO;

 //-------------------------------------------
 // Parse the header, left nav and right nav
 // to the Skinning System
 //-------------------------------------------

 $std_func->std_navbar( &$l_nav_cats, &$l_nav_items, &$r_nav_array );

 $display->add_output( $site->html->header( $INFO['site_name'].' -- Task System' ) );
 $display->add_output( $site->html->left_nav( $l_nav_cats, $l_nav_items ) );
 $display->add_output( $site->html->right_nav( $r_nav_array ) );


 //-------------------------------------------
 // Load the Skin Stuff
 //-------------------------------------------
 
 $this->task_html = $std_func->load_template( 'task' );
 
 
 //-------------------------------------------
 // Decide what to do
 //-------------------------------------------

 switch ( $site->vars['input']['code'] )
 {
  case 01: $this->new_task();
  break;
  case 02: $this->view_task();
  break;
  case 03: $this->edit_task();
  break;
  default: $this->view_task();
 }

 // Remind people of their tasks
 $this->email_reminder();
 
}

...

} //class

It is the master class for the Task System Module and its contruct function works out, which function to start upon some values of variables.

Got a first insight ? ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...