4images Forum & Community

4images Issues / Ausgaben => Installation, Update & Configuration => Topic started by: renicolay on April 20, 2005, 06:05:48 AM

Title: Show / Hide View IMages Button based on Session
Post by: renicolay 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

Title: Re: Show / Hide View IMages Button based on Session
Post by: V@no 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";
}
?>
Title: Re: Show / Hide View IMages Button based on Session
Post by: renicolay 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";
}
?>
Title: Re: Show / Hide View IMages Button based on Session
Post by: V@no 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";