Author Topic: Change background color according to permissions  (Read 6023 times)

0 Members and 1 Guest are viewing this topic.

Offline mark1491

  • Newbie
  • *
  • Posts: 25
    • View Profile
Change background color according to permissions
« on: August 17, 2006, 07:55:47 PM »
I would like to change the background color of the thumbnail_bit according to the users permission.

For instance if the guests are not a registered user the images for only registered users would have a background color of red.

I wouldn't care if the color was like that for both registered and guests.  I just need it to stand out so it doesn't have to turn back to the original color when registered users sign-in

Thanks in advance,
Mark

Offline mark1491

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Change background color according to permissions
« Reply #1 on: August 18, 2006, 12:12:20 AM »
does anyone know how to do this?  It is probably an if else statement or soemthing, but I do not know if I need to edit template files or the system files?

Thanks
Mark

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Change background color according to permissions
« Reply #2 on: August 18, 2006, 01:55:59 AM »
Lets see...in includes/functions.php find:
Code: [Select]
    "image_file_size" => $file_size,
Insert below:
Code: [Select]
    "noaccess" => $show_link ? 0 : 1,
Now you can add the style you want in thumbnail_bit.html template between  {if noaccess} and {endif noaccess} tags
i.e.
Code: [Select]
{if noaccess}style="background-color: red;"{endif noaccess}
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline mark1491

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Change background color according to permissions
« Reply #3 on: August 18, 2006, 04:34:45 AM »
thanks veno, one more question:

Is there and IF ELSE statement for unregistered users that I can add to any of my template, so that they can see certain signup links?

Thanks, Mark

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Change background color according to permissions
« Reply #4 on: August 18, 2006, 04:43:06 AM »
{if user_loggedin}message for members{endif user_loggedin}
{if user_loggedout}message for guests{endif user_loggedout}
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline mark1491

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Change background color according to permissions
« Reply #5 on: August 18, 2006, 04:58:45 AM »
thanks for all your help, it works great!