kvanbiesen
Forum Replies Created
-
Forum: Plugins
In reply to: [PHP Everywhere] PHP 7.2: Deprecated function create_function()replace line 24 of /home/cotosanc/public_html/wp-content/plugins/php-everywhere/phpeverywhere.php
with this line:
add_action(‘widgets_init’, function(){return register_widget(“phpeverywherewidget”);});
booom fixed
Forum: Plugins
In reply to: [SS Quiz] Timer Function Not Workingread my reply in here
http://wordpress.org/support/topic/timer-not-working-correctlyForum: Plugins
In reply to: [SS Quiz] How to set 3 attempts to make the quiz?you sure you published the page?
dont use the back button to retake the quiz
it work fine here, multiple browsers
what happens if you add? it will show a dirty attemps and maxtries (it will only look a the attemps when loading the page, so use back for browser = no worky.
if( isset( $params["chances"])) { $attempts = $wpdb->get_var( " SELECT count(*) FROM {$wpdb->base_prefix}ssquiz_history WHERE user_id = {$info->user->id} AND quiz_id = {$info->quiz->id} "); echo "Attempts Saved: ".$attempts." Max_chances". intval( $params["chances"]); if( $attempts >= intval( $params["chances"]) ) return ssquiz_return_quiz_body( '<h2>'.__('You already took this quiz', 'ssquiz').'</h2>' ); }
ps, tried both logged in and logout users
Forum: Plugins
In reply to: [SS Quiz] Timer Problem – Minor Bug.Forum: Plugins
In reply to: [SS Quiz] Timer not working correctlyi’m pretty sure its related to the timezone/time notation on your pc…
if you change it to like say belgian notation/timezone, i’m pretty sure it will work.
The Date function ssvadim used, doesnt cover that, he will need to adapt the conversion to UTCtime, and then calculate with it.
i’ve created a dirty fix for you guys. it should work/but break after an update
open the ssquiz.js in in editorreplace line 947-949
var date = new Date(left * 1000); var time = date.toTimeString().substr(3, 5);
with
var secsleft=left; var minutes = Math.floor(secsleft / 60); secsleft -= minutes * 60; var seconds = parseInt(secsleft % 60, 10); var time = (minutes < 10 ? '0' + minutes : minutes) + ':' + (seconds < 10 ? '0' + seconds : seconds);
should work if you stay under the hour, easy to change ofc
Forum: Plugins
In reply to: [SS Quiz] How to set 3 attempts to make the quiz?Dirty hack – will break on update most likely
open client-quiz.php
replace (line 83-90)
// Did current user tried this quiz if( $info->one_chance ) { $attempts = $wpdb->get_var( " SELECT count(*) FROM {$wpdb->base_prefix}ssquiz_history WHERE user_id = {$info->user->id} AND quiz_id = {$info->quiz->id} "); if( $attempts > 0 ) return ssquiz_return_quiz_body( '<h2>'.__('You already took this quiz', 'ssquiz').'</h2>' ); }
with
//remove one_change and replaced with chances if( isset( $params["chances"])) { $attempts = $wpdb->get_var( " SELECT count(*) FROM {$wpdb->base_prefix}ssquiz_history WHERE user_id = {$info->user->id} AND quiz_id = {$info->quiz->id} "); if( $attempts >= intval( $params["chances"]) ) return ssquiz_return_quiz_body( '<h2>'.__('You already took this quiz', 'ssquiz').'</h2>' ); }
then in your yourcode, add chances=3 to make 3 attempts. (1 for once_change)
Forum: Plugins
In reply to: [SS Quiz] Language Spanish not workingwell i’m pretty new @ wordpress(only start looking at it 1 week ago), so i’m still trying to figure everything out myself.
i think, this is explanation..
let say your site = http://somewpsite.com
the plugins_url function gives the full path to the lang dir. so it will be the absolute path
http://somewpsite.com/wp-content/plugins/ssquiz/lang/ssquiz-es_ES.mo wich it will look for.Most likely it wont be able to fetch this, well maybe it can, but it wont find the Po files.
if you change it by my command, it will look in the folders using relative paths (relative from the folder its located..). and then it will know how to find every file.
Btw a lot of __() need to be replaced, otherwise it will be partial your language, partial english..
Other then that, Its an awesome plugin. easy, works fine (in english, multilang needed some fixing)
Forum: Plugins
In reply to: [SS Quiz] Language Spanish not workingChange Line 361 of ssquiz.php
load_plugin_textdomain( 'ssquiz', false, plugins_url( 'ssquiz/lang' ) );
to
load_plugin_textdomain( 'ssquiz', false, dirname(plugin_basename( __FILE__ ) ) .'/lang');
btw while the plugin works great, it needs some fixing in the localization. Some Fields Arent Translated but can be dirty hacked to make it work.
by example in client-quiz, __(“Answered questions”) must be changed to __(“Answered questions”, ‘ssquiz’) in order to make it work