Forum Replies Created

Viewing 15 replies - 16 through 30 (of 118 total)
  • Plugin Author ccprog

    (@ccprog)

    Not under add_action, but inide the mycred_crw_submit function.

    Plugin Author ccprog

    (@ccprog)

    Where do you call that? In function mycred_crw_submit? You could try to feed $FAILED back to the user feedback message like this:

    add_filter('crw_solution_message', function ( $message ) use ( $FAILED, $submission ) {
        $success = $FAILED ? 'recorded' : 'declined';
        return $success . '<br/>' . print_r( $submission, true);
    }

    After submitting the solution, the dialog should stay open and display some text:

    • If recorded is displayed, the credit should be logged
    • If declined shows, the function was called but failed to record anything
    • If nothing shows or the dialog hangs without closing, the function call has probably failed. I’d expect an error message in your PHP log.
    • This reply was modified 7 years, 4 months ago by ccprog.
    Plugin Author ccprog

    (@ccprog)

    Oops, I think my WP skills are geting stale. It should be $user->get( 'ID' ) or simply $user->ID.

    If that does not help, can you see if mycred_add() is called at all?

    Plugin Author ccprog

    (@ccprog)

    I am not sure if what you want isn’t contrary to the basic design of the plugin, but maybe I am missunderstanding you. The frontend code only communicates with the server once the timer has expired or the riddle was solved, and the user explicitely requests that the server should be alerted. Only then the backend code will be called. Marking wrong words is a frontend-only action and never communicated back.

    As long as that is understood and acceptable for your needs, there is an API you can leverage to integrate with myCred. The submission of a solution will raise an action crw_solution_submitted. Define in your code something like this:

    function mycred_crw_submit ( $user, $submission ) {
        extract( $submission );
        $user_id = $user->get( 'id' );
        $FAILED = mycred_add( 'crossword', $user_id, $solved, 'Crosswordsearch found word' );
    }
    add_action( 'crw_solution_submitted', 'mycred_crw_submit', 10, 2 );

    The function crw_log_text you cited is only called if another plugin integration is active and wants to format a log message for consumption. I think I’ll add a note to that effect to the Wiki page.

    I don’t think you need that unless you want to add the text to the log message. Like this, using the mycred_log_entry filter inside the above function:

    add_filter( 'mycred_log_entry', function ( $content, $entry ) use ( $submission ) {
        $crw_message = crw_log_text( $submission );
        return $content . '<br/>' . $crw_message;
    } );

    To get some ideas how things can work, you can take a look at function crw_badgeos_submit in file badgeos.php which provides the integration with BadgeOS.

    • This reply was modified 7 years, 4 months ago by ccprog.
    Plugin Author ccprog

    (@ccprog)

    No probs. Have fun with the crosswords!

    Plugin Author ccprog

    (@ccprog)

    I doubt that you would install the multisite version accidentally. You can identify that if you look at the “My Sites” entry in the admin bar at the top of the screen. In a multisite installation, there will be more than one entry, and the first one is called “Network Admin”.

    Do not click on the “Plugins” sub-entry there, but choose one of the blog names below, and select “Plugins” from the left-hand menu. If you activate the plugin from there, I would hope that the activation works.

    If you do not have the “Network Admin” entry, you are not on multisite, and we’d have to look further for the source of the error. In this case, the PHP error log would be most helpfull.

    Plugin Author ccprog

    (@ccprog)

    I apologise for the un-helpfull error message. Do you have a multisite installation? I know that these sort of messages pop up there because of a bug in WordPress Core.

    Anyway, do you have access to the PHP logs of your site? A more specific message might have been entered there.

    The plugin itself triggers errors on activation in three cases:

    • if you try to activate it centrally it in a multsite installation. You must activate the plugin individually for each blog.
    • if PHP is installed in a version < 5.3 – you ruled that out.
    • if the database engine does not support InnoDB tables. Some old MySQL versions need these tables to be explicitely enabled.
    Plugin Author ccprog

    (@ccprog)

    The request for Editor status seems to take longer. No reaction yet.

    In the meantime, if you have already translated something and think you can handle the tech involved, you can upload (partial) translations even without this status. The main difference is that your strings will appear in the “waiting for approval” column.

    No pressure – decide for yourself if you want to engage.

    Plugin Author ccprog

    (@ccprog)

    Thank you for the report. I never looked into WP-CLI, so I’ll have to test for myself.

    Varables declared in a plugin, as I understand it, are not really global, as the plugin file itself seems to be loaded from inside a function. For normal use, this only has effects for certain specialized hooks like plugin activation. Maybe the CLI does things differently.

    I am in the middle of a general overhaul anyway (to implement REST API endpoints), so look out for a new version within the next two weeks.

    Plugin Author ccprog

    (@ccprog)

    Since this concerns the frontend, you would have to look at the development repository at https://github.com/ccprog/crosswordsearch. Please review the grunt tasks for compiling and testing the js files. If you change src/js/ files, you must run ‘grunt uglify’, if you change src/css/ files, you must run ‘grunt cssmin’.

    It is important to note that

    1. This is a Angular v1 application
    2. It has been developed with compatibility with Internet Explorer 8 in mind, which means is has to work with Angular 1.5 and 1.2

    In plugin/app.php, you find the Angular directive tags:

    • lines 97 and 124 have ‘crw-catch-mouse’, which bind the mouse click events to Controller methods. It is defined at the start of src/js/CrosswordController.js
    • line 98ff has ‘transform-multi-style’, which refers to the qantic.angularjs.stylemodel module included in plugin/js and steered from src/js/SizeController.js. It is pretty complex, so if you don’t want to make crossword building accessible by touch, you better leave it alone.
    • line 127 has the mouse move event directives, which refer to src/js/TableController.js.

    No, it is not as simple as adding a few event names. But if you get something working, I would appreciate a pull request.

    • This reply was modified 8 years, 1 month ago by ccprog.
    Plugin Author ccprog

    (@ccprog)

    Thank you for your praise.

    Currently, I have no plans to support touch devices, but I’ll take it as a feature request. Due to other projects it may take until summer until I get to work on it.

    The main problem are not the touch gestures but small device screens.

    Plugin Author ccprog

    (@ccprog)

    I just reread your posts, and there are two other things I should comment on:

    No, the search word crosswords are the only type I did a plugin for.

    If you decide to use LearnDash, I can’t help you with integrating crosswordsearch. It is a commercial product I have no access to. and to quote their website:

    Do you offer custom development services?

    Due to our current workload, we are unable to take on custom development projects. If you are interested in custom development for LearnDash, contact us and we can provide you with a list of trusted partners.

    Plugin Author ccprog

    (@ccprog)

    Not really sure what you mean here:

    I can′t have a Spanish language in English.

    If you are serious to do a spanish translation, that would be great!

    The best way to do it would be to use the online tools on translate.www.remarpro.com, where you can load your work directly into the plugin deployment chain. On the plugin page, there is a green button “Translate crosswordsearch”. Log in, follow it, and and look for the “Spanish” line. Click on the column “Development”. There you can enter your translations directly (expand “Details” on the right side of every line).

    If you have a ready translation produced with Loco, you can use that. Loco lets you download a file called crossordsearch-es_ES.po with the “PO” button at the top right of the translation table. At the bottom of the WordPress translation page there is a link “Import Translations” where you can upload it.

    But wait until you do it: For your translations to get approved, you must be registered as a Plugin Translation Editor. I have to apply for that status for you.

    Your translation will not appear imediately in the plugin itself, but I will keep an eye on the translation page, and within days of you uploading I will publish a new version of crosswordsearch, and that will contain your work.

    A great big thank you in advance!

    Plugin Author ccprog

    (@ccprog)

    From your profile it seems that you are looking at LMS software. If you would like to use Crosswordsearch as part of coursework, you might be interested in users sending in solutions/proving they have solved them.

    Crosswordsearch has out-of-the-box support for BadgeOS to do that. If that doesn’t fit your needs, feel free to contact me about it in a new thread. While I won’t promise anything, writing interfaces to other plugins has in other cases been not that complex.

    Plugin Author ccprog

    (@ccprog)

    Create or edit a public post where you would like to publish the crossword. Press the Create Crosswordsearch shortcode button. In the dialog, choose Solve crosswords, choose your crossword, decide whether you would like to display a timer and press Insert Shortcode.

    For details on what you can do with the shortcode, see this entry in the wiki. You do not need to fiddle with the attribute codes, every option described there can also be set in the dialog.

Viewing 15 replies - 16 through 30 (of 118 total)