Jump to content

DrMath

Clients
  • Posts

    11
  • Joined

  • Last visited

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Forums

Events

Store

Gallery

Posts posted by DrMath

  1. On 9/15/2016 at 8:22 PM, Mike John said:

    Technically yes but IPB4 doesn't make things easy for me. If you open applications/autowelcome/hooks/validatehook.php. I'll have to confirm with the code but if you remove the "validationComplete" function and the second if statement in the "postRegistration" function.

    
    	    /* Welcome member straight awway */
    	    if( \IPS\Settings::i()->reg_auth_type == 'none' OR \IPS\Request::i()->do == 'complete' )
            {

    That should in theory welcome the member after email validation but before admin validation. But it would need to be tested and I may be missing some improvements that IPB 4.1.14 or later may have introduced.

    I have validated that this is working.

  2. On 9/15/2016 at 8:22 PM, Mike John said:

    Not for a few more weeks unfortunately. Still flat out with bug fixes for all my apps.

    No issue for me as long as people understand it's not currently a core feature.

    Technically yes but IPB4 doesn't make things easy for me. If you open applications/autowelcome/hooks/validatehook.php. I'll have to confirm with the code but if you remove the "validationComplete" function and the second if statement in the "postRegistration" function.

    
    	    /* Welcome member straight awway */
    	    if( \IPS\Settings::i()->reg_auth_type == 'none' OR \IPS\Request::i()->do == 'complete' )
            {

    That should in theory welcome the member after email validation but before admin validation. But it would need to be tested and I may be missing some improvements that IPB 4.1.14 or later may have introduced.

    I will check this and see if it works.

  3. On 9/12/2016 at 0:54 AM, jacboy said:

    Could you describe us how you did that?

    In your IPS root, go into "applications/autowelcome/sources/Alerts/". In it is a file called "Alerts.php" Edit this file.

    Find 

    protected static function returnTagValues( $member=NULL, $topic=NULL )

    In this, you will see the current values you can used defined. Before the "Topic tag" section, add your own values. This requires some knowledge of the $member functionality which you can find here: https://invisionpower.com/4docs/advanced-usage/development/working-with-members-r179/

    If you have custom profile fields, you will need to use the $member->profileFields() getter. This creates an array of all of your custom profile fields. An easy way to get see how yours is structured is to create a page and display this for yourself. Create a page using as an HTML page then use the following code to see the array:

    {{ $member = \IPS\Member::loggedIn(); }}
    {{ var_dump($member->profileFields()); exit; }}

    Each "section" you have defined with have its own array, so to get these you will have to define variables as a multidimensional array. An example of mine are below:

    		/* Get Profile Fields for Custom Tags */
    		$profile_fields = $member->profileFields();
    		
    		/* Custom Tags */
    		$tags['%region%']       = $profile_fields['core_pfieldgroups_1']['core_pfield_11'];
    		$tags['%discord_un%']   = $profile_fields['core_pfieldgroups_1']['core_pfield_38'];
    		$tags['%main_game%']   = $profile_fields['core_pfieldgroups_3']['core_pfield_12'];
    		$tags['%battle_tag%']   = $profile_fields['core_pfieldgroups_4']['core_pfield_4'];

    These will not show up in the list in the ACP, but you will be able to then use them in your welcome messages and code. ^_^ If the author does not want this posted, I will remove it upon request. Hope this helps some people!

    Side question, @Mike John, is it possible to change when the messages are sent? For example, we have two-step registration, email confirmation then admin approval. We'd like to send the message/post the thread before the admin approves if possible. Thanks!

  4. 18 minutes ago, Mike John said:

    Not possible currently but it is something I will be looking at for the next major version

    I figured out how to do it manually editing the code a bit. Not too difficult once I found where it was hiding. ^_^

  5. I was wondering if there is an easy way to include additional fields in the messages? There are already built-in variables for member name, ID, etc. but for example, we're planning on using this to post auto-intro threads and want to include specific contact information they enter in custom profile fields. Is there an easy way to pass this information into new variables?

×
×
  • Create New...