本文整理汇总了PHP中osc_version函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_version函数的具体用法?PHP osc_version怎么用?PHP osc_version使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osc_version函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
parent::__construct();
osc_run_hook('init_admin');
// check if exist a new version each day
if (time() - osc_last_version_check() > 24 * 3600) {
$data = osc_file_get_contents('http://osclass.org/latest_version.php?callback=?');
$data = preg_replace('|^\\?\\((.*?)\\);$|', '$01', $data);
$json = json_decode($data);
if ($json->version > osc_version()) {
osc_set_preference('update_core_json', $data);
} else {
osc_set_preference('update_core_json', '');
}
osc_set_preference('last_version_check', time());
osc_reset_preferences();
}
$config_version = str_replace('.', '', OSCLASS_VERSION);
$config_version = preg_replace('|-.*|', '', $config_version);
if ($config_version > Preference::newInstance()->get('version')) {
if (get_class($this) == 'CAdminTools') {
} else {
if (get_class($this) != 'CAdminUpgrade') {
$this->redirectTo(osc_admin_base_url(true) . '?page=upgrade');
}
}
}
}
示例2: __construct
function __construct()
{
parent::__construct();
// check if is moderator and can enter to this page
if ($this->isModerator()) {
if (!in_array($this->page, array('items', 'comments', 'media', 'login', 'admins', 'ajax', 'stats', ''))) {
osc_add_flash_error_message(_m("You don't have enough permissions"), 'admin');
$this->redirectTo(osc_admin_base_url());
}
}
osc_run_hook('init_admin');
// check if exist a new version each day
if (time() - osc_last_version_check() > 24 * 3600) {
$data = osc_file_get_contents('http://osclass.org/latest_version.php?callback=?');
$data = preg_replace('|^\\?\\((.*?)\\);$|', '$01', $data);
$json = json_decode($data);
if ($json->version > osc_version()) {
osc_set_preference('update_core_json', $data);
} else {
osc_set_preference('update_core_json', '');
}
osc_set_preference('last_version_check', time());
osc_reset_preferences();
}
$config_version = str_replace('.', '', OSCLASS_VERSION);
$config_version = preg_replace('|-.*|', '', $config_version);
if ($config_version > Preference::newInstance()->get('version')) {
if (get_class($this) == 'CAdminTools') {
} else {
if (get_class($this) != 'CAdminUpgrade') {
$this->redirectTo(osc_admin_base_url(true) . '?page=upgrade');
}
}
}
// 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;
}
}
// show donation successful
if (Params::getParam('donation') == 'successful') {
osc_add_flash_ok_message(_m('Thank you very much for your donation'), 'admin');
}
}
示例3: add_market_jsvariables
function add_market_jsvariables()
{
$marketPage = Params::getParam("mPage");
$version_length = strlen(osc_version());
$main_version = substr(osc_version(), 0, $version_length - 2) . "." . substr(osc_version(), $version_length - 2, 1);
if ($marketPage >= 1) {
$marketPage--;
}
$action = Params::getParam("action");
$js_lang = array('by' => __('by'), 'ok' => __('Ok'), 'error_item' => __('There was a problem, try again later please'), 'wait_download' => __('Please wait until the download is completed'), 'downloading' => __('Downloading'), 'close' => __('Close'), 'download' => __('Download'), 'update' => __('Update'), 'last_update' => __('Last update'), 'downloads' => __('Downloads'), 'requieres_version' => __('Requires at least'), 'compatible_with' => __('Compatible up to'), 'screenshots' => __('Screenshots'), 'preview_theme' => __('Preview theme'), 'download_manually' => __('Download manually'), 'buy' => __('Buy'), 'proceed_anyway' => sprintf(__('Warning! This package is not compatible with your current version of Osclass (%s)'), $main_version), 'sure' => __('Are you sure?'), 'proceed_anyway_btn' => __('Ok, proceed anyway'), 'not_compatible' => sprintf(__('Warning! This theme is not compatible with your current version of Osclass (%s)'), $main_version), 'themes' => array('download_ok' => __('The theme has been downloaded correctly, proceed to activate or preview it.')), 'plugins' => array('download_ok' => __('The plugin has been downloaded correctly, proceed to install and configure.')), 'languages' => array('download_ok' => __('The language has been downloaded correctly, proceed to activate.')));
?>
<script type="text/javascript">
var theme = window.theme || {};
theme.adminBaseUrl = "<?php
echo osc_admin_base_url(true);
?>
";
theme.marketAjaxUrl = "<?php
echo osc_admin_base_url(true);
?>
?page=ajax&action=market&<?php
echo osc_csrf_token_url();
?>
";
theme.marketCurrentURL = "<?php
echo osc_admin_base_url(true);
?>
?page=market&action=<?php
echo Params::getParam('action');
?>
";
theme.themUrl = "<?php
echo osc_current_admin_theme_url();
?>
";
theme.langs = <?php
echo json_encode($js_lang);
?>
;
theme.CSRFToken = "<?php
echo osc_csrf_token_url();
?>
";
var osc_market = {};
osc_market.main_version = <?php
echo $main_version;
?>
;
</script>
<?php
}
示例4: __construct
function __construct()
{
parent::__construct();
// check if is moderator and can enter to this page
if( $this->isModerator() ) {
if( !in_array($this->page, osc_apply_filter('moderator_access', array('items', 'comments', 'media', 'login', 'admins', 'ajax', 'stats',''))) ) {
osc_add_flash_error_message(_m("You don't have enough permissions"), 'admin');
$this->redirectTo(osc_admin_base_url());
}
}
osc_run_hook( 'init_admin' );
// check if exist a new version each day
if( (time() - osc_last_version_check()) > (24 * 3600) ) {
$data = osc_file_get_contents('http://osclass.org/latest_version_v1.php?callback=?');
$data = preg_replace('|^\?\((.*?)\);$|', '$01', $data);
$json = json_decode($data);
if( $json->version > osc_version() ) {
osc_set_preference( 'update_core_json', $data );
} else {
osc_set_preference( 'update_core_json', '' );
}
osc_set_preference( 'last_version_check', time() );
osc_reset_preferences();
}
$config_version = str_replace('.', '', OSCLASS_VERSION);
$config_version = preg_replace('|-.*|', '', $config_version);
if( $config_version > osc_get_preference('version') ) {
if(get_class($this) == 'CAdminTools') {
} else {
if(get_class($this) != 'CAdminUpgrade' )
$this->redirectTo(osc_admin_base_url(true) . '?page=upgrade');
}
}
// show donation successful
if( Params::getParam('donation') == 'successful' ) {
osc_add_flash_ok_message(_m('Thank you very much for your donation'), 'admin');
}
// enqueue scripts
osc_enqueue_script('jquery');
osc_enqueue_script('jquery-ui');
osc_enqueue_script('admin-osc');
osc_enqueue_script('admin-ui-osc');
}
示例5: qrcode_admin_menu
function qrcode_admin_menu()
{
if (osc_version() < 320) {
echo '<h3><a href="#">QR Code</a></h3>
<ul>
<li><a href="' . osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'conf.php') . '">» ' . __('Settings', 'qrcode') . '</a></li>
<li><a href="' . osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'help.php') . '">» ' . __('Help', 'qrcode') . '</a></li>
</ul>';
} else {
osc_add_admin_submenu_divider('plugins', 'QR Codes', 'qrcode_divider', 'administrator');
osc_add_admin_submenu_page('plugins', __('QR Settings', 'qrcode'), osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'conf.php'), 'qrcode_settings', 'administrator');
osc_add_admin_submenu_page('plugins', __('QR Help', 'qrcode'), osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'help.php'), 'qrcode_help', 'administrator');
}
}
示例6: contact_counter_admin_menu
function contact_counter_admin_menu()
{
if (osc_version() < 320) {
echo '<h3><a href="#">' . __('Contact counter', 'contact_counter') . '</a></h3>
<ul>
<li><a href="' . osc_admin_configure_plugin_url("contact_counter/admin/stats.php") . '">» ' . __('Contact stats', 'contact_counter') . '</a></li>
<li><a href="' . osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'admin/help.php') . '">» ' . __('Help', 'contact_counter') . '</a></li>
</ul>';
} else {
osc_add_admin_submenu_page('stats', __('View contact stats', 'contact_counter'), osc_route_admin_url('stats-contact-counter', array('id' => '')), '', 'administrator');
osc_add_admin_submenu_divider('plugins', __('Contact counter', 'contact_counter'), 'contact_counter');
osc_add_admin_submenu_page('plugins', __('Help', 'contact_counter'), osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'admin/help.php'), 'contact_counter_help', 'administrator');
}
}
示例7: digitalgoods_admin_menu
function digitalgoods_admin_menu()
{
if (osc_version() < 320) {
echo '<h3><a href="#">Digital Goods</a></h3>
<ul>
<li><a href="' . osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'admin/conf.php') . '">» ' . __('Settings', 'digitalgoods') . '</a></li>
<li><a href="' . osc_admin_configure_plugin_url("digitalgoods/index.php") . '">» ' . __('Configure categories', 'digitalgoods') . '</a></li>
<li><a href="' . osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'admin/stats.php') . '">» ' . __('Stats', 'digitalgoods') . '</a></li>
</ul>';
} else {
osc_add_admin_submenu_divider('plugins', 'Digital Goods', 'digitalgoods_divider', 'administrator');
osc_add_admin_submenu_page('plugins', __('Settings', 'digitalgoods'), osc_route_admin_url('digitalgoods-admin-conf'), 'digitalgoods_settings', 'administrator');
osc_add_admin_submenu_page('plugins', __('Configure categories', 'digitalgoods'), osc_admin_configure_plugin_url("digitalgoods/index.php"), 'digitalgoods_categories', 'administrator');
osc_add_admin_submenu_page('plugins', __('File stats', 'digitalgoods'), osc_route_admin_url('digitalgoods-admin-stats'), 'digitalgoods_stats', 'administrator');
}
}
示例8: foreach
foreach ($perms as $k => $v) {
@chmod($k, $v);
}
if ($ok) {
?>
$(function() {
var steps_div = document.getElementById('steps_div') ;
steps_div.style.display = '';
var steps = document.getElementById('steps') ;
var version = <?php
echo osc_version();
?>
;
var fileToUnzip = '';
steps.innerHTML += "<?php
printf(__('Checking for updates (Current version %s)'), osc_version());
?>
" ;
$.getJSON("http://www.osclass.org/latest_version.php?callback=?", function(data) {
if(data.version <= version) {
steps.innerHTML += "<?php
_e('Congratulations! Your OSClass installation is up to date!');
?>
";
} else {
steps.innerHTML += "<?php
_e('New version to update:');
?>
" + data.version + "<br/>" ;
<?php
示例9: osc_set_preference
osc_set_preference('description_character_length', '5000', 'osclass', 'INTEGER');
}
if(osc_version() < 340) {
$comm->query(sprintf("ALTER TABLE `%st_widget` ADD INDEX `idx_s_description` (`s_description`);", DB_TABLE_PREFIX));
osc_set_preference('force_jpeg', '0', 'osclass', 'BOOLEAN');
@unlink(ABS_PATH . '.maintenance');
// THESE LINES PROBABLY HIT LOW TIMEOUT SCRIPTS, RUN THE LAST OF THE UPGRADE PROCESS
//osc_calculate_location_slug('country');
//osc_calculate_location_slug('region');
//osc_calculate_location_slug('city');
}
if(osc_version() < 343) {
// update t_alerts - Save them in plain json instead of base64
$mAlerts = Alerts::newInstance();
$aAlerts = $mAlerts->findByType('HOURLY');
foreach($aAlerts as $alert) {
$s_search = base64_decode($alert['s_search']);
if(stripos(strtolower($s_search), 'union select')!==false || stripos(strtolower($s_search), 't_admin')!==false) {
$mAlerts->delete(array('pk_i_id' => $alert['pk_i_id']));
} else {
$mAlerts->update(array('s_search' => $s_search), array('pk_i_id' => $alert['pk_i_id']));
}
}
unset($aAlerts);
$aAlerts = $mAlerts->findByType('DAILY');
foreach($aAlerts as $alert) {
示例10: fbc_check_logout
function fbc_check_logout()
{
if (Params::getParam("page") == "main" && Params::getParam("action") == "logout" && osc_version() < 310) {
OSCFacebook::newInstance()->resetCookies();
}
}
示例11: osc_file_get_contents
function osc_file_get_contents($url)
{
require_once LIB_PATH . 'libcurlemu/libcurlemu.inc.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT'] . ' OSClass (v.' . osc_version() . ')');
if (!defined('CURLOPT_RETURNTRANSFER')) {
define('CURLOPT_RETURNTRANSFER', 1);
}
@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
示例12: register_user
function register_user($user)
{
$manager = User::newInstance();
$input['s_name'] = $user['name'];
$input['s_email'] = $user['email'];
$input['s_password'] = sha1(osc_genRandomPassword());
$input['dt_reg_date'] = date('Y-m-d H:i:s');
$input['s_secret'] = osc_genRandomPassword();
$email_taken = $manager->findByEmail($input['s_email']);
if ($email_taken == null) {
$manager->insert($input);
$userID = $manager->dao->insertedId();
$result = $manager->dao->replace();
osc_run_hook('user_register_completed', $userID);
$userDB = $manager->findByPrimaryKey($userID);
if (osc_notify_new_user()) {
osc_run_hook('hook_email_admin_new_user', $userDB);
}
if (osc_version() >= 310) {
$manager->update(array('b_active' => '1', 's_username' => $userID), array('pk_i_id' => $userID));
} else {
$manager->update(array('b_active' => '1'), array('pk_i_id' => $userID));
}
insert_facebook_user_data($userID, $user['id']);
osc_run_hook('hook_email_user_registration', $userDB);
osc_run_hook('validate_user', $userDB);
osc_add_flash_ok_message(sprintf(__('Your account has been created successfully', 'facebook'), osc_page_title()));
}
}
示例13: osc_do_auto_upgrade
function osc_do_auto_upgrade()
{
$data = osc_file_get_contents('http://osclass.org/latest_version_v1.php?callback=?');
$data = preg_replace('|^\\?\\((.*?)\\);$|', '$01', $data);
$json = json_decode($data);
$result['error'] = 0;
if ($json->version > osc_version() && osc_check_dir_writable()) {
osc_set_preference('update_core_json', $data);
if (substr($json->version, 0, 1) != substr(osc_version(), 0, 1)) {
// NEW BRANCH
if (strpos(osc_auto_update(), 'branch') !== false) {
osc_run_hook('before_auto_upgrade');
$result = osc_do_upgrade();
osc_run_hook('after_auto_upgrade', $result);
}
} else {
if (substr($json->version, 1, 1) != substr(osc_version(), 1, 1)) {
// MAJOR RELEASE
if (strpos(osc_auto_update(), 'branch') !== false || strpos(osc_auto_update(), 'major') !== false) {
osc_run_hook('before_auto_upgrade');
$result = osc_do_upgrade();
osc_run_hook('after_auto_upgrade', $result);
}
} else {
if (substr($json->version, 2, 1) != substr(osc_version(), 2, 1)) {
// MINOR RELEASE
if (strpos(osc_auto_update(), 'branch') !== false || strpos(osc_auto_update(), 'major') !== false || strpos(osc_auto_update(), 'minor') !== false) {
osc_run_hook('before_auto_upgrade');
$result = osc_do_upgrade();
osc_run_hook('after_auto_upgrade', $result);
}
}
}
}
} else {
osc_set_preference('update_core_json', '');
}
osc_set_preference('last_version_check', time());
if ($result['error'] == 0 || $result['error'] == 6) {
osc_set_preference('update_core_json', '');
if (strpos(osc_auto_update(), 'plugins') !== false) {
$total = osc_check_plugins_update(true);
if ($total > 0) {
$elements = osc_get_preference('plugins_to_update');
foreach ($elements as $element) {
if (osc_is_update_compatible('plugins', $element, $json->s_name)) {
osc_market('plugins', $element);
}
}
}
}
if (strpos(osc_auto_update(), 'themes') !== false) {
$total = osc_check_themes_update(true);
if ($total > 0) {
$elements = osc_get_preference('themes_to_update');
foreach ($elements as $element) {
if (osc_is_update_compatible('themes', $element, $json->s_name)) {
osc_market('themes', $element);
}
}
}
}
if (strpos(osc_auto_update(), 'languages') !== false) {
$total = osc_check_languages_update(true);
if ($total > 0) {
$elements = osc_get_preference('languages_to_update');
foreach ($elements as $element) {
if (osc_is_update_compatible('languages', $element, $json->s_name)) {
osc_market('languages', $element);
}
}
}
}
}
}
示例14: base64_decode
$s_search = base64_decode($alert['s_search']);
if (stripos(strtolower($s_search), 'union select') !== false || stripos(strtolower($s_search), 't_admin') !== false) {
$mAlerts->delete(array('pk_i_id' => $alert['pk_i_id']));
} else {
$mAlerts->update(array('s_search' => $s_search), array('pk_i_id' => $alert['pk_i_id']));
}
}
unset($aAlerts);
}
if (osc_version() < 350) {
osc_set_preference('marketURL', 'http://market.osclass.org/api/v2/');
osc_set_preference('marketAPIConnect', '');
osc_set_preference('marketCategories', '');
osc_set_preference('marketDataUpdate', 0);
}
if (osc_version() < 352) {
osc_set_preference('marketURL', 'http://market.osclass.org/api/v2/');
}
osc_changeVersionTo(360);
if (!defined('IS_AJAX') || !IS_AJAX) {
if (empty($aMessages)) {
osc_add_flash_ok_message(_m('Osclass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>'), 'admin');
echo '<script type="text/javascript"> window.location = "' . osc_admin_base_url(true) . '?page=tools&action=version"; </script>';
} else {
echo '<div class="well ui-rounded-corners separate-top-medium">';
echo '<p>' . __('Osclass » Updated correctly') . '</p>';
echo '<p>' . __('Osclass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>') . '</p>';
foreach ($aMessages as $msg) {
echo "<p>" . $msg . "</p>";
}
echo "</div>";
示例15: get_item_price
function get_item_price($item)
{
$priceFromSession = Session::newInstance()->_getForm('price');
if (count($item) == 0) {
if (osc_version() >= 230) {
$priceFromSession = osc_prepare_price($priceFromSession);
}
return $priceFromSession;
}
if ($priceFromSession != '') {
if (osc_version() >= 230) {
$priceFromSession = osc_prepare_price($priceFromSession);
}
return $priceFromSession;
}
if (osc_version() < 230) {
return $item['f_price'];
}
return osc_prepare_price($item['i_price']);
}