How to add "MUST REGISTER" at the top when NOT reg

imroue

Joined: 2002-09-24
Posts: 15
Posted: Tue, 2005-02-01 03:02

I would like to know if there is a feature where you can put some text on your gallery to say "YOU MUST REGISTER...etc etc.." when someone is trying to access your gallery. Once they login the message would go away.
Basically, I was able to make all the albums invisible unless you login. There is a little "register" link at the top right, but it would be nice to have an explanation in themiddle if someon is not logged in.

Thanks in advance!!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2005-02-01 04:44

in albums.php look for echo "<!-- End top nav -->"; and add

if (!$gallery->user->isLoggedIn()) {

	echo "\n<center><div style=\"width:60%; border-style:outset; border-width:5px; border-color:red; padding: 5px;\">";
	echo "\n<p class=\"head\"><u>". _("Attention!") ."</u></p>";
	echo "\nIn order to view the albums you must log in.<br>";
	echo "\nYou can " . popup_link(_("register"), "register.php", false, true, 500, 500) . " to view the albums. <br>If you have registered already:<br>";
	echo "Please " . popup_link(_("Log in"), "login.php", false, true, 500, 500) . " to view the albums.";
	echo "\n</div></center>\n";
}

Chnage the text inbetween the quotes to your liking.

Dave

 
imroue

Joined: 2002-09-24
Posts: 15
Posted: Tue, 2005-02-01 20:28

thanks Dave! I will try that. :lol:

 
imroue

Joined: 2002-09-24
Posts: 15
Posted: Sat, 2005-02-05 23:29

by the way, why do you have an underscore before ("Attention")?

Quote:
echo "\n<p class=\"head\"><u>". _("Attention!") ."</u></p>";

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2005-02-06 19:27

localization. (translations)

 
imroue

Joined: 2002-09-24
Posts: 15
Posted: Sun, 2005-02-06 19:36

excuse my ignorance, but when i removed the _ it still worked.
am i missing something?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2005-02-06 20:09

You can if you wish. The translation code looks for the underscore and bracket and quote and the text after it is translated. It is a bit more complex than that but this is it in a nutshell. If you look at the code you will see all text that is translated has the same syntax.

Dave

 
jambojim

Joined: 2007-08-09
Posts: 1
Posted: Thu, 2007-08-09 02:23
Quote:
in albums.php look for echo "<!-- End top nav -->"; and add

I am franticly searching for the file "albums.php". Please someone tell me where in the Gallery directory I can find it.

Many thanks

Jay

 
paradesi

Joined: 2005-09-25
Posts: 78
Posted: Sun, 2007-09-16 20:20

Hi,

I've the same requirement and actually i am not able to restrict non-members to view the albums. Could you help me how to restrict the non-members and set the "MUST REGISTER" message for non-members.

Thanks,
Paradesi