Forum Moderators: coopster

Message Too Old, No Replies

Help with an if/else statement

For a module on my Joomla/CB site

         

camaroboy

3:20 am on Nov 4, 2008 (gmt 0)

10+ Year Member



The following is a piece of code from my site:

if ($row2->avatarapproved != 0) {
if ($pic != '') {
if (!stristr($pic, 'gallery/')) {
$thumb_url = $mosConfig_live_site.'/images/comprofiler/'.$pic;
$wid = $MaxWidth;
} else {
$thumb_url = $mosConfig_live_site.'/images/comprofiler/'.$pic;
$wid = $MaxWidth;
}
} else {
$thumb_url = $mosConfig_live_site.'/components/com_comprofiler/plugin/language/default_language/images/nophoto.jpg';
$wid = $MaxWidth;
}
} else {
$thumb_url = $mosConfig_live_site.'/components/com_comprofiler/plugin/language/default_language/images/nophoto.jpg';
$wid = $MaxWidth;
}

This code prevents members without images from having their profile show up on the module. I want to add another part to this statement and do not know how.

I need it to not only block users without photos (like it already does) but also block one specific user with a certain photo. So basically I need to add one more piece to this. Please help!

jatar_k

4:12 pm on Nov 4, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I am guessing that we are looking at this line

if ($row2->avatarapproved != 0) {

meaning if they are not approved then it doesn't show

you could add a second criteria there

if ($row2->avatarapproved != 0 && user_id!='12345') {

obviously that's just an example but I am not sure which comparison you need to add && means AND so the if must pass on both parts for it to execute the block