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 define ('Current_poll_id', 7);
04 define ('Max_picture_width', 100);
05 define ('Max_picture_height', 75);
06 $Themes_to_show = array (16, 33, 10, 32, 20, 1);
07
08 include_once ('news/init.php');
09 $news_app = $Page->make_application (News_application_id);
10
11 include_once ('albums/init.php');
12 $albums_app = $Page->make_application (Album_application_id);
13
14 include_once ('recipes/init.php');
15 $recipes_app = $Page->make_application (Recipe_application_id);
16
17 require_once ('projects/init.php');
18 $projects_app = $Page->make_application (Project_application_id);
19
20 $apps_url = $Page->resolve_path('{apps}');
21 $browser_url = $Page->resolve_file($Page->template_options->browser_url);
22 $settings_url = $Page->resolve_file($Page->template_options->settings_url);
23
24 /* Make this the last page for this application. A login will return here. */
25
26 $news_app->set_referer ();
27
28 /* Make the application's login info appear in the header. It's the
29 main application for the page, but set in this way so that it doesn't
30 override the banner icon and other settings. */
31 $Page->app = $news_app;
32
33 $Page->start_display ();
34
35 define ("Webcore_project_id", 6);
36 require_once ('projects/util/project_version_formatter.php');
37 $release_data = new PROJECT_VERSION_FORMATTER($projects_app, Webcore_project_id);
38 ?>
39 <div class="main-box">
40 <div class="text-flow">
41 <p>This is a personal website, run by <a href="users/marco" title="Marco Von Ballmoos">Marco</a>,
42 that caters to a small community of users. Its exclusivity is almost guaranteed by its obscurity.</p>
43 <h2>
44 <a href="<?php echo $apps_url; ?>albums/?panel=picture&time_frame=recent">Albums</a>
45 </h2>
46 <div class="grid-content">
47 <?php
48
49 $entry_query = $albums_app->login->all_entry_query ();
50 $entry_query->set_type ('picture');
51 $entry_query->set_filter (Visible);
52 $entry_query->set_order ('time_created DESC');
53
54 $class_name = $albums_app->final_class_name ('TINY_PICTURE_GRID', 'albums/gui/tiny_picture_grid.php');
55 /** @var $grid TINY_PICTURE_GRID */
56 $grid = new $class_name ($albums_app);
57 $grid->set_page_size (24);
58 $grid->show_pager = false;
59 $grid->max_width = Max_picture_width;
60 $grid->max_height = Max_picture_height;
61 $grid->set_query ($entry_query);
62 $grid->display ();
63 ?>
64 </div>
65 <h2>
66 <a href="<?php echo $apps_url; ?>news/">News</a>
67 </h2>
68 <div class="grid-content">
69 <?php
70 $entry_query = $news_app->login->all_entry_query ();
71 $entry_query->set_filter (Visible);
72
73 require_once('news/gui/article_grid.php');
74
75 /** @var BASE_ARTICLE_GRID $grid */
76 $grid = new BASE_ARTICLE_GRID($news_app);
77 $grid->show_pager = false;
78 $grid->show_folder = true;
79 $grid->show_menus = false;
80 $grid->css_class = 'grid small-tiles subtle-titles';
81 $grid->set_query($entry_query);
82 $grid->set_page_size(20);
83 $grid->display();
84 ?>
85 </div>
86 <h2>
87 <a href="<?php echo $apps_url; ?>projects/">Projects</a>
88 </h2>
89 <div class="grid-content">
90 <?php
91 /** @var PROJECT_USER_ENTRY_QUERY $entry_query */
92 $entry_query = $projects_app->login->all_entry_query ();
93 $entry_query->set_type ('job');
94 $entry_query->set_filter (Visible);
95 $entry_query->restrict ("closer_id = 0");
96 $entry_query->set_order ('time_modified DESC');
97 $entry_query->store_order_as_recent ();
98
99 require_once('projects/gui/job_grid.php');
100
101 /** @var JOB_GRID $grid */
102 $grid = new JOB_GRID($projects_app);
103 $grid->show_pager = false;
104 $grid->show_folder = true;
105 $grid->show_menus = false;
106 $grid->show_description = false;
107 $grid->show_user_details = false;
108 $grid->show_release_details = false;
109 $grid->css_class = 'grid small-tiles subtle-titles';
110 $grid->set_query($entry_query);
111 $grid->set_page_size(10);
112 $grid->display();
113 ?>
114 </div>
115 <h2>
116 <a href="<?php echo $apps_url; ?>recipes/">Recipes</a>
117 </h2>
118 <?php
119 $entry_query = $recipes_app->login->all_entry_query ();
120 $entry_query->set_filter (Visible);
121
122 require_once('recipes/gui/recipe_grid.php');
123
124 /** @var RECIPE_GRID $grid */
125 $grid = new RECIPE_GRID($recipes_app);
126 $grid->show_pager = false;
127 $grid->show_folder = true;
128 $grid->show_menus = false;
129 $grid->show_description = false;
130 $grid->css_class = 'grid small-tiles subtle-titles';
131 $grid->set_query($entry_query);
132 $grid->set_page_size(10);
133 $grid->display();
134 ?>
135 <h2>Miscellaneous</h2>
136 <div class="columns">
137 <div>
138 <p>These areas are no longer actively updated but are retained for archival purposes.</p>
139 <ul class="minimal">
140 <li><?php echo $Page->get_icon_with_text('{site_icons}products/software', Twenty_px, '<a href="software/">Software</a>'); ?></li>
141 <li><?php echo $Page->get_icon_with_text('{site_icons}products/hochzeit', Twenty_px, '<a href="hochzeit/">Hochzeit</a>'); ?></li>
142 <li><?php echo $Page->get_icon_with_text('{site_icons}products/earthli_rabbit_logo', Twenty_px, '<a href="users/oz/">Oz</a>'); ?></li>
143 <li><?php echo $Page->get_icon_with_text('{site_icons}products/jass', Twenty_px, '<a href="jass/">Jass</a>'); ?></li>
144 <li><?php echo $Page->get_icon_with_text('{site_icons}products/quake', Twenty_px, '<a href="quake/">Quake III</a>'); ?></li>
145 <li><?php echo $Page->get_icon_with_text('{site_icons}products/jkd', Twenty_px, '<a href="jkd/">Jeet Kune Do</a>'); ?></li>
146 <li><?php echo $Page->get_icon_with_text('{site_icons}products/systems', Twenty_px, '<a href="systems/">Systems</a>'); ?></li>
147 <li><?php echo $Page->get_icon_with_text('{site_icons}products/webcam', Twenty_px, '<a href="webcam/">Webcam</a>'); ?></li>
148 </ul>
149 </div>
150 <div>
151 <p>This site is built with the <a href="software/webcore/">earthli WebCore</a>.</p>
152 <p><a href="software/webcore/"><img src="software/webcore/media/images/webcore_box_green_small.png" alt="WebCore Box"></a></p>
153 <table class="basic columns left-labels">
154 <tr>
155 <th>Version</th>
156 <td><?php echo $release_data->version; ?></td>
157 </tr>
158 <tr>
159 <th>Released</th>
160 <td><?php echo $release_data->release_date; ?></td>
161 </tr>
162 <tr>
163 <th></th>
164 <td><a href="<?php echo $release_data->change_log_link; ?>">Release Notes</a></td>
165 </tr>
166 </table>
167 </div>
168 <div>
169 <p>Proud to be a standards-compliant web site.</p>
170 <?php $path_to_powered_by = $Page->resolve_path ('{root}/common/images/powered_by/'); ?>
171 <p>
172 <a href="http://validator.w3.org/check/referer"><img src="<?php echo $path_to_powered_by; ?>HTML5_Badge_72.png" alt="Valid HTML 5"></a>
173 <a href="http://jigsaw.w3.org/css-validator/validator"><img src="<?php echo $path_to_powered_by; ?>CSS3_Badge_72.png" alt="Valid CSS 3"></a>
174 </p>
175 <p>Find out more about <a href="<?php echo $browser_url; ?>">your browser</a>.</p>
176 </div>
177 </div>
178 </div>
179 </div>
180 <?php $Page->finish_display (); ?>