Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.
Please keep in mind:
<div><input type="checkbox" id="pref-watermark" <?php if(isset($_COOKIE['doWMark'])) echo 'checked="checked"'; ?> /> <label for="pref-watermark"><?php show_lang_txt('txt_watermark_enable'); ?></label></div>
<div><input type="checkbox" id="pref-shorturl" <?php if(isset($_COOKIE['doShort'])) echo 'checked="checked"'; ?> /> <label for="pref-shorturl"><?php show_lang_txt('txt_create_short_url'); ?> <?php show_tinyurl_service(); ?></label></div>
function is_user_preference_watermark() {
return (isset($_COOKIE['doWMark'])) ? true : false;
}
function is_user_preference_short_url() {
return (isset($_COOKIE['doShort'])) ? true : false;
}
if(!is_animated_image($this->working) && conditional_config('watermark_enable') and chevereto_config('watermark_opacity')>0)
if(!is_animated_image($this->working) && conditional_config('watermark_enable') and chevereto_config('watermark_opacity')>0 and is_user_preference_watermark())
preferences_watermark : "#pref-watermark",
preferences_shorturl : "#pref-shorturl",
$(selectors.preferences_watermark).change(function(){
$(this).ajax_watermark_enable();
});
$(selectors.preferences_shorturl).change(function(){
$(this).ajax_short_url();
});
preferences_watermark : "#pref-watermark",
preferences_shorturl : "#pref-shorturl",
jQuery.fn.ajax_watermark_enable = function() {
$.ajax({url: base_url_js+"pref.php?doWMark="+($(get_safe_selector("preferences_watermark")).is(':checked')?1:0)});
};
jQuery.fn.ajax_short_url = function() {
shorturl_checkbox_selector = this;
$(get_safe_selector("uploadify")).uploadify('settings', 'formData',{sID: session_id, doShort: shorturl_checkbox_selector.is(':checked')});
$.ajax({url: base_url_js+"pref.php?doShort="+(shorturl_checkbox_selector.is(':checked')?1:0)});
};
$doWMark = $_GET['doWMark'];
$doShort = $_GET['doShort'];
if ($doWMark=='0') setcookie('doWMark', '', time() - 3600, __CHV_RELATIVE_ROOT__, $_SERVER['SERVER_NAME']);
if ($doWMark=='1') setcookie('doWMark', 1, time()+60*60*24*30, __CHV_RELATIVE_ROOT__, $_SERVER['SERVER_NAME']);
if ($doShort=='1') setcookie('doShort', 1, time()+60*60*24*30, __CHV_RELATIVE_ROOT__, $_SERVER['SERVER_NAME']);
<div><input type="checkbox" id="pref-watermark" <?php if(isset($_COOKIE['doWMark'])) echo 'checked="checked"'; ?> /> <label for="pref-watermark"><?php show_lang_txt('txt_watermark_enable'); ?></label></div>
<div><input type="checkbox" id="pref-watermark" <?php if(isset($_COOKIE['doWMark'])) echo 'checked="checked"'; ? checked> /> <label for="pref-watermark"><?php show_lang_txt('txt_watermark_enable'); ?></label></div>
Ok, was able to make it myself. Here's what I've changed:
in content/themes/Peafowl/index.php add
afterPHP:<div><input type="checkbox" id="pref-watermark" <?php if(isset($_COOKIE['doWMark'])) echo 'checked="checked"'; ?> /> <label for="pref-watermark"><?php show_lang_txt('txt_watermark_enable'); ?></label></div>
in includes/functions.php addPHP:<div><input type="checkbox" id="pref-shorturl" <?php if(isset($_COOKIE['doShort'])) echo 'checked="checked"'; ?> /> <label for="pref-shorturl"><?php show_lang_txt('txt_create_short_url'); ?> <?php show_tinyurl_service(); ?></label></div>
afterPHP:function is_user_preference_watermark() { return (isset($_COOKIE['doWMark'])) ? true : false; }
in includes/classes/class.upload.php change linePHP:function is_user_preference_short_url() { return (isset($_COOKIE['doShort'])) ? true : false; }
toPHP:if(!is_animated_image($this->working) && conditional_config('watermark_enable') and chevereto_config('watermark_opacity')>0)
in content/themes/Peafowl/theme.js addPHP:if(!is_animated_image($this->working) && conditional_config('watermark_enable') and chevereto_config('watermark_opacity')>0 and is_user_preference_watermark())
afterCode:preferences_watermark : "#pref-watermark",
andCode:preferences_shorturl : "#pref-shorturl",
afterCode:$(selectors.preferences_watermark).change(function(){ $(this).ajax_watermark_enable(); });
in content/system/js/chevereto.js addCode:$(selectors.preferences_shorturl).change(function(){ $(this).ajax_short_url(); });
afterCode:preferences_watermark : "#pref-watermark",
andCode:preferences_shorturl : "#pref-shorturl",
afterCode:jQuery.fn.ajax_watermark_enable = function() { $.ajax({url: base_url_js+"pref.php?doWMark="+($(get_safe_selector("preferences_watermark")).is(':checked')?1:0)}); };
in content/system/js/pref.php addCode:jQuery.fn.ajax_short_url = function() { shorturl_checkbox_selector = this; $(get_safe_selector("uploadify")).uploadify('settings', 'formData',{sID: session_id, doShort: shorturl_checkbox_selector.is(':checked')}); $.ajax({url: base_url_js+"pref.php?doShort="+(shorturl_checkbox_selector.is(':checked')?1:0)}); };
afterPHP:$doWMark = $_GET['doWMark'];
andPHP:$doShort = $_GET['doShort'];
afterPHP:if ($doWMark=='0') setcookie('doWMark', '', time() - 3600, __CHV_RELATIVE_ROOT__, $_SERVER['SERVER_NAME']); if ($doWMark=='1') setcookie('doWMark', 1, time()+60*60*24*30, __CHV_RELATIVE_ROOT__, $_SERVER['SERVER_NAME']);
Just need to delete content/system/js/chevereto.min.js and content/themes/Peafowl/theme.min.js after modification.PHP:if ($doShort=='1') setcookie('doShort', 1, time()+60*60*24*30, __CHV_RELATIVE_ROOT__, $_SERVER['SERVER_NAME']);
In fact I just copied over the short url code with a little change. Maybe it can be useful to someone else.