Forum Activity for @michael

michael
@michael
05/17/18 02:22:32AM
7,831 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,831 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,831 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,831 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,831 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,831 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,831 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,831 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.
michael
@michael
05/09/18 05:12:40PM
7,831 posts

Is there a way to reorder GROUPS


Design and Skin Customization

My mistake. Thanks douglas for spotting it. The template is jrGroup item_index.tpl that controls https://site.com/profilename/group

You will find the jrCore_list in there line 42 ish.
michael
@michael
05/09/18 05:08:18PM
7,831 posts

auto-follow a discussion when you've posted to it


Using Jamroom

In the next version of jrForum (2.2.6) the auto-follow a discussion when you've posted to it issue should be fixed. Previously the module would check the 'Forums Updated' setting. In the new version it does not check that setting.

This should have the effect of any user who comments on a forum thread will then be following that forum thread.

There is nothing you need to do, just update it and it should work for everybody. Those that have a setting for 'Forum Updated' and those that don't. It should now work for everybody because that setting is ignored.
  130