/[LeafOK_CVS]/fenglin/bbs/theme.inc.php
ViewVC logotype

Contents of /fenglin/bbs/theme.inc.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Mon Apr 7 06:34:07 2025 UTC (11 months, 1 week ago) by sysadm
Branch: MAIN
Add theme support

1 <?php
2 if (!defined("_BBS_THEME_INIT_"))
3 {
4 define("_BBS_THEME_INIT_",1);
5
6 $BBS_theme_set = array(
7 "default" => array(
8 "css" => "css/default.css",
9 "member_service_guide" => "member_service_guide.view.php",
10 "update_profile" => "update_profile.view.php",
11 "preference" => "preference.view.php",
12 ),
13 );
14
15 function get_theme_view_file(string $view_name, string $theme_name = "default") : string | null
16 {
17 global $BBS_theme_set;
18
19 if (!isset($BBS_theme_set[$theme_name]) || !isset($BBS_theme_set[$theme_name][$view_name]))
20 {
21 $theme_name = "default"; // fallback
22 }
23
24 if (!isset($BBS_theme_set[$theme_name][$view_name]))
25 {
26 return null; // View not exist
27 }
28
29 $file = "./themes/" . $theme_name . "/" . $BBS_theme_set[$theme_name][$view_name];
30
31 if (!file_exists($file))
32 {
33 return null; // View file not exist
34 }
35
36 return $file;
37 }
38 }
39 ?>

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1