当前位置: 首页>>代码示例>>PHP>>正文


PHP osc_base_url函数代码示例

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


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

示例1: minify_clean_url

/**
 * Sanitize the file url removing the base url
 * @param array $urls
 * @return array Urls
 */
function minify_clean_url(array $urls)
{
    foreach ($urls as &$url) {
        $url = str_replace(osc_base_url(), '/', $url);
    }
    return $urls;
}
开发者ID:oanav,项目名称:closetshare,代码行数:12,代码来源:index.php

示例2: new_pm_email

/**
 * Send email to user when they get a new PM
 * 
 * @param integer $item
 * @param integer $offer_value 
 *
 * @dynamic tags
 *
 * '{RECIP_NAME}', '{SENDER_NAME}', '{WEB_URL}', '{WEB_TITLE}', '{PM_URL}', '{PM_SUBJECT}', '{PM_MESSAGE}'
 */
function new_pm_email($pm_info)
{
    $mPages = new Page();
    $aPage = $mPages->findByInternalName('email_PM_alert');
    $locale = osc_current_user_locale();
    $content = array();
    if (isset($aPage['locale'][$locale]['s_title'])) {
        $content = $aPage['locale'][$locale];
    } else {
        $content = current($aPage['locale']);
    }
    if ($pm_info['sender_id'] == 0) {
        $sender_name = pmAdmin();
    } else {
        $pm_senderData = User::newInstance()->findByPrimaryKey($pm_info['sender_id']);
        $sender_name = $pm_senderData['s_name'];
    }
    if ($pm_info['recip_id'] == 0) {
        $pm_url = osc_admin_base_url(true) . '?page=plugins&action=renderplugin&file=osclass_pm/admin-send.php?userId=' . $pm_info['sender_id'] . '&mType=adminQuote&messId=' . $pm_info['pm_id'];
        $pm_name = pmAdmin();
        $pm_recipData['s_email'] = osc_contact_email();
    } else {
        $pm_url = osc_base_url(true) . '?page=custom&file=osclass_pm/user-send.php?userId=' . $pm_info['sender_id'] . '&mType=quote&messId=' . $pm_info['pm_id'];
        $pm_recipData = User::newInstance()->findByPrimaryKey($pm_info['recip_id']);
        $pm_name = $pm_recipData['s_name'];
    }
    $pm_url = '<a href="' . $pm_url . '" >' . $pm_url . '</a>';
    $words = array();
    $words[] = array('{RECIP_NAME}', '{SENDER_NAME}', '{WEB_URL}', '{WEB_TITLE}', '{PM_URL}', '{PM_SUBJECT}', '{PM_MESSAGE}', '[quote]', '[/quote]', '[quoteAuthor]', '[/quoteAuthor]');
    $words[] = array($pm_name, $sender_name, osc_base_url(), osc_page_title(), $pm_url, $pm_info['pm_subject'], nl2br($pm_info['pm_message']), '<div class="messQuote">', '</div>', '<div class="quoteAuthor">', '</div>');
    $title = osc_mailBeauty($content['s_title'], $words);
    $body = osc_mailBeauty($content['s_text'], $words);
    $emailParams = array('subject' => $title, 'to' => $pm_recipData['s_email'], 'to_name' => $pm_name, 'body' => $body, 'alt_body' => $body);
    osc_sendMail($emailParams);
}
开发者ID:oanav,项目名称:closetshare,代码行数:45,代码来源:email-temps.php

示例3: __construct

 function __construct()
 {
     // this is necessary because if HTTP_HOST doesn't have the PORT the parse_url is null
     $current_host = parse_url(Params::getServerParam('HTTP_HOST'), PHP_URL_HOST);
     if ($current_host === null) {
         $current_host = Params::getServerParam('HTTP_HOST');
     }
     if (parse_url(osc_base_url(), PHP_URL_HOST) !== $current_host) {
         // first check if it's http or https
         $url = 'http://';
         if (osc_is_ssl()) {
             $url = 'https://';
         }
         // append the domain
         $url .= parse_url(osc_base_url(), PHP_URL_HOST);
         // append the port number if it's necessary
         $http_port = parse_url(Params::getServerParam('HTTP_HOST'), PHP_URL_PORT);
         if ($http_port !== 80) {
             $url .= ':' . parse_url(Params::getServerParam('HTTP_HOST'), PHP_URL_PORT);
         }
         // append the request
         $url .= Params::getServerParam('REQUEST_URI', false, false);
         $this->redirectTo($url);
     }
     $this->subdomain_params($current_host);
     $this->page = Params::getParam('page');
     $this->action = Params::getParam('action');
     $this->ajax = false;
     $this->time = list($sm, $ss) = explode(' ', microtime());
     WebThemes::newInstance();
     osc_run_hook('init');
 }
开发者ID:oanav,项目名称:closetshare,代码行数:32,代码来源:BaseModel.php

示例4: autocompleteCity

function autocompleteCity()
{
    ?>
    <script type="text/javascript">
    $(function() {
                    function log( message ) {
                        $( "<div/>" ).text( message ).prependTo( "#log" );
                        $( "#log" ).attr( "scrollTop", 0 );
                    }

                    $( "#sCity" ).autocomplete({
                        source: "<?php 
    echo osc_base_url(true);
    ?>
?page=ajax&action=location",
                        minLength: 2,
                        select: function( event, ui ) {
                            $("#sRegion").attr("value", ui.item.region);
                            log( ui.item ?
                                "<?php 
    echo osc_esc_html(__('Selected', 'bender'));
    ?>
: " + ui.item.value + " aka " + ui.item.id :
                                "<?php 
    echo osc_esc_html(__('Nothing selected, input was', 'bender'));
    ?>
 " + this.value );
                        }
                    });
                });
    </script>
    <?php 
}
开发者ID:mylastof,项目名称:os-class,代码行数:33,代码来源:search.php

示例5: setCurrentThemeUrl

 private function setCurrentThemeUrl()
 {
     if ($this->theme_exists) {
         $this->theme_url = osc_base_url() . 'oc-content/themes/' . $this->theme . '/';
     } else {
         $this->theme_url = osc_base_url() . 'oc-includes/osclass/gui/';
     }
 }
开发者ID:hashemgamal,项目名称:OSClass,代码行数:8,代码来源:WebThemes.php

示例6: indeed

function indeed()
{
    echo '<?xml version="1.0" encoding="utf-8"?>
    <source>
    <publisher>' . osc_page_title() . '</publisher>
    <publisherurl>' . osc_base_url() . '</publisherurl>
    <lastBuildDate>' . date("D, j M Y G:i:s T") . '</lastBuildDate>';
    if (osc_count_items()) {
        while (osc_has_items()) {
            $item = feed_get_job_data(osc_item());
            $salary = "";
            if (isset($item['i_salary_min']) && $item['i_salary_min'] != '') {
                $salary = $item['i_salary_min'];
            }
            if (isset($item['i_salary_max']) && $item['i_salary_max'] != '') {
                if ($salary != "") {
                    $salary .= ' - ';
                }
                $salary .= $item['i_salary_max'];
            }
            if (isset($item['e_salary_period']) && $item['e_slary_period'] != '') {
                if ($salary != "") {
                    $salary .= ' ';
                    $salary .= $item['e_salary_period'];
                }
            }
            $locale = current($item['locale']);
            if (isset($locale['s_desired_exp']) && $locale['s_desired_exp'] != '') {
                $experience = $locale['s_desired_exp'];
            } else {
                $experience = '';
            }
            if (isset($locale['s_studies']) && $locale['s_studies'] != '') {
                $education = $locale['s_studies'];
            } else {
                $education = '';
            }
            echo '<job>
            <title><![CDATA[' . osc_item_title() . ']]></title>
            <date><![CDATA[' . osc_item_pub_date() . ']]></date>
            <referencenumber><![CDATA[' . osc_item_id() . ']]></referencenumber>
            <url><![CDATA[' . osc_item_url() . ']]></url>
            <company><![CDATA[' . (isset($item['s_company_name']) && $item['s_company_name'] != NULL ? $item['s_company_name'] : '') . ']]></company>
            <city><![CDATA[' . (osc_item_city() != NULL ? osc_item_city() : '') . ']]></city>
            <state><![CDATA[' . (osc_item_region() != NULL ? osc_item_region() : '') . ']]></state>
            <country><![CDATA[' . (osc_item_country() != NULL ? osc_item_country() : '') . ']]></country>
            <postalcode><![CDATA[' . (osc_item_zip() != NULL ? osc_item_zip() : '') . ']]></postalcode>
            <description><![CDATA[' . (osc_item_description() != NULL ? osc_item_description() : '') . ']]></description>
            <salary><![CDATA[' . $salary . ']]></salary>
            <education><![CDATA[' . $education . ']]></education>
            <jobtype><![CDATA[' . (isset($item['e_position_type']) && $item['e_position_type'] != NULL ? $item['e_position_type'] : '') . ']]></jobtype>
            <category><![CDATA[]]></category>
            <experience><![CDATA[' . $experience . ']]></experience>
            </job>';
        }
    }
    echo '</source>';
}
开发者ID:oanav,项目名称:closetshare,代码行数:58,代码来源:indeed.php

示例7: doModel

 function doModel()
 {
     switch ($this->action) {
         case 'change_email_confirm':
             //change email confirm
             if (Params::getParam('userId') && Params::getParam('code')) {
                 $userManager = new User();
                 $user = $userManager->findByPrimaryKey(Params::getParam('userId'));
                 if ($user['s_pass_code'] == Params::getParam('code') && $user['b_enabled'] == 1) {
                     $userEmailTmp = UserEmailTmp::newInstance()->findByPk(Params::getParam('userId'));
                     $code = osc_genRandomPassword(50);
                     $userManager->update(array('s_email' => $userEmailTmp['s_new_email']), array('pk_i_id' => $userEmailTmp['fk_i_user_id']));
                     Item::newInstance()->update(array('s_contact_email' => $userEmailTmp['s_new_email']), array('fk_i_user_id' => $userEmailTmp['fk_i_user_id']));
                     ItemComment::newInstance()->update(array('s_author_email' => $userEmailTmp['s_new_email']), array('fk_i_user_id' => $userEmailTmp['fk_i_user_id']));
                     Alerts::newInstance()->update(array('s_email' => $userEmailTmp['s_new_email']), array('fk_i_user_id' => $userEmailTmp['fk_i_user_id']));
                     Session::newInstance()->_set('userEmail', $userEmailTmp['s_new_email']);
                     UserEmailTmp::newInstance()->delete(array('s_new_email' => $userEmailTmp['s_new_email']));
                     osc_add_flash_ok_message(_m('Your email has been changed successfully'));
                     $this->redirectTo(osc_user_profile_url());
                 } else {
                     osc_add_flash_error_message(_m('Sorry, the link is not valid'));
                     $this->redirectTo(osc_base_url());
                 }
             } else {
                 osc_add_flash_error_message(_m('Sorry, the link is not valid'));
                 $this->redirectTo(osc_base_url());
             }
             break;
         case 'activate_alert':
             $email = Params::getParam('email');
             $secret = Params::getParam('secret');
             $result = 0;
             if ($email != '' && $secret != '') {
                 $result = Alerts::newInstance()->activate($email, $secret);
             }
             if ($result == 1) {
                 osc_add_flash_ok_message(_m('Alert activated'));
             } else {
                 osc_add_flash_error_message(_m('Ops! There was a problem trying to activate alert. Please contact the administrator'));
             }
             $this->redirectTo(osc_base_url(true));
             break;
         case 'unsub_alert':
             $email = Params::getParam('email');
             $secret = Params::getParam('secret');
             if ($email != '' && $secret != '') {
                 Alerts::newInstance()->delete(array('s_email' => $email, 'S_secret' => $secret));
                 osc_add_flash_ok_message(_m('Unsubscribed correctly'));
             } else {
                 osc_add_flash_error_message(_m('Ops! There was a problem trying to unsubscribe you. Please contact the administrator'));
             }
             $this->redirectTo(osc_base_url());
             break;
         default:
             $this->redirectTo(osc_user_login_url());
             break;
     }
 }
开发者ID:nsswaga,项目名称:OSClass,代码行数:58,代码来源:user-non-secure.php

示例8: qrcode_install

function qrcode_install()
{
    @mkdir(osc_content_path() . 'uploads/qrcode/');
    $conn = getConnection();
    osc_set_preference('upload_path', osc_content_path() . 'uploads/qrcode/', 'qrcode', 'STRING');
    osc_set_preference('upload_url', osc_base_url() . 'oc-content/uploads/qrcode/', 'qrcode', 'STRING');
    osc_set_preference('code_size', '2', 'qrcode', 'INTEGER');
    $conn->commit();
}
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:9,代码来源:index.php

示例9: osc_search_pagination

/**
 * Gets the pagination links of search pagination
 *
 * @return string pagination links
 */
function osc_search_pagination()
{
    $params = array();
    if (View::newInstance()->_exists('search_uri')) {
        $params['url'] = osc_base_url() . View::newInstance()->_get('search_uri') . '/{PAGE}';
    }
    $pagination = new Pagination($params);
    return $pagination->doPagination();
}
开发者ID:semul,项目名称:Osclass,代码行数:14,代码来源:hPagination.php

示例10: listcloud_ShowCloud

function listcloud_ShowCloud()
{
    $text_content = file_get_contents(osc_base_url() . '/oc-content/uploads/listcloud_feeds.cache');
    $cloud = new PTagCloud(50);
    $cloud->setUTF8(true);
    $cloud->addTagsFromText($text_content);
    $cloud->setWidth("300px");
    echo $cloud->listcloud_Show();
}
开发者ID:fear-otaku,项目名称:oc-listcloud,代码行数:9,代码来源:index.php

示例11: dialogJS

    public static function dialogJS()
    {
        ?>
            <div id="coinjar-dialog" title="<?php 
        _e('CoinJar', 'payment');
        ?>
" style="display: none;"><span id="coinjar-dialog-text"></span></div>
            <script type="text/javascript">
                function coinjar_pay(amount, description, itemnumber, extra) {
                    $('#coinjar-dialog-text').html('<?php 
        _e('You are going to be redirected to our payment processor to continue with the payment. Please wait', 'payment');
        ?>
');
                    $('#coinjar-dialog').dialog('open');
                    $.ajax({
                        type: "POST",
                        url: '<?php 
        echo osc_base_url(true);
        ?>
',
                        dataType: 'json',
                        data: {
                            'page':'ajax',
                            'action':'runhook',
                            'hook':'coinjar',
                            'amount':amount,
                            'description':description,
                            'itemnumber':itemnumber,
                            'extra':extra
                        },
                        success: function(data)
                        {
                            console.log(data);
                            if(data.error==0) {
                                window.location = data.url;
                            } else {
                                $('#coinjar-dialog-text').html('<?php 
        _e('We are experiencing some errors, please try in a few moments', 'payment');
        ?>
');
                            }
                        }
                    });
                }

                $(document).ready(function(){
                    $("#coinjar-dialog").dialog({
                        autoOpen: false,
                        modal: true
                    });
                });

            </script>

        <?php 
    }
开发者ID:virsoni,项目名称:plugin-payment,代码行数:56,代码来源:CoinjarPayment.php

示例12: doModel

 function doModel()
 {
     switch ($this->action) {
         case 'contact_post':
             //contact_post
             $yourName = Params::getParam('yourName');
             $yourEmail = Params::getParam('yourEmail');
             $subject = Params::getParam('subject');
             $message = Params::getParam('message');
             if (osc_recaptcha_private_key() != '' && Params::existParam("recaptcha_challenge_field")) {
                 if (!osc_check_recaptcha()) {
                     osc_add_flash_error_message(_m('The Recaptcha code is wrong'));
                     Session::newInstance()->_setForm("yourName", $yourName);
                     Session::newInstance()->_setForm("yourEmail", $yourEmail);
                     Session::newInstance()->_setForm("subject", $subject);
                     Session::newInstance()->_setForm("message_body", $message);
                     $this->redirectTo(osc_contact_url());
                     return false;
                     // BREAK THE PROCESS, THE RECAPTCHA IS WRONG
                 }
             }
             if (!preg_match('|.*?@.{2,}\\..{2,}|', $yourEmail)) {
                 osc_add_flash_error_message(_m('You have to introduce a correct e-mail'));
                 Session::newInstance()->_setForm("yourName", $yourName);
                 Session::newInstance()->_setForm("subject", $subject);
                 Session::newInstance()->_setForm("message_body", $message);
                 $this->redirectTo(osc_contact_url());
             }
             $params = array('from' => $yourEmail, 'from_name' => $yourName, 'subject' => '[' . osc_page_title() . '] ' . __('Contact form') . ': ' . $subject, 'to' => osc_contact_email(), 'to_name' => __('Administrator'), 'body' => $message, 'alt_body' => $message);
             if (osc_contact_attachment()) {
                 $attachment = Params::getFiles('attachment');
                 $resourceName = $attachment['name'];
                 $tmpName = $attachment['tmp_name'];
                 $resourceType = $attachment['type'];
                 $path = osc_content_path() . 'uploads/' . time() . '_' . $resourceName;
                 if (!is_writable(osc_content_path() . 'uploads/')) {
                     osc_add_flash_error_message(_m('There has been some errors sending the message'));
                     $this->redirectTo(osc_base_url());
                 }
                 if (!move_uploaded_file($tmpName, $path)) {
                     unset($path);
                 }
             }
             if (isset($path)) {
                 $params['attachment'] = $path;
             }
             osc_sendMail($params);
             osc_add_flash_ok_message(_m('Your e-mail has been sent properly. Thank your for contacting us!'));
             $this->redirectTo(osc_base_url());
             break;
         default:
             //contact
             $this->doView('contact.php');
     }
 }
开发者ID:acharei,项目名称:OSClass,代码行数:55,代码来源:contact.php

示例13: setGuiTheme

 public function setGuiTheme()
 {
     $this->theme = '';
     $this->theme_exists = false;
     $this->theme_path = osc_lib_path() . 'osclass/gui/';
     $this->theme_url = osc_base_url() . 'oc-includes/osclass/gui/';
     $functions_path = $this->getCurrentThemePath() . 'functions.php';
     if (file_exists($functions_path)) {
         require_once $functions_path;
     }
 }
开发者ID:jmcclenon,项目名称:Osclass,代码行数:11,代码来源:WebThemes.php

示例14: button

    public static function button($amount = '0.00', $description = '', $itemnumber = '101', $extra_array = null)
    {
        $extra = payment_prepare_custom($extra_array);
        $r = rand(0, 1000);
        $extra .= 'random,' . $r;
        $apcs = self::customToAPC($extra);
        $RETURNURL = osc_base_url() . 'oc-content/plugins/' . osc_plugin_folder(__FILE__) . 'return.php?extra=' . $extra;
        $CANCELURL = osc_base_url() . 'oc-content/plugins/' . osc_plugin_folder(__FILE__) . 'cancel.php?extra=' . $extra;
        ?>
            <form method="post" action="https://secure.payza.com/checkout" >
                <input type="hidden" name="ap_merchant" value="seller_1_desteban@osclass.org"/>
                <input type="hidden" name="ap_purchasetype" value="service"/>
                <input type="hidden" name="ap_itemname" value="<?php 
        echo $description;
        ?>
"/>
                <input type="hidden" name="ap_amount" value="<?php 
        echo $amount;
        ?>
"/>
                <input type="hidden" name="ap_currency" value="<?php 
        echo osc_get_preference('currency', 'payment');
        ?>
"/>

               <input type="hidden" name="ap_quantity" value="1"/>
                <input type="hidden" name="ap_itemcode" value="<?php 
        echo $itemnumber;
        ?>
"/>
                <input type="hidden" name="ap_description" value="Audio equipment"/>
                <input type="hidden" name="ap_returnurl" value="<?php 
        echo $RETURNURL;
        ?>
"/>
                <input type="hidden" name="ap_cancelurl" value="<?php 
        echo $CANCELURL;
        ?>
"/>

                <?php 
        foreach ($apcs as $k => $v) {
            echo '<input type="hidden" name="apc_' . $k . '" value="' . $v . '"/>';
        }
        ?>

                <input type="image" src="<?php 
        echo osc_base_url() . 'oc-content/plugins/' . osc_plugin_folder(__FILE__);
        ?>
payza-buy-now.png"/>
            </form>
        <?php 
    }
开发者ID:virsoni,项目名称:plugin-payment,代码行数:53,代码来源:Payza.php

示例15: showAuthFailPage

 function showAuthFailPage()
 {
     if (Params::getParam('page') == 'ajax') {
         echo json_encode(array('error' => 1, 'msg' => __('Session timed out')));
         exit;
     } else {
         //Session::newInstance()->session_start();
         Session::newInstance()->_setReferer(osc_base_url() . preg_replace('|^' . REL_WEB_URL . '|', '', Params::getServerParam('REQUEST_URI', false, false)));
         header("Location: " . osc_admin_base_url(true) . "?page=login");
         exit;
     }
 }
开发者ID:mylastof,项目名称:os-class,代码行数:12,代码来源:AdminSecBaseModel.php


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