Recent Topics

1 Jan 27, 2008 03:24    

My b2evolution Version: Not Entered

b2evolution 2.4.0-rc2

I feel like I have been posting so many questions.... sorry about that.

I would like to create an IF statement depending on the users ID number. So, if a user has the user ID #2, something is shown specific to that user... if they are user ID # 3 than something else is shown specific to that user and so on... and if no one is logged in, nothing is shown. Kind of similar to the IF statement for if the user is logged in or not. I am not too familiar with the b2evo code yet and I am not looking for anything huge, just for a few users IDs... can anyone help me out?

just thinking out loud here... not sure if I am close or WAY OFF

<?php
			if( $user_ID = 1 )
{
	return;
	echo 'you can see this';
}
else
{

}
?>

2 Jan 27, 2008 09:59

<?php
if( empty( $current_User ) )
{ // not logged in
  .......
}
else
{ // logged in
  switch( $current_User->ID )
  {
     case 1 :
      .........
      break;

     case 2 :
      .........
      break;

     case 3 :
      .........
      break;

    default :
     .........
  }
}
?>

;)

¥

3 Jan 27, 2008 14:52

LadyEase wrote:

I feel like I have been posting so many questions.... sorry about that.

pul-LEEZ continue to ask your questions!! Lots of questions!

I've taken an interest in (and made a start at) contributing to clarifying/expanding/updating the manual. This interest was sparked by my own newbie questions as well as other q's I've noticed on this forum that made me think, "Good content for the docs."

Also, any q asked and effectively answered becomes persistent reference material for future newbies.

So. Don't apologize, k?

kazar

5 Feb 03, 2008 02:10

I've been called many things in my life ... I even got accused of being lucid once, but that was by an aussie and they're renowned for huge spaces .... mainly between the ears :|

but that's the first time I've been accused of beauty .... can I recommend a good opticians?

¥

6 Feb 03, 2008 02:24

warning: not fit for all ages:

¥åßßå when a Lady who calls herself "easeee" says your thing is beautiful DO NOT argue!

Okay back on topic: nice solution!

7 Feb 03, 2008 02:54

:P yer bullshit is only matched by your perception ...... that was another fortune cookie ;)

¥

8 Feb 08, 2008 03:23

"thing of beauty".. well it was a beautiful CODE I must say. and who said anything about being easeeee.. LOL. You guys are too much... I LOVE IT HERE.

Ok, so the code works perfectly... so much so that I, with ¥åßßå's help, wrote out the code for user groups... cause not everyone might find it useful to have it only for each user. So if you want to display something for a selected group, you can. I like! It was tons of fun writing it all up in my blog!

http://www.beatease.com/web-design.php/b2evolution-hacks/custom-display-for-specific-groups

<?php  
 if( empty( $current_User ) )  
 { // not logged in  
 }  
 else  
 { // logged in  
   switch( $current_User->group_ID )  
   {  
      case 1 :  
    echo 'group 1 can see this';  
       break;  
      case 2 :  
    echo 'group 2 can see this';  
       break;  
      case 3 :  
    echo 'group 3 can see this';  
       break;  
     default :  
   }  
 }  
 ?> 


Form is loading...