本文整理汇总了PHP中get_opendb_config_var函数的典型用法代码示例。如果您正苦于以下问题:PHP get_opendb_config_var函数的具体用法?PHP get_opendb_config_var怎么用?PHP get_opendb_config_var使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_opendb_config_var函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_s_item_type_insert_form
function display_s_item_type_insert_form($HTTP_VARS)
{
$sat_results = fetch_sfieldtype_attribute_type_rs(array('TITLE', 'CATEGORY', 'STATUSTYPE', 'STATUSCMNT', 'DURATION'));
while ($attribute_type_r = db_fetch_assoc($sat_results)) {
$s_attribute_type_list_rs[] = $attribute_type_r;
}
db_free_result($sat_results);
echo get_s_attribute_type_tooltip_array($s_attribute_type_list_rs);
echo "\n<table>";
// s_item_type
echo get_input_field("s_item_type", NULL, "Item Type", "text(10,10)", "Y", $HTTP_VARS['s_item_type']);
//description
echo get_input_field("description", NULL, "Description", "text(30,60)", "Y", $HTTP_VARS['description']);
//image
echo get_input_field("image", NULL, "Image", "url(15,*,\"gif,jpg,png\",N)", "N", $HTTP_VARS['image']);
echo "\n</table>";
echo "<h4>Field Type Attributes</h4>";
echo "\n<table>";
display_item_type_insert_field('Title', 'TITLE');
display_item_type_insert_field('Category', 'CATEGORY');
display_item_type_insert_field('Status Type', 'STATUSTYPE');
display_item_type_insert_field('Status Comment', 'STATUSCMNT');
if (get_opendb_config_var('borrow', 'enable') !== FALSE && get_opendb_config_var('borrow', 'duration_support') !== FALSE) {
display_item_type_insert_field('Borrow Duration', 'DURATION');
}
echo "\n</table>";
}
示例2: get_announcements_block
function get_announcements_block()
{
$buffer = '';
if (is_user_granted_permission(PERM_ADMIN_ANNOUNCEMENTS)) {
// include a login warning if user password and email are still the defaults
if (get_opendb_session_var('user_id') == 'admin') {
$announcements_rs = get_admin_announcements_rs();
while (list(, $announcement_r) = each($announcements_rs)) {
$buffer .= "<li><h4>" . $announcement_r['heading'] . "</h4>\n\t\t\t\t\t<p class=\"content\">" . $announcement_r['message'] . "<a class=\"adminLink\" href=\"" . $announcement_r['link'] . "\">" . $announcement_r['link_text'] . "</a></p>";
}
}
}
if (get_opendb_config_var('welcome.announcements', 'enable') !== FALSE && is_user_granted_permission(PERM_VIEW_ANNOUNCEMENTS)) {
$results = fetch_announcement_rs('submit_on', 'DESC', 0, get_opendb_config_var('welcome.announcements', 'display_count'), 'Y', 'Y');
if ($results) {
while ($announcement_r = db_fetch_assoc($results)) {
$buffer .= "<li><h4>" . $announcement_r['title'] . "</h4>";
$buffer .= "<small class=\"submitDate\">" . get_localised_timestamp(get_opendb_config_var('welcome.announcements', 'datetime_mask'), $announcement_r['submit_on']) . "</small>";
$buffer .= "<p class=\"content\">" . nl2br($announcement_r['content']) . "</p></li>";
}
db_free_result($results);
}
}
if (strlen($buffer) > 0) {
return "\n<div id=\"announcements\">" . "<h3>" . get_opendb_lang_var('announcements') . "</h3>" . "\n<ul>" . $buffer . "\n</ul></div>";
} else {
return NULL;
}
}
示例3: check_item_type_structure
function check_item_type_structure($s_item_type, &$error)
{
if (is_exists_item_type($s_item_type)) {
$missing_s_field_types = NULL;
if (!fetch_sfieldtype_item_attribute_type($s_item_type, 'TITLE')) {
$missing_s_field_types[] = 'TITLE';
}
if (!fetch_sfieldtype_item_attribute_type($s_item_type, 'STATUSTYPE')) {
$missing_s_field_types[] = 'STATUSTYPE';
}
if (!fetch_sfieldtype_item_attribute_type($s_item_type, 'STATUSCMNT')) {
$missing_s_field_types[] = 'STATUSCMNT';
}
if (!fetch_sfieldtype_item_attribute_type($s_item_type, 'CATEGORY')) {
$missing_s_field_types[] = 'CATEGORY';
}
if (get_opendb_config_var('borrow', 'enable') !== FALSE && get_opendb_config_var('borrow', 'duration_support') !== FALSE) {
if (!fetch_sfieldtype_item_attribute_type($s_item_type, 'DURATION')) {
$missing_s_field_types[] = 'DURATION';
}
}
if (is_not_empty_array($missing_s_field_types)) {
$error = array('error' => 'The following Field Type attribute relationships are missing.', 'detail' => $missing_s_field_types);
return FALSE;
} else {
// No errors so no problem.
return TRUE;
}
} else {
// no message if s_item_type does not even exist.
return FALSE;
}
}
示例4: output_cache_file
function output_cache_file($url)
{
// no point streaming a local URI
if (is_url_absolute($url) && get_opendb_config_var('http.stream_external_images', 'enable') !== FALSE && is_uri_domain_in_list($url, get_opendb_config_var('http.stream_external_images', 'domain_list'))) {
$snoopy = new OpenDbSnoopy();
$dataBuffer =& $snoopy->fetchURI($url, FALSE);
if ($dataBuffer !== FALSE) {
if (is_array($snoopy->headers)) {
for ($i = 0; $i < count($snoopy->headers); $i++) {
header($snoopy->headers[$i]);
}
}
echo $dataBuffer;
flush();
} else {
opendb_redirect($url);
}
unset($snoopy);
} else {
if (($file = get_item_input_file_upload_url($url)) !== FALSE) {
// file upload - that is not cached
opendb_redirect($file);
} else {
opendb_redirect($url);
}
}
}
示例5: get_edit_announcement_input_form
function get_edit_announcement_input_form($announcement_r, $HTTP_VARS = NULL)
{
global $PHP_SELF;
$buffer .= "<form action=\"{$PHP_SELF}\" method=\"POST\">";
$buffer .= "\n<input type=\"hidden\" name=\"type\" value=\"announcements\">";
if (is_array($announcement_r)) {
$buffer .= "\n<input type=\"hidden\" name=\"op\" value=\"update\">" . "\n<input type=\"hidden\" name=\"announcement_id\" value=\"" . $announcement_r['announcement_id'] . "\">";
} else {
$buffer .= "\n<input type=\"hidden\" name=\"op\" value=\"insert\">";
}
$buffer .= "<table>";
$buffer .= get_input_field("title", NULL, 'Title', "text(50,500)", "Y", ifempty($announcement_r['title'], $HTTP_VARS['title']), TRUE);
$buffer .= get_input_field("content", NULL, 'Announcement', "htmlarea(60,15)", "Y", ifempty($announcement_r['content'], $HTTP_VARS['content']), TRUE);
$buffer .= get_input_field("display_days", NULL, 'Display Days', "number(10,10)", "Y", ifempty($announcement_r['display_days'], $HTTP_VARS['display_days']), TRUE);
if (is_array($announcement_r)) {
$buffer .= get_input_field("closed_ind", NULL, 'Closed', "checkbox(Y,N)", "N", ifempty($announcement_r['closed_ind'], $HTTP_VARS['closed_ind']), TRUE);
}
$buffer .= "</table>";
$help_r[] = array('img' => 'compulsory.gif', 'text' => get_opendb_lang_var('compulsory_field'), id => 'compulsory');
$help_r[] = array('text' => 'A zero in Display Days indicates the announcment will never expire.');
$help_r[] = array('text' => 'No validation is performed on HTML entered in the Announcement text field.');
$buffer .= format_help_block($help_r);
if (get_opendb_config_var('widgets', 'enable_javascript_validation') !== FALSE) {
$onclick_event = "if(!checkForm(this.form)){return false;}else{this.form.submit();}";
} else {
$onclick_event = "this.form.submit();";
}
$buffer .= "<input type=\"button\" class=\"button\" onclick=\"{$onclick_event}\" value=\"Save\">";
$buffer .= "\n</form>";
return $buffer;
}
示例6: is_valid_item_type_structure
function is_valid_item_type_structure($s_item_type)
{
if (is_exists_item_type($s_item_type)) {
if (fetch_sfieldtype_item_attribute_type($s_item_type, 'TITLE')) {
if (fetch_sfieldtype_item_attribute_type($s_item_type, 'STATUSTYPE')) {
if (fetch_sfieldtype_item_attribute_type($s_item_type, 'STATUSCMNT')) {
if (fetch_sfieldtype_item_attribute_type($s_item_type, 'CATEGORY')) {
if (get_opendb_config_var('borrow', 'enable') !== FALSE && get_opendb_config_var('borrow', 'duration_support') !== FALSE) {
if (fetch_sfieldtype_item_attribute_type($s_item_type, 'DURATION')) {
// At this point all the required s_field_type mappings have been provided.
return TRUE;
}
} else {
// At this point $borrow functionality is not enabled, so we do not
// have to do anymore testing.
return TRUE;
}
}
}
}
}
}
//else
return FALSE;
}
示例7: isAvailable
function isAvailable($userid)
{
if (($this->getConfigId() == NULL || get_opendb_config_var($this->getConfigId(), 'enable') === TRUE) && ($this->getPermId() == NULL || is_user_granted_permission($this->getPermId(), $userid))) {
return TRUE;
} else {
return FALSE;
}
}
示例8: get_secret_image_code
/**
* TODO - note that date is used as part of the generated code, so if someone tries to
* register just before a date change, the registration may fail - but its a fairly
* unlikely occurence.
*
* @param unknown_type $random_num
* @return unknown
*/
function get_secret_image_code($random_num)
{
$security_hash = get_opendb_config_var('site', 'security_hash');
$datekey = date("F j");
$rcode = hexdec(md5(get_http_env('HTTP_USER_AGENT') . $security_hash . $random_num . $datekey));
$code = substr($rcode, 2, 6);
return $code;
}
示例9: get_content_type_charset
function get_content_type_charset()
{
$contentType = "text/html";
$charSet = get_opendb_config_var('themes', 'charset');
if (strlen($charSet) > 0) {
$contentType .= ";charset=" . $charSet;
}
return $contentType;
}
示例10: opendb_pre_query
/**
* @param $sql
*/
function opendb_pre_query($sql)
{
$dbserver_conf_r = get_opendb_config_var('db_server');
if (strlen($dbserver_conf_r['table_prefix']) > 0) {
$sql = parse_sql_statement($sql, $dbserver_conf_r['table_prefix']);
}
if ($dbserver_conf_r['debug-sql'] === TRUE) {
echo '<p class="debug-sql">SQL: ' . $sql . '</p>';
}
return $sql;
}
示例11: validate_review_input
function validate_review_input($HTTP_VARS, &$errors)
{
$errors = NULL;
if (get_opendb_config_var('item_review', 'comment_compulsory') == TRUE && strlen($HTTP_VARS['comment']) == 0) {
$errors[] = array(error => get_opendb_lang_var('prompt_must_be_specified', 'prompt', get_opendb_lang_var('review')));
}
if (get_opendb_config_var('item_review', 'rating_compulsory') == TRUE && strlen($HTTP_VARS['rating']) == 0) {
$errors[] = array(error => get_opendb_lang_var('prompt_must_be_specified', 'prompt', get_opendb_lang_var('rating')));
}
if (is_array($errors)) {
return FALSE;
} else {
return TRUE;
}
}
示例12: build_announcements_feed
function build_announcements_feed($URL, $datemask)
{
$rssout = '';
$last_items_list_conf_r = get_opendb_config_var('feeds.announcements');
// TODO - make the options here configurable
$result = fetch_announcement_rs(NULL, "DESC", 0, $last_items_list_conf_r['total_num_items'], "N", "Y");
//$limit_closed
// Create the RSS item tags
if ($result && db_num_rows($result) > 0) {
while ($item_instance_r = db_fetch_assoc($result)) {
$rssout .= "\n\t<item>" . "\n\t\t<title>" . rss_encoded($item_instance_r['title']) . "</title>" . "\n\t\t<link>" . rss_encoded($URL) . "</link>" . "\n\t\t<pubDate>" . get_localised_timestamp($datemask, $item_instance_r['submit_on']) . " " . date('T') . "</pubDate>" . "\n\t\t<guid>" . rss_encoded($URL) . "</guid>" . "\n\t\t<description>" . rss_encoded(nl2br($item_instance_r['content'])) . "</description>" . "\n\t</item>";
}
db_free_result($result);
}
return $rssout;
}
示例13: getItemsPerPageControl
function getItemsPerPageControl($PHP_SELF, $HTTP_VARS)
{
$buffer = '';
$items_per_page_options_r = get_opendb_config_var('listings', 'items_per_page_options');
if (is_not_empty_array($items_per_page_options_r)) {
$items_per_page_rs = array();
while (list(, $items_per_page) = each($items_per_page_options_r)) {
if ($items_per_page == '0') {
$display = get_opendb_lang_var('all');
} else {
$display = $items_per_page;
}
$items_per_page_rs[] = array('value' => $items_per_page, 'display' => $display);
}
$buffer .= "<form class=\"itemsPerPageControl\" id=\"form-items_per_page\" action=\"" . $PHP_SELF . "\" method=\"GET\">" . get_url_fields($HTTP_VARS) . "<label for=\"select-items_per_page\">" . get_opendb_lang_var('items_per_page') . '</label>' . "<select id=\"select-items_per_page\" name=\"items_per_page\" class=\"footer\" onChange=\"this.form.submit()\">" . custom_select('items_per_page', $items_per_page_rs, '%display%', 'NA', ifempty($HTTP_VARS['items_per_page'], get_opendb_config_var('listings', 'items_per_page')), 'value') . "\n</select></form>";
}
return $buffer;
}
示例14: get_table_content
/**
Get the content of $table as a series of INSERT statements.
*/
function get_table_content($table, $crlf)
{
$result = db_query("SELECT * FROM {$table}");
//prefix if required to table name before exporting.
if (strlen(get_opendb_config_var('db_server', 'table_prefix')) > 0) {
$table = get_opendb_config_var('db_server', 'table_prefix') . $table;
}
$i = 0;
while ($row = db_fetch_row($result)) {
$table_list = "";
for ($j = 0; $j < db_num_fields($result); $j++) {
if (strlen($table_list) > 0) {
$table_list .= ", ";
}
$table_list .= db_field_name($result, $j);
}
$table_list = "(" . $table_list . ")";
$schema_insert = "";
for ($j = 0; $j < db_num_fields($result); $j++) {
if (strlen($schema_insert) > 0) {
$schema_insert .= ", ";
}
if (!isset($row[$j])) {
$schema_insert .= "NULL";
} else {
if ($row[$j] != "") {
$row[$j] = replace_newlines($row[$j]);
// Escape normal addslashes: \', \", \\, \0 add to that \n
$row[$j] = addcslashes($row[$j], "\\'\"\\\n");
$schema_insert .= "'" . $row[$j] . "'";
} else {
$schema_insert .= "''";
}
}
}
$schema_insert = "INSERT INTO {$table} {$table_list} VALUES (" . $schema_insert . ")";
// Get rid of newlines.
$schema_insert = str_replace("\n", "", $schema_insert);
$schema_insert = str_replace("\r", "", $schema_insert);
echo trim($schema_insert) . ";" . $crlf;
$i++;
}
return TRUE;
}
示例15: OpenDbSnoopy
function OpenDbSnoopy($debug = FALSE)
{
// if file cache table is not installed, we cannot use file cache.
$this->_file_cache_enabled = get_opendb_config_var('http.cache', 'enable');
//override user agent.
$this->agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4';
// in how many cases is this going to work?
$this->passcookies = FALSE;
$this->_debug = $debug;
$proxy_server_config_r = get_opendb_config_var('http.proxy_server');
if ($proxy_server_config_r['enable'] == TRUE) {
$this->proxy_host = $proxy_server_config_r['host'];
$this->proxy_port = $proxy_server_config_r['port'];
$this->proxy_user = $proxy_server_config_r['userid'];
$this->proxy_pass = $proxy_server_config_r['password'];
}
// the default curl path for snoopy is /usr/local/bin/curl - often however, it will reside in another path
if (!empty($this->curl_path) || !@is_executable($this->curl_path)) {
$curlpaths = array();
// variable for test-paths
// let's do something depending on whether we're using windows or linux (windows lookup not tested)
if (strncasecmp(PHP_OS, 'WIN', 3) == 0) {
// This is a server using Windows!
$curlpaths[] = 'C:\\Windows\\System32\\curl.exe';
} else {
// assuming a unix system, first try detection and then some other standard paths
$whichcurl = @exec("which curl");
if ($whichcurl != NULL) {
$curlpaths[] = $whichcurl;
}
$curlpaths[] = '/usr/bin/curl';
$curlpaths[] = '/usr/local/sbin/curl';
$curlpaths[] = '/usr/sbin/curl';
}
foreach ($curlpaths as $curlpath) {
if (@is_executable($curlpath)) {
$this->curl_path = $curlpath;
break;
// once found, break out of the loop
}
}
}
}