Author Topic: Show / Hide View IMages Button based on Session  (Read 4264 times)

0 Members and 1 Guest are viewing this topic.

Offline renicolay

  • Newbie
  • *
  • Posts: 43
    • View Profile
Show / Hide View IMages Button based on Session
« on: April 20, 2005, 06:05:48 AM »
Hello,

I have moved the login to another page on my website.  However, once the user has logged in I would like a link or button to appear that would direct the user to the 4images gallery.  Can anyone give me help on this issue? Thanks in advance! :o


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: Show / Hide View IMages Button based on Session
« Reply #1 on: April 20, 2005, 06:12:26 AM »
(hope u have some basic PHP skill)
u could try something like this:
Code: [Select]
<?php
define
('ROOT_PATH''/path/to/4images/dir/'); //with trailng slash!!!
$nozip 1;
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
if (
$user_info['user_level'] > GUEST)
{
  echo "blah blah";
}
?>
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 renicolay

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Show / Hide View IMages Button based on Session
« Reply #2 on: April 20, 2005, 03:33:20 PM »
V@no , thanks for the quick reply! My PHP skills are weak, I'm trying to learn.  Can I ask you this...

If I want the text "Click here to visit Galley" to only appear when logged in.  How would I complete the statement you posted?


<?php
define('ROOT_PATH', '/path/to/4images/dir/'); //with trailng slash!!!
$nozip = 1;
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
if ($user_info['user_level'] > GUEST)
{
  echo "blah blah";
}
?>

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: Show / Hide View IMages Button based on Session
« Reply #3 on: April 21, 2005, 12:34:25 AM »
in my example it will print on screen "blah blah" only if visitor is logged in. so, basicaly all u need is change echo "blah blah"; to whatever u want.
for example:
Code: [Select]
echo "Click <a href=\"http://yoursitename/path/to/4images/index.php\">here</a> to visit Gallery";
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)