PDA

View Full Version : Empty Profile Field Notification! 1.0.0


Stangsta
25 Feb 2006, 09:33
Empty Profile Field Notification! 1.0.0

WHAT IT DOES: This hack will inform your users in a somewhat annoying way that they should fill in profile fields that you specify. Once they fill in the specified fields, this message will go away. This Hack can be used for many things, for example. You can have a notice displayed if they are not a subscriber, not a member of a certain usergroup, have not selected an avatar, and more. Its up to your imagination :)

WHY I MADE THIS: Rather than forcing users to fill out profile fields and potentially lose new members because they just didnt feel like doing it right then and there during signup, this will remind them while they are browsing the forums that "hey, its a good idea to fill this out or you have to look at this annoying message everyday"! :)

INSTRUCTIONS:

Step 1 - Go in your adminCP > Styles & Templates > Edit Templates > Forum Home Templates > FORUMHOME

Find: $navbar
Below, add:<!-- Empty Profile Field Notification by Stangsta -->
<if condition="$bbuserinfo == 1">
<else />
<if condition="$bbuserinfo[fieldXX]==''">
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">

<tr>
<td class="tcat" colspan="5">
<strong><font color="#FF9933">ATTENTION:</font> You do not have anything listed for the <a href="http://www.YOUR_DOMAIN_NAME.com/forums/profile.php?do=editprofile">"About Me" </a>field in your profile.</strong>
</if>
</td>
</tr>
</if>
<!-- / Empty Profile Fields Notification by Stangsta -->

Step 2 This can get tricky for beginners. Now, customize the Hex color for the word "ATTENTION:" to whatever color you wish. I just made it a different color to help it stand out, you may remove the color formatting if you wish. Now select the profile field number you wish to produce a warning with.
ex. <if condition="$bbuserinfo[fieldXX]==''">

*NOTE: Make sure you change the URL to match yours.

Step 3 This is [U]OPTIONAL!

Lets say, you want your users to fill out 2 or more profile fields. Simple, just keep adding the code like this:
<!-- Empty Profile Field Notification by Stangsta -->
<if condition="$bbuserinfo == 1">
<else />
<if condition="$bbuserinfo[fieldXX]==''">
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">

<tr>
<td class="tcat" colspan="5">
<strong><font color="#FF9933">ATTENTION:</font> You do not have anything listed for the <a href="http://www.YOUR_DOMAIN_NAME.com/forums/profile.php?do=editprofile">"Field 1" </a>field in your profile.</strong>
</if>
</td>
</tr>

<if condition="$bbuserinfo[fieldXX]==''">
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">

<tr>
<td class="tcat" colspan="5">
<strong><font color="#FF9933">ATTENTION:</font> You do not have anything listed for the <a href="http://www.YOUR_DOMAIN_NAME.com/forums/profile.php?do=editprofile">"Field 2" </a>field in your profile.</strong>
</if>
</td>
</tr>

<if condition="$bbuserinfo[fieldXX]==''">
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">

<tr>
<td class="tcat" colspan="5">
<strong><font color="#FF9933">ATTENTION:</font> You do not have anything listed for the <a href="http://www.YOUR_DOMAIN_NAME.com/forums/profile.php?do=editprofile">"Field 3" </a>field in your profile.</strong>
</if>
</td>
</tr>
</if>
<!-- / Empty Profile Fields Notification by Stangsta -->


Hopefully this was informative and helpful. I will support this the best I can, but I am no expert. Feel free to improve upon this, all I ask is you share the improvements with others in this thread.

PLEASE PLEASE PLEASE....If you use this hack [U]CLICK INSTALL!

bubba1977
25 Feb 2006, 13:13
install went ok, shows that i need to fill in some information about me.

i filled in the info but the warning is still on the main page

any help?

EDIT.... silly me, forgot to change the XX to profile field number.

works ok now thanks :squareeyed:

MissKalunji
25 Feb 2006, 13:40
nice just what i needed :)

/me clicks installed

bubba1977
25 Feb 2006, 13:49
just noticed that when this is in place it makes the footer of the skin skewif and makes a large gap at the bottom of the page. :ermm:

Stangsta
25 Feb 2006, 15:41
just noticed that when this is in place it makes the footer of the skin skewif and makes a large gap at the bottom of the page. :ermm:Hmmmmm, Ill look into it.

It shouldnt effect the footer. Are you sure you installed it in the FORUMHOME template under the $navbar?

trancetopia
25 Feb 2006, 19:03
Now this is more like it. Thanks for sharing.

/me clicks install

bubba1977
25 Feb 2006, 20:04
Hmmmmm, Ill look into it.

It shouldnt effect the footer. Are you sure you installed it in the FORUMHOME template under the $navbar?


yes i did install it it in forumhome under $navbar

Stangsta
25 Feb 2006, 21:30
yes i did install it it in forumhome under $navbar
Can you PM me with a link to your forum with guest access?

FleaBag
25 Feb 2006, 21:35
Nice! I'll install I think.

bubba1977
25 Feb 2006, 21:36
Sorry the forum is members only but i will still pm you the link

moonclamp
25 Feb 2006, 22:14
Does someone know how to do this for a profile photo?

ie. You have not yet uploaded a profle photograph. Click here to do so now.

Stangsta
26 Feb 2006, 06:13
Sorry the forum is members only but i will still pm you the linkIt looks fine to me. I tried firefox & IE (I registered). Ill look more into it tomorrow, but it seems to be specific to your forum.

Stangsta
26 Feb 2006, 06:14
Does someone know how to do this for a profile photo?

ie. You have not yet uploaded a profle photograph. Click here to do so now.Try this, let me know if it works:
<if condition="$show['profilepic']">
<else />
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">

<tr>
<td class="tcat" colspan="5">
<strong><font color="#FF9933">ATTENTION:</font> You have not created a <a href="http://www.YOUR_DOMAIN_NAME.com/forums/profile.php?do=editprofile">"Profile Picture" </a>for your profile.</strong>
</if>
</td>
</tr>
Change the URL to the location to change the profile pic.

Brandon Sheley
26 Feb 2006, 06:42
nice. I'll install this soon

moonclamp
26 Feb 2006, 16:51
Try this, let me know if it works:
<if condition="$show['profilepic']">
<else />
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">

<tr>
<td class="tcat" colspan="5">
<strong><font color="#FF9933">ATTENTION:</font> You have not created a <a href="http://www.YOUR_DOMAIN_NAME.com/forums/profile.php?do=editprofile">"Profile Picture" </a>for your profile.</strong>
</if>
</td>
</tr>
Change the URL to the location to change the profile pic.

Unfortunately there was something wrong with the if condition ... it displayed for everyone regardless of whether they had a picture or not, even non-members.

Stangsta
26 Feb 2006, 18:53
Unfortunately there was something wrong with the if condition ... it displayed for everyone regardless of whether they had a picture or not, even non-members.
Ok , try this. If I had a way to test this, I would. My site does not use profile pics and has it disabled. I would as always recommend that you use a "test style" if you dont already. Just so your users arent affected.
<!-- Empty Profile Field Notification by Stangsta -->
<if condition="$bbuserinfo[usergroupid] == 1">
<else />
<if condition="$show['profilepic']">
<else />
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">

<tr>
<td class="tcat" colspan="5">
<strong><font color="#FF9933">ATTENTION:</font> You have not created a <a href="http://www.YOUR_DOMAIN_NAME.com/forums/profile.php?do=editprofile">"Profile Picture" </a>for your profile.</strong>
</td>
</tr>
</if></if>
<!-- / Empty Profile Fields Notification by Stangsta -->



or this
<!-- Empty Profile Field Notification by Stangsta -->
<if condition="$bbuserinfo['usergroupid'] == 1 OR $show['profilepic'] ">
<else />
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">

<tr>
<td class="tcat" colspan="5">
<strong><font color="#FF9933">ATTENTION:</font> You have not created a <a href="http://www.YOUR_DOMAIN_NAME.com/forums/profile.php?do=editprofile">"Profile Picture" </a>for your profile.</strong>
</td>
</tr>
</if>
<!-- / Empty Profile Fields Notification by Stangsta -->

I know im close on this.

Stangsta
26 Feb 2006, 19:53
Also, this Hack can be used for many things, for example. You can have a notice displayed if they are not a subscriber, not a member of a certain usergroup, have not selected an avatar, and more. Its up to your imagination :)

moonclamp
26 Feb 2006, 20:29
Ok , try this. If I had a way to test this, I would. My site does not use profile pics and has it disabled. I would as always recommend that you use a "test style" if you dont already. Just so your users arent affected.


I know im close on this.Instead of adding this to forumhome I added it to the bottom of the navbar template to test it on different pages.

It actually works on "profile.php?do=editprofilepic" but it displays all the time on other pages.

I think that <if condition="$show['profilepic']"> will only work on that particular page, so I'm guessing it will need a plugin to function properly.

Stangsta
27 Feb 2006, 04:01
so I'm guessing it will need a plugin to function properly.Thats where I cannot help. :( Maybe someone else here has the knowledge on this one.

arossphoto
12 Apr 2006, 02:39
I just installed this and everything seemed to be working fine, until I realized the right column that I placed in my forums page using vBadvanced CPMS was gone. I removed your code from FORUMHOME and the right column magically reappeared.

I'd really like to get this working and don't want to give up my right column, so if you have any advice I'd really appreaciate it. If it helps, here's the instructions from the vBadvanced manual that I used and they have nothing to do with the FORUMHOME template.

http://www.vbadvanced.com/membersarea.php?do=viewusermanual&productid=4&pageid=6

Thanks

bada_bing
12 Apr 2006, 03:26
Wow this sounds great but can someone make this a plugin as I hate template mods.

Stangsta
12 Apr 2006, 03:40
Wow this sounds great but can someone make this a plugin as I hate template mods.If someone would be so kind in showing me how to make a plugin, I would do that. :)

arossphoto
12 Apr 2006, 16:01
Any suggestions regarding my problems with the vBadvanced right column? Am I out of luck?

Cheers,

Andrew

Stangsta
12 Apr 2006, 16:45
Any suggestions regarding my problems with the vBadvanced right column? Am I out of luck?

Cheers,

AndrewI have no idea, I don't use VBA.

arossphoto
12 Apr 2006, 18:17
Thanks,

I ended up using the other mod here to force users to fill in the fields. I prefered your more gentle approach, but I'm glad I found something that works. It's always nice to have options.

Cheers.

arossphoto
13 Apr 2006, 22:16
I just reinstalled this. Using vBadvanced to add columns to the forum pages seemed to be causing other weird layout problems so I got rid of it.

Thanks for a great mod!

PennylessZ28
17 Apr 2006, 01:14
Hurm, I was looking at this and I was wondering why you did this

<if condition="$bbuserinfo[usergroupid] == 1">
<else />

And not this


<if condition="$vbulletin->userinfo['userid'] != '0' AND THIS_SCRIPT == 'index'">


Or you could use something even simpler

<if condition="$show['member']">

Stangsta
17 Apr 2006, 01:27
Hurm, I was looking at this and I was wondering why you did thisGotta start somewhere ;)

Good looking out.

truCido
04 May 2006, 22:22
looks like a great hack exactly what I've been after but how would I get this to work with the email field?

Tralala
04 May 2006, 22:41
You can have a notice displayed if they are not a subscriber, not a member of a certain usergroup, have not selected an avatar, and more.

This looks great, just what I am looking for. I'd like to gently remind folks to upload an avatar.

So how is this done? What is the profile field # for avatar?

FleaBag
13 Aug 2006, 17:39
Is this default in 3.6.0 now?

robert_2004
02 Nov 2006, 04:34
I just installed this and everything seemed to be working fine, until I realized the right column that I placed in my forums page using vBadvanced CPMS was gone. I removed your code from FORUMHOME and the right column magically reappeared.

I'd really like to get this working and don't want to give up my right column, so if you have any advice I'd really appreaciate it. If it helps, here's the instructions from the vBadvanced manual that I used and they have nothing to do with the FORUMHOME template.

http://www.vbadvanced.com/membersarea.php?do=viewusermanual&productid=4&pageid=6

Thanks


It's because this mod is poorly coded.
The code SHOULD BE

<!-- Empty Profile Field Notification by Stangsta -->
<!-- Enter the IDs for guest usergroups, and any other usergroups you don't want to show this to, below. -->
<if condition="in_array($bbuserinfo['usergroupid'], array(1,34,41,45))">
<!-- Anything here will be displayed to guests and above usergroups -->
<else />
<if condition="$bbuserinfo[field2]==''">
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">
<tr>
<td class="tcat" colspan="5">
<strong><a href="/forums/profile.php?do=editprofile"><font color="#FF9933">ATTENTION:</font> You have not entered your Suburb into your profile.</a></strong>
</td>
</tr>
</table>
</if>

<!-- / Empty Profile Fields Notification by Stangsta -->



the table wasn't closed on the original version.

robert_2004
02 Nov 2006, 04:36
on another note, does anyone know how to get this to work on non forum pages, like vBa CMPS index?
i need to call the userprofile variables from somewhere...