Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Showing "anycontent.php" to Unregistered Members / Guests  (Read 5452 times)

0 Members and 1 Guest are viewing this topic.

pols1337

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 244
Showing "anycontent.php" to Unregistered Members / Guests
« 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
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: Showing "anycontent.php" to Unregistered Members / Guests
« Reply #1 on: February 19, 2012, 11:54:21 am »

Try this:

Code: [Select]
<?php
if (!USER_ID) {
  echo 
"YOUR MESSAGE";
}
?>




pols1337

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 244
Re: Showing "anycontent.php" to Unregistered Members / Guests
« Reply #2 on: February 19, 2012, 10:46:41 pm »

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  :-[
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Showing "anycontent.php" to Unregistered Members / Guests
« Reply #3 on: February 24, 2012, 04:29:29 pm »

Please post the code you added, respectively your whole file content.
Logged

pols1337

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 244
Re: Showing "anycontent.php" to Unregistered Members / Guests
« Reply #4 on: March 11, 2012, 10:27:52 am »

Hi Andre,

I would like the following message to only be shown to guests / unregistered visitors (copied from my anycontent.php):

Code: [Select]
</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. 
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Showing "anycontent.php" to Unregistered Members / Guests
« Reply #5 on: March 11, 2012, 11:24:29 am »

As Joe already described, replace it with the following code:
Code: [Select]
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>';
}
Logged

pols1337

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 244
[Resolved] Showing "anycontent.php" to Unregistered Members / Guests
« Reply #6 on: March 11, 2012, 06:18:36 pm »

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:

Code: [Select]
<?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. 
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Showing "anycontent.php" to Unregistered Members / Guests
« Reply #7 on: March 11, 2012, 07:24:32 pm »

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.
Logged
Pages: [1]   Go Up
 

Page created in 0.031 seconds with 19 queries.