1

Topic: Preventing a member from reading their inbox until field completed

There are times I create a new field in the control panel that I want all members to fill out. No problem with new members -- I'll make it a required field when they sign up.

For existing members who signed up before the new field was created, they need to edit their profile to update the new field.

You can send  existing members a message asking them to update, but if your members are like my members, they don't always do what you ask.

Since I wanted existing members to update their profile for the new field, I coded the inbox template so existing members could not read their inbox messages until they updated the new field in their profile.

Here is how (I'm using version 2.5.3 but it should work for all versions):


[START CODING NOTES]


OPEN: account_messages_inbox.tpl (note this is the template used for members to read the messages in their inbox.)


FIND:

Find the form in the template. On my template it started around line 110 and ended around line 178 but it should be easy to find. Just look for something like: <form name="messages" method="post" action="{virtual_path}{messages_delete_link}"> for the start of the form and </form> for the end of the form.


BEFORE: <form name="messages" method="post" action="{virtual_path}{messages_delete_link}">


ADD: <!-- IF session.profile_matter --> (here you want to use the label you assign to the field when creating it in the CP. In my case the label name was "matter")


FIND: </form>

AFTER ADD:

<!-- ELSE -->

Put your message here telling the member they need to update the new field in their profile. You can format it so it is pretty, put a link to "edit member's profile" etc.

<!-- ENDIF -->


[END OF CODING NOTES]


That's it. Now when  an existing member has a message in their inbox, they will not have access to their messages until they updated the new field in their profile. After they updated their profile, the above message after the <!-- ELSE --> statement will go away and they will have access to the messages in their inbox.

You also could use more than one field -- just use AND in your IF statement:

<!-- IF session.profile_matter AND session.profile_country -->

Last edited by db3204 (2010-10-18 15:52:30)

2

Re: Preventing a member from reading their inbox until field completed

Hi DB, thank you very much for writing up the tutorial.

I have 2 questions that are related to this:

1. Is there a way to check whether a member has filled out ALL fields, other than writing a long IF statement?

2. Do you know how to check how many pictures the member has uploaded? I want to give them some kind of a bonus if they upload "x" number of pictures.

Thank you. smile

3

Re: Preventing a member from reading their inbox until field completed

A lot of coding has changed since the version I'm using (2.5.3) so if you are using a later version than my reply may not be the answer, but here goes.

1. I don't know any way to see if a member has filled out all fields. However, I thought the newer versions did have a way of showing what percentage of a member's profile has been filled out and what percentage was left for them to complete their profile. You may want to ask vlad to be sure.

2. The earlier versions of vldP (prior to 2.5.x) you could code to see how many pictures a member uploaded. When vldP started to use albums that coding went away. I wish it would come back, but as far as I know, there is no plans to do so.

Sorry I wasn't much help, but maybe others can chime in.

4

Re: Preventing a member from reading their inbox until field completed

Regarding #1, you're right, I'll go look up that percentage profile thing. I think that's the way to do it.

Regarding #2, that's a bummer. There should be a simple variable for a member's picture count. Maybe I'll just ask Vlad about it.

Thanks again for the pointers. smile

5

Re: Preventing a member from reading their inbox until field completed

One way to get members to fill out their profiles is to make all fields 'required' at sign up, and remove the "I'll tell you later" option.

6

Re: Preventing a member from reading their inbox until field completed

dragon wrote:

One way to get members to fill out their profiles is to make all fields 'required' at sign up, and remove the "I'll tell you later" option.

please tell us how to remove the "I'll tell you later" option wink

Give the world the best you have, and the best will come to you.
Tutorials and Mods for VldPersonals  Add CometChat to your vldPersonals site

7

Re: Preventing a member from reading their inbox until field completed

db3204 this is a fantastic mod!

gugu, make field required, this will not approve "i'll tell you later" option.