Forum Activity for @michael

michael
@michael
05/17/18 11:07:36PM
7,823 posts

Convert PHP file for use in Smarty template


Jamroom Developers

agreed. Ask for anything you get stuck at here. There is a lot to learn about how things connect, but once you get the hang of it its WAY more configurable than it every used to be.

There is a system called "Events and Listeners" that allow you to tap into data before it reaches the screen so you can override modules functionality without changing the module.

Docs: "Events and Listeners"
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/1011/events-and-listeners

and the module developers guide

Docs: "Module developers guide"
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide
michael
@michael
05/17/18 11:04:37PM
7,823 posts

Unable to update modules


Installation and Configuration

The problem is with the server. Your server is saying NO when jamroom says "I just need to write this to the error log/ activity log/ (other) log". That's a serious issue that needs to be fixed.

In fixing that issue ( allowing the web user to write to the file system ) you will also fix the marketplace issue.

you can download the jamroom packages again via the "Download open source" button here:
https://www.jamroom.net/products
michael
@michael
05/17/18 02:22:32AM
7,823 posts

Convert PHP file for use in Smarty template


Jamroom Developers

There is already a module that posts to twitter, its called OneAll

Modules: OneAll
https://www.jamroom.net/the-jamroom-network/networkmarket/47/oneall-social

If you wanted to turn your existing php file into a jamroom module then you can do it that way too.

Yes, everything in jamroom is a module.

The most basic module has a directory, a changelog.txt an include.php and in your case, if you want it to control a URL then it needs an index.php

Example
* call your module xxPost and place it in /modules/xxPost/
/modules/xxPost/changelog.txt
/modules/xxPost/include.php
/modules/xxPost/index.php

/modules/xxPost/changelog.txt
Changelog for Post to Twitter module

Version 1.0.0
 - Initial Release

/modules/xxPost/include.php
<?php
/**
 * @copyright ..........................
 * @author ........ .......... <someone [at] somewhere [dot] com>
 */


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

/**
 * meta
 */
function xxPost_meta(){
    $_tmp = array(
        'name'        => 'Post to Twitter',
        'url'         => 'post',
        'version'     => '1.0.0',
        'developer'   => 'Sombody Somwhere, ©' . strftime('%Y'),
        'description' => 'Somthing about your module here',
        'category'    => 'custom'
    );
    return $_tmp;
}

/**
 * init
 */
function xxPost_init(){
    return true;
}

That will get your module appearing in the ACP. If you cant see it run the INTEGRITY CHECK. Then go to the INFO tab of the module and check the checkbox to activate it.

Next make it do something
/modules/xxPost/index.php
<?php
/**
 * @copyright ..........................
 * @author ........ .......... <someone [at] somewhere [dot] com>
 */


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

//------------------------------
// create
//------------------------------
function view_xxPost_message($_post, $_user, $_conf)
{ // the $_post array contains anything coming in on the URL and the _message part of this function is the url. // this function will fire when you visit example.com/post/message // So you can either have the url example.com/post/message/message=hello // then $_post['message'] will equal "hello" or you can skip the name and just use the url example.com/post/message/hello // and "hello" can be found on either $_post['_1'] or $_post['_2'] need to check. // put the contents of your PHP file in this function and return whatever you want echoed to the screen return 'all the processing has completed'; or to return to a different location: jrCore_location("{$_conf['jrCore_base_url']}/somewhere/you/want/to/redirect/to"); }


Docs: "Freelancers Read this"
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/3513/freelance-developers-read-this
updated by @michael: 05/17/18 02:24:21AM
michael
@michael
05/16/18 04:15:03PM
7,823 posts

Unable to update modules


Installation and Configuration

That's the problem, not all directories are writeable by the web user. Contact your hosting provider and ask them to correct the situation.
michael
@michael
05/16/18 12:50:59AM
7,823 posts

Unable to update modules


Installation and Configuration

Cloud Media:..... unable to change permissions on directory /modules/jrPayment...
Sounds like your php config for your server isn't allowing jamroom to change folder permissions. check your SYSTEM CHECK to see all the lights are green.
michael
@michael
05/16/18 12:48:19AM
7,823 posts

DB Get JR ProfileURL from UserID


Jamroom Developers

user_id and profile_id are separate since any user can have multiple profiles. The _profile_id listed in the jrUser datastore is the 'home profile' so maybe use that.

Once you have the profile_id use it in the second query explained above with the SINGLE option.
standard_sql.jpg standard_sql.jpg - 61KB
michael
@michael
05/15/18 12:21:04AM
7,823 posts

Can the search box for group members do more than finding member usernames?


Suggestions

Currently the only fields that are searched on are
* user_name
* profile_name

And the only way to customize that is to setup a listener on 'db_search_params' and add in the field you want to search for into the search event.

--
In your custom module something like this
function xxYourModule_db_search_params_listener($_data, $_user, $_conf, $_args, $event)
{ global $_post; if (isset($_post['module_url']) && isset($_post['ss']) && strlen($_post['ss']) > 0) { $_data['search'] .="|| profile_bio = %{$_post['ss'}%"; } return $_data; }

So you'd just append
||profile_bio = %whatever%
and any other fields you wanted to search.
michael
@michael
05/14/18 10:39:26PM
7,823 posts

DB Get JR ProfileURL from UserID


Jamroom Developers

I'd avoid trying to use SQL on a datastore if at all possible. If possible use the jrCore_db_query() function to get datastore stuff or you're bypassing all the other modules optional overrides.

A search query to get all profiles info would be
    // We have mentions - make sure they are good
        $_rt = array(
            'search'         => array(
                'profile_url in ' . implode(',', $_tmp)
            ),
            'return_keys'    => array('_profile_id', 'profile_url'),
            'skip_triggers'  => true,
            'ignore_pending' => true,
            'limit'          => count($_tmp)
        );
        $_rt = jrCore_db_search_items('jrProfile', $_rt);
        if ($_rt && is_array($_rt) && isset($_rt['_items'])) {
.....

do a search on the codebase for 'jrCore_db_search_items('jrProfile',' and you'll see many examples.

A profile url in is just the base url of the site + the profile_url, so in php that's
$profile_url  = "{$_conf['jrCore_base_url']}/{$item['profile_url']}";

if you absolutely have to do a direct SQL query then its
$tbl = jrCore_db_table_name('jrProfile', 'item_key');
$req = "SELECT * FROM {$tbl} WHERE item_id = '1' ";
$single = jrCore_db_query($req, 'SINGLE'); // a single query or
$_many = jrCore_db_query($req, 'NUMERIC'); // many items
michael
@michael
05/11/18 06:03:12AM
7,823 posts

Jamroom Instalation


Using Jamroom

You can spin up a jamroom server from your hosting control panel here:
https://www.jamroom.net/leannedonnelly/hosting/overview

There's a 7 day free trial on the servers. That should be enough time to decide if you do or dont want to go forward with it. Jamroom is targeted more to web developers than wordpress is. Wordpress is much more friendly to non-developers, but Jamroom is more customizable for users who are familiar with web development techniques like php, html, css.

Check out the docs here:

Docs: "Table of contents"
https://www.jamroom.net/the-jamroom-network/documentation/contents

And the videos here

Video Learning
https://www.jamroom.net/video-training
michael
@michael
05/09/18 05:15:44PM
7,823 posts

Is there a way to reorder GROUPS


Design and Skin Customization

As for adding a GROUPS button to profiles that do not have access to the groups module, then yes strumelia correct for the location. You'd need to add a button to those profile menus that don't have it via the skins profile_menu.tpl file.
  129