本文整理汇总了PHP中settings::getSettings方法的典型用法代码示例。如果您正苦于以下问题:PHP settings::getSettings方法的具体用法?PHP settings::getSettings怎么用?PHP settings::getSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类settings
的用法示例。
在下文中一共展示了settings::getSettings方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: settings
require_once "../../include/session.php";
require_once "include/fields.php";
foreach ($phpbms->modules as $module => $moduleinfo) {
if ($module != "base" && file_exists("../" . $module . "/adminsettings.php")) {
include "modules/" . $module . "/adminsettings.php";
}
}
require_once "modules/base/include/adminsettings_include.php";
$settings = new settings($db);
if (!hasRights("Admin")) {
goURL(APP_PATH . "noaccess.php");
}
if (isset($_POST["command"])) {
$statusmessage = $settings->processForm($_POST);
}
$therecord = $settings->getSettings();
$pageTitle = "Configuration";
$phpbms->cssIncludes[] = "pages/base/adminsettings.css";
$phpbms->jsIncludes[] = "modules/base/javascript/adminsettings.js";
foreach ($phpbms->modules as $module => $moduleinfo) {
if ($module != "base" && file_exists("../" . $module . "/javascript/adminsettings.js")) {
$phpbms->jsIncludes[] = "modules/" . $module . "/javascript/adminsettings.js";
}
}
//Form Elements
//==============================================================
$theform = new phpbmsForm();
$theform->enctype = "multiform/form-data";
$theinput = new inputField("application_name", $therecord["application_name"], "application name", true);
$theform->addField($theinput);
$theinput = new inputField("application_uuid", $therecord["application_uuid"], "application uuid", false, NULL, 40);
示例2: getFile
/**
* Return a file
*
* @param string $id File ID
* @return array $file File details
*/
function getFile($id)
{
global $conn;
$id = (int) $id;
// Get the file from the database
$file = $conn->query("SELECT * FROM files WHERE ID={$id}")->fetch();
if (!empty($file)) {
// Determine if there is a MIME-type icon corresponding to the file's MIME-type. If not, set 'none'
$file['type'] = str_replace("/", "-", $file["type"]);
// Get settings (needed to add a different MIME-type icon per theme for each file)
$set = new settings();
$settings = $set->getSettings();
// Construct the path to the MIME-type icon
$myfile = "./templates/" . $settings["template"] . "/theme/" . $settings["theme"] . "/images/files/" . $file['type'] . ".png";
if (!file_exists($myfile)) {
$file['type'] = "none";
}
// Determine if it is an image or text file or some other kind of file (required for lightbox)
if (stristr($file['type'], "image")) {
$file['imgfile'] = 1;
} elseif (stristr($file['type'], "text")) {
$file['imgfile'] = 0;
} else {
$file['imgfile'] = 0;
}
// Strip slashes from title, desc and tags
$file["title"] = stripslashes($file["title"]);
$file["desc"] = stripslashes($file["desc"]);
$file["size"] = filesize(realpath($file["datei"])) / 1024;
$file["size"] = round($file["size"]);
$file["addedstr"] = date(CL_DATEFORMAT, $file["added"]);
// Attach data about the user who uploaded the file
$userobj = new user();
$file["userdata"] = $userobj->getProfile($file["user"]);
return $file;
} else {
return false;
}
}
示例3: searchFiles
function searchFiles($query, $project = 0)
{
global $conn;
$project = (int) $project;
if ($project > 0) {
$sel = $conn->prepare("SELECT `ID`,`name`,`desc`,`type`,`datei`,`title`,`project` FROM `files` WHERE `name` LIKE ? OR `desc` LIKE ? OR `title` LIKE ? HAVING project = ?");
$sel->execute(array("%{$query}%", "%{$query}%", "%{$query}%", $project));
} else {
$sel = $conn->prepare("SELECT `ID`,`name`,`desc`,`type`,`datei`,`title`,`project` FROM `files` WHERE `name` LIKE ? OR `desc` LIKE ? OR `title` LIKE ?");
$sel->execute(array("%{$query}%", "%{$query}%", "%{$query}%"));
}
$files = array();
while ($result = $sel->fetch()) {
if (!empty($result)) {
$project = $conn->query("SELECT name FROM projekte WHERE ID = {$result['project']}")->fetch();
$project = $project[0];
$result["pname"] = $project;
$result["ftype"] = str_replace("/", "-", $result["type"]);
$set = new settings();
$settings = $set->getSettings();
$myfile = CL_ROOT . "/templates/" . $settings["template"] . "/images/symbols/files/" . $result["ftype"] . ".png";
if (stristr($result["type"], "image")) {
$result["imgfile"] = 1;
} elseif (stristr($result['type'], "text")) {
$result["imgfile"] = 2;
} else {
$result["imgfile"] = 0;
}
if (!file_exists($myfile)) {
$result["ftype"] = "none";
}
$result["title"] = stripslashes($result["title"]);
$result["desc"] = stripslashes($result["desc"]);
// $result["tags"] = stripslashes($result["tags"]);
$result["type"] = "file";
$result[3] = "file";
$result["icon"] = "files.png";
array_push($files, $result);
}
}
if (!empty($files)) {
return $files;
} else {
return array();
}
}
示例4: getFile
/**
* Return a file
*
* @param string $id File ID
* @return array $file File details
*/
function getFile($id)
{
$id = (int) $id;
// get the file from MySQL
$sel = mysql_query("SELECT * FROM files WHERE ID={$id}");
$file = mysql_fetch_array($sel);
if (!empty($file)) {
// determine if there is an mimetype icon corresponding to the files mimetype. If not set 'none'
$file['type'] = str_replace("/", "-", $file["type"]);
$set = new settings();
$settings = $set->getSettings();
$myfile = "./templates/" . $settings["template"] . "/images/files/" . $file['type'] . ".png";
if (!file_exists($myfile)) {
$file['type'] = "none";
}
// determine if its an image or textfile or some other file. this is needed for lightboxes
if (stristr($file['type'], "image")) {
$file['imgfile'] = 1;
} elseif (stristr($file['type'], "text")) {
$file['imgfile'] = 2;
} else {
$file['imgfile'] = 0;
}
// split the tags string into an array, and also count how many tags the file has
$tagobj = new tags();
$thetags = $tagobj->splitTagStr($file["tags"]);
$file["tagsarr"] = $thetags;
$file["tagnum"] = count($file["tagsarr"]);
// strip slashes from titles , desc and tags
$file["title"] = stripslashes($file["title"]);
$file["desc"] = stripslashes($file["desc"]);
$file["tags"] = stripslashes($file["tags"]);
$file["size"] = filesize(realpath($file["datei"])) / 1024;
$file["size"] = round($file["size"]);
$file["addedstr"] = date("d.m.y", $file["added"]);
$userobj = new user();
$file["userdata"] = $userobj->getProfile($file["user"]);
return $file;
} else {
return false;
}
}
示例5: getArrayVal
}
array_push($languages_fin, $fin);
}
$msgcount = getArrayVal($_GET, "msg");
$peoplecount = getArrayVal($_GET, "peop");
$procount = getArrayVal($_GET, "pro");
$taskcount = getArrayVal($_GET, "tsk");
$template->assign("msgcount", $msgcount);
$template->assign("peoplecount", $peoplecount);
$template->assign("procount", $procount);
$template->assign("taskcount", $taskcount);
$template->assign("languages_fin", $languages_fin);
$title = $langfile["systemadministration"];
$template->assign("title", $title);
$template->assign("classes", $classes);
$sets = $theset->getSettings();
$templates = $theset->getTemplates();
$themes = $theset->getThemes($settings["template"]);
$template->assign("themes", $themes);
$template->assign("settings", $sets);
$timezones = DateTimeZone::listIdentifiers();
$template->assign("timezones", $timezones);
$template->assign("templates", $templates);
$template->display("editsettings.tpl");
} elseif ($action == "editsets") {
$theme = getArrayVal($_POST, "theme");
if ($theset->editSettings($name, $subtitle, $locale, $timezone, $dateformat, $templ, $theme, $rssuser, $rsspass)) {
$handle = opendir($template->compile_dir);
while (false !== ($file = readdir($handle))) {
if ($file != "." and $file != "..") {
unlink(CL_ROOT . "/" . $template->compile_dir . "/" . $file);
示例6: getAttachedFiles
/**
* Get files attached to a message
*
* @param int $msg ID of the message
* @return array $files Attached files
*/
private function getAttachedFiles($msg)
{
global $conn;
$msg = (int) $msg;
$files = array();
$sel = $conn->prepare("SELECT file FROM files_attached WHERE message = ?");
$sel->execute(array($msg));
while ($file = $sel->fetch()) {
$sel2 = $conn->query("SELECT * FROM files WHERE ID = {$file['0']}");
$thisfile = $sel2->fetch();
$thisfile["type"] = str_replace("/", "-", $thisfile["type"]);
//get systemSettings
$settingsObj = new settings();
$settings = $settingsObj->getSettings();
// Construct the path to the MIME-type icon
$myfile = "./templates/" . $settings["template"] . "/theme/" . $settings["theme"] . "/images/files/" . $thisfile['type'] . ".png";
if (!file_exists($myfile)) {
$thisfile['type'] = "none";
}
// Determine if it is an image or text file or some other kind of file (required for lightbox)
if (stristr($thisfile['type'], "image")) {
$thisfile['imgfile'] = 1;
} elseif (stristr($thisfile['type'], "text")) {
$thisfile['imgfile'] = 2;
} else {
$thisfile['imgfile'] = 0;
}
array_push($files, $thisfile);
}
if (!empty($files)) {
return $files;
} else {
return false;
}
}
示例7: getAttachedFiles
private function getAttachedFiles($msg)
{
$msg = (int) $msg;
$files = array();
$sel = mysql_query("SELECT file FROM files_attached WHERE message = {$msg}");
while ($file = mysql_fetch_row($sel)) {
$sel2 = mysql_query("SELECT * FROM files WHERE ID = {$file['0']}");
$thisfile = mysql_fetch_array($sel2);
$thisfile["type"] = str_replace("/", "-", $thisfile["type"]);
if (isset($thisfile["desc"])) {
$thisfile["desc"] = stripslashes($thisfile["desc"]);
}
if (isset($thisfile["tags"])) {
$thisfile["tags"] = stripslashes($thisfile["tags"]);
}
if (isset($thisfile["title"])) {
$thisfile["title"] = stripslashes($thisfile["title"]);
}
$set = new settings();
$settings = $set->getSettings();
$myfile = "./templates/" . $settings["template"] . "/images/files/" . $thisfile["type"] . ".png";
if (stristr($thisfile["type"], "image")) {
$thisfile["imgfile"] = 1;
} elseif (stristr($thisfile["type"], "text")) {
$thisfile["imgfile"] = 2;
} else {
$thisfile["imgfile"] = 0;
}
if (!file_exists($myfile)) {
$thisfile["type"] = "none";
}
array_push($files, $thisfile);
}
if (!empty($files)) {
return $files;
} else {
return false;
}
}
示例8: getFiles
private function getFiles($query, $project = 0)
{
$query = mysql_real_escape_string($query);
$project = (int) $project;
if ($project > 0) {
$sel = mysql_query("SELECT `ID`,`name`,`desc`,`type`,`datei`,`title`,`project`,`tags` FROM `files` WHERE `tags` LIKE '%{$query}%' HAVING project = {$project}");
} else {
$sel = mysql_query("SELECT `ID`,`name`,`desc`,`type`,`datei`,`title`,`project`,`tags` FROM `files` WHERE `tags` LIKE '%{$query}%'");
}
$files = array();
while ($result = mysql_fetch_array($sel)) {
if (!empty($result)) {
$project = mysql_query("SELECT name FROM projekte WHERE ID = {$result['project']}");
$project = mysql_fetch_row($project);
$project = $project[0];
$result["pname"] = $project;
$result["ftype"] = str_replace("/", "-", $result["type"]);
$set = new settings();
$settings = $set->getSettings();
$myfile = CL_ROOT . "/templates/" . $settings["template"] . "/images/symbols/files/" . $result["ftype"] . ".png";
if (stristr($result["type"], "image")) {
$result["imgfile"] = 1;
} elseif (stristr($result['type'], "text")) {
$result["imgfile"] = 2;
} else {
$result["imgfile"] = 0;
}
if (!file_exists($myfile)) {
$result["ftype"] = "none";
}
$result["title"] = stripslashes($result["title"]);
$result["desc"] = stripslashes($result["desc"]);
$result["tags"] = stripslashes($result["tags"]);
$thetags = $this->splitTagStr($result["tags"]);
$result["tagsarr"] = $thetags;
$result["tagnum"] = count($result["tagsarr"]);
$result["type"] = "file";
$result[3] = "file";
$result["icon"] = "files.png";
array_push($files, $result);
}
}
if (!empty($files)) {
return $files;
} else {
return array();
}
}