PDA

View Full Version : Images in profiles on conditional statements


MThornback
15 Feb 2006, 04:03
This is compatable with 3.6, but depending on how modified your templates are...you may need to revert.

Hey,

I normally don't release my own tweaks, cause they're usually not useful to anyone but me :p but since a few people seemed to like this as I was working on it....here goes....first release so be gentle :p

First you need a profile field...this modification works best (and makes the most sense) if you have multiple options to select, so go with the check boxes or the list.

REMEMBER the number of the field you make, you'll need it later.

Few notes about the list, when your uploading your images, i've only gotten them to work as numbers....if you can do better :) please do! Your more than welcome! The numbers of your images should corrspond to the order of your options....so:

If you have

1. Flowers
2. Gum
3. Candy

and you want to display candy in your profile, the image for candy should be 3.gif (or whatever extension your using).

Next comes the profile edit:

FIND:


<td><strong><phrase 1="$userinfo[username]">$vbphrase[x_is_not_a_member_of_any_public_groups]</phrase></strong></td>
</if>
</tr>
$membergroupbits
</table>
</div>

</div>
</div>
</td>

</tr>


ADD AFTER (remember to change xx to the field number in ALL places):


<if condition="$userinfo[fieldxx] != ''">
<tr>
<td class="tcat" width="50%">Title of your field goes here (phrase it if you want to)</td>
</tr>
<tr>
<td class="panelsurround" align="center">
<div class="panel">
<div align="$stylevar[center]">

<if condition="$post['fieldxx'] & 1"><img src="./images/1.gif"></if>
<if condition="$post['fieldxx'] & 2"><img src="./images/2.gif"></if>
<if condition="$post['fieldxx'] & 4"><img src="./images/3.gif"></if>
<if condition="$post['fieldxx'] & 8"><img src="./images/4.gif"></if>
<if condition="$post['fieldxx'] & 16"><img src="./images/5.gif"></if>

</div>
</div>
</td>
</tr></if>


You'll notice that there are numbers going up in multiples for each if statement...if you add more than the 5 in the example they would go up 32, 64, 128 etc...(Thanks to tutorials by Andreas, and frequenting this place for 2 years :p I know this now :p)

A myth to debunk:
1. This will not allow your users to upload multiple images for their profiles (cool idea....far beyond my skill level :p), this is strictly for images YOU as the forum host...like if you put up a list of book covers or something for favorite books read....not something you'd let people upload because of copyright and so forth.


I'll support this as needed....its pretty straight forward really, any questions feel free to post or PM...this will likely be a final release unless someone comes up with something brilliant to add to it....in which case your free to do, just credit my work as needed.

Snake
15 Feb 2006, 13:10
First installer! :D

Thanks!

FleaBag
16 Feb 2006, 00:23
Yeah I like it too. Cheers.

`SLVR`
16 Feb 2006, 08:44
Yeah I like it too. Cheers.

could someone post a screen shot or link to a live demo with this? (definitly curious about this)

MThornback
18 Feb 2006, 20:00
could someone post a screen shot or link to a live demo with this? (definitly curious about this)

Live Demo can be found here:

http://webcadets.com/forum/member.php?u=2

you will have to register to view profiles....and if you like the place stick around :) we always welcome new members

o0Hubba0o
25 Feb 2006, 18:11
Live Demo can be found here:

http://webcadets.com/forum/member.php?u=2

you will have to register to view profiles....and if you like the place stick around :) we always welcome new members
You should post screenshots then, not sure how they feel about asking people to register in your release threads, but kind of comes off as self-promoting your site which I don't thinks allowed.

`SLVR`
26 Feb 2006, 02:43
Live Demo can be found here:

http://webcadets.com/forum/member.php?u=2

you will have to register to view profiles....and if you like the place stick around :) we always welcome new members

I appreciate the offer, but I think a screenshot would be easier for both of us.

MThornback
27 Feb 2006, 04:08
You should post screenshots then, not sure how they feel about asking people to register in your release threads, but kind of comes off as self-promoting your site which I don't thinks allowed.

Good Point....screenshots added