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   require_once ('webcore/init.php');
02  
03   $Page->title->subject = "Webcam Gallery";
04   
05   $Page->template_options->icon = '{site_icons}products/webcam';
06   $Page->template_options->title = 'Webcam';
07  
08   $Page->location->add_root_link ();
09   $Page->location->append("WebCam", "./");
10   $Page->location->append ("Gallery");
11  
12   $Page->start_display ();
13 ?>
14 <div class="top-box">
15   <div class="button-content">
16     <a class="button" href="index.php">"Live" Image</a>
17   </div>
18 </div>
19 <div class="main-box">
20   <div class="text-flow">
21     <p>The webcam has captured some interesting moments.</p>
22     <?php
23       include ('albums/init.php');
24       $albums_app = $Page->make_application (Album_application_id);
25       $folder_query = $albums_app->login->folder_query ();
26       $folder = $folder_query->object_at_id (42);
27       if ($folder)
28       {
29         /** @var ALBUM_ENTRY_QUERY $pic_query */
30         $pic_query = $folder->entry_query ();
31         $pic_query->set_type ('picture');
32         $pic_query->set_order ('date DESC');
33  
34         $class_name = $albums_app->final_class_name ('PICTURE_GRID', 'albums/gui/picture_grid.php');
35         /** @var PICTURE_GRID $grid */
36         $grid = new $class_name ($albums_app);
37         $grid->set_page_size (Default_page_size);
38         $grid->set_query ($pic_query);
39         $grid->display ();
40       }
41       else
42       {
43         echo "<span class=\"error\">The webcam album is unavailable.</span>";
44       }
45     ?>
46   </div>
47 </div>
48 <?php $Page->finish_display (); ?>
49