本文整理汇总了PHP中osc_base_path函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_base_path函数的具体用法?PHP osc_base_path怎么用?PHP osc_base_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osc_base_path函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setCurrentThemeUrl
private function setCurrentThemeUrl()
{
if ($this->theme_exists) {
$this->theme_url = osc_base_url() . str_replace(osc_base_path(), '', $this->theme_path);
} else {
$this->theme_url = osc_base_url() . 'oc-includes/osclass/gui/';
}
}
示例2: doModel
//.........这里部分代码省略.........
$this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=locations');
break;
}
$aCountries = $mCountries->listAllAdmin();
$this->_exportVariableToView('aCountries', $aCountries);
$this->doView('settings/locations.php');
break;
case 'permalinks':
// calling the permalinks view
$htaccess = Params::getParam('htaccess_status');
$file = Params::getParam('file_status');
$this->_exportVariableToView('htaccess', $htaccess);
$this->_exportVariableToView('file', $file);
$this->doView('settings/permalinks.php');
break;
case 'permalinks_post':
// updating permalinks option
$htaccess_status = 0;
$file_status = 0;
$rewriteEnabled = Params::getParam('rewrite_enabled');
$rewriteEnabled = $rewriteEnabled ? true : false;
if ($rewriteEnabled) {
Preference::newInstance()->update(array('s_value' => '1'), array('s_name' => 'rewriteEnabled'));
require_once ABS_PATH . 'generate_rules.php';
$htaccess = '
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase ' . REL_WEB_URL . '
RewriteRule ^index\\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . ' . REL_WEB_URL . 'index.php [L]
</IfModule>';
if (file_exists(osc_base_path() . '.htaccess')) {
$file_status = 1;
} else {
if (file_put_contents(osc_base_path() . '.htaccess', $htaccess)) {
$file_status = 2;
} else {
$file_status = 3;
}
}
if (apache_mod_loaded('mod_rewrite')) {
$htaccess_status = 1;
Preference::newInstance()->update(array('s_value' => '1'), array('s_name' => 'mod_rewrite_loaded'));
} else {
$htaccess_status = 2;
Preference::newInstance()->update(array('s_value' => '0'), array('s_name' => 'mod_rewrite_loaded'));
}
} else {
$modRewrite = apache_mod_loaded('mod_rewrite');
Preference::newInstance()->update(array('s_value' => '0'), array('s_name' => 'rewriteEnabled'));
Preference::newInstance()->update(array('s_value' => '0'), array('s_name' => 'mod_rewrite_loaded'));
}
$redirectUrl = osc_admin_base_url(true) . '?page=settings&action=permalinks&htaccess_status=';
$redirectUrl .= $htaccess_status . '&file_status=' . $file_status;
$this->redirectTo($redirectUrl);
break;
case 'spamNbots':
// calling the spam and bots view
$this->doView('settings/spamNbots.php');
break;
case 'spamNbots_post':
// updating spam and bots option
$iUpdated = 0;
$akismetKey = Params::getParam('akismetKey');
示例3: _zip_folder_pclzip
/**
* Zips a specified folder to a file
*
* @param string $archive_folder full path of the folder
* @param string $archive_name full path of the destination zip file
* @return int
*/
function _zip_folder_pclzip($archive_folder, $archive_name)
{
// first, we load the library
require_once LIB_PATH . 'pclzip/pclzip.lib.php';
$zip = new PclZip($archive_name);
if ($zip) {
$dir = preg_replace('/[\\/]{2,}/', '/', $archive_folder . "/");
$v_dir = osc_base_path();
$v_remove = $v_dir;
// To support windows and the C: root you need to add the
// following 3 lines, should be ignored on linux
if (substr($v_dir, 1, 1) == ':') {
$v_remove = substr($v_dir, 2);
}
$v_list = $zip->create($v_dir, PCLZIP_OPT_REMOVE_PATH, $v_remove);
if ($v_list == 0) {
return false;
}
return true;
} else {
return false;
}
}
示例4: file_exists
* OSClass – software for creating and publishing online classified advertising platforms
*
* Copyright (C) 2010 OSCLASS
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
$maintenance = file_exists(osc_base_path() . '.maintenance');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="<?php
echo str_replace('_', '-', osc_current_user_locale());
?>
">
<head>
<?php
osc_current_admin_theme_path('head.php');
?>
</head>
<body>
<?php
osc_current_admin_theme_path('header.php');
?>
示例5: ajaxPayment
public static function ajaxPayment()
{
$status = self::processPayment();
$data = payment_get_custom(Params::getParam('extra'));
$product_type = explode('x', $data['product']);
if ($status == PAYMENT_COMPLETED) {
osc_add_flash_ok_message(sprintf(__('Success! Please write down this transaction ID in case you have any problem: %s', 'payment'), Params::getParam('stripe_transaction_id')));
if ($product_type[0] == 101) {
$item = Item::newInstance()->findByPrimaryKey($product_type[2]);
$category = Category::newInstance()->findByPrimaryKey($item['fk_i_category_id']);
View::newInstance()->_exportVariableToView('category', $category);
payment_js_redirect_to(osc_search_category_url());
} else {
if ($product_type[0] == 201) {
if (osc_is_web_user_logged_in()) {
payment_js_redirect_to(osc_route_url('payment-user-menu'));
} else {
View::newInstance()->_exportVariableToView('item', Item::newInstance()->findByPrimaryKey($product_type[2]));
payment_js_redirect_to(osc_item_url());
}
} else {
if (osc_is_web_user_logged_in()) {
payment_js_redirect_to(osc_route_url('payment-user-pack'));
} else {
// THIS SHOULD NOT HAPPEN
payment_js_redirect_to(osc_base_path());
}
}
}
} else {
if ($status == PAYMENT_ALREADY_PAID) {
osc_add_flash_warning_message(__('Warning! This payment was already paid', 'payment'));
} else {
osc_add_flash_error_message(_e('There were an error processing your payment', 'payment'));
}
if ($product_type[0] == 301) {
if (osc_is_web_user_logged_in()) {
payment_js_redirect_to(osc_route_url('payment-user-pack'));
} else {
// THIS SHOULD NOT HAPPEN
payment_js_redirect_to(osc_base_path());
}
} else {
if (osc_is_web_user_logged_in()) {
payment_js_redirect_to(osc_route_url('payment-user-menu'));
} else {
View::newInstance()->_exportVariableToView('item', Item::newInstance()->findByPrimaryKey($product_type[2]));
payment_js_redirect_to(osc_item_url());
}
}
}
}
示例6: foreach
$pages = ModelSeoLink::newInstance()->getPages();
foreach ($pages as $page) {
Page::newInstance()->deleteByPrimaryKey($page['pk_i_id']);
}
}
if (!function_exists('osc_search_country')) {
function osc_search_country()
{
if (View::newInstance()->_get('search_country')) {
return View::newInstance()->_get('search_country');
} else {
return Params::getParam('sCountry');
}
}
}
$myPlugin = file(osc_base_path() . 'oc-content/plugins/all_in_one/index.php');
if (!function_exists('message_ok')) {
function message_ok($text)
{
$final = '<div style="padding: 1%;width: 98%;margin-bottom: 15px;" class="flashmessage flashmessage-ok flashmessage-inline">';
$final .= $text;
$final .= '</div>';
echo $final;
}
}
if (!function_exists('message_error')) {
function message_error($text)
{
$final = '<div style="padding: 1%;width: 98%;margin-bottom: 15px;" class="flashmessage flashmessage-error flashmessage-inline">';
$final .= $text;
$final .= '</div>';
示例7: osc_base_path
case 'language':
// set language
require_once osc_base_path() . 'language.php';
$do = new CWebLanguage();
$do->doModel();
break;
case 'contact':
//contact
require_once osc_base_path() . 'contact.php';
$do = new CWebContact();
$do->doModel();
break;
case 'custom':
//contact
require_once osc_base_path() . 'custom.php';
$do = new CWebCustom();
$do->doModel();
break;
default:
// home and static pages that are mandatory...
require_once osc_base_path() . 'main.php';
$do = new CWebMain();
$do->doModel();
break;
}
if (!defined('__FROM_CRON__')) {
if (osc_auto_cron()) {
osc_doRequest(osc_base_url(), array('page' => 'cron'));
}
}
/* file end: ./index.php */
示例8: _e
<h2 class="render-title"><?php
_e('Watermark Image Settings');
?>
</h2>
<div class="form-row">
<div class="form-label"><?php
_e('Image');
?>
</div>
<div class="form-controls">
<input type="file" name="watermark_image" id="watermark_image_file"/>
<?php
if (osc_is_watermark_image() != '') {
?>
<div class="help-box"><img width="100px" src="<?php
echo osc_base_url() . str_replace(osc_base_path(), '', osc_uploads_path()) . "watermark.png";
?>
" /></div>
<?php
}
?>
<div class="help-box"><?php
_e("It has to be a .PNG image");
?>
</div>
<div class="help-box"><?php
_e("Osclass doesn't check the watermark image size");
?>
</div>
</div>
</div>
示例9: doModel
function doModel()
{
switch ($this->action) {
case 'permalinks':
// calling the permalinks view
$htaccess = Params::getParam('htaccess_status');
$file = Params::getParam('file_status');
$this->_exportVariableToView('htaccess', $htaccess);
$this->_exportVariableToView('file', $file);
$this->doView('settings/permalinks.php');
break;
case 'permalinks_post':
// updating permalinks option
osc_csrf_check();
$htaccess_file = osc_base_path() . '.htaccess';
$rewriteEnabled = Params::getParam('rewrite_enabled') ? true : false;
$rewrite_base = REL_WEB_URL;
$htaccess = <<<HTACCESS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase {$rewrite_base}
RewriteRule ^index\\.php\$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . {$rewrite_base}index.php [L]
</IfModule>
HTACCESS;
if ($rewriteEnabled) {
osc_set_preference('rewriteEnabled', '1');
// 1. OK (ok)
// 2. OK no apache module detected (warning)
// 3. No se puede crear + apache
// 4. No se puede crear + no apache
// 5. .htaccess exists, no overwrite
$status = 3;
if (file_exists($htaccess_file)) {
$status = 5;
} else {
if (is_writable(osc_base_path()) && file_put_contents($htaccess_file, $htaccess)) {
$status = 1;
}
}
if (!@apache_mod_loaded('mod_rewrite')) {
$status++;
}
$errors = 0;
$item_url = substr(str_replace('//', '/', Params::getParam('rewrite_item_url') . '/'), 0, -1);
if (!osc_validate_text($item_url)) {
$errors += 1;
} else {
osc_set_preference('rewrite_item_url', $item_url);
}
$page_url = substr(str_replace('//', '/', Params::getParam('rewrite_page_url') . '/'), 0, -1);
if (!osc_validate_text($page_url)) {
$errors += 1;
} else {
osc_set_preference('rewrite_page_url', $page_url);
}
$cat_url = substr(str_replace('//', '/', Params::getParam('rewrite_cat_url') . '/'), 0, -1);
// DEPRECATED: backward compatibility, remove in 3.4
$cat_url = str_replace('{CATEGORY_SLUG}', '{CATEGORY_NAME}', $cat_url);
if (!osc_validate_text($cat_url)) {
$errors += 1;
} else {
osc_set_preference('rewrite_cat_url', $cat_url);
}
$search_url = substr(str_replace('//', '/', Params::getParam('rewrite_search_url') . '/'), 0, -1);
if (!osc_validate_text($search_url)) {
$errors += 1;
} else {
osc_set_preference('rewrite_search_url', $search_url);
}
if (!osc_validate_text(Params::getParam('rewrite_search_country'))) {
$errors += 1;
} else {
osc_set_preference('rewrite_search_country', Params::getParam('rewrite_search_country'));
}
if (!osc_validate_text(Params::getParam('rewrite_search_region'))) {
$errors += 1;
} else {
osc_set_preference('rewrite_search_region', Params::getParam('rewrite_search_region'));
}
if (!osc_validate_text(Params::getParam('rewrite_search_city'))) {
$errors += 1;
} else {
osc_set_preference('rewrite_search_city', Params::getParam('rewrite_search_city'));
}
if (!osc_validate_text(Params::getParam('rewrite_search_city_area'))) {
$errors += 1;
} else {
osc_set_preference('rewrite_search_city_area', Params::getParam('rewrite_search_city_area'));
}
if (!osc_validate_text(Params::getParam('rewrite_search_category'))) {
$errors += 1;
} else {
osc_set_preference('rewrite_search_category', Params::getParam('rewrite_search_category'));
}
if (!osc_validate_text(Params::getParam('rewrite_search_user'))) {
$errors += 1;
} else {
//.........这里部分代码省略.........
示例10: payment_get_custom
<?php
$data = payment_get_custom(Params::getParam('extra'));
$product_type = explode('x', Params::getParam('item_number'));
osc_add_flash_info_message(__('We are processing your payment, if we did not finish in a few minutes, please contact us', 'payment'));
if ($product_type[0] == 301) {
if (osc_is_web_user_logged_in()) {
osc_redirect_to(osc_route_url('payment-user-pack'));
} else {
// THIS SHOULD NOT HAPPEN
osc_redirect_to(osc_base_path());
}
} else {
if (osc_is_web_user_logged_in()) {
osc_redirect_to(osc_route_url('payment-user-menu'));
} else {
View::newInstance()->_exportVariableToView('item', Item::newInstance()->findByPrimaryKey($product_type[2]));
osc_redirect_to(osc_item_url());
}
}
示例11: fopen
$robots = $content;
} else {
if (file_exists(osc_base_path() . "robots_backup.txt") != 1) {
$fp_backup = fopen(osc_base_path() . "robots_backup.txt", "wb");
fwrite($fp_backup, file_get_contents(osc_base_path() . "robots.txt"));
fclose($fp_backup);
message_ok(__('Backup file robots_backup.txt file was successfully created', 'all_in_one'));
}
$content = $robots;
}
$fp = fopen(osc_base_path() . "robots.txt", "wb");
fwrite($fp, $content);
fclose($fp);
osc_reset_preferences();
message_ok(__('robots.txt file was successfully updated', 'all_in_one'));
if (!is_writable(osc_base_path() . "/robots.txt")) {
message_error(__('It is impossible to write to robots.txt file, please change CHMOD settings on this file.', 'all_in_one'));
}
$dao_preference->update(array("s_value" => $robotsEnabled), array("s_section" => "plugin-all_in_one", "s_name" => "allSeo_robots_enabled"));
$dao_preference->update(array("s_value" => $robots), array("s_section" => "plugin-all_in_one", "s_name" => "allSeo_robots"));
}
unset($dao_preference);
?>
<div id="settings_form">
<?php
echo config_menu();
?>
<form name="promo_form" id="promo_form" action="<?php
echo osc_admin_base_url(true);
示例12: _zip_folder_pclzip
/**
* Zips a specified folder to a file
*
* @param string $archive_folder full path of the folder
* @param string $archive_name full path of the destination zip file
* @return int
*/
function _zip_folder_pclzip($archive_folder, $archive_name)
{
if (strpos($archive_folder, "../") !== false || strpos($archive_name, "../") !== false || strpos($archive_folder, "..\\") !== false || strpos($archive_name, "..\\") !== false) {
return false;
}
$zip = new PclZip($archive_name);
if ($zip) {
$dir = preg_replace('/[\\/]{2,}/', '/', $archive_folder . "/");
$v_dir = osc_base_path();
$v_remove = $v_dir;
// To support windows and the C: root you need to add the
// following 3 lines, should be ignored on linux
if (substr($v_dir, 1, 1) == ':') {
$v_remove = substr($v_dir, 2);
}
$v_list = $zip->create($dir, PCLZIP_OPT_REMOVE_PATH, $v_remove);
if ($v_list == 0) {
return false;
}
return true;
} else {
return false;
}
}
示例13: _e
_e('You can back up OSClass here. WARNING: If you don\'t specify a backup folder, the backup files will be created in the root of your OSClass installation');
?>
<form action="<?php
echo osc_admin_base_url(true);
?>
" method="post" id="bckform" name="bckform" >
<input type="hidden" name="page" value="tools" />
<input type="hidden" name="action" value="" />
<p>
<label for="data"><?php
_e('Backup folder');
?>
</label>
<input type="text" id="backup_dir" name="bck_dir" value="<?php
echo osc_base_path();
?>
" />
<?php
_e('This is the folder in which your backups will be created. We recommend that you choose a non-public path. For more information, please refer to OSClass\' documentation');
?>
.
</p>
<p>
<label for="data"><?php
_e('Back up database');
?>
(.sql)</label>
<button class="formButton" type="button" onclick="javascript:submitForm(this.form, 'sql');" ><?php
_e('Backup');
示例14: __
$htaccess_exist = true;
$htaccess_text = __("It exists <em>.htaccess</em> file. Below you can see the content of the file:");
}
?>
<ul>
<li>
<?php
echo $mod_rewrite;
?>
</li>
<li>
<?php
echo $htaccess_text;
if ($htaccess_exist && is_readable(osc_base_path() . '.htaccess')) {
echo '<pre>';
echo osc_esc_html(file_get_contents(osc_base_path() . '.htaccess'));
echo '</pre>';
}
?>
</li>
</ul>
</div>
<div class="clear"></div>
<!-- /settings form -->
</div>
<!-- /right container -->
</div>
<!-- /container -->
<?php
osc_current_admin_theme_path('footer.php');
示例15: payment_path
function payment_path()
{
return osc_base_path() . 'oc-content/plugins/' . osc_plugin_folder(__FILE__);
}