/[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.2 - (show annotations)
Mon Apr 7 08:39:17 2025 UTC (11 months, 1 week ago) by sysadm
Branch: MAIN
Changes since 1.1: +13 -2 lines
Add post.view.php

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 "post" => "post.view.php",
10 "member_service_guide" => "member_service_guide.view.php",
11 "update_profile" => "update_profile.view.php",
12 "preference" => "preference.view.php",
13 ),
14 );
15
16 $BBS_theme_current = "";
17
18 function get_theme_view_file(string $view_name, string $theme_name = "") : string | null
19 {
20 global $BBS_theme_set;
21 global $BBS_theme_current;
22
23 if ($theme_name == "")
24 {
25 $theme_name = $BBS_theme_current; // Use current selected theme
26 }
27
28 if (!isset($BBS_theme_set[$theme_name]) || !isset($BBS_theme_set[$theme_name][$view_name]))
29 {
30 $theme_name = "default"; // fallback
31 }
32
33 $BBS_theme_current = $theme_name; // Remember current theme for later use
34
35 if (!isset($BBS_theme_set[$theme_name][$view_name]))
36 {
37 return null; // View not exist
38 }
39
40 $file = "./themes/" . $theme_name . "/" . $BBS_theme_set[$theme_name][$view_name];
41
42 if (!file_exists($file))
43 {
44 return $BBS_theme_set[$theme_name][$view_name]; // fallback file without theme
45 }
46
47 return $file;
48 }
49 }
50 ?>

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