The best way to learn how to use the WebCore is by example. See the documentation for more information.

The requested URL is always shown first; if a page uses one or more WebCore templates, those are shown afterwards.

00 <?php
01   include_once ('quake/init.php');
02  
03   $Page->location->append ("Quake III Arena", "./");
04   $Page->location->append ("Maps", "maps.php");
05  
06   $map = read_var ('map');
07   if ($map)
08   {
09     $Page->ensure_database_exists ();
10     $db = $Page->database;
11     $db->query ("SELECT * FROM quake_iii_maps WHERE map = '$map'");
12  
13     if ($db->next_record ())
14     {
15       $name = $db->f ("name");
16       $version = $db->f ("version");
17       $has_details = $db->f ("has_details");
18       $Page->location->append ($name);
19       $Page->title->subject = "$name - $map";
20     }
21     else
22     {
23       $Page->location->append ("Unknown Map");
24       $Page->title->subject = 'Unknown Map';
25     }
26   }
27   else
28   {
29     $Page->location->append ("Unknown Map");
30     $Page->title->subject = 'Unknown Map';
31   }
32  
33   $Page->start_display ();
34 ?>
35 <div class="main-box">
36   <div class="text-flow">
37   <?php
38     if (isset($name))
39     {
40       if ($has_details)
41       {
42         include ("pages/maps/$map.php");
43       }
44       else
45       {
46         $Page->show_message('There are no details for this map.');
47       }
48     }
49     else
50     {
51       $Page->show_message('The map <span class="field">' . $map . '</span> does not exist.');
52     }
53   ?>
54   </div>
55 </div>
56 <?php $Page->finish_display (); ?>
57
58