本文整理汇总了PHP中osc_uploads_path函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_uploads_path函数的具体用法?PHP osc_uploads_path怎么用?PHP osc_uploads_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osc_uploads_path函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _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>
示例2: logo_footer
function logo_footer()
{
$html = '<a id="logo-footer" href="' . osc_base_url() . '"><img border="0" alt="' . osc_page_title() . '" src="' . osc_base_url() . str_replace(ABS_PATH, '', osc_uploads_path()) . "realestate-logo-footer.jpg" . '" /></a>';
if (file_exists(osc_uploads_path() . "realestate-logo-footer.jpg")) {
return $html;
} else {
return '<a id="logo-footer" class="logo-footer-text" href="' . osc_base_url() . '">' . osc_page_title() . '</a>';
}
}
示例3: fn_email_item_inquiry
function fn_email_item_inquiry($aItem) {
$id = $aItem['id'];
$yourEmail = $aItem['yourEmail'];
$yourName = $aItem['yourName'];
$phoneNumber= $aItem['phoneNumber'];
$message = nl2br( strip_tags( $aItem['message'] ) );
$path = null;
$item = Item::newInstance()->findByPrimaryKey( $id );
View::newInstance()->_exportVariableToView('item', $item);
$mPages = new Page();
$aPage = $mPages->findByInternalName('email_item_inquiry');
$locale = osc_current_user_locale();
if( isset($aPage['locale'][$locale]['s_title']) ) {
$content = $aPage['locale'][$locale];
} else {
$content = current($aPage['locale']);
}
$item_url = osc_item_url();
$item_url = '<a href="' . $item_url . '" >' . $item_url . '</a>';
$words = array();
$words[] = array(
'{CONTACT_NAME}',
'{USER_NAME}',
'{USER_EMAIL}',
'{USER_PHONE}',
'{ITEM_TITLE}',
'{ITEM_URL}',
'{ITEM_LINK}',
'{COMMENT}'
);
$words[] = array(
$item['s_contact_name'],
$yourName,
$yourEmail,
$phoneNumber,
$item['s_title'],
osc_item_url(),
$item_url,
$message
);
$title = osc_apply_filter('email_item_inquiry_title_after', osc_mailBeauty(osc_apply_filter('email_title', osc_apply_filter('email_item_inquiry_title', $content['s_title'], $aItem)), $words), $aItem);
$body = osc_apply_filter('email_item_inquiry_description_after', osc_mailBeauty(osc_apply_filter('email_description', osc_apply_filter('email_item_inquiry_description', $content['s_text'], $aItem)), $words), $aItem);
$from = osc_contact_email();
$from_name = osc_page_title();
$emailParams = array(
'from' => $from,
'from_name' => $from_name,
'subject' => $title,
'to' => $item['s_contact_email'],
'to_name' => $item['s_contact_name'],
'body' => $body,
'alt_body' => $body,
'reply_to' => $yourEmail
);
if( osc_notify_contact_item() ) {
$emailParams['add_bcc'] = osc_contact_email();
}
if( osc_item_attachment() ) {
$attachment = Params::getFiles('attachment');
$resourceName = $attachment['name'];
$tmpName = $attachment['tmp_name'];
$path = osc_uploads_path() . time() . '_' . $resourceName;
if( !is_writable(osc_uploads_path()) ) {
osc_add_flash_error_message( _m('There has been some errors sending the message') );
}
if( !move_uploaded_file($tmpName, $path) ) {
unset($path);
}
}
if( isset($path) ) {
$emailParams['attachment'] = $path;
}
osc_sendMail($emailParams);
@unlink($path);
}
示例4: doModel
function doModel()
{
switch ($this->action) {
case 'logout':
// unset only the required parameters in Session
osc_run_hook('logout_admin');
$this->logout();
$this->redirectTo(osc_admin_base_url(true));
break;
default:
//default dashboard page (main page at oc-admin)
$this->_exportVariableToView("numItemsPerCategory", osc_get_non_empty_categories());
$this->_exportVariableToView("numUsers", User::newInstance()->count());
$this->_exportVariableToView("numItems", Item::newInstance()->count());
// stats
$items = array();
$stats_items = Stats::newInstance()->new_items_count(date('Y-m-d H:i:s', mktime(0, 0, 0, date("m"), date("d") - 10, date("Y"))), 'day');
for ($k = 10; $k >= 0; $k--) {
$items[date('Y-m-d', mktime(0, 0, 0, date("m"), date("d") - $k, date("Y")))] = 0;
}
foreach ($stats_items as $item) {
$items[$item['d_date']] = $item['num'];
}
$users = array();
$stats_users = Stats::newInstance()->new_users_count(date('Y-m-d H:i:s', mktime(0, 0, 0, date("m"), date("d") - 10, date("Y"))), 'day');
for ($k = 10; $k >= 0; $k--) {
$users[date('Y-m-d', mktime(0, 0, 0, date("m"), date("d") - $k, date("Y")))] = 0;
}
foreach ($stats_users as $user) {
$users[$user['d_date']] = $user['num'];
}
if (function_exists('disk_free_space')) {
$freedisk = @disk_free_space(osc_uploads_path());
if ($freedisk !== false && $freedisk < 52428800) {
//52428800 = 50*1024*1024
osc_add_flash_error_message(_m('You have very few free space left, users will not be able to upload pictures'), 'admin');
}
}
// show messages subscribed
$status_subscribe = Params::getParam('subscribe_osclass');
if ($status_subscribe != '') {
switch ($status_subscribe) {
case -1:
osc_add_flash_error_message(_m('Entered an invalid email'), 'admin');
break;
case 0:
osc_add_flash_warning_message(_m("You're already subscribed"), 'admin');
break;
case 1:
osc_add_flash_ok_message(_m('Subscribed correctly'), 'admin');
break;
default:
osc_add_flash_warning_message(_m("Error subscribing"), 'admin');
break;
}
}
$this->_exportVariableToView("item_stats", $items);
$this->_exportVariableToView("user_stats", $users);
//calling the view...
$this->doView('main/index.php');
}
}
示例5: osc_set_preference
@unlink(osc_base_path() . 'language.php');
@unlink(osc_base_path() . 'login.php');
@unlink(osc_base_path() . 'main.php');
@unlink(osc_base_path() . 'page.php');
@unlink(osc_base_path() . 'register.php');
@unlink(osc_base_path() . 'search.php');
@unlink(osc_base_path() . 'user-non-secure.php');
@unlink(osc_base_path() . 'user.php');
@unlink(osc_base_path() . 'readme.php');
@unlink(osc_lib_path() . 'osclass/plugins.php');
@unlink(osc_lib_path() . 'osclass/feeds.php');
$comm->query(sprintf('UPDATE %st_user t, (SELECT pk_i_id FROM %st_user) t1 SET t.s_username = t1.pk_i_id WHERE t.pk_i_id = t1.pk_i_id', DB_TABLE_PREFIX, DB_TABLE_PREFIX));
osc_set_preference('username_blacklist', 'admin,user', 'osclass', 'STRING');
osc_set_preference('rewrite_user_change_username', 'username/change');
osc_set_preference('csrf_name', 'CSRF' . mt_rand(0, mt_getrandmax()));
@mkdir(osc_uploads_path() . 'page-images');
}
if (osc_version() < 320) {
osc_set_preference('mailserver_mail_from', '');
osc_set_preference('mailserver_name_from', '');
osc_set_preference('seo_url_search_prefix', '');
$comm->query(sprintf("ALTER TABLE %st_category ADD `b_price_enabled` TINYINT(1) NOT NULL DEFAULT 1", DB_TABLE_PREFIX));
osc_set_preference('subdomain_type', '');
osc_set_preference('subdomain_host', '');
// email_new_admin
$comm->query(sprintf("INSERT INTO %st_pages (s_internal_name, b_indelible, dt_pub_date) VALUES ('email_new_admin', 1, '%s' )", DB_TABLE_PREFIX, date('Y-m-d H:i:s')));
$comm->query(sprintf("INSERT INTO %st_pages_description (fk_i_pages_id, fk_c_locale_code, s_title, s_text) VALUES (%d, 'en_US', '{WEB_TITLE} - Success creating admin account!', '<p>Hi {ADMIN_NAME},</p><p>The admin of {WEB_LINK} has created an account for you,</p><ul><li>Username: {USERNAME}</li><li>Password: {PASSWORD}</li></ul><p>You can access the admin panel here {WEB_ADMIN_LINK}.</p><p>Thank you!</p><p>Regards,</p>')", DB_TABLE_PREFIX, $comm->insertedId()));
osc_set_preference('warn_expiration', '0', 'osclass', 'INTEGER');
$comm->query(sprintf("INSERT INTO %st_pages (s_internal_name, b_indelible, dt_pub_date) VALUES ('email_warn_expiration', 1, '%s' )", DB_TABLE_PREFIX, date('Y-m-d H:i:s')));
$comm->query(sprintf("INSERT INTO %st_pages_description (fk_i_pages_id, fk_c_locale_code, s_title, s_text) VALUES (%d, 'en_US', '{WEB_TITLE} - Your ad is about to expire', '<p>Hi {USER_NAME},</p><p>Your listing <a href=\"{ITEM_URL}\">{ITEM_TITLE}</a> is about to expire at {WEB_LINK}.')", DB_TABLE_PREFIX, $comm->insertedId()));
osc_set_preference('force_aspect_image', '0', 'osclass', 'BOOLEAN');
示例6: define
//disable image editor and text editor
define('CONFIG_OPTIONS_SEARCH', false);
//disable to search documents
//FILESYSTEM CONFIG
/*
* CONFIG_SYS_DEFAULT_PATH is the default folder where the files would be uploaded to
and it must be a folder under the CONFIG_SYS_ROOT_PATH or the same folder
these two paths accept relative path only, don't use absolute path
*/
define('CONFIG_SYS_DEFAULT_PATH', '../../../../../../../' . str_replace(osc_base_path(), '', osc_uploads_path()) . 'page-images/');
//accept relative path only
define('CONFIG_SYS_ROOT_PATH', '../../../../../../../' . str_replace(osc_base_path(), '', osc_uploads_path()) . 'page-images/');
//accept relative path only
define('CONFIG_SYS_FOLDER_SHOWN_ON_TOP', true);
//show your folders on the top of list if true or order by name
define("CONFIG_SYS_DIR_SESSION_PATH", '../../../../../../../' . str_replace(osc_base_path(), '', osc_uploads_path()) . 'page-images/');
define("CONFIG_SYS_PATTERN_FORMAT", 'list');
//three options: reg ,csv, list, this option define the parttern format for the following patterns
/**
* reg => regulare expression
* csv => a list of comma separated file/folder name, (exactly match the specified file/folders)
* list => a list of comma spearated vague file/folder name (partially match the specified file/folders)
*
*/
//more details about regular expression please visit http://nz.php.net/manual/en/function.eregi.php
define('CONFIG_SYS_INC_DIR_PATTERN', '');
//force listing of folders with such pattern(s). separated by , if multiple
define('CONFIG_SYS_EXC_DIR_PATTERN', '');
//will prevent listing of folders with such pattern(s). separated by , if multiple
define('CONFIG_SYS_INC_FILE_PATTERN', '');
//force listing of fiels with such pattern(s). separated by , if multiple
示例7: osc_get_preference
$logo_prefence = osc_get_preference('logo', 'pop_theme');
if (is_writable(osc_uploads_path())) {
?>
<?php
if ($logo_prefence) {
?>
<h3 class="render-title"><?php
_e('Preview', 'pop');
?>
</h3>
<p class="preview_logo">
<img border="2" alt="<?php
echo osc_esc_html(osc_page_title());
?>
" src="<?php
echo pop_logo_url() . '?' . filemtime(osc_uploads_path() . osc_get_preference('logo', 'pop_theme'));
?>
" />
</p>
<form action="<?php
echo osc_admin_render_theme_url('oc-content/themes/pop/admin/header.php');
?>
" method="post" enctype="multipart/form-data" class="nocsrf">
<input type="hidden" name="action_specific" value="remove" />
<fieldset>
<div class="form-horizontal">
<div class="form-actions">
<input id="button_remove" type="submit" value="<?php
echo osc_esc_html(__('Remove logo', 'pop'));
?>
" class="btn btn-red">
示例8: theme_bender_actions_admin
function theme_bender_actions_admin()
{
//if(OC_ADMIN)
if (Params::getParam('file') == 'oc-content/themes/bender/admin/settings.php') {
if (Params::getParam('donation') == 'successful') {
osc_set_preference('donation', '1', 'bender_theme');
osc_reset_preferences();
}
}
switch (Params::getParam('action_specific')) {
case 'settings':
$footerLink = Params::getParam('footer_link');
osc_set_preference('keyword_placeholder', Params::getParam('keyword_placeholder'), 'bender_theme');
osc_set_preference('footer_link', $footerLink ? '1' : '0', 'bender_theme');
osc_set_preference('defaultShowAs@all', Params::getParam('defaultShowAs@all'), 'bender_theme');
osc_set_preference('defaultShowAs@search', Params::getParam('defaultShowAs@all'));
osc_set_preference('header-728x90', trim(Params::getParam('header-728x90', false, false, false)), 'bender');
osc_set_preference('homepage-728x90', trim(Params::getParam('homepage-728x90', false, false, false)), 'bender');
osc_set_preference('sidebar-300x250', trim(Params::getParam('sidebar-300x250', false, false, false)), 'bender');
osc_set_preference('search-results-top-728x90', trim(Params::getParam('search-results-top-728x90', false, false, false)), 'bender');
osc_set_preference('search-results-middle-728x90', trim(Params::getParam('search-results-middle-728x90', false, false, false)), 'bender');
osc_add_flash_ok_message(__('Theme settings updated correctly', 'bender'), 'admin');
osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/bender/admin/settings.php'));
break;
case 'upload_logo':
$package = Params::getFiles('logo');
if ($package['error'] == UPLOAD_ERR_OK) {
$img = ImageResizer::fromFile($package['tmp_name']);
$ext = $img->getExt();
$logo_name = 'bender_logo';
$logo_name .= '.' . $ext;
$path = osc_uploads_path() . $logo_name;
$img->saveToFile($path);
osc_set_preference('logo', $logo_name, 'bender_theme');
osc_add_flash_ok_message(__('The logo image has been uploaded correctly', 'bender'), 'admin');
} else {
osc_add_flash_error_message(__("An error has occurred, please try again", 'bender'), 'admin');
}
osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/bender/admin/header.php'));
break;
case 'remove':
$logo = osc_get_preference('logo', 'bender_theme');
$path = osc_uploads_path() . $logo;
if (file_exists($path)) {
@unlink($path);
osc_delete_preference('logo', 'bender_theme');
osc_reset_preferences();
osc_add_flash_ok_message(__('The logo image has been removed', 'bender'), 'admin');
} else {
osc_add_flash_error_message(__("Image not found", 'bender'), 'admin');
}
osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/bender/admin/header.php'));
break;
}
}
示例9: osc_uploads_url
function osc_uploads_url($item = '')
{
$logo = osc_get_preference('logo', 'bender');
if ($logo != '' && file_exists(osc_uploads_path() . $logo)) {
$path = str_replace(ABS_PATH, '', osc_uploads_path() . '/');
return osc_base_url() . $path . $item;
}
}
示例10: osc_get_preference
<?php
$logo_prefence = osc_get_preference('logo', 'osclassclsx');
if (is_writable(osc_uploads_path())) {
?>
<?php
if ($logo_prefence) {
?>
<h3 class="render-title"><?php
_e('Preview', 'osclassclsx');
?>
</h3>
<img border="0" alt="<?php
echo osc_esc_html(osc_page_title());
?>
" src="<?php
echo osclassclsx_logo_url() . '?' . filemtime(osc_uploads_path() . osc_get_preference('logo', 'osclassclsx'));
?>
" />
<form action="<?php
echo osc_admin_render_theme_url('oc-content/themes/osclassclsx/admin/header.php');
?>
" method="post" enctype="multipart/form-data" class="nocsrf">
<input type="hidden" name="action_specific" value="remove" />
<fieldset>
<div class="form-horizontal">
<div class="form-actions">
<input id="button_remove" type="submit" value="<?php
echo osc_esc_html(__('Remove logo', 'osclassclsx'));
?>
" class="btn btn-red">
</div>
示例11: osc_change_permissions
function osc_change_permissions($dir = ABS_PATH)
{
if (strpos($dir, "../") !== false || strpos($dir, "..\\") !== false) {
return false;
}
clearstatcache();
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if ($file != "." && $file != ".." && substr($file, 0, 1) != ".") {
if (is_dir(str_replace("//", "/", $dir . "/" . $file))) {
if (!is_writable(str_replace("//", "/", $dir . "/" . $file))) {
$res = @chmod(str_replace("//", "/", $dir . "/" . $file), 0777);
if (!$res) {
return false;
}
}
if (str_replace("//", "/", $dir) == ABS_PATH . "oc-content/themes") {
if ($file == "modern" || $file == "index.php") {
$res = osc_change_permissions(str_replace("//", "/", $dir . "/" . $file));
if (!$res) {
return false;
}
}
} else {
if (str_replace("//", "/", $dir) == ABS_PATH . "oc-content/plugins") {
if ($file == "google_maps" || $file == "google_analytics" || $file == "index.php") {
$res = osc_change_permissions(str_replace("//", "/", $dir . "/" . $file));
if (!$res) {
return false;
}
}
} else {
if (str_replace("//", "/", $dir) == ABS_PATH . "oc-content/languages") {
if ($file == "en_US" || $file == "index.php") {
$res = osc_change_permissions(str_replace("//", "/", $dir . "/" . $file));
if (!$res) {
return false;
}
}
} else {
if (str_replace("//", "/", $dir) == ABS_PATH . "oc-content/downloads") {
} else {
if (str_replace("//", "/", $dir) == osc_uploads_path()) {
} else {
$res = osc_change_permissions(str_replace("//", "/", $dir . "/" . $file));
if (!$res) {
return false;
}
}
}
}
}
}
} else {
if (!is_writable(str_replace("//", "/", $dir . "/" . $file))) {
return @chmod(str_replace("//", "/", $dir . "/" . $file), 0777);
} else {
return true;
}
}
}
}
closedir($dh);
}
return true;
}
示例12: osc_get_preference
<?php
$logo_prefence = osc_get_preference('homeimage', 'osclasswizards_theme');
if (is_writable(osc_uploads_path())) {
?>
<?php
if ($logo_prefence) {
?>
<h3 class="render-title"><?php
_e('Preview', 'osclasswizards');
?>
</h3>
<img style="max-width:100%;" border="0" alt="<?php
echo osc_esc_html(osc_page_title());
?>
" src="<?php
echo osclasswizards_homeimage_url() . '?' . filemtime(osc_uploads_path() . osc_get_preference('homeimage', 'osclasswizards_theme'));
?>
" />
<form action="<?php
echo osc_admin_render_theme_url('oc-content/themes/osclasswizards/admin/settings.php');
?>
" method="post" enctype="multipart/form-data" class="nocsrf">
<input type="hidden" name="action_specific" value="remove_homeimage" />
<fieldset>
<div class="form-horizontal">
<div class="form-actions">
<input id="button_remove" type="submit" value="<?php
echo osc_esc_html(__('Remove image', 'osclasswizards'));
?>
" class="btn btn-red">
</div>
示例13: theme_flatter_actions_admin
//.........这里部分代码省略.........
$adsenseEnable = Params::getParam('google_adsense');
osc_set_preference('google_adsense', $adsenseEnable ? '1' : '0', 'flatter_theme');
osc_set_preference('ads_pubid', Params::getParam('ads_pubid'), 'flatter_theme');
osc_set_preference('ads_slotid', Params::getParam('ads_slotid'), 'flatter_theme');
osc_add_flash_ok_message(__('Adsense settings updated correctly', 'flatter'), 'admin');
osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/flatter/admin/settings.php#adsense'));
break;
case 'footer_settings':
$facebookLink = Params::getParam('facebook_likebox');
$footerLink = Params::getParam('footer_link');
osc_set_preference('facebook_likebox', $facebookLink ? '1' : '0', 'flatter_theme');
osc_set_preference('footer_link', $footerLink ? '1' : '0', 'flatter_theme');
osc_add_flash_ok_message(__('Widgets updated correctly', 'flatter'), 'admin');
osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/flatter/admin/settings.php#footerwidget'));
break;
case 'other_settings':
$position1 = Params::getParam('position1_enable');
$position2 = Params::getParam('position2_enable');
$position3 = Params::getParam('position3_enable');
$position4 = Params::getParam('position4_enable');
$position5 = Params::getParam('position5_enable');
$position6 = Params::getParam('position6_enable');
$position7 = Params::getParam('position7_enable');
$position8 = Params::getParam('position8_enable');
$position9 = Params::getParam('position9_enable');
$position10 = Params::getParam('position10_enable');
$positionhide1 = Params::getParam('position1_hide');
$positionhide2 = Params::getParam('position2_hide');
$positionhide3 = Params::getParam('position3_hide');
$positionhide4 = Params::getParam('position4_hide');
$positionhide5 = Params::getParam('position5_hide');
$positionhide6 = Params::getParam('position6_hide');
$positionhide7 = Params::getParam('position7_hide');
$positionhide8 = Params::getParam('position8_hide');
$positionhide9 = Params::getParam('position9_hide');
$positionhide10 = Params::getParam('position10_hide');
osc_set_preference('position1_enable', $position1 ? '1' : '0', 'flatter_theme');
osc_set_preference('position2_enable', $position2 ? '1' : '0', 'flatter_theme');
osc_set_preference('position3_enable', $position3 ? '1' : '0', 'flatter_theme');
osc_set_preference('position4_enable', $position4 ? '1' : '0', 'flatter_theme');
osc_set_preference('position5_enable', $position5 ? '1' : '0', 'flatter_theme');
osc_set_preference('position6_enable', $position6 ? '1' : '0', 'flatter_theme');
osc_set_preference('position7_enable', $position7 ? '1' : '0', 'flatter_theme');
osc_set_preference('position8_enable', $position8 ? '1' : '0', 'flatter_theme');
osc_set_preference('position9_enable', $position9 ? '1' : '0', 'flatter_theme');
osc_set_preference('position10_enable', $position10 ? '1' : '0', 'flatter_theme');
osc_set_preference('position1_hide', $positionhide1 ? '1' : '0', 'flatter_theme');
osc_set_preference('position2_hide', $positionhide2 ? '1' : '0', 'flatter_theme');
osc_set_preference('position3_hide', $positionhide3 ? '1' : '0', 'flatter_theme');
osc_set_preference('position4_hide', $positionhide4 ? '1' : '0', 'flatter_theme');
osc_set_preference('position5_hide', $positionhide5 ? '1' : '0', 'flatter_theme');
osc_set_preference('position6_hide', $positionhide6 ? '1' : '0', 'flatter_theme');
osc_set_preference('position7_hide', $positionhide7 ? '1' : '0', 'flatter_theme');
osc_set_preference('position8_hide', $positionhide8 ? '1' : '0', 'flatter_theme');
osc_set_preference('position9_hide', $positionhide9 ? '1' : '0', 'flatter_theme');
osc_set_preference('position10_hide', $positionhide10 ? '1' : '0', 'flatter_theme');
osc_set_preference('position1_content', Params::getParam('position1_content', false, false), 'flatter_theme');
osc_set_preference('position2_content', Params::getParam('position2_content', false, false), 'flatter_theme');
osc_set_preference('position3_content', Params::getParam('position3_content', false, false), 'flatter_theme');
osc_set_preference('position4_content', Params::getParam('position4_content', false, false), 'flatter_theme');
osc_set_preference('position5_content', Params::getParam('position5_content', false, false), 'flatter_theme');
osc_set_preference('position6_content', Params::getParam('position6_content', false, false), 'flatter_theme');
osc_set_preference('position7_content', Params::getParam('position7_content', false, false), 'flatter_theme');
osc_set_preference('position8_content', Params::getParam('position8_content', false, false), 'flatter_theme');
osc_set_preference('position9_content', Params::getParam('position9_content', false, false), 'flatter_theme');
osc_set_preference('position10_content', Params::getParam('position10_content', false, false), 'flatter_theme');
osc_add_flash_ok_message(__('Settings updated correctly', 'flatter'), 'admin');
osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/flatter/admin/settings.php#others'));
break;
case 'upload_logo':
$package = Params::getFiles('logo');
if ($package['error'] == UPLOAD_ERR_OK) {
$img = ImageResizer::fromFile($package['tmp_name']);
$ext = $img->getExt();
$logo_name = 'flatter_logo';
$logo_name .= '.' . $ext;
$path = osc_uploads_path() . $logo_name;
$img->saveToFile($path);
osc_set_preference('logo', $logo_name, 'flatter_theme');
osc_add_flash_ok_message(__('The logo image has been uploaded correctly', 'flatter'), 'admin');
} else {
osc_add_flash_error_message(__("An error has occurred, please try again", 'flatter'), 'admin');
}
osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/flatter/admin/settings.php#logo'));
break;
case 'remove':
$logo = osc_get_preference('logo', 'flatter_theme');
$path = osc_uploads_path() . $logo;
if (file_exists($path)) {
@unlink($path);
osc_delete_preference('logo', 'flatter_theme');
osc_reset_preferences();
osc_add_flash_ok_message(__('The logo image has been removed', 'flatter'), 'admin');
} else {
osc_add_flash_error_message(__("Image not found", 'flatter'), 'admin');
}
osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/flatter/admin/settings.php#logo'));
break;
}
}
示例14: osc_get_preference
<?php
$logo_prefence = osc_get_preference('logo', 'bender');
if (is_writable(osc_uploads_path())) {
?>
<?php
if ($logo_prefence) {
?>
<h3 class="render-title"><?php
_e('Preview', 'bender');
?>
</h3>
<img border="0" alt="<?php
echo osc_esc_html(osc_page_title());
?>
" src="<?php
echo bender_logo_url() . '?' . filemtime(osc_uploads_path() . osc_get_preference('logo', 'bender'));
?>
" />
<form action="<?php
echo osc_admin_render_theme_url('oc-content/themes/bender/admin/header.php');
?>
" method="post" enctype="multipart/form-data" class="nocsrf">
<input type="hidden" name="action_specific" value="remove" />
<fieldset>
<div class="form-horizontal">
<div class="form-actions">
<input id="button_remove" type="submit" value="<?php
echo osc_esc_html(__('Remove logo', 'bender'));
?>
" class="btn btn-red">
</div>
示例15: theme_osclasswizards_actions_admin
function theme_osclasswizards_actions_admin()
{
if (Params::getParam('file') == 'oc-content/themes/' . OSCLASSWIZARDS_THEME_FOLDER . '/admin/settings.php') {
if (Params::getParam('donation') == 'successful') {
osc_set_preference('donation', '1', 'osclasswizards_theme');
osc_reset_preferences();
}
}
switch (Params::getParam('action_specific')) {
case 'settings':
osc_set_preference('welcome_message', Params::getParam('welcome_message'), 'osclasswizards_theme');
osc_set_preference('defaultShowAs@all', Params::getParam('defaultShowAs@all'), 'osclasswizards_theme');
osc_set_preference('defaultShowAs@search', Params::getParam('defaultShowAs@all'));
osc_add_flash_ok_message(__('Theme settings updated correctly', OSCLASSWIZARDS_THEME_FOLDER), 'admin');
osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/' . OSCLASSWIZARDS_THEME_FOLDER . '/admin/settings.php'));
break;
case 'templates_home':
osc_set_preference('show_banner', Params::getParam('show_banner') ? '1' : '0', 'osclasswizards_theme');
osc_set_preference('keyword_placeholder', Params::getParam('keyword_placeholder'), 'osclasswizards_theme');
osc_set_preference('show_search_country', Params::getParam('show_search_country') ? '1' : '0', 'osclasswizards_theme');
osc_set_preference('premium_listings_shown_home', Params::getParam('premium_listings_shown_home'), 'osclasswizards_theme');
osc_set_preference('sub_cat_limit', Params::getParam('sub_cat_limit'), 'osclasswizards_theme');
osc_set_preference('show_popular', Params::getParam('show_popular'), 'osclasswizards_theme');
osc_set_preference('show_popular_regions', Params::getParam('show_popular_regions'), 'osclasswizards_theme');
osc_set_preference('show_popular_cities', Params::getParam('show_popular_cities'), 'osclasswizards_theme');
osc_set_preference('show_popular_searches', Params::getParam('show_popular_searches'), 'osclasswizards_theme');
osc_set_preference('popular_regions_limit', Params::getParam('popular_regions_limit'), 'osclasswizards_theme');
osc_set_preference('popular_cities_limit', Params::getParam('popular_cities_limit'), 'osclasswizards_theme');
osc_set_preference('popular_searches_limit', Params::getParam('popular_searches_limit'), 'osclasswizards_theme');
osc_add_flash_ok_message(__('Templates settings updated correctly', OSCLASSWIZARDS_THEME_FOLDER), 'admin');
osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/' . OSCLASSWIZARDS_THEME_FOLDER . '/admin/settings.php#templates'));
break;
case 'templates_search':
osc_set_preference('premium_listings_shown', Params::getParam('premium_listings_shown'), 'osclasswizards_theme');
osc_add_flash_ok_message(__('Templates settings updated correctly', OSCLASSWIZARDS_THEME_FOLDER), 'admin');
osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/' . OSCLASSWIZARDS_THEME_FOLDER . '/admin/settings.php#templates'));
break;
case 'templates_item_post':
$locations_input_as = Params::getParam('locations_input_as', 'osclasswizards_theme');
$locations_required = Params::getParam('locations_required', 'osclasswizards_theme');
$category_multiple_selects = Params::getParam('category_multiple_selects', 'osclasswizards_theme');
osc_set_preference('title_minimum_length', Params::getParam('title_minimum_length', 'osclasswizards_theme'), 'osclasswizards_theme');
osc_set_preference('description_minimum_length', Params::getParam('description_minimum_length', 'osclasswizards_theme'), 'osclasswizards_theme');
osc_set_preference('locations_input_as', $locations_input_as, 'osclasswizards_theme');
osc_set_preference('locations_required', $locations_required ? '1' : '0', 'osclasswizards_theme');
osc_set_preference('category_multiple_selects', $category_multiple_selects ? '1' : '0', 'osclasswizards_theme');
osc_add_flash_ok_message(__('Templates settings updated correctly', OSCLASSWIZARDS_THEME_FOLDER), 'admin');
osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/' . OSCLASSWIZARDS_THEME_FOLDER . '/admin/settings.php#templates'));
break;
case 'ads_mgmt':
osc_set_preference('header-728x90', trim(Params::getParam('header-728x90', false, false, false)), 'osclasswizards_theme');
osc_set_preference('homepage-728x90', trim(Params::getParam('homepage-728x90', false, false, false)), 'osclasswizards_theme');
osc_set_preference('sidebar-300x250', trim(Params::getParam('sidebar-300x250', false, false, false)), 'osclasswizards_theme');
osc_set_preference('search-results-top-728x90', trim(Params::getParam('search-results-top-728x90', false, false, false)), 'osclasswizards_theme');
osc_set_preference('search-results-middle-728x90', trim(Params::getParam('search-results-middle-728x90', false, false, false)), 'osclasswizards_theme');
osc_add_flash_ok_message(__('Ads management updated correctly', OSCLASSWIZARDS_THEME_FOLDER), 'admin');
osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/' . OSCLASSWIZARDS_THEME_FOLDER . '/admin/settings.php#ads'));
break;
case 'categories_icons':
$catsIcons = Params::getParam('cat-icons');
foreach ($catsIcons as $catId => $iconName) {
osc_set_preference('cat-icons-' . $catId, $iconName, 'osclasswizards_theme_cat_icons');
}
osc_add_flash_ok_message(__('Category icons settings updated correctly', OSCLASSWIZARDS_THEME_FOLDER), 'admin');
osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/' . OSCLASSWIZARDS_THEME_FOLDER . '/admin/settings.php#category-icons'));
break;
case 'theme_style':
$color_mode = Params::getParam('theme_color_mode');
osc_set_preference('theme_color_mode', $color_mode, 'osclasswizards_theme');
osc_set_preference('google_fonts', Params::getParam('google_fonts'), 'osclasswizards_theme');
$rtl_view = Params::getParam('rtl_view', 'osclasswizards_theme');
osc_set_preference('rtl_view', $rtl_view ? '1' : '0', 'osclasswizards_theme');
osc_set_preference('custom_css', trim(Params::getParam('custom_css', false, false, false)), 'osclasswizards_theme');
osc_add_flash_ok_message(__('Theme color settings updated correctly', OSCLASSWIZARDS_THEME_FOLDER), 'admin');
osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/' . OSCLASSWIZARDS_THEME_FOLDER . '/admin/settings.php#theme-style'));
break;
case 'facebook':
osc_set_preference('facebook-url', trim(Params::getParam('facebook-url', false, false, false)), 'osclasswizards_theme');
osc_set_preference('facebook-width', trim(Params::getParam('facebook-width', false, false, false)), 'osclasswizards_theme');
osc_set_preference('facebook-height', trim(Params::getParam('facebook-height', false, false, false)), 'osclasswizards_theme');
osc_set_preference('facebook-hidecover', trim(Params::getParam('facebook-hidecover', false, false, false)), 'osclasswizards_theme');
osc_set_preference('facebook-showface', trim(Params::getParam('facebook-showface', false, false, false)), 'osclasswizards_theme');
osc_set_preference('facebook-showpost', trim(Params::getParam('facebook-showpost', false, false, false)), 'osclasswizards_theme');
osc_set_preference('facebook-showitem', trim(Params::getParam('facebook-showitem', false, false, false)), 'osclasswizards_theme');
osc_set_preference('facebook-showsearch', trim(Params::getParam('facebook-showsearch', false, false, false)), 'osclasswizards_theme');
osc_add_flash_ok_message(__('Facebook Page settings updated correctly', OSCLASSWIZARDS_THEME_FOLDER), 'admin');
osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/' . OSCLASSWIZARDS_THEME_FOLDER . '/admin/settings.php#facebook'));
break;
case 'upload_favicon':
$package = Params::getFiles('favicon');
if ($package['error'] == UPLOAD_ERR_OK) {
$img = ImageResizer::fromFile($package['tmp_name']);
$ext = $img->getExt();
$logo_name = 'favicon';
$logo_name .= '.' . $ext;
$path = osc_uploads_path() . $logo_name;
$img->saveToFile($path);
osc_set_preference('favicon', $logo_name, 'osclasswizards_theme');
osc_add_flash_ok_message(__('The favicon image has been uploaded correctly', OSCLASSWIZARDS_THEME_FOLDER), 'admin');
} else {
//.........这里部分代码省略.........