forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: pols1337 on February 18, 2012, 10:02:11 pm
-
Hi,
I'd like to use "anycontent.php" to show a message only to unregistered members / guests. Can you suggest a coding for it?
I've read http://forum.coppermine-gallery.net/index.php/topic,45673.msg217268.html#msg217268 but not sure if it applies, since I'm bridging from SMF2.0
Joel / pols1337
-
Try this:
<?php
if (!USER_ID) {
echo "YOUR MESSAGE";
}
?>
-
A more advanced question on how to replace YOUR MESSAGE ...
I'd like to say something like:
Welcome to Gallery!
(paragraph 1)Thank you for visiting.
(paragraph 2)You will need to log-in to send ecards, rate, comment, and download.
I tried to simply copy and paste my HTML code inside the echo function ... that didn't go over so well :-[
-
Please post the code you added, respectively your whole file content.
-
Hi Andre,
I would like the following message to only be shown to guests / unregistered visitors (copied from my anycontent.php):
</br>
<center>
<table id="Welcome to UOM Main Gallery" width="90%" border = "0">
<tr>
<td>
<p><center><h3>Welcome to the Main Gallery</h3></center></p>
<p>The UOM Main Gallery contains adult material. You must read and agree to the <a href="http://universeofmen.com/index.php?action=kb;area=article;cont=71">Adult Warning</a> and <a href="http://universeofmen.com/index.php?action=kb;area=article;cont=70">User Agreement</a> before entering. <br><br>The UOM Main Gallery is the flagship gallery of <a href="http://universeofmen.com/index.php">UniverseOfMen (UOM)</a>, a free gay website dedicated to showing the very best gay and homoerotic content from around the male universe. You may <a href="http://universeofmen.com/index.php?action=register">Register</a> for free to add comments, rate pictures, search albums, send ecards, and download.</p>
</td>
</tr>
</table>
</center>
</br>
Screenshot is attached.
-
As Joe already described, replace it with the following code:
if (!USER_ID) {
echo '</br>
<center>
<table id="Welcome to UOM Main Gallery" width="90%" border = "0">
<tr>
<td>
<p><center><h3>Welcome to the Main Gallery</h3></center></p>
<p>The UOM Main Gallery contains adult material. You must read and agree to the <a href="http://universeofmen.com/index.php?action=kb;area=article;cont=71">Adult Warning</a> and <a href="http://universeofmen.com/index.php?action=kb;area=article;cont=70">User Agreement</a> before entering. <br><br>The UOM Main Gallery is the flagship gallery of <a href="http://universeofmen.com/index.php">UniverseOfMen (UOM)</a>, a free gay website dedicated to showing the very best gay and homoerotic content from around the male universe. You may <a href="http://universeofmen.com/index.php?action=register">Register</a> for free to add comments, rate pictures, search albums, send ecards, and download.</p>
</td>
</tr>
</table>
</center>
</br>';
}
-
Resolved -- thanks.
For those of you who might be searching in the future, there are some tweaks to both Andre's and Joe's suggestions:
<?php
if (!USER_ID) {
echo 'YOUR MESSAGE';
}
?>
1. Use single quotations instead of double
2. Make sure you include the <?php> stuff
3. If you use the single quotations, don't use apostrophes ' in your HTML or description or you'll get a parse error.
-
Don't forget to
tag your answer as "solved" by clicking on the "Topic Solved" button on the bar at the left hand side at the bottom of your thread.