Welcome Guest[3.145.161.194], connected from
Color for male and female
|
Post: #1
|
|||
|
|||
Color for male and female
I am using 2 plugins right now to have it look like this
female.jpg (Size: 5.74 KB / Downloads: 93) Downloaded by :Technoman, exdiogene, Nadjia, FBI, Test, atomjani, Mobius, phoenix male.jpg (Size: 4.54 KB / Downloads: 93) Downloaded by :Technoman, exdiogene, Nadjia, FBI, Test, atomjani, Mobius, phoenix I just want it to be where when they Register and there forced to choose there own sex ... they are a specfic color automatically... is there anyway to do this with out 2 plugins? Thanks |
|||
Post: #2
|
|||
|
|||
RE: Color for male and female
Here is a simple way to achieve this without any plugins :
1 - Go to AdminCP -> Configuration -> Custom Profile Fields -> Add New Profile Field 2 - Fill out the form so you will have two options like male and female for the sexes and click "Yes" for the "Required" field. 3 - Make sure that you have two images for each sex named like male.gif and female.gif in your "MyBB/images/" directory if you want to display images instead of text. 4 - Now go to AdminCP -> Templates & Style -> Templates -> Post Bit Templates -> postbit 5 - Around the {$post['profilelink']}, just add your field like {$post['fid3']} if you want a text display or like < img src="images/{$post['fid3']}.gif" > if you would like an image... Now enjoy the view! P.S. Depending of the number of new profile fields you already have the FieldID could be different like 'fid2' or 'fid4'. |
|||
Post: #3
|
|||
|
|||
RE: Color for male and female
Thanks for your time and this awesome in depth tutorial!
|
|||
07-21-2010, 08:08 PM
(This post was last modified: 07-21-2010 08:10 PM by Technoman.)
Post: #4
|
|||
|
|||
RE: Color for male and female
Ok now if I wanted a regular female "member name" highlighted in pink and same for a regular male in blue ... what are my ways of making this happen?
So what I would have to do in this part Around the {$post['profilelink']}, just add your field like {$post['fid3']} if you want a text display or like < img src="images/{$post['fid3']}.gif" > if you would like an image... See so this is sorta what I mean A. regular male member ( name blue) + ( male icon upon registeration) ? B. regular female member ( name pink ) + ( female icon upon registeration ) ? Subscriber female member ( name green ) + ( female icon the same as A ) ? Subscriber male member ( name purple ) + ( male icon the same as B) ? now the code to be replaced directly inside the postbit would be like what? Images I know that they have to placed inside the images folder but the code to be replaced in order for this to function correctly? Thanks again! |
|||
Post: #5
|
|||
|
|||
RE: Color for male and female
No easy way for what you want, but you could have the background kept pink for female and blue for male quite easily.
For the background you would simply put the username section inside a span tag with a male or female class. Something like : < span class="{$post['fid3']}" >< strong >< span class="largetext">{$post['profilelink']}< /span >< /strong >< /span > You now have to create the classes in the CSS file by adding this in AdminCP -> Templates & Style -> Themes -> YourTheme -> global.css .male { background: #e0e0ff; padding: 2px; } .female{ background: #ffe0e0; padding: 2px; } I have temporarely installed these changes to MyBBCodes.com, have a look at a few members posts... |
|||
Post: #6
|
|||
|
|||
RE: Color for male and female
Thats really neat exdiogene, I will have a play with it for sure... its always good to know other ways of coding tecniques
Thanks friend! |
|||
Post: #7
|
|||
|
|||
RE: Color for male and female | |||
Post: #8
|
|||
|
|||
RE: Color for male and female
I am trying to understand the problem you wrote about:
With code tags : Code:[Highlight] <php if ($post['fid3'] ) == 1 then> color </if> Without code tags : I do not see any error! P.S. I will try it as a normal member to see if it is different... |
|||
07-23-2010, 10:44 AM
(This post was last modified: 07-23-2010 11:09 AM by Test.)
Post: #9
|
|||
|
|||
RE: Color for male and female
With code tags :
Code:[Highlight] <php if ($post[\'fid3\'] ) == 1 then> color </if> Without code tags : <php if ($post[\'fid3\'] ) == 1 then> color </if> P.S. FROM EXDIOGENE : I can now see the problem, it is because of unescaped apostrophes in the message that clash with a new plugin i have installed yesterday, for testing, to eliminate duplicated posts! I will try something to solve this right now! New test... With code tags : Code:[Highlight] <php if ($post['fid3'] ) == 1 then> color </if> Without code tags : <php if ($post['fid3'] ) == 1 then> color </if> |
|||
Post: #10
|
|||
|
|||
RE: Color for male and female
It is working well now!
|
|||
0 member(s) viewed this thread in the last 365 days :
|
« Next Oldest | Next Newest »
|
WWWHostingServer.com
|
||||||
|
||||||
|
|
|
|
|
Powered By MyBB, © 2002-2024 MyBB Group. Golden Crown - Designed and Published by ghazal & exdiogene of MyBBCodes. Hosting provided by WWWHostingServer.com |