Current time: 11-10-2024, 03:44 PM Hello There, Guest! (LoginRegister)


Announcement
We have the biggest collection of MyBB Plugins here on the Net. We have currently 175+ MyBB Exclusive Plugins, 80+ MyBB Compatible MyCodes and 16+ MyBB 1.4.x Themes (Some are still under construction...) Thus, we provide you the largest MyBB Stuff on the net including tutorials. Stay with us, you will find out some more to come.
Now you can easily create your own buttons set for MyBB! Click here to have a look...
*** You cannot do your registration behind any Proxies anymore! ***
Welcome Guest[3.139.97.89], connected from
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Color for male and female
07-21-2010, 04:37 PM
Post: #1
Color for male and female
I am using 2 plugins right now to have it look like this


.jpg  female.jpg (Size: 5.74 KB / Downloads: 93)
Downloaded by :Technoman, exdiogene, Nadjia, FBI, Test, atomjani, Mobius, phoenix

.jpg  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

Technoman's signature
Visit this user's website Find all posts by this user
Quote this message in a reply
07-21-2010, 06:12 PM
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'.

Wink

exdiogene's signature MyBBCodes.com administrator
Cool " It is not what you know that matters, it is what you do or do not do!"
Visit this user's website Find all posts by this user
Quote this message in a reply
07-21-2010, 07:51 PM
Post: #3
RE: Color for male and female
Thanks for your time and this awesome in depth tutorial!

Technoman's signature
Visit this user's website Find all posts by this user
Quote this message in a reply
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!

Technoman's signature
Visit this user's website Find all posts by this user
Quote this message in a reply
07-21-2010, 08:54 PM
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...

exdiogene's signature MyBBCodes.com administrator
Cool " It is not what you know that matters, it is what you do or do not do!"
Visit this user's website Find all posts by this user
Quote this message in a reply
07-21-2010, 10:33 PM
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 Wink

Thanks friend!

Technoman's signature
Visit this user's website Find all posts by this user
Quote this message in a reply
07-23-2010, 09:24 AM
Post: #7
RE: Color for male and female
nice tutorial Wink
Because before this, I am thinking using Yumi PHP in Templates condition plugins Wink

   

Hahaha, there is something wrong in my post.
Read inside BBcode [code]
If, I didnt use bbcode, your forum show this error Wink

   
Find all posts by this user
Quote this message in a reply
07-23-2010, 10:32 AM
Post: #8
RE: Color for male and female
I am trying to understand the problem you wrote about:

With code tags :
<php if ($post['fid3'] ) == 1 then> color </if>

Without code tags :
color

I do not see any error!

Undecided

P.S. I will try it as a normal member to see if it is different...

exdiogene's signature MyBBCodes.com administrator
Cool " It is not what you know that matters, it is what you do or do not do!"
Visit this user's website Find all posts by this user
Quote this message in a reply
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 :
<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!

Wink
New test...

With code tags :
<php if ($post['fid3'] ) == 1 then> color </if>

Without code tags :
<php if ($post['fid3'] ) == 1 then> color </if>
Find all posts by this user
Quote this message in a reply
07-23-2010, 11:13 AM
Post: #10
RE: Color for male and female
It is working well now! Wink

exdiogene's signature MyBBCodes.com administrator
Cool " It is not what you know that matters, it is what you do or do not do!"
Visit this user's website Find all posts by this user
Quote this message in a reply
0 member(s) viewed this thread in the last 365 days :
Post Reply 


Was This Thread Useful ?
Please Link To Us
URL
BBCode
HTML

Forum Jump:

 
New To Site ?
Some Useful Links
  • Help

  • You Might Need To Register

  • Forum Statistics

  • Mark All Forums Read

  • Forum Staff

  • Log Out
  • Contact Us

  • Mybbcodes

  • Return to Top

  • Return to Content

  • Lite (Archive) Mode

  • RSS Syndication
  • Powered By MyBB, © 2002-2024 MyBB Group.
    Golden Crown - Designed and Published by ghazal & exdiogene of MyBBCodes.
    Hosting provided by WWWHostingServer.com