Forum Activity for @michael

michael
@michael
12/29/17 10:43:51PM
7,823 posts

Unable to Retrieve Quota Settings for Module


Jamroom Developers

The normal fix for that is run the integrity check.

The cause is probably the module was activated, but the datastore hasn't been created yet.

Try that first.
michael
@michael
12/28/17 12:28:59PM
7,823 posts

jrGallery db_update_item listener


Jamroom Developers

So putting flags in the code (as above) should do the trick.

--edit--
A flag will only last for this round of processing, as soon as the next round starts (a page refresh, another url call) the flag will be gone.
updated by @michael: 12/28/17 12:30:00PM
michael
@michael
12/28/17 12:24:03PM
7,823 posts

jrGallery db_update_item listener


Jamroom Developers

so you want that to only fire ONCE or once for each separate (something)?

function ujHotspots_db_update_item_listener($_data, $_user, $_conf, $_args, $event)
{ if (isset($_args['module']) && $_args['module'] == 'jrGallery' && !jrCore_get_flag('ujHotspots_already_done')) { fdebug("ujHotspots_db_update_item_listener",$_data,$_args, $event); jrCore_set_flag('ujHotspots_already_done', 1); } return $_data; }
michael
@michael
12/28/17 11:47:15AM
7,823 posts

jrGallery db_update_item listener


Jamroom Developers

That will update every image in that gallery. The 'gallery_title' and the 'gallery_title_url' will be updated.

What I think you're trying to avoid is having your custom modules check function fire too many times. If thats the case, what about setting a flag when the first one runs, then check if that flag has been set before running the second time.

similar to this (screenshot)
flags.jpg flags.jpg - 182KB
michael
@michael
12/28/17 11:38:57AM
7,823 posts

profile_stats function example


Jamroom Developers

If its for a profile's side bar or similar, you could use the jrCore_list call with the return_count parameter something like:
{jrCore_list module="jrGallery" profile_id=2 group_by="gallery_title_url" return_count=true}

Will that work for you?
michael
@michael
12/28/17 11:26:27AM
7,823 posts

TinyMce Image Margin Not Showing in Firefox


Design and Skin Customization

It will be specific to your skins CSS if its not working @lornawebber. The reason it was not working on @derrickhand300's site is that he has a custom image display script that adds captions to his images and that was interfering.

For you the solution will be different. Where is an image that has been added using this method, I'll see what the issue is.
michael
@michael
12/28/17 11:07:08AM
7,823 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,823 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,823 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.
  161