anycontent change content with an if code (logged in/not logged in) anycontent change content with an if code (logged in/not logged in)
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

anycontent change content with an if code (logged in/not logged in)

Started by hooch, September 27, 2004, 02:51:22 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hooch

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

hooch

#1
removed..sorry

Joachim Müller

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

hooch

#3
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";
}
 
?>


Joachim Müller

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

hooch

#5
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)

Joachim Müller

to stop you editing this thread further I locked it. ::)

Joachim