Forum Activity for @ultrajam

SteveX
@ultrajam
12/28/17 12:31:00PM
2,589 posts

jrGallery db_update_item listener


Jamroom Developers

Ah OK, I hadn't realised that!

I will give it a try.

Thanks Michael :)
SteveX
@ultrajam
12/28/17 12:27:41PM
2,589 posts

jrGallery db_update_item listener


Jamroom Developers

Ideally once. My hotspots module references the gallery using the gallery title. When the title changes I need to update the reference in the Hotspots datastore. And delete it if that gallery no longer exists.

For your code suggestion there where would I set the flag to off?
updated by @ultrajam: 12/28/17 12:29:08PM
SteveX
@ultrajam
12/28/17 12:20:16PM
2,589 posts

jrGallery db_update_item listener


Jamroom Developers

I guess it's a separate listener, but I'm also going to need to update my module's datastore when the last gallery image is deleted. Just mentioning that here to remind myself later ;)
SteveX
@ultrajam
12/28/17 12:13:23PM
2,589 posts

jrGallery db_update_item listener


Jamroom Developers

Yes, that's what I'm trying too avoid, but it's many separate db_update_item triggers - from a db_update_item listener I'm not sure how to unset the flag after the last image has been updated. There's no way of telling if it's the last iteration. Also no way of passing the old gallery title (which I would have to get from the db on the first item) between iterations, so I would be getting from and then writing to the database for each image.

Here is a listener with an fdebug to the log:
function ujHotspots_db_update_item_listener($_data, $_user, $_conf, $_args, $event)
{ if (isset($_args['module']) && $_args['module'] == 'jrGallery') { fdebug("ujHotspots_db_update_item_listener",$_data,$_args, $event); } return $_data; }

And here is the output ($_data,$_args, $event) for a 2 image gallery:
Quote: (2017-12-28T20:04:42+00:00.0.68599500 : 0.012)-(mem: 2MB)-(pid: 6174)-(ip: 92.238.255.12)-(user: SteveX)-(uri: POST /gallery/update_save/__ajax=1)
|ujHotspots_db_update_item_listener|

(2017-12-28T20:04:42+00:00.0.68599500 : 0.012)-(mem: 2MB)-(pid: 6174)-(ip: 92.238.255.12)-(user: SteveX)-(uri: POST /gallery/update_save/__ajax=1)
Array
(
[gallery_title] => Banksy Gallery
[gallery_title_url] => banksy-gallery
[gallery_order] => 2
[_updated] => 1514393591
)

(2017-12-28T20:04:42+00:00.0.68599500 : 0.012)-(mem: 2MB)-(pid: 6174)-(ip: 92.238.255.12)-(user: SteveX)-(uri: POST /gallery/update_save/__ajax=1)
Array
(
[_item_id] => 1
[module] => jrGallery
[jrcore_unique_trigger_id] => 9815d1287d1054c2ac358c9460db6667
)

(2017-12-28T20:04:42+00:00.0.68599500 : 0.012)-(mem: 2MB)-(pid: 6174)-(ip: 92.238.255.12)-(user: SteveX)-(uri: POST /gallery/update_save/__ajax=1)
|db_update_item|

(2017-12-28T20:04:42+00:00.0.68698600 : 0.013)-(mem: 2MB)-(pid: 6174)-(ip: 92.238.255.12)-(user: SteveX)-(uri: POST /gallery/update_save/__ajax=1)
|ujHotspots_db_update_item_listener|

(2017-12-28T20:04:42+00:00.0.68698600 : 0.013)-(mem: 2MB)-(pid: 6174)-(ip: 92.238.255.12)-(user: SteveX)-(uri: POST /gallery/update_save/__ajax=1)
Array
(
[gallery_title] => Banksy Gallery
[gallery_title_url] => banksy-gallery
[gallery_order] => 3
[_updated] => 1514393591
)

(2017-12-28T20:04:42+00:00.0.68698600 : 0.013)-(mem: 2MB)-(pid: 6174)-(ip: 92.238.255.12)-(user: SteveX)-(uri: POST /gallery/update_save/__ajax=1)
Array
(
[_item_id] => 2
[module] => jrGallery
[jrcore_unique_trigger_id] => 002d51479d35e48108c6a997fd295506
)
SteveX
@ultrajam
12/28/17 11:47:47AM
2,589 posts

profile_stats function example


Jamroom Developers

Hi Michael. Yes that will work - simpler than I was thinking, and simplest is definitely best!

Thanks :)
SteveX
@ultrajam
12/28/17 06:47:24AM
2,589 posts

Configure button in jrCore_item_list_buttons ignores the size parameter


Jamroom Developers

In an item_list.tpl if I add a parameter to change button size to jrCore_item_list_buttons the "Configure these buttons and the order they appear in" button does not obey the size parameter.

{jrCore_item_list_buttons module="jrVideo" field="video_file" item=$item size=20}

This isn't very important as only the admin sees the Configure button.

Thanks!

buttons.png buttons.png - 90KB

updated by @ultrajam: 03/29/18 10:04:13AM
SteveX
@ultrajam
12/27/17 01:54:28PM
2,589 posts

profile_stats function example


Jamroom Developers

Is there an example of a profile_stats function anywhere?

And is there any way to override a profile stat? I'd like to show the number of galleries in jrGallery rather than the number of images.

Thanks!
updated by @ultrajam: 03/31/18 03:20:00AM
SteveX
@ultrajam
12/27/17 12:35:20PM
2,589 posts

jrGallery db_update_item listener


Jamroom Developers

I need to check a custom model for a reference to a gallery whenever a jrGallery title is changed, then update that custom item with the new gallery title.

jrGallery uses jrCore_db_update_multiple_items so the best trigger I can see is db_update_item, but that will run for each image in a gallery.

Is there a better listener to use?

Thanks!
updated by @ultrajam: 03/31/18 04:01:00PM
SteveX
@ultrajam
12/27/17 04:28:45AM
2,589 posts

jrElastic2 footer social images don't show


Using Jamroom

In jrElastic2 2.04 current download (downloaded from https://www.jamroom.net/the-jamroom-network/networkmarket/ss=jrElastic2) the footer.tpl is using social icon images named like "sn-twitter.png" but the images in the skin img directory are named like "social-twitter.png", so the images don't show.
updated by @ultrajam: 03/28/18 10:48:44PM
SteveX
@ultrajam
12/23/17 05:32:27PM
2,589 posts

Cyber Monday - up to $200 off Jamroom Premium and Pro!


Announcements

Nice jrSanta logo @mm

I still see that kitten every time I scroll through images, how does that happen? (see attachment) Jamroom team, am I being hounded by a kitten?
kitten-cutex.jpg kitten-cutex.jpg - 101KB
  23