• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getSettings函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getSettings函数的典型用法代码示例。如果您正苦于以下问题:PHP getSettings函数的具体用法?PHP getSettings怎么用?PHP getSettings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getSettings函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: run_disallow_permissions

function run_disallow_permissions()
{
    $settings = getSettings();
    $root = "..";
    pake_echo_action("permissions", "allow permissions...");
    pake_chmod('', $root, 0755);
}
开发者ID:otis22,项目名称:reserve-copy-system,代码行数:7,代码来源:Pakefile.php


示例2: getUserConfig

 function getUserConfig($configKey, $baseFolder = null, $reset = false)
 {
     $configKey = strtolower($configKey);
     if ($reset) {
         if (isset($_SESSION['USERCONFIG'][$configKey])) {
             unset($_SESSION['USERCONFIG'][$configKey]);
         }
     }
     if (isset($_SESSION['USERCONFIG']) && isset($_SESSION['USERCONFIG'][$configKey])) {
         return $_SESSION['USERCONFIG'][$configKey];
     }
     $configData = getSettings($configKey);
     if (strlen($configData) > 2) {
         $_SESSION['USERCONFIG'][$configKey] = json_decode($configData, true);
         return $_SESSION['USERCONFIG'][$configKey];
     }
     if ($baseFolder == null) {
         $bt = debug_backtrace();
         $baseFolder = dirname($bt[0]['file']) . "/";
     }
     $configArr = [APPROOT . APPS_DATA_FOLDER . "jsonData/" . $configKey . ".json", $baseFolder . "config.json"];
     foreach ($configArr as $f) {
         if (file_exists($f)) {
             $configData = file_get_contents($f);
             $_SESSION['USERCONFIG'][$configKey] = json_decode($configData, true);
             setSettings($configKey, $configData);
             return $_SESSION['USERCONFIG'][$configKey];
         }
     }
     return false;
 }
开发者ID:logiks,项目名称:logiks-core,代码行数:31,代码来源:boot.php


示例3: showModuleSettings

function showModuleSettings($module, $key)
{
    $table = getSettings($module);
    table_open();
    if ($table) {
        tr_open();
        td_open(1);
        echo getString("settings_description", "Beskrivelse");
        td_close();
        td_open(1);
        echo getString("settings_value", "Verdi");
        td_close();
        td_open(1);
        echo getString("settings_type", "Type");
        td_close();
        td_open(1);
        echo getString("settings_edit", "Endre");
        td_close();
        tr_close();
        while ($row = nextResultInTable($table)) {
            tr_open();
            td_open(1);
            echo $row['description'];
            td_close();
            form_start_post();
            if ($row['settingskey'] == $key) {
                showSetting($row, true);
                td_open(1);
                form_hidden("m_c", "showSettingsGUI");
                form_hidden("module", $module);
                form_hidden("key", $row['settingskey']);
                form_hidden("save", true);
                form_submit("submit", getString("settings_save_setting", "Lagre"));
                td_close();
            } else {
                showSetting($row, false);
                td_open(1);
                form_hidden("m_c", "showSettingsGUI");
                form_hidden("module", $module);
                form_hidden("key", $row['settingskey']);
                form_submit("submit", getString("settings_edit_setting", "Endre"));
                td_close();
            }
            form_end();
            tr_close();
        }
    } else {
        // ingen settings, gi beskjed:
        tr_open();
        td_open(1);
        echo getString("settings_could_not_find_settings_for_this_module", "Fant ingen innstillinger for denne modulen");
        td_close();
        tr_close();
    }
    table_close();
}
开发者ID:arewold,项目名称:calcuttagutta,代码行数:56,代码来源:settingsGUI.php


示例4: printSettings

function printSettings($uid, $pid, $name, $typeid)
{
    echo "\n\t\t<li class=\"plant\" data-uid=\"" . $uid . "\" data-pid=\"" . $pid . "\" data-plant-nickname=\"" . $name . "\" data-plant-type=\"" . getCommonName($typeid) . "\"><h2 class=\"name button\">" . $name . " <span>(" . getCommonName($typeid) . ")</span></h2>\n\t\t\t<ul class=\"sub\">";
    $info = getSettings($uid, $pid);
    foreach ($info as $key => $value) {
        $key = str_replace("_", " ", $key);
        echo "<li class='plant{$key}'><span class='key'>" . $key . "</span><span class=\"value\">" . ucfirst($value) . "</span></li>";
    }
    echo "\n\t\t\t<li data-value=\"alert\" class=\"button green \">Set Alert Type</li>\n\t\t\t<li class=\"button red\">Delete</li>\n\t\t\t</ul>\n\t\t</li>\n\t\t";
}
开发者ID:andymikulski,项目名称:dotcom,代码行数:10,代码来源:SettingsLego.php


示例5: processSettings

function processSettings($calID)
{
    //get settings from calendar
    $dbSet = getSettings();
    if (!empty($dbSet)) {
        echo "<li>Calendar settings retrieved from database.</li>\n";
    }
    //convert 2.7.1 date settings to new settings
    $ds = isset($dbSet['dateSep']) ? $dbSet['dateSep'] : '.';
    //dateSep: LuxCal 2.7.1
    if (isset($dbSet['dateFormat'])) {
        switch ($dbSet['dateFormat']) {
            //dateSep: LuxCal 2.7.1 format
            case '1':
                $dbSet['dateFormat'] = 'd' . $ds . 'm' . $ds . 'y';
                break;
            case '2':
                $dbSet['dateFormat'] = 'm' . $ds . 'd' . $ds . 'y';
                break;
            case '3':
                $dbSet['dateFormat'] = 'y' . $ds . 'm' . $ds . 'd';
        }
    }
    if (empty($dbSet['MdFormat'])) {
        $dbSet['MdFormat'] = empty($dbSet['dateUSorEU']) ? 'M d' : 'd M';
    }
    //dateUSorEU: LuxCal 2.7.1
    if (empty($dbSet['MdyFormat'])) {
        $dbSet['MdyFormat'] = empty($dbSet['dateUSorEU']) ? 'M d, y' : 'd M y';
    }
    if (empty($dbSet['MyFormat'])) {
        $dbSet['MyFormat'] = empty($dbSet['dateUSorEU']) ? 'M y' : 'M y';
    }
    if (empty($dbSet['DMdFormat'])) {
        $dbSet['DMdFormat'] = empty($dbSet['dateUSorEU']) ? 'WD, M d' : 'WD d M';
    }
    if (empty($dbSet['DMdyFormat'])) {
        $dbSet['DMdyFormat'] = empty($dbSet['dateUSorEU']) ? 'WD, M d, y' : 'WD d M y';
    }
    if (empty($dbSet['timeFormat'])) {
        $dbSet['timeFormat'] = empty($dbSet['time24']) ? 'h:ma' : 'h.m';
    }
    //time24: LuxCal 2.7.1
    //check and complete settings
    checkSettings($dbSet);
    //if $dbSet['x'] empty, set to default value
    echo "<li>Calendar settings verified/completed.</li>\n";
    //save calendar settings to calendar
    $result = saveSettings($calID, $dbSet, true);
    if ($result === false) {
        exit('Error: Unable to save settings in database. Check database credentials.');
    }
    echo "<li>Calendar settings saved to database.</li>\n";
    return $result;
}
开发者ID:krievley,项目名称:schedule,代码行数:55,代码来源:upgrade323.php


示例6: getSettings

 public function getSettings()
 {
     $settings = getSettings();
     if (strstr($_SERVER['HTTP_REFERER'], 'admin')) {
         $langs = $this->config->item('languages');
         $language = $this->config->item('language');
         $locale = $langs[$language][0];
     } else {
         $locale = MY_Controller::getCurrentLocale();
     }
     $settings['curLocale'] = $locale;
     return json_encode($settings);
 }
开发者ID:NaszvadiG,项目名称:ImageCMS,代码行数:13,代码来源:translator.php


示例7: runClient

function runClient()
{
    $settings = getSettings();
    $client = Client::getInstance($settings);
    $type = 'echo';
    $data = array('foo' => 'bar', 'baz' => 9001);
    $resultId = $client->putRequest($type, $data);
    Common::$lg->addDebug("Client put request {$resultId} on AMQ");
    $result = $client->getResult($resultId);
    Common::$lg->addDebug("Client got data for {$resultId}");
    if ($result->{'foo'} == $data['foo'] && $result->{'baz'} == $data['baz']) {
        exit(0);
    } else {
        echo "Client received wrong data for {$resultId}";
        exit(1);
    }
}
开发者ID:adfinis-sygroup,项目名称:syrpc-php,代码行数:17,代码来源:main.php


示例8: writeGlobalCache

function writeGlobalCache()
{
    global $db, $_SYS;
    $row = getSettings(0);
    $apikey = $row['apikey'];
    $tmparr = array();
    if (!empty($apikey)) {
        $row['apikey'] = array();
        $tmpapis = explode("\n", $apikey);
        foreach ($tmpapis as $tmpapi) {
            $tmpapikv = explode(":", $tmpapi);
            if (is_array($tmpapikv) && !empty($tmpapikv[0]) && !empty($tmpapikv[1])) {
                $row['apikey'][$tmpapikv[0]] = trim($tmpapikv[1]);
            }
        }
    }
    $str = "<?php \r\n \$cache_global = " . varToStr($row) . "; \r\n?>";
    writeFile(getCacheFilePath("global.php"), $str);
}
开发者ID:rust1989,项目名称:edit,代码行数:19,代码来源:cache.php


示例9: deleteJob

                            deleteJob($_REQUEST["job_id"]);
                            header("Location: " . $GLOBALS['contextpath'] . "/user/" . $_SESSION['username'] . "/");
                        }
                        exit;
                        break;
                    case "reset":
                        if (is_numeric($_REQUEST["job_id"])) {
                            resetJob($_REQUEST["job_id"]);
                            header("Location: " . $GLOBALS['contextpath'] . "/job/" . $_REQUEST["job_id"] . "/");
                        }
                    case "viewall":
                        header("Location: " . $GLOBALS['contextpath'] . "/user/" . $_SESSION['username'] . "/");
                        break;
                    default:
                        getJobs();
                        exit;
                        break;
                }
                exit;
                break;
            case "useragents":
                getUserAgents();
                exit;
                break;
            case "settings":
                getSettings();
                exit;
                break;
        }
    }
}
开发者ID:awakecoding,项目名称:testswarm,代码行数:31,代码来源:admin.php


示例10: mysql_client_encoding

// include the default language
require_once WB_PATH . '/modules/foldergallery/languages/EN.php';
// check if module language file exists for the language set by the user (e.g. DE, EN)
if (file_exists(WB_PATH . '/modules/foldergallery/languages/' . LANGUAGE . '.php')) {
    require_once WB_PATH . '/modules/foldergallery/languages/' . LANGUAGE . '.php';
}
// Files includen
require_once WB_PATH . '/modules/foldergallery/info.php';
require_once WB_PATH . '/modules/foldergallery/admin/scripts/backend.functions.php';
require_once WB_PATH . '/modules/foldergallery/class/class.upload.php';
require_once WB_PATH . '/modules/foldergallery/class/validator.php';
require_once WB_PATH . '/modules/foldergallery/class/DirectoryHandler.Class.php';
//  Set the mySQL encoding to utf8
$oldMysqlEncoding = mysql_client_encoding();
mysql_set_charset('utf8', $database->db_handle);
$settings = getSettings($section_id);
$root_dir = $settings['root_dir'];
//Chio
if (isset($_GET['cat_id']) && is_numeric($_GET['cat_id'])) {
    $cat_id = $_GET['cat_id'];
} else {
    $error['no_cat_id'] = 1;
    $admin->print_error('lost cat', ADMIN_URL . '/pages/modify.php?page_id=' . $page_id . '&section_id=' . $section_id);
    die;
}
// Kategorie Infos aus der DB holen
$sql = 'SELECT * FROM ' . TABLE_PREFIX . 'mod_foldergallery_categories WHERE id=' . $cat_id . ' LIMIT 1;';
$query = $database->query($sql);
$categorie = $query->fetchRow();
if (is_array($categorie)) {
    if ($categorie['parent'] != -1) {
开发者ID:dev4me,项目名称:Foldergallery,代码行数:31,代码来源:modify_cat.php


示例11: errorlog

//Insert a log message into the error log
function errorlog($msg, &$db)
{
    $insert['msg'] = $msg;
    $insert['time'] = time();
    $query = $db->autoexecute('log_errors', $insert, 'INSERT');
}
//Insert a log message into the GM log
function gmlog($msg, &$db)
{
    $insert['msg'] = $msg;
    $insert['time'] = time();
    $query = $db->autoexecute('log_gm', $insert, 'INSERT');
}
//Get all settings variables
function getSettings(&$db)
{
    $query = $db->execute("select `name`, `value` from `settings`");
    while ($set = $query->fetchrow()) {
        $setting->{$set}['name'] = $set['value'];
    }
    return $setting;
}
$setting = getSettings($db);
//Get the player's IP address
$ip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
//Check that the player has the appropriate permission of a GM rank above 20
if (check_permissions($player, 21) == 0) {
    header("Location: ../logout.php");
    exit;
}
开发者ID:BGCX067,项目名称:ezrpg-svn-to-git,代码行数:31,代码来源:lib.php


示例12: getSession

<?php

require_once '../configuration_admin.php';
// start the session
$session = getSession();
// get smarty handle
$smarty = getSmartyHandle();
$GLOBALS['applog']->logMessage(var_export($_REQUEST, true), LOGGER_ERROR, 'edit_custom');
// check permissions
if ($session->isLoggedIn()) {
    // get handle on database
    $db = getDBHandle();
    // get handle on the settings
    $settings = getSettings();
    // define standard fields to parse/clear
    $fields = array('eventHeaderCustom', 'eventTextCustom', 'eventSubtextCustom', 'eventLinkCustom', 'boingoLinkCustom');
    if (isset($_REQUEST['submit'])) {
        $GLOBALS['applog']->logMessage("normal form submission hit", LOGGER_ERROR, 'edit_custom');
        // some of the fields just get dumped into settings
        $fields = array('eventLinkCustom', 'boingoLinkCustom');
        foreach ($fields as $key) {
            if (strlen($_REQUEST[$key])) {
                $GLOBALS['applog']->logMessage("Saving setting {$key}, value " . $_REQUEST[$key], LOGGER_DEBUG, 'edit_custom');
                $settings->__set($key, $_REQUEST[$key]);
            }
        }
        // some get truncated if they are too long
        $fields = array('eventHeaderCustom', 'eventTextCustom', 'eventSubtextCustom');
        foreach ($fields as $key) {
            if (strlen($_REQUEST[$key])) {
                if (strlen($_REQUEST[$key]) > $GLOBALS['textRestrictions'][$key]) {
开发者ID:jjb867,项目名称:Tampa-Internet,代码行数:31,代码来源:edit_custom.php


示例13: foreach

<table  align="center" width="800">
	<tr  align="center" height="25">
		<td bgcolor="#AAAAAA"><strong>Index</strong></td>
		<td bgcolor="#AAAAAA"><strong>Ontology Prefix</strong></td>
		<td bgcolor="#AAAAAA"><strong>Classes</strong></td>
		<td bgcolor="#AAAAAA"><strong>Object Properties</strong></td>
		<td bgcolor="#AAAAAA"><strong>Datatype Properties</strong></td>
		<td bgcolor="#AAAAAA"><strong>Annotation Properties</strong></td>
		<td bgcolor="#AAAAAA"><strong>Total</strong></td>
	</tr>


<?php 
foreach ($rs as $row) {
    $o = $row['ontology_abbrv'];
    $settings = getSettings($o);
    $classQueryString = "\nPREFIX rdf: <{$settings['ns_rdf']}>\nPREFIX owl: <{$settings['ns_owl']}>\nSELECT  count(distinct ?s) as ?cCount\nFROM <{$settings['ns_main']}>\nWHERE\n{\n?s a owl:Class .\nFILTER (isIRI(?s)).\n}\n";
    $objectQueryString = "\nPREFIX rdf: <{$settings['ns_rdf']}>\nPREFIX owl: <{$settings['ns_owl']}>\nSELECT  count(distinct ?s) as ?oCount\nFROM <{$settings['ns_main']}>\nWHERE\n{\n?s a owl:ObjectProperty .\nFILTER (isIRI(?s)).\n}\n";
    $datatypeQueryString = "\nPREFIX rdf: <{$settings['ns_rdf']}>\nPREFIX owl: <{$settings['ns_owl']}>\nSELECT  count(distinct ?s) as ?dCount\nFROM <{$settings['ns_main']}>\nWHERE\n{\n?s a owl:DatatypeProperty .\nFILTER (isIRI(?s)).\n}\n";
    $annotationQueryString = "\nPREFIX rdf: <{$settings['ns_rdf']}>\nPREFIX owl: <{$settings['ns_owl']}>\nSELECT  count(distinct ?s) as ?aCount\nFROM <{$settings['ns_main']}>\nWHERE\n{\n?s a owl:AnnotationProperty .\nFILTER (isIRI(?s)).\n}\n";
    $cCountResult = json_query($classQueryString);
    $aCountResult = json_query($annotationQueryString);
    $dCountResult = json_query($datatypeQueryString);
    $oCountResult = json_query($objectQueryString);
    $cCount = $cCountResult[0]['cCount'];
    $aCount = $aCountResult[0]['aCount'];
    $dCount = $dCountResult[0]['dCount'];
    $oCount = $oCountResult[0]['oCount'];
    $total = $cCount + $aCount + $dCount + $oCount;
    ?>
	<tr align="center" height="25" <?php 
开发者ID:e4ong1031,项目名称:ontobee,代码行数:31,代码来源:ontostatMain.php


示例14: Workflows

<?php

require './vendor/autoload.php';
require './src/functions.php';
require_once './src/workflows.php';
$w = new Workflows('com.vdesabou.spotify.mini.player');
//
// Read settings from JSON
//
$settings = getSettings($w);
$oauth_client_id = $settings->oauth_client_id;
$oauth_client_secret = $settings->oauth_client_secret;
$oauth_redirect_uri = $settings->oauth_redirect_uri;
try {
    $session = new SpotifyWebAPI\Session($oauth_client_id, $oauth_client_secret, $oauth_redirect_uri);
    if (!empty($_GET['code'])) {
        // Request a access token using the code from Spotify
        $ret = $session->requestAccessToken($_GET['code']);
        if ($ret == true) {
            $api = new SpotifyWebAPI\SpotifyWebAPI();
            // Set the code on the API wrapper
            $api->setAccessToken($session->getAccessToken());
            $user = $api->me();
            $ret = updateSetting($w, 'oauth_access_token', $session->getAccessToken());
            if ($ret == false) {
                echo "There was an error when updating settings";
                exec("kill -9 \$(ps -efx | grep \"php -S localhost:15298\"  | grep -v grep | awk '{print \$2}')");
                return;
            }
            $ret = updateSetting($w, 'oauth_expires', time());
            if ($ret == false) {
开发者ID:troyxmccall,项目名称:alfred-spotify-mini-player,代码行数:31,代码来源:callback.php


示例15: catch

         } catch (Exception $e) {
             echo $e->getMessage();
             //Boring error messages from anything else!
         }
     }
 }
 if (isset($_POST['regid']) && isset($_POST['sendEmail']) && isset($_POST['template']) && !$cancelProcess) {
     $CustomMsg;
     $Header;
     $Subject;
     $Body;
     $Footer;
     $email;
     $template;
     $userid = $_SESSION['UserID'];
     $data = getSettings($userid);
     $useremail = $data->email;
     $userfriendlyemail = $data->friendlyemail;
     $userbcc = $data->bcc;
     if ($userbcc != 1) {
         //it is a no, blank it
         $userbcc = "";
     } else {
         $userbcc = $useremail;
     }
     $template = $_POST['template'];
     $regid = $_POST['regid'];
     $tbl = "registration";
     //grab the message to be sent
     if (!$cancelProcess) {
         $result = mysql_query("SELECT CustomMessageBody,EmailAddress FROM " . $tbl . " WHERE regid='" . $regid . "'");
开发者ID:misumoo,项目名称:bascomb,代码行数:31,代码来源:custommessages_handle.php


示例16: import_sql

function import_sql($source, $result_code = 'import_ok')
{
    global $modx, $e;
    $tbl_active_users = $modx->getFullTableName('active_users');
    $rs = $modx->db->select('count(*)', $tbl_active_users, "action='27'");
    if (0 < $modx->db->getValue($rs)) {
        $modx->webAlertAndQuit("Resource is edit now by any user.");
    }
    $settings = getSettings();
    if (strpos($source, "\r") !== false) {
        $source = str_replace(array("\r\n", "\n", "\r"), "\n", $source);
    }
    $sql_array = preg_split('@;[ \\t]*\\n@', $source);
    foreach ($sql_array as $sql_entry) {
        $sql_entry = trim($sql_entry, "\r\n; ");
        if (empty($sql_entry)) {
            continue;
        }
        $rs = $modx->db->query($sql_entry);
    }
    restoreSettings($settings);
    $modx->clearCache();
    $_SESSION['last_result'] = $modx->db->makeArray($rs);
    $_SESSION['result_msg'] = $result_code;
}
开发者ID:WorkForFood,项目名称:MODxPress,代码行数:25,代码来源:bkmanager.static.php


示例17: array

<?php

$data_setting = array('group' => 'page');
$settings = getSettings($data_setting);
if ($settings) {
    foreach ($settings as $setting) {
        if ($setting['key'] == 'security') {
            $security = $setting['value'];
        }
    }
}
$title = $lang['head_security'];
?>
<h5><?php 
echo $lang['head_security'];
?>
</h5>
<article class="auction_container">
	<?php 
echo $security;
?>
	<img class="bottom" src="includes/images/bottom/security.png" alt="security">
</article>
开发者ID:nvcDeb,项目名称:CoinCod,代码行数:23,代码来源:security.php


示例18: updateSettings

function updateSettings($datas)
{
    foreach ($datas as $data) {
        $data_setting = array('group' => $data['group'], 'Key' => $data['Key'], 'Value' => $data['Value']);
        $settings = getSettings($data_setting);
        if (count($settings) > 0) {
            $query = editSettings($data_setting);
        } else {
            $query = insertSettings($data_setting);
        }
    }
    if ($query) {
        return true;
    }
    return false;
}
开发者ID:nvcDeb,项目名称:CoinCod,代码行数:16,代码来源:sql_function.php


示例19: createTest

/**
* Stores test information to 
* the database for the first time.
*
* @param $jsonQuestions | string
*
* @return void
*
*/
function createTest($jsonQuestions)
{
    // date_default_timezone_set("UTC");
    $test_id = "";
    $user_id = $_SESSION['user_id'];
    $duration = getSettings()[0]['duration'];
    $startedAt = date('Y-m-d H:i:s');
    $data = ['user_id' => $user_id, 'started_at' => $startedAt, 'json' => $jsonQuestions, 'duration' => $duration];
    if (insert('test_info', $data)) {
        return mysql_insert_id();
    }
    return false;
}
开发者ID:brightantwiboasiako,项目名称:tratech2016,代码行数:22,代码来源:test.php


示例20: id_projectGrid

function id_projectGrid($attrs)
{
    ob_start();
    if (isset($attrs['columns'])) {
        $wide = $attrs['columns'];
    } else {
        $wide = 3;
    }
    $width = 90 / $wide;
    $margin = 10 / ($wide - 1);
    if (isset($attrs['max'])) {
        $max = $attrs['max'];
    } else {
        $max = null;
    }
    // project category
    if (isset($attrs['category'])) {
        $category = $attrs['category'];
        $args = array('post_type' => 'ignition_product', 'tax_query' => array(array('taxonomy' => 'project_category', 'field' => 'id', 'terms' => $category)));
    } else {
        // in case category isn't defined, query args must contain post type
        $args['post_type'] = 'ignition_product';
    }
    if (isset($max)) {
        $args['posts_per_page'] = $max;
    }
    // --> Custom args - START
    // orderby possible values - days_left, percent_raised, funds_raised, rand, title, date (default)
    if (isset($attrs['orderby'])) {
        if ($attrs['orderby'] == 'days_left') {
            $args['orderby'] = 'meta_value_num';
            $args['meta_key'] = 'ign_days_left';
        } else {
            if ($attrs['orderby'] == 'percent_raised') {
                $args['orderby'] = 'meta_value_num';
                $args['meta_key'] = 'ign_percent_raised';
            } else {
                if ($attrs['orderby'] == 'funds_raised') {
                    $args['orderby'] = 'meta_value_num';
                    $args['meta_key'] = 'ign_fund_raised';
                } else {
                    // reserved for later use
                    $args['orderby'] = $attrs['orderby'];
                }
            }
        }
    }
    // order possible values = ASC, DESC (default)
    if (isset($attrs['order'])) {
        $args['order'] = $attrs['order'];
    }
    // author (single name)
    if (isset($attrs['author'])) {
        $args['author_name'] = $attrs['author'];
    }
    // --> Custom args - END
    // moved this block before the query call
    require 'languages/text_variables.php';
    $custom = false;
    if (isset($attrs['deck'])) {
        $deck_id = $attrs['deck'];
        $settings = Deck::get_deck_attrs($deck_id);
        if (!empty($settings)) {
            $attrs = unserialize($settings->attributes);
            $custom = true;
        }
    }
    // start the actual query, which will also output decks
    $posts = get_posts($args);
    $project_ids = array();
    echo '<div class="ignitiondeck"><div class="grid_wrap" data-wide="' . $wide . '">';
    $i = 1;
    foreach ($posts as $post) {
        $post_id = $post->ID;
        $project_id = get_post_meta($post_id, 'ign_project_id', true);
        // no more "pass" checks are required, because the query gets all proper projects in proper order and settings
        $deck = new Deck($project_id);
        $mini_deck = $deck->mini_deck();
        $post_id = $deck->get_project_postid();
        $status = get_post_status($post_id);
        $custom = apply_filters('idcf_custom_deck', $custom, $post_id);
        $attrs = apply_filters('idcf_deck_attrs', isset($attrs) ? $attrs : null, $post_id);
        if (strtoupper($status) == 'PUBLISH') {
            $settings = getSettings();
            echo '<div class="grid_item" style="float: left; margin: 0 ' . $margin . '% ' . $margin . '% 0; width: ' . $width . '%;">';
            include 'templates/_miniWidget.php';
            echo '</div>';
            $i++;
        }
    }
    // end with query and continue with original code
    echo '</div></div>';
    echo '<br style="clear: both"/>';
    $grid = ob_get_contents();
    ob_end_clean();
    return $grid;
}
开发者ID:christopherreay,项目名称:freeFreeCrowdfunding_ignitiondeck_crowdfunding,代码行数:97,代码来源:ignitiondeck-shortcodes.php



注:本文中的getSettings函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getSettingsBlockId函数代码示例发布时间:2022-05-15
下一篇:
PHP getSettingWithDefault函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap