Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Kit the Human

What have you learnt recently?

Recommended Posts

Was there a variable that made your life easier? A clever exploit of myBB's features? A feature that you didn't know existed, but you found it and huzzah! It helped.

  • Like 1

 

sig.png.30b42565d04d922988370bf14e1447bc.png

PSI: an Occult Investigations RP

Roleplay Architects: Grab a friend (or many friends!) and just write.

You can also find me at:

static-historicalrp.jpg  B8CB4x.png rpabutton.png

Share this post


Link to post
Share on other sites

I love customizing postbit stuff so it's coloured according to each member's usergroup. I used to do it in a really clunky McGuiver-esque way by sticking the {$post['usertitle']} variable into an element class name. It corresponded to a bunch of classes I had in my css like; 

 

.text_Member {color: red;}

.background_Member {background: red;}

etc

 

But now I've learned about the magic of {$usergroup['gid']}. It's less work and much more flexible.

Share this post


Link to post
Share on other sites

ID variables are a godsend, I swear. My favourite trick with them though was (to save myself rewriting the same code) is thus:

class="miniprofile group{$usergroup['gid']}"

So, you can do all your applicable to all groups with .miniprofile

 

For the stuff you want to be unique to each group? .miniprofile.groupX

 

Beats copy pasta all the time!

 

(I don't know why, but you can't start a class with a number, so you have to add a word or letter in front of the variable.)


 

sig.png.30b42565d04d922988370bf14e1447bc.png

PSI: an Occult Investigations RP

Roleplay Architects: Grab a friend (or many friends!) and just write.

You can also find me at:

static-historicalrp.jpg  B8CB4x.png rpabutton.png

Share this post


Link to post
Share on other sites

I recently pieced together a code to allow members to change their own usergroup (of course to the specific group set for that link), less work for the staff and users don’t have to wait for staff to get the time to update the usergroup.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use, Guidelines and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.