Forum Activity for @elise

Elise
@elise
09/10/16 09:14:44PM
249 posts

2 Suggestions for Jamroom to woo Ning creators


Ning To Jamroom

I would suggest giving a free month of hosting (or 14 days).
But have them pay for the import (because that takes up your time). Then you'll know exactly what size it is and they can decide if they want to pay the hosting after the trial or get hosted elsewhere.
Elise
@elise
09/10/16 06:46:26PM
249 posts

Creating a module to change from the Follow model to the Friend model


Jamroom Developers

So the better version (that compiles)
function xxFriend_follow_request_authorized_listener($_data, $_user, $_conf, $_args, $event)
{ if ($_args['module'] == 'jrFollower' && isset($_args['option']) && $_args['option'] == 'follow' && isset($_data['__ajax']) && $_args['__ajax'] == '1' && //profile_id isset($_data['_1']) && jrCore_checktype($_data['_1'], 'number_nz') && //requester user_id isset($_data['_1']) && jrCore_checktype($_data['_2'], 'number_nz')) { } return $_data; }

I still don't know how to look at th incoming data or print it out so I can see what variable I have to switch out.
Elise
@elise
09/10/16 12:33:17PM
249 posts

Creating a module to change from the Follow model to the Friend model


Jamroom Developers

Is that enough (or too much) to ensure I am only responding to the db_update_item that relates to a follower being authorized?


function xxFriend_follow_request_authorized_listener($_data, $_user, $_conf, $_args, $event)
{ if ($_args['module'] == 'jrFollower' && jrCore_checktype($_args['option'], 'follow') && jrCore_checktype($_data['__ajax'], '1') && //profile_id isset($_data['_1']) && jrCore_checktype($_data['_1'], 'number_nz') && //requester user_id isset($_data['_1']) && jrCore_checktype($_data['_2'], 'number_nz')) { return $_data;
Elise
@elise
09/10/16 12:17:15PM
249 posts

Creating a module to change from the Follow model to the Friend model


Jamroom Developers

Ok, I have achieved integrity and I can see my tiny module. It's cute.

Now I'm guessing I need to test if the event has the follow_active = 1 data in it. On to figure that out :)
Elise
@elise
09/10/16 12:10:12PM
249 posts

Creating a module to change from the Follow model to the Friend model


Jamroom Developers

OOooo there's error messages in the dashboard Activity Log.
[EliseLebeau] invalid module: xxxFriend - required meta function does not exist

Ooops one too many xx.
Elise
@elise
09/10/16 11:53:04AM
249 posts

Creating a module to change from the Follow model to the Friend model


Jamroom Developers

<?php
/**
 * @copyright xxxxxx.
 */

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

/**
 * meta
 */
function xxFriend_meta(){
    $_tmp = array(
        'name'        => 'Friend',
        'url'         => 'friend',
        'version'     => '0.0.1',
        'developer'   => 'Elise, ©' . strftime('%Y'),
        'description' => 'When a follow request is accepted, the user follows the requester back.',
        'category'    => 'profiles'
    );
    return $_tmp;
}

/**
 * init
 */
function xxFriend_init(){
    //register event listeners
    jrCore_register_event_listener('jrCore', 'db_update_item', 'xxFriend_follow_request_authorized_listener');

    return true;
}

/**
 * Listens for when a user accepts a Follow request
 * Update the user to immediately follow the requester back 
 * @param $_data array Array of information from trigger
 * @param $_user array Current user
 * @param $_conf array Global Config
 * @param $_args array additional parameters passed in by trigger caller
 * @param $event string Triggered Event name
 * @return array
 */
function xxFriend_follow_request_authorized_listener($_data, $_user, $_conf, $_args, $event)
{ return $_data; }

updated by @elise: 09/10/16 12:00:25PM
Elise
@elise
09/10/16 11:46:08AM
249 posts

Creating a module to change from the Follow model to the Friend model


Jamroom Developers

When a bare bone module has been created (modules/xxxFriend) with an /include.php and /index.php files, should it show up in the ACP? Or is that only for jrModules?
Elise
@elise
09/10/16 10:51:28AM
249 posts

Creating a module to change from the Follow model to the Friend model


Jamroom Developers

lolyes, i posted that URL higher in the discussion. That's what I am following :)
Elise
@elise
09/10/16 10:48:55AM
249 posts

Creating a module to change from the Follow model to the Friend model


Jamroom Developers

Yes, I am sweating heavily as I try to do this, being deathly afraid to break something :)
Thanks, I found the datastore call and I am looking into other similar listeners to see how they do it.
Elise
@elise
09/10/16 10:38:23AM
249 posts

Creating a module to change from the Follow model to the Friend model


Jamroom Developers

So that event would not be listed on the info tab of a specific module? Since datastore events are common to all?

How do I find the original call that makes the datastore update?
  23