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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (hide annotations)
Fri Apr 18 04:25:28 2025 UTC (10 months, 4 weeks ago) by sysadm
Branch: MAIN
Changes since 1.14: +1 -0 lines
Refact bbs_msg feature

1 sysadm 1.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 sysadm 1.4 "css/default" => "css/default.css",
9     "js/lml_assistant" => "js/lml_assistant.js",
10 sysadm 1.7 "view/list" => "list.view.php",
11 sysadm 1.4 "view/post" => "post.view.php",
12 sysadm 1.9 "view/view_article" => "view_article.view.php",
13 sysadm 1.8 "view/search_article" => "search_article.view.php",
14 sysadm 1.4 "view/member_service_guide" => "member_service_guide.view.php",
15     "view/update_profile" => "update_profile.view.php",
16     "view/preference" => "preference.view.php",
17     "view/s_favor" => "s_favor.view.php",
18 sysadm 1.5 "view/section_setting" => "section_setting.view.php",
19 sysadm 1.6 "view/show_profile" => "show_profile.view.php",
20 sysadm 1.13 "view/score_detail" => "score_detail.view.php",
21 sysadm 1.14 "view/suicide" => "suicide.view.php",
22 sysadm 1.15 "view/read_msg" => "read_msg.view.php",
23 sysadm 1.1 ),
24 sysadm 1.10 "xml" => array(
25     "xsl/1" => "xsl/1.xsl",
26     "view/view_article" => "view_article_xml.view.php",
27     ),
28 sysadm 1.11 "gen_ex" => array(
29     "view/view_article" => "gen_ex_article.view.php",
30     ),
31 sysadm 1.12 "portal" => array(
32     "css/default" => "../www/css/default.css",
33     "view/view_article" => "view_article.view.php",
34     ),
35 sysadm 1.1 );
36    
37 sysadm 1.2 $BBS_theme_current = "";
38    
39 sysadm 1.4 function get_theme_file(string $view_name, string $theme_name = "") : string | null
40 sysadm 1.1 {
41     global $BBS_theme_set;
42 sysadm 1.2 global $BBS_theme_current;
43    
44     if ($theme_name == "")
45     {
46     $theme_name = $BBS_theme_current; // Use current selected theme
47     }
48 sysadm 1.1
49     if (!isset($BBS_theme_set[$theme_name]) || !isset($BBS_theme_set[$theme_name][$view_name]))
50     {
51     $theme_name = "default"; // fallback
52     }
53    
54 sysadm 1.2 $BBS_theme_current = $theme_name; // Remember current theme for later use
55    
56 sysadm 1.1 if (!isset($BBS_theme_set[$theme_name][$view_name]))
57     {
58     return null; // View not exist
59     }
60    
61 sysadm 1.11 $file = "../bbs/themes/" . $theme_name . "/" . $BBS_theme_set[$theme_name][$view_name];
62 sysadm 1.1
63     if (!file_exists($file))
64     {
65 sysadm 1.2 return $BBS_theme_set[$theme_name][$view_name]; // fallback file without theme
66 sysadm 1.1 }
67    
68     return $file;
69     }
70     }
71     ?>

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