⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 theme.php

📁 软件类别: PHP源码 / 文章管理 软件语言: 简体中文 授权方式: 商业版 文件大小: 308K
💻 PHP
📖 第 1 页 / 共 4 页
字号:
    adminerror("Cannot Delete","You cannot delete this page set as it is currently in use by the theme $temp[title]");  }  echodeleteconfirm("page set","theme_pageset_kill",$id);break;case "theme_pageset_kill":  verifyid("news_pageset",$id);  if ($temp = query_first("SELECT title FROM news_theme WHERE pagesetid = $id LIMIT 1")) {    adminerror("Cannot Delete","You cannot delete this page set as it is currently in use by the theme $temp[title]");  }  query("DELETE FROM news_pageset WHERE id = $id");  query("DELETE FROM news_page WHERE pagesetid = $id");  $dir_arr[] = "pages/user/mod";  $dir_arr[] = "pages/user";  $dir_arr[] = "static/comment";  $dir_arr[] = "static/index";  $dir_arr[] = "static/polls";  $dir_arr[] = "static/sub_pages";  $dir_arr[] = "static";  foreach ($dir_arr AS $path) {    if (is_dir($path)) {      if ($handle = @opendir($path)) {        while (false !== ($file = readdir($handle))) {          $filetype_arr = explode(".",$file);          $filetype = $filetype_arr[count($filetype_arr)-1];          if (($filetype == "php") | ($filetype == "vnp")) {            unset($filetype_arr[count($filetype_arr)-1]);            $filename = join(".",$filetype_arr);            $setid = explode("_",$filename);            $setid = $setid[count($setid)-1];            if ($setid == $id) {              unlink($path."/".$filename.".".$filetype);            }          }        }      }      @closedir($handle);    }  }  writeallpages();  echoadminredirect("admin.php?action=theme");  exit;break;case "theme_style":  $defaultstyles['body'][title] = "Body Tag";  $defaultstyles['body'][description] = "This will replace the body tag on each page with whatever you specify here, use it to set your page background, margins etc.";  $defaultstyles['mainbgcolor'][title] = "Main background colour";  $defaultstyles['mainbgcolor'][description] = "Set the main background colour of the your pages.";  $defaultstyles['menubgcolor'][title] = "Menu background colour";  $defaultstyles['menubgcolor'][description] = "Set the background colour of the menu shown on your pages.";  $defaultstyles['headerbgcolor'][title] = "Header background colour";  $defaultstyles['headerbgcolor'][description] = "Set the background colour of the headers displayed on your pages.";  $defaultstyles['bordercolor'][title] = "Border colour";  $defaultstyles['bordercolor'][description] = "Set the colour of the borders displayed on your pages.";  $defaultstyles['maincellpadding'][title] = "Main cell padding";  $defaultstyles['maincellpadding'][description] = "Set the cell padding for the tables on your pages.";  $defaultstyles['maincellspacing'][title] = "Main cell spacing";  $defaultstyles['maincellspacing'][description] = "Set the cell spacing for the tables on your pages.";  $defaultstyles['maintablewidth'][title] = "Main table width";  $defaultstyles['maintablewidth'][description] = "Set the width of the main tables on your site.";  $defaultstyles['headertablewidth'][title] = "Header table width";  $defaultstyles['headertablewidth'][description] = "Set the width of the header tables on your site.";  $defaultstyles['imagefolder'][title] = "Image Folder";  $defaultstyles['imagefolder'][description] = "Set the folder containing images for this theme, note please do not include the trailing slash.";  $defaultstyles['csspath'][title] = "Path to CSS file";  $defaultstyles['csspath'][description] = "Set the relative (to index.php file) path to the css file for your theme.";  $defaultstyles['logopath'][title] = "Path to Logo";  $defaultstyles['logopath'][description] = "Set the relative (to index.php file) path to the css file for your theme.";  $defaultstyles['submitbutton'][title] = "Submit Code";  $defaultstyles['submitbutton'][description] = "Set the code to insert in place for a submit button.";  $defaultstyles['htmldoctype'][title] = "HTML Document Type";  $defaultstyles['htmldoctype'][description] = "Set the html doctype for your pages.";  $defaultstyles['charset'][title] = "HTML Character Set";  $defaultstyles['charset'][description] = "Set the html character set for your pages.";  settype($themeid,"integer");  if ($data_arr = query_first("SELECT news_theme.title,news_theme.stylesetid,news_styleset.title AS stylesettitle FROM news_theme LEFT JOIN news_styleset ON news_theme.stylesetid = news_styleset.id WHERE news_theme.id = $themeid")) {    echohtmlheader();    echoformheader("theme_style_update","编辑主题风格");    updatehiddenvar("themeid",$themeid);    echotabledescription("VirtuaNews provides you with the ability to quickly edit the look of your theme with the use of styles.  There is no need to create a new page set if you just want to change the colour of a theme, using styles you can edit certain variables which can be used in your pages which will change with each theme.");    echotabledescription(returnlinkcode("Edit Theme","admin.php?action=theme_edit&id=$themeid")." |".returnlinkcode("添加风格设置","admin.php?action=theme_styleset_add"));    echotablerow("风格名称:",$data_arr[title]." |".returnlinkcode("编辑","admin.php?action=theme_edit&id=$themeid")." |".returnlinkcode("删除","admin.php?action=theme_delete&id=$themeid"),"",15);    echotablerow("风格设置:",$data_arr[stylesettitle]." |".returnlinkcode("编辑","admin.php?action=theme_styleset_edit&id=$data_arr[stylesetid]&themeid=$themeid")." |".returnlinkcode("删除","admin.php?action=theme_styleset_delete&id=$data_arr[stylesetid]"),"",15);    echotablefooter();    $getstyle = query("SELECT id,varname,value,stylesetid FROM news_style WHERE stylesetid IN ('-1','$data_arr[stylesetid]') ORDER BY stylesetid");    while ($style_arr = fetch_array($getstyle)) {      $styles[$style_arr[varname]][id] = $style_arr[id];      $styles[$style_arr[varname]][data] = $style_arr[value];      $styles[$style_arr[varname]][altered] = iif($style_arr[stylesetid] == -1,0,1);    }    echotableheader("默认风格变量");    echotabledescription("Following is a list of the default style variables, the style variable displayed by each input will be replaced by whatever you specify when the page is outputted to the user, eg. in the pages you edit you will see \$stylevar[body] in places, this will be replaced by whatever you specify as your body tag for this theme when the page is displayed.");    echotabledescription("Tags which you have altered are displayed in <span class=\"red\">red</span>, to revert them back to the original click the link next to it.");    echotabledescription("Once you have finished your changes please press submit to save your changes.");    foreach ($defaultstyles AS $key => $val) {      echoinputcode(iif($styles[$key][altered],"<span class=\"red\">","")."<b>$val[title]</b>".iif($styles[$key][altered],"</span> |".returnlinkcode("回复","admin.php?action=theme_style_revert&themeid=$themeid&setid=$data_arr[stylesetid]&findword=".urlencode($key))." |".returnlinkcode("查看最初","admin.php?action=theme_style_view&varname=".urlencode($key),1),"")."<br />$val[description]<br />Replaces the variable <b>\$stylevar[".htmlspecialchars($key)."]</b>","style[".$styles[$key][id]."]",$styles[$key][data],40,0,60);      unset($styles[$key]);    }    echotabledescription("<input type=\"submit\" name=\"submit\" value=\"Submit\" class=\"form\"><input type=\"reset\" name=\"reset\" value=\"Reset\" class=\"form\">",2,1);    echotablefooter();    echotableheader("习惯风格变量");    echotabledescription("Following is a list of the custom variables which have been added to this style.  To update them please alter the input box as you wish and press submit when you have finished to save your changes.");    foreach ($styles AS $key => $val) {      echoinputcode("Replace <b>\$stylevar[".htmlspecialchars($key)."]</b> with:<br />".returnlinkcode("删除","admin.php?action=theme_style_delete&id=$val[id]&themeid=$themeid"),"style[$val[id]]",$val[data],40,0,50);    }    echotabledescription("If you wish to add further custom variables to be replaced, you can do so by using the 2 boxes below, just enter the details and press submit to save your changes.  You only need to enter the variable to be replaced, do not enter the \$stylevar bit.");    echotablerow("Replace: <input type=\"text\" name=\"new1[varname]\" class=\"form\" size=\"40\">","With: <input type=\"text\" name=\"new1[value]\" class=\"form\" size=\"40\">","",50);    echotablerow("Replace: <input type=\"text\" name=\"new2[varname]\" class=\"form\" size=\"40\">","With: <input type=\"text\" name=\"new2[value]\" class=\"form\" size=\"40\">","",50);    echoformfooter();    echohtmlfooter();  } else {    adminerror("无效ID","你指定了一个无效id.");  }break;case "theme_style_update":  settype($themeid,"integer");  if ($temp = query_first("SELECT stylesetid FROM news_theme WHERE id = $themeid")) {    $stylesetid = $temp[stylesetid];    if ($new1[varname]) {      query("INSERT INTO news_style VALUES (NULL,'$stylesetid','$new1[varname]','$new1[value]')");    }    if ($new2[varname]) {      query("INSERT INTO news_style VALUES (NULL,'$stylesetid','$new2[varname]','$new2[value]')");    }    $getstyle = query("SELECT id,varname,value,stylesetid FROM news_style WHERE stylesetid IN ('-1','$stylesetid') ORDER BY stylesetid");    while ($style_arr = fetch_array($getstyle)) {      if (isset($style[$style_arr[id]]) & ($style_arr[value] != stripslashes($style[$style_arr[id]]))) {        if ($style_arr[stylesetid] == -1) {          query("INSERT INTO news_style VALUES (NULL,'$stylesetid','$style_arr[varname]','".$style[$style_arr[id]]."')");        } else {          query("UPDATE news_style SET value = '".$style[$style_arr[id]]."' WHERE id = $style_arr[id]");        }      }    }    writeallpages();    echoadminredirect("admin.php?action=theme_style&themeid=$themeid");    exit;  } else {    adminerror("无效ID","你指定了一个无效id.");  }break;case "theme_style_view":  if ($data_arr = query_first("SELECT varname,value FROM news_style WHERE (varname = '".urldecode($varname)."') AND (stylesetid = '-1')")) {    echohtmlheader();    echotableheader("View Original Style Varname");    echotabledescription("This page will display the default replacement for the style variable that you specified.");    echotablerow("\$stylevar[$data_arr[varname]] is replaced with:",htmlspecialchars($data_arr[value]),"",25);    echotablefooter();    echohtmlfooter();  } else {    adminerror("Invalid Findword","You have specified an invalid word to view the original for.");  }break;case "theme_style_delete":  verifyid("news_theme",$themeid);  settype($id,"integer");  if ($temp = query_first("SELECT stylesetid FROM news_style WHERE id = $id")) {    if ($temp[stylesetid] == -1) {      adminerror("不能删除默认风格变量","你不能删除这个默认风格变量.");    }    echodeleteconfirm("custom style tag","theme_style_kill",$id,"","&themeid=$themeid");  } else {    adminerror("无效ID","你指定了一个无效id.");  }break;case "theme_style_revert":  verifyid("news_styleset",$setid);  verifyid("news_theme",$themeid);  if ($data_arr = query_first("SELECT id FROM news_style WHERE (stylesetid = $setid) AND (varname = '".urldecode($findword)."') LIMIT 1")) {    echodeleteconfirm("style tag","theme_style_kill",$data_arr[id]," This will revert the style tag you specified back to the original.","&themeid=$themeid","回复");  } else {    admineror("Invalid Style Tag","You have specified an invalid style tag as there is no such tag that exists as you specified in the style set you specified.");  }break;case "theme_style_kill":  settype($id,"integer");  if ($temp = query_first("SELECT stylesetid FROM news_style WHERE id = $id")) {    verifyid("news_theme",$themeid);    if ($temp[stylesetid] == -1) {      adminerror("Cannot Delete Defaults","You cannot delete the default style variables.");    }    query("DELETE FROM news_style WHERE id = $id");    writeallpages();    echoadminredirect("admin.php?action=theme_style&themeid=$themeid");    exit;  } else {    adminerror("无效ID","你指定了一个无效id.");  }break;case "theme_styleset_add":  echohtmlheader();  echoformheader("theme_styleset_new","添加风格设置");  echotabledescription("使用者能在你的站向你使用的风格添加一个新的风格设置.");  echoinputcode("标题:","title");  echoformfooter();  echohtmlfooter();break;case "theme_styleset_new":  if ($title == "") {    adminerror("空白栏目","所有栏目必须填写, 只有一个 <span class=\"red\">(可选)</span> 可以留空");  }  query("INSERT INTO news_styleset VALUES (NULL,'$title')");  writeallpages();  echoadminredirect("admin.php?action=theme");  exit;break;case "theme_styleset_edit":  settype($id,"integer");  if ($data_arr = query_first("SELECT title FROM news_styleset WHERE id = $id")) {    if ($themeid) {      verifyid("news_theme",$themeid);    }    echohtmlheader();    echoformheader("theme_styleset_update","编辑风格设置");    updatehiddenvar("id",$id);    updatehiddenvar("themeid",$themeid);    echotabledescription("Using this form you can edit the details of the style sets for use within your themes on your site.");    echoinputcode("标题:","title",$data_arr[title]);    echoformfooter();    echohtmlfooter();  } else {    adminerror("无效ID","你指定了一个无效id.");  }break;case "theme_styleset_update":  if ($title == "") {    adminerror("空白栏目","所有栏目必须填写, 只有一个 <span class=\"red\">(可选)</span> 可以留空");  }  verifyid("news_styleset",$id);  query("UPDATE news_styleset SET title = '$title' WHERE id = $id");  writeallpages();  if ($themeid) {    echoadminredirect("admin.php?action=theme_style&themeid=$themeid");  } else {    echoadminredirect("admin.php?action=theme");  }  exit;break;case "theme_styleset_delete":  verifyid("news_styleset",$id);  if ($temp = query_first("SELECT title FROM news_theme WHERE stylesetid = $id LIMIT 1")) {    adminerror("Cannot Delete","You cannot delete this style set as it is currently in use by the theme $temp[title]");  }  echodeleteconfirm("style set","theme_styleset_kill",$id);break;case "theme_styleset_kill":  verifyid("news_styleset",$id);  if ($temp = query_first("SELECT title FROM news_theme WHERE stylesetid = $id LIMIT 1")) {    adminerror("Cannot Delete","You cannot delete this style set as it is currently in use by the theme $temp[title]");  }  query("DELETE FROM news_styleset WHERE id = $id");  query("DELETE FROM news_style WHERE stylesetid = $id");  writeallpages();  echoadminredirect("admin.php?action=theme");  exit;break;default:  adminerror("无效连接","你跳转到一个无效的连接");}/*======================================================================*\|| ####################################################################|| # VirtuaNews is not free software|| # Downloaded: [WDYL-WTN]|| # File: admin/theme.php|| ####################################################################\*======================================================================*/?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -