Forum Activity for @michael

michael
@michael
12/28/17 11:07:08AM
7,826 posts

Datastore Conversion


Jamroom Developers

AH! This is an important feature for you to know about @tig, queue workers. They are a way to move the processing of whatever needs done to the background so the person running the integrity check (or whatever) doesnt need to wait for the process that was started to finish.

In the performance improvement for jrComment the key is added byt the jrComment_verify_db_worker().

That worker is started in the 'repair_module' listener with:
        // Verify comments
        jrCore_queue_create('jrComment', 'verify_db', array('count' => $num), 0, null, 1);

So if its going to take a long time to complete, pass it off to a queue worker.

Docs: "The Queue System"
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/1543/the-queue-system
queue_worker.jpg queue_worker.jpg - 423KB
michael
@michael
12/28/17 10:58:17AM
7,826 posts

Datastore Conversion


Jamroom Developers

Any database adjustments or updates usually fire off of the integrity check listeners
ACP -> MODULES -> CORE -> SYSTEM CORE -> TOOLS -> INTEGRITY CHECK

So probably the 'repair_module' listener.

Then in there whatever adjustments that need to be done are done. Example, the Gallery Module needed to make sure that all datastore items have a 'gallery_order' value set, so does this in the repair module listener:

function jrGallery_repair_module_listener($_data, $_user, $_conf, $_args, $event)
{ $_rt = jrCore_db_get_items_missing_key('jrGallery', 'gallery_order'); if ($_rt && is_array($_rt)) { $_up = array(); foreach ($_rt as $id) { $_up[$id] = array('gallery_order' => 100); } if (count($_up) > 0) { jrCore_db_update_multiple_items('jrGallery', $_up); jrCore_logger('INF', "updated " . count($_up) . " gallery images missing gallery_order key"); } } return $_data; }
* get all gallery items missing the 'gallery_order' key.
* set that items 'gallery_order' key to 100
* update all those items.
michael
@michael
12/27/17 10:18:13AM
7,826 posts

Datastore Conversion


Jamroom Developers

There is the "Batch Item" update module that allows you to update multiple items from the ACP. Install it and each module that uses a datastore will have an extra tool in their TOOLS tab.

https://www.jamroom.net/the-jamroom-network/documentation/modules/2922/batch-item-editor

If you're after a function, then jrCore_db_update_multiple_items() is probably what you're after.
michael
@michael
12/27/17 10:14:55AM
7,826 posts

Change Module Landing Page?


Using Jamroom

The suggestion is just to add that to the top. When that is in the template, the template will redirect instead of displaying.
michael
@michael
12/27/17 10:14:04AM
7,826 posts

Search module/templates + FollowMe template


Design and Skin Customization

After you have changed a template, make sure you use the Reset cache tool.
ACP -> MODULES -> CORE -> SYSTEM CORE -> TOOLS -> RESET CACHES
michael
@michael
12/26/17 05:54:20PM
7,826 posts

Reordering Threaded Comments


Jamroom Developers

fire it from 'parse_url' event and you wont have to worry about priority.
michael
@michael
12/26/17 12:43:32PM
7,826 posts

TinyMce Image Margin Not Showing in Firefox


Design and Skin Customization

and thats not working?

try adding
.captionjs p figure {
 margin: 10px !important;
}
at the bottom.
michael
@michael
12/24/17 03:18:02PM
7,826 posts

Reordering Threaded Comments


Jamroom Developers

I tried fiddling with the priority too, but for whatever reason when my _init() was firing the jrComment_db_search_items_listener hadn't been set yet.

Just something to remember if any future ones dont fire.
michael
@michael
12/24/17 01:17:13PM
7,826 posts

Reordering Threaded Comments


Jamroom Developers

my first idea was to put that unregister code directly in the _init() function, but the issue I ran into was that some modules were firing their _init() function AFTER mine, so I couldn't unset them because they were't set yet. so I moved it to the next firing listener after init which was 'parse_url'.
michael
@michael
12/24/17 12:43:29PM
7,826 posts

Reordering Threaded Comments


Jamroom Developers

How about this. Put this into a module's include file. (I called it xxCommentOverride, but anything)
<?php
/**
 * @copyright 2018 noone
 */

// make sure we are not being called directly
defined('APP_DIR') or exit();

/**
 * meta
 */
function xxCommentOverride_meta(){
    $_tmp = array(
        'name'        => 'Comment Override',
        'url'         => 'commentoverdrive',
        'version'     => '1.0.0',
        'developer'   => 'noone, ©' . strftime('%Y'),
        'description' => 'Stops the jrComment_db_search_items_listener listener from firing',
        'category'    => 'custom',
        'license'     => 'mpl',
        'priority'    => 255
    );
    return $_tmp;
}

/**
 * init
 */
function xxCommentOverride_init(){
    jrCore_register_event_listener('jrCore', 'parse_url', 'xxCommentOverride_parse_url_listener');

    return true;
}

function xxCommentOverride_parse_url_listener($_data, $_user, $_conf, $_args, $event)
{ if (isset($GLOBALS['__JR_FLAGS']['jrcore_event_listeners']['jrCore_db_search_items'])) { if ($pos = array_search('jrComment_db_search_items_listener', $GLOBALS['__JR_FLAGS']['jrcore_event_listeners']['jrCore_db_search_items'])) { unset($GLOBALS['__JR_FLAGS']['jrcore_event_listeners']['jrCore_db_search_items'][$pos]); } } return $_data; }

Turns off the comment modules listener.
updated by @michael: 12/24/17 12:44:30PM
  162