coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: hooch on September 27, 2004, 02:51:22 AM

Title: anycontent change content with an if code (logged in/not logged in)
Post by: hooch on September 27, 2004, 02:51:22 AM
Hello!
Is there anyway to make the content of anycontet change depends on if you are logged in or not,
like if you not are logged in it says LOG IN!
and if you are logged in it says Welcome [nick]! (or something)?
thanks/Gustav
Title: Re: one small question..(refer when loggin in)
Post by: hooch on September 28, 2004, 01:45:10 AM
removed..sorry
Title: Re: one small question..(refer when loggin in)
Post by: Joachim Müller on September 28, 2004, 08:41:53 AM
we have a "one question per thread" policy on this board.
Anycontent will always be displayed, but it can contain php, so you could add the switch (if/then) yourself. I rather suggest looking at the mods board, there's a mod that will do what you request. Please always do a search before posting.

Joachim
Title: Re: one small question..(refer when loggin in)
Post by: hooch on September 29, 2004, 04:08:11 PM
i have serched but could not find the answer..(im not that good at php yes but i know how to do an if thing but it wont work..:


<?php
 
if (!USER_IDcpg_die(ERROR
'Your have to  <a href="login.php">log in</a> !<br>
Not<a href="register.php"> registered</a> yet? Do it now!'
__FILE____LINE__);


else {
print 
"You are in logged $name";
}
 
?>

Title: Re: one small question..(refer when loggin in)
Post by: Joachim Müller on September 30, 2004, 07:05:05 AM
I already answered the other one that you deleted. Don't do this stunt again, it makes the thread unusable by others, as there's an answer to a question that appears never to have been asked.

Joachim
Title: Re: one small question..(refer when loggin in)
Post by: hooch on September 30, 2004, 02:06:15 PM
i changed the topic and took away the question..

but this question remains..(how to do the if thing in anycontent.php, see "" Reply #1 & #3  ""

thanks in advance!
/Gustav (soon good on php :D)
Title: Re: anycontent change content with an if code (logged in/not logged in)
Post by: Joachim Müller on October 01, 2004, 06:42:36 AM
to stop you editing this thread further I locked it. ::)

Joachim