Hey guys, I have a favor to ask someone. I really don't know PHP enough to write this block, but was hoping someone out there could give me a hand. I have the "pStaffStatusLite" block on my site, and I want to change something on it. looking over teh block I see where it makes a call to add a flag by a username based on their ip address. I would like to chanfe this to show a picture for a special group of users.
Basically I've made a new group and put users into that group. I have a small image that I want displayed next to the neames of the users in that group. what I don't know is how to write the PHP code to make that work.
I know what I need it to do,
if user is in group 3 then dispaly image "X" else display image "Y"
but I don't know how to make the PHP do it :(
please don't flame me or tell me to read a book, I'm working on it :)
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 07:01 AM
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 06:41 AM
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 06:27 AM
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 01:29 AM
- mdee created topic »How to implement returnpage ?« 01:00 AM
- nestormateo responded to »Fillters in Clip« 24. May
- damon responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Small PHP code help
-
**unknown user**
- Rank: Softmore
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 110
Quote
if user is in group 3 then dispaly image "X" else display image "Y"
Code
//$groupid is the variable used for group, you must find the correct variable in the script and just replace it
$Y = "xxxxxx"; // image X
$X = "xxxxxx"; // image Y
if ($groupid == 3){
$img = $X;
} else {
$img = $Y;
}
// Just remember that in this way it will only show X if there is a match, else it would use Y (for un-reg and all other ids different than 3.
Some might drop in a fancier way of doing it.. so I will save their time:
Code
- Moderated by:
- Support
