OK - Do this
Create a folder in the modules folder called 'jrAutoFollow'
In that folder create two files named 'config.php' and include.php'
In the config.php file enter this code -
<?php
defined('APP_DIR') or exit();
function jrAutoFollow_config(){
$_tmp = array(
'name' => 'followee',
'label' => 'Select Profile',
'type' => 'text',
'help' => 'Enter the ID of the profile that will be automatically followed upon signup',
'validate' => 'number_nz',
'default' => 1,
'required' => true
);
jrCore_register_setting('jrAutoFollow', $_tmp);
return true;
}
?>
In the include.php file enter this code -
<?php
defined('APP_DIR') or exit();
function jrAutoFollow_meta(){
$_tmp = array(
'name' => 'Auto Follow',
'url' => 'autofollow',
'version' => '1.0.0',
'developer' => 'The Jamroom Network, ©' . strftime('%Y'),
'description' => 'Automatically follow specified profiles upon signup',
'category' => 'profiles',
'license' => 'jcl'
);
return $_tmp;
}
function jrAutoFollow_init(){
jrCore_register_event_listener('jrUser', 'signup_activated', 'jrAutoFollow_signup_activated_listener');
return true;
}
function jrAutoFollow_signup_activated_listener($_data, $_user, $_conf, $_args, $event)
{
$_tmp = array(
'follow_active' => 1,
'follow_profile_id' => $_conf['jrAutoFollow_followee']
);
$_core = array(
'_profile_id' => $_data['_profile_id'],
'_user_id' => $_data['_user_id']
);
jrCore_db_create_item('jrFollower', $_tmp, $_core);
return $_data;
}
Goto your ACP then in the Profiles section enable this new module.
In its config section enter the ID of the profile to be auto-followed.
Done
--
Paul Asher - JR Developer and System Import Specialist