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

PHP getPreference函数代码示例

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

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



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

示例1: checkLogin

<?php

//stop the direct browsing to this file - let index.php handle which files get displayed
checkLogin();
//if valid then do save
if ($_POST['p_description'] != "") {
    include "./modules/preferences/save.php";
}
#get the invoice id
$preference_id = $_GET['id'];
$preference = getPreference($preference_id);
$index_group = getPreference($preference['index_group']);
$preferences = getActivePreferences();
$defaults = getSystemDefaults();
$status = array(array('id' => '0', 'status' => $LANG['draft']), array('id' => '1', 'status' => $LANG['real']));
$smarty->assign('preference', $preference);
$smarty->assign('defaults', $defaults);
$smarty->assign('index_group', $index_group);
$smarty->assign('preferences', $preferences);
$smarty->assign('status', $status);
$smarty->assign('pageActive', 'preference');
$subPageActive = $_GET['action'] == "view" ? "preferences_view" : "preferences_edit";
$smarty->assign('subPageActive', $subPageActive);
$smarty->assign('active_tab', '#setting');
开发者ID:alachaum,项目名称:simpleinvoices,代码行数:24,代码来源:details.php


示例2: updateTwitterFeed

function updateTwitterFeed($lastupdate)
{
    // Twitter!
    global $preferences;
    global $twit;
    require_once 'oauth/twitteroauth.php';
    $twit = new TwitterOAuth($preferences->CONSUMER_KEY, $preferences->CONSUMER_SECRET_KEY, $preferences->OAUTH_TOKEN, $preferences->OAUTH_SECRET_TOKEN);
    // Update the following/followed balance
    updateTwitterFollowing();
    // Update user information for those who require it
    updateTwitterUsers();
    // Get mentions since the last update
    $args = array();
    $lastreadid = getPreference("last_twitter_id");
    if ($lastreadid) {
        $args['since_id'] = $lastreadid;
    }
    $tweets = $twit->get('statuses/mentions_timeline', $args);
    // if we have no tweets, stop here
    if (!is_array($tweets)) {
        loginfo("No tweets to read!");
        return false;
    }
    // process tweets individually
    uasort($tweets, 'cmpTweetId');
    foreach ($tweets as $tweet) {
        $lastreadid = processTweet($tweet);
    }
    // Save the last updated tweet id
    setPreference("last_twitter_id", $lastreadid);
    return true;
}
开发者ID:language-learners,项目名称:superchallengebot,代码行数:32,代码来源:update.php


示例3: insert

 public function insert()
 {
     //insert in si_invoice
     global $db_server;
     $sql = "INSERT \n\t\t\t\tINTO\n\t\t\t" . TB_PREFIX . "invoices (\n\t\t\t\tid, \n\t\t \t\tindex_id,\n\t\t\t\tdomain_id,\n\t\t\t\tbiller_id, \n\t\t\t\tcustomer_id, \n\t\t\t\ttype_id,\n\t\t\t\tpreference_id, \n\t\t\t\tdate, \n\t\t\t\tnote,\n\t\t\t\tcustom_field1,\n\t\t\t\tcustom_field2,\n\t\t\t\tcustom_field3,\n\t\t\t\tcustom_field4\n\t\t\t)\n\t\t\tVALUES\n\t\t\t(\n\t\t\t\tNULL,\n\t\t\t\t:index_id,\n\t\t\t\t:domain_id,\n\t\t\t\t:biller_id,\n\t\t\t\t:customer_id,\n\t\t\t\t:type_id,\n\t\t\t\t:preference_id,\n\t\t\t\t:date,\n\t\t\t\t:note,\n\t\t\t\t:custom_field1,\n\t\t\t\t:custom_field2,\n\t\t\t\t:custom_field3,\n\t\t\t\t:custom_field4\n\t\t\t\t)";
     $pref_group = getPreference($this->preference_id, $this->domain_id);
     $sth = dbQuery($sql, ':index_id', index::next('invoice', $pref_group['index_group'], $this->domain_id), ':domain_id', $this->domain_id, ':biller_id', $this->biller_id, ':customer_id', $this->customer_id, ':type_id', $this->type_id, ':preference_id', $this->preference_id, ':date', $this->date, ':note', trim($this->note), ':custom_field1', $this->custom_field1, ':custom_field2', $this->custom_field2, ':custom_field3', $this->custom_field3, ':custom_field4', $this->custom_field4);
     #index::increment('invoice',$pref_group['index_group'], $domain_id,$this->biller_id);
     index::increment('invoice', $pref_group['index_group'], $this->domain_id);
     return lastInsertID();
 }
开发者ID:JPG-Consulting,项目名称:simpleinvoices,代码行数:11,代码来源:invoice.php


示例4: getPreference

                            dots = '';
                            if(description.length > 80){
                                dots = '...';
                            }

                            var plugins_downloaded  = <?php 
$plugins_downloaded = getPreference('plugins_downloaded');
if ($plugins_downloaded != '') {
    echo $plugins_downloaded;
} else {
    echo 'new Array()';
}
?>
;
                            var plugin_to_update    = <?php 
echo getPreference('plugins_to_update');
?>
;
                            var button = '';

                            if(jQuery.inArray(data.plugins[i].s_update_url, plugins_downloaded) >= 0 ) {
                                if( jQuery.inArray(data.plugins[i].s_update_url, plugin_to_update) >= 0 ) {
                                    button = '<a href="#'+data.plugins[i].s_update_url+'" class="btn btn-mini btn-orange market-popup market_update"><?php 
echo osc_esc_js(__('Update'));
?>
</a>';
                                } else {
                                    button = '<a href="#" class="btn btn-mini btn-blue btn-disabled" ><?php 
echo osc_esc_js(__('Already downloaded'));
?>
</a>';
开发者ID:semul,项目名称:Osclass,代码行数:31,代码来源:plugins.php


示例5: osc_subdomain_host

/**
 * Return subdomain host
 *
 * @return string
 */
function osc_subdomain_host()
{
    return getPreference('subdomain_host');
}
开发者ID:mylastof,项目名称:os-class,代码行数:9,代码来源:hPreference.php


示例6: bender_default_show_as

 function bender_default_show_as()
 {
     return getPreference('defaultShowAs@all', 'bender');
 }
开发者ID:mylastof,项目名称:os-class,代码行数:4,代码来源:functions.php


示例7: getUpdateNames

function getUpdateNames($count = 100)
{
    // where did we start off?
    $lastindex = getPreference("last_userupdate_index");
    // return those rows
    global $link;
    /* echo "SELECT UserName FROM Participants LIMIT ".$lastindex." ".$count ; */
    /* $namesresult = mysqli_query($link, "SELECT UserName FROM Participants  */
    /*     LIMIT ".$lastindex.", ".$count) */
    /*         or die(__FILE__.__LINE__.mysqli_error($link)); */
    // echo "SELECT UserName FROM Participants LIMIT ".$lastindex." ".$count . "\n" ;
    $namesresult = mysqli_query($link, "SELECT UserName FROM Participants \n        LIMIT " . $lastindex . ", " . $count) or die(__FILE__ . __LINE__ . mysqli_error($link));
    $namearray = array();
    while ($namerow = mysqli_fetch_assoc($namesresult)) {
        $namearray[] = $namerow['UserName'];
    }
    // how many rows, if we need to wrap
    $countresult = mysqli_query($link, "SELECT COUNT(*) FROM Participants") or die(__FILE__ . __LINE__ . mysqli_error($link));
    $totalcount = mysqli_fetch_array($countresult);
    $lastindex += $count;
    if ($lastindex >= $totalcount[0]) {
        $lastindex = 0;
    }
    // Save the last updated index (wrapping if necessary)
    setPreference("last_userupdate_index", $lastindex);
    return $namearray;
}
开发者ID:language-learners,项目名称:superchallengebot,代码行数:27,代码来源:database.php


示例8: getPreference

                                    var description = $(data.themes[i].s_description).text();
                                    dots = '';
                                    if(description.length > 80){
                                        dots = '...';
                                    }
                                    var themes_downloaded  = <?php 
$themes_downloaded = getPreference('themes_downloaded');
if ($themes_downloaded != '') {
    echo $themes_downloaded;
} else {
    echo 'new Array()';
}
?>
;
                                    var themes_to_update    = <?php 
echo getPreference('themes_to_update');
?>
;
                                    var button = '';

                                    if(jQuery.inArray(data.themes[i].s_update_url, themes_downloaded) >= 0 ) {
                                        if( jQuery.inArray(data.themes[i].s_update_url, themes_to_update) >= 0 ) {
                                            button = '<a href="#'+data.themes[i].s_update_url+'" class="btn btn-mini btn-orange market-popup market_update"><?php 
echo osc_esc_js(__('Update'));
?>
</a>';
                                        } else {
                                            button = '<a href="#" class="btn btn-mini btn-disabled" ><?php 
echo osc_esc_js(__('Already downloaded'));
?>
</a>';
开发者ID:semul,项目名称:Osclass,代码行数:31,代码来源:themes.php


示例9: foreach

                <option value='0'> </option>
EOD;
                        foreach ($taxes as $tax) {
                            $selected = $tax['tax_id'] == $defaults['tax'] ? "selected style='font-weight: bold'" : "";
                            $escaped = htmlsafe($tax['tax_description']);
                            $display_block_tax .= <<<EOD
\t\t\t<option {$selected} value="{$tax['tax_id']}">{$escaped}</option>
EOD;
                        }
                    }
                    $description = "{$LANG['tax']}";
                    $value = $display_block_tax;
                } else {
                    if ($_GET["submit"] == "preference_id") {
                        $pref = getPreference($defaults['preference']);
                        $preferences = getActivePreferences();
                        if ($preferences == null) {
                            //no records
                            $display_block_preferences = "<p><em>{$LANG['no_preferences']}</em></p>";
                        } else {
                            $default = "preference";
                            //has records, so display them
                            $display_block_preferences = <<<EOD
\t        <select name="value">

                <option value='0'> </option>
EOD;
                            foreach ($preferences as $preference) {
                                $selected = $preference['pref_id'] == $defaults['preference'] ? "selected style='font-weight: bold'" : "";
                                $escaped = htmlsafe($preference['pref_description']);
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:30,代码来源:edit.php


示例10: doModel


//.........这里部分代码省略.........
             //                            osc_add_flash_error_message( __('Error occurred') . ' ' . $slug , 'admin');
             //                        }
             //                    }
             if (Params::getParam('checkUpdated') != '') {
                 osc_admin_toolbar_update_plugins(true);
             }
             if (Params::getParam('iDisplayLength') == '') {
                 Params::setParam('iDisplayLength', 10);
             }
             // ?
             $this->_exportVariableToView('iDisplayLength', Params::getParam('iDisplayLength'));
             $p_iPage = 1;
             if (is_numeric(Params::getParam('iPage')) && Params::getParam('iPage') >= 1) {
                 $p_iPage = Params::getParam('iPage');
             }
             Params::setParam('iPage', $p_iPage);
             $aPlugin = Plugins::listAll();
             $active_plugins = osc_get_plugins();
             // pagination
             $start = ($p_iPage - 1) * Params::getParam('iDisplayLength');
             $limit = Params::getParam('iDisplayLength');
             $count = count($aPlugin);
             $displayRecords = $limit;
             if ($start + $limit > $count) {
                 $displayRecords = $start + $limit - $count;
             }
             // --------------------------------------------------------
             $aData = array();
             $aInfo = array();
             $max = $start + $limit;
             if ($max > $count) {
                 $max = $count;
             }
             $aPluginsToUpdate = json_decode(getPreference('plugins_to_update'));
             $bPluginsToUpdate = is_array($aPluginsToUpdate) ? true : false;
             for ($i = $start; $i < $max; $i++) {
                 $plugin = $aPlugin[$i];
                 $row = array();
                 $pInfo = osc_plugin_get_info($plugin);
                 // prepare row 1
                 $installed = 0;
                 if (osc_plugin_is_installed($plugin)) {
                     $installed = 1;
                 }
                 $enabled = 0;
                 if (osc_plugin_is_enabled($plugin)) {
                     $enabled = 1;
                 }
                 // prepare row 2
                 $sUpdate = '';
                 // get plugins to update from t_preference
                 if ($bPluginsToUpdate) {
                     if (in_array(@$pInfo['plugin_update_uri'], $aPluginsToUpdate)) {
                         $sUpdate = '<a class="market_update market-popup" href="#' . htmlentities($pInfo['plugin_update_uri']) . '">' . __("There's a new update available") . '</a>';
                     }
                 }
                 // prepare row 4
                 $sConfigure = '';
                 if (isset($active_plugins[$plugin . '_configure'])) {
                     $sConfigure = '<a href="' . osc_admin_base_url(true) . '?page=plugins&amp;action=admin&amp;plugin=' . $pInfo['filename'] . "&amp;" . osc_csrf_token_url() . '">' . __('Configure') . '</a>';
                 }
                 // prepare row 5
                 $sEnable = '';
                 if ($installed) {
                     if ($enabled) {
                         $sEnable = '<a href="' . osc_admin_base_url(true) . '?page=plugins&amp;action=disable&amp;plugin=' . $pInfo['filename'] . "&amp;" . osc_csrf_token_url() . '">' . __('Disable') . '</a>';
开发者ID:jmcclenon,项目名称:Osclass,代码行数:67,代码来源:plugins.php


示例11: osc_check_themes_update

function osc_check_themes_update($force = false)
{
    $total = 0;
    $array = array();
    $array_downloaded = array();
    // check if exist a new version each day
    if (time() - osc_themes_last_version_check() > 24 * 3600 || $force) {
        $themes = WebThemes::newInstance()->getListThemes();
        foreach ($themes as $theme) {
            $info = WebThemes::newInstance()->loadThemeInfo($theme);
            if (osc_check_theme_update(@$info['theme_update_uri'], @$info['version'])) {
                $array[] = $theme;
                $total++;
            }
            $array_downloaded[] = @$info['theme_update_uri'];
        }
        osc_set_preference('themes_to_update', json_encode($array));
        osc_set_preference('themes_downloaded', json_encode($array_downloaded));
        osc_set_preference('themes_update_count', $total);
        osc_set_preference('themes_last_version_check', time());
        osc_reset_preferences();
    } else {
        $total = getPreference('themes_update_count');
    }
    return $total;
}
开发者ID:semul,项目名称:Osclass,代码行数:26,代码来源:functions.php


示例12: osc_get_preference

function osc_get_preference($key, $section = 'osclass')
{
    return getPreference($key, $section);
}
开发者ID:hashemgamal,项目名称:OSClass,代码行数:4,代码来源:hPreference.php


示例13: doModel


//.........这里部分代码省略.........
                             osc_add_flash_error_message(sprintf(_m("Directory '%s' couldn't be removed;)"), $code), 'admin');
                         }
                     } else {
                         osc_add_flash_error_message(sprintf(_m("Directory '%s' couldn't be removed because it's the default language. Set another language as default first and try again"), $code), 'admin');
                     }
                 }
             }
             $this->redirectTo(osc_admin_base_url(true) . '?page=languages');
             break;
         default:
             if (Params::getParam('checkUpdated') != '') {
                 osc_admin_toolbar_update_languages(true);
             }
             if (Params::getParam("action") != "") {
                 osc_run_hook("language_bulk_" . Params::getParam("action"), Params::getParam('id'));
             }
             // -----
             if (Params::getParam('iDisplayLength') == '') {
                 Params::setParam('iDisplayLength', 10);
             }
             // ?
             $this->_exportVariableToView('iDisplayLength', Params::getParam('iDisplayLength'));
             $p_iPage = 1;
             if (is_numeric(Params::getParam('iPage')) && Params::getParam('iPage') >= 1) {
                 $p_iPage = Params::getParam('iPage');
             }
             Params::setParam('iPage', $p_iPage);
             $aLanguages = OSCLocale::newInstance()->listAll();
             // pagination
             $start = ($p_iPage - 1) * Params::getParam('iDisplayLength');
             $limit = Params::getParam('iDisplayLength');
             $count = count($aLanguages);
             $displayRecords = $limit;
             if ($start + $limit > $count) {
                 $displayRecords = $start + $limit - $count;
             }
             // ----
             $aLanguagesToUpdate = json_decode(getPreference('languages_to_update'));
             $bLanguagesToUpdate = is_array($aLanguagesToUpdate) ? true : false;
             // ----
             $aData = array();
             $max = $start + $limit;
             if ($max > $count) {
                 $max = $count;
             }
             for ($i = $start; $i < $max; $i++) {
                 $l = $aLanguages[$i];
                 $row = array();
                 $row[] = '<input type="checkbox" name="id[]" value="' . $l['pk_c_code'] . '" />';
                 $options = array();
                 $options[] = '<a href="' . osc_admin_base_url(true) . '?page=languages&amp;action=edit&amp;id=' . $l['pk_c_code'] . '">' . __('Edit') . '</a>';
                 $options[] = '<a href="' . osc_admin_base_url(true) . '?page=languages&amp;action=' . ($l['b_enabled'] == 1 ? 'disable_selected' : 'enable_selected') . '&amp;id[]=' . $l['pk_c_code'] . '&amp;' . osc_csrf_token_url() . '">' . ($l['b_enabled'] == 1 ? __('Disable (website)') : __('Enable (website)')) . '</a> ';
                 $options[] = '<a href="' . osc_admin_base_url(true) . '?page=languages&amp;action=' . ($l['b_enabled_bo'] == 1 ? 'disable_bo_selected' : 'enable_bo_selected') . '&amp;id[]=' . $l['pk_c_code'] . '&amp;' . osc_csrf_token_url() . '">' . ($l['b_enabled_bo'] == 1 ? __('Disable (oc-admin)') : __('Enable (oc-admin)')) . '</a>';
                 $options[] = '<a onclick="return delete_dialog(\'' . $l['pk_c_code'] . '\');"  href="' . osc_admin_base_url(true) . '?page=languages&amp;action=delete&amp;id[]=' . $l['pk_c_code'] . '&amp;' . osc_csrf_token_url() . '">' . __('Delete') . '</a>';
                 $auxOptions = '<ul>' . PHP_EOL;
                 foreach ($options as $actual) {
                     $auxOptions .= '<li>' . $actual . '</li>' . PHP_EOL;
                 }
                 $actions = '<div class="actions">' . $auxOptions . '</div>' . PHP_EOL;
                 $sUpdate = '';
                 // get languages to update from t_preference
                 if ($bLanguagesToUpdate) {
                     if (in_array($l['pk_c_code'], $aLanguagesToUpdate)) {
                         $sUpdate = '<a class="btn-market-update btn-market-popup" href="#' . htmlentities($l['pk_c_code']) . '">' . __("Update here") . '</a>';
                     }
                 }
                 $row[] = $l['s_name'] . $sUpdate . $actions;
                 $row[] = $l['s_short_name'];
                 $row[] = $l['s_description'];
                 $row[] = $l['b_enabled'] ? __('Yes') : __('No');
                 $row[] = $l['b_enabled_bo'] ? __('Yes') : __('No');
                 $aData[] = $row;
             }
             // ----
             $array['iTotalRecords'] = $displayRecords;
             $array['iTotalDisplayRecords'] = count($aLanguages);
             $array['iDisplayLength'] = $limit;
             $array['aaData'] = $aData;
             $page = (int) Params::getParam('iPage');
             if (count($array['aaData']) == 0 && $page != 1) {
                 $total = (int) $array['iTotalDisplayRecords'];
                 $maxPage = ceil($total / (int) $array['iDisplayLength']);
                 $url = osc_admin_base_url(true) . '?' . $_SERVER['QUERY_STRING'];
                 if ($maxPage == 0) {
                     $url = preg_replace('/&iPage=(\\d)+/', '&iPage=1', $url);
                     $this->redirectTo($url);
                 }
                 if ($page > 1) {
                     $url = preg_replace('/&iPage=(\\d)+/', '&iPage=' . $maxPage, $url);
                     $this->redirectTo($url);
                 }
             }
             $this->_exportVariableToView('aLanguages', $array);
             $bulk_options = array(array('value' => '', 'data-dialog-content' => '', 'label' => __('Bulk actions')), array('value' => 'enable_selected', 'data-dialog-content' => sprintf(__('Are you sure you want to %s the selected languages?'), strtolower(__('Enable (Website)'))), 'label' => __('Enable (Website)')), array('value' => 'disable_selected', 'data-dialog-content' => sprintf(__('Are you sure you want to %s the selected languages?'), strtolower(__('Disable (Website)'))), 'label' => __('Disable (Website)')), array('value' => 'enable_bo_selected', 'data-dialog-content' => sprintf(__('Are you sure you want to %s the selected languages?'), strtolower(__('Enable (oc-admin)'))), 'label' => __('Enable (oc-admin)')), array('value' => 'disable_bo_selected', 'data-dialog-content' => sprintf(__('Are you sure you want to %s the selected languages?'), strtolower(__('Disable (oc-admin)'))), 'label' => __('Disable (oc-admin)')), array('value' => 'delete', 'data-dialog-content' => sprintf(__('Are you sure you want to %s the selected languages?'), strtolower(__('Delete'))), 'label' => __('Delete')));
             $bulk_options = osc_apply_filter("language_bulk_filter", $bulk_options);
             $this->_exportVariableToView('bulk_options', $bulk_options);
             $this->doView('languages/index.php');
             break;
     }
 }
开发者ID:jmcclenon,项目名称:Osclass,代码行数:101,代码来源:languages.php


示例14: flatter_def_color

 function flatter_def_color()
 {
     return getPreference('defaultColor@all', 'flatter_theme');
 }
开发者ID:abhi143u11,项目名称:ads,代码行数:4,代码来源:functions.php


示例15: drawMarketItem

function drawMarketItem($item, $color = false)
{
    //constants
    $updateClass = '';
    $updateData = '';
    $thumbnail = false;
    $featuredClass = '';
    $style = '';
    $letterDraw = '';
    $compatible = '';
    $type = strtolower($item['e_type']);
    $items_to_update = json_decode(getPreference($type . 's_to_update'), true);
    $items_downloaded = json_decode(getPreference($type . 's_downloaded'), true);
    if ($item['s_thumbnail']) {
        $thumbnail = $item['s_thumbnail'];
    }
    if ($item['s_banner']) {
        if (@$item['s_banner_path'] != '') {
            $thumbnail = $item['s_banner_path'] . $item['s_banner'];
        } else {
            $thumbnail = 'http://market.osclass.org/oc-content/uploads/market/' . $item['s_banner'];
        }
    }
    $downloaded = false;
    if (in_array($item['s_update_url'], $items_downloaded)) {
        if (in_array($item['s_update_url'], $items_to_update)) {
            $updateClass = 'has-update';
            $updateData = ' data-update="true"';
        } else {
            // market item downloaded !
            $downloaded = true;
        }
    }
    //Check if is compatibleosc_version()
    if ($type == 'language') {
        if (!check_market_language_compatibility($item['s_update_url'], $item['s_version'])) {
            $compatible = ' not-compatible';
        }
    } else {
        if (!check_market_compatibility($item['s_compatible'], $type)) {
            $compatible = ' not-compatible';
        }
    }
    if (!$thumbnail && $color) {
        $thumbnail = osc_current_admin_theme_url('images/gr-' . $color . '.png');
        $letterDraw = $item['s_update_url'][0];
        if ($type == 'language') {
            $letterDraw = $item['s_update_url'];
        }
    }
    if ($item['b_featured']) {
        $featuredClass = ' is-featured';
        if ($downloaded || $updateClass) {
            $featuredClass .= '-';
        }
    }
    if ($downloaded) {
        $featuredClass .= 'is-downloaded';
    }
    $style = 'background-image:url(' . $thumbnail . ');';
    echo '<a href="#' . $item['s_update_url'] . '" class="mk-item-parent ' . $featuredClass . $updateClass . $compatible . '" data-type="' . $type . '"' . $updateData . ' data-gr="' . $color . '" data-letter="' . $item['s_update_url'][0] . '">';
    echo '<div class="mk-item mk-item-' . $type . '">';
    echo '    <div class="banner" style="' . $style . '">' . $letterDraw . '</div>';
    echo '    <div class="mk-info"><i class="flag"></i>';
    echo '        <h3>' . $item['s_title'] . '</h3>';
    echo '        <span class="downloads"><strong>' . $item['i_total_downloads'] . '</strong> ' . __('downloads') . '</span>';
    echo '        <i>by ' . $item['s_contact_name'] . '</i>';
    echo '        <div class="market-actions">';
    echo '            <span class="more">' . __('View more') . '</span>';
    echo '            <span class="download-btn' . $compatible . '" data-code="' . $item['s_update_url'] . '" data-type="' . $type . '"' . '>' . __('Download') . '</span>';
    echo '        </div>';
    echo '    </div>';
    echo '</div>';
    echo '</a>';
}
开发者ID:jmcclenon,项目名称:Osclass,代码行数:75,代码来源:functions.php


示例16: run

 public function run()
 {
     global $db;
     $today = date('Y-m-d');
     $cron = new cron();
     $data = $cron->select_crons_to_run();
     $return['cron_message'] = "Cron started";
     $number_of_crons_run = "0";
     $cron_log = new cronlog();
     $cron_log->run_date = $today;
     foreach ($data as $key => $value) {
         $cron->domain_id = $value['domain_id'];
         $cron_log->cron_id = $value['id'];
         $cron_log->domain_id = $domain_id = $value['domain_id'];
         $check_cron_log = $cron_log->check();
         $i = "0";
         if ($check_cron_log == 0) {
             //only proceed if cron has not been run for today
             $run_cron = false;
             $start_date = date('Y-m-d', strtotime($value['start_date']));
             $end_date = $value['end_date'];
             // Seconds in a day = 60 * 60 * 24 = 86400
             $diff = number_format((strtotime($today) - strtotime($start_date)) / 86400, 0);
             //only check if diff is positive
             if ($diff >= 0 and ($end_date == "" or $end_date >= $today)) {
                 if ($value['recurrence_type'] == 'day') {
                     $modulus = $diff % $value['recurrence'];
                     if ($modulus == 0) {
                         $run_cron = true;
                     } else {
                         #$return .= "cron does not runs TODAY-days";
                     }
                 }
                 if ($value['recurrence_type'] == 'week') {
                     $period = 7 * $value['recurrence'];
                     $modulus = $diff % $period;
                     if ($modulus == 0) {
                         $run_cron = true;
                     } else {
                         #$return .= "cron is not runs TODAY-week";
                     }
                 }
                 if ($value['recurrence_type'] == 'month') {
                     $start_day = date('d', strtotime($value['start_date']));
                     $start_month = date('m', strtotime($value['start_date']));
                     $start_year = date('Y', strtotime($value['start_date']));
                     $today_day = date('d');
                     $today_month = date('m');
                     $today_year = date('Y');
                     $months = $today_month - $start_month + 12 * ($today_year - $start_year);
                     $modulus = $months % $value['recurrence'];
                     if ($modulus == 0 and $start_day == $today_day) {
                         $run_cron = true;
                     } else {
                         #$return .= "cron is not runs TODAY-month";
                     }
                 }
                 if ($value['recurrence_type'] == 'year') {
                     $start_day = date('d', strtotime($value['start_date']));
                     $start_month = date('m', strtotime($value['start_date']));
                     $start_year = date('Y', strtotime($value['start_date']));
                     $today_day = date('d');
                     $today_month = date('m');
                     $today_year = date('Y');
                     $years = $today_year - $start_year;
                     $modulus = $years % $value['recurrence'];
                     if ($modulus == 0 and $start_day == $today_day and $start_month == $today_month) {
                         $run_cron = true;
                     } else {
                         #$return .= "cron is not runs TODAY-year";
                     }
                 }
                 //run the recurrence for this invoice
                 if ($run_cron) {
                     $number_of_crons_run++;
                     $return['cron_message_' . $value['cron_id']] = "Cron ID: " . $value['cron_id'] . " - Cron for " . $value['index_name'] . " with start date of " . $value['start_date'] . ", end date of " . $value['end_date'] . " where it runs each " . $value['recurrence'] . " " . $value['recurrence_type'] . " was run today :: Info diff=" . $diff;
                     $i++;
                     $ni = new invoice();
                     $ni->id = $value['invoice_id'];
                     $ni->domain_id = $domain_id;
                     // $domain_id gets propagated from invoice to be copied from
                     $new_invoice_id = $ni->recur();
                     //insert into cron_log date of run
                     //$cron_log = new cronlog();
                     //$cron_log->run_date = $today;
                     //$cron_log->domain_id = $domain_id;
                     //$cron_log->cron_id = $value['cron_id'];
                     $cron_log->insert();
                     ## email the people
                     $invoiceobj = new invoice();
                     $invoice = $invoiceobj->select($new_invoice_id, $domain_id);
                     $preference = getPreference($invoice['preference_id'], $domain_id);
                     $biller = getBiller($invoice['biller_id'], $domain_id);
                     $customer = getCustomer($invoice['customer_id'], $domain_id);
                     #print_r($customer);
                     #create PDF nameVj
                     $spc2us_pref = str_replace(" ", "_", $invoice['index_name']);
                     $pdf_file_name_invoice = $spc2us_pref . ".pdf";
                     // email invoice
                     if ($value['email_biller'] == "1" or $value['email_customer'] == "1") {
//.........这里部分代码省略.........
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:101,代码来源:cron.php


示例17: osclassclsx_default_show_as

 function osclassclsx_default_show_as()
 {
     return getPreference('defaultShowAs@all', 'osclassclsx');
 }
开发者ID:kraymond70,项目名称:osclassclsx,代码行数:4,代码来源:functions.php


示例18: osc_add_hook

                $("#dialog-uninstall").dialog('open');
                return false;
            }
        </script>
        <?php 
}
osc_add_hook('admin_header', 'customHead');
$iDisplayLength = __get('iDisplayLength');
$aData = __get('aPlugins');
$tab_index = 1;
osc_current_admin_theme_path('parts/header.php');
?>
<div id="tabs" class="ui-osc-tabs ui-tabs-right">
    <ul>
        <?php 
$aPluginsToUpdate = json_decode(getPreference('plugins_to_update'));
$bPluginsToUpdate = is_array($aPluginsToUpdate) ? true : false;
if ($bPluginsToUpdate && count($aPluginsToUpdate) > 0) {
    $tab_index = 2;
    ?>
        <li><a href="#update-plugins"><?php 
    _e('Updates');
    ?>
</a></li>
        <?php 
}
?>
        <li><a href="#market" onclick="window.location = '<?php 
echo osc_admin_base_url(true) . '?page=market&action=plugins';
?>
'; return false; "><?php 
开发者ID:semul,项目名称:Osclass,代码行数:31,代码来源:index.php


示例19: checkLogin

* Script: email.php
* 	Email invoice page
*
* License:
*	 GPL v3 or above
*
* Website:
* 	http://www.simpleinvoices.org
*/
//stop the direct browsing to this file - let index.php handle which files get displayed
checkLogin();
#get the invoice id
$invoice_id = $_GET['id'];
$invoiceobj = new invoice();
$invoice = $invoiceobj->select($invoice_id);
$preference = getPreference($invoice['preference_id']);
$biller = getBiller($invoice['biller_id']);
$customer = getCustomer($invoice['customer_id']);
$invoiceType = getInvoiceType($invoice['type_id']);
#create PDF name
$spc2us_pref = str_replace(" ", "_", $invoice['index_name']);
$pdf_file_name = $spc2us_pref . '.pdf';
if ($_GET['stage'] == 2) {
    #echo $block_stage2;
    // Create invoice
    $export = new export();
    $export->format = "pdf";
    $export->file_location = 'file';
    $export->module = 'invoice';
    $export->id = $invoice_id;
    $export->execute();
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:31,代码来源:email.php


示例20: pop_default_show_as

 function pop_default_show_as()
 {
     return getPreference('defaultShowAs@all', 'pop_theme');
 }
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:4,代码来源:functions.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP getPrevAlbum函数代码示例发布时间:2022-05-15
下一篇:
PHP getPref函数代码示例发布时间: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