Advanced search  

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

Pages: [1]   Go Down

Author Topic: displaying anycontent only for a certain group  (Read 6052 times)

0 Members and 1 Guest are viewing this topic.

celeritycat

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 33
displaying anycontent only for a certain group
« on: September 28, 2005, 09:41:19 am »

I know this question was asked about CPG when it is bridged, but I have searching for hours to see if this can be done as a standalone.
I am using the most recent stable version 1.3.5 and I wanted to know if anycontent.php could only be visible when a particular group is viewing your albums. Not necessarily a registered group, just a group of your choosing, like say a friend group? ;D
« Last Edit: September 30, 2005, 07:20:17 pm by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Logged

celeritycat

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 33
Re: displaying anycontent only for a certain group
« Reply #2 on: September 29, 2005, 09:57:56 am »

http://forum.coppermine-gallery.net/index.php?topic=11619.0

Respectfully, that thread is based on all registered users, maybe I was not clear.
i.e. I have a group name family, and even though they are registered users to have albums, I would like to have anycontent.php showing only when they are logged in. So not all registered users can see anycontent, just those of the family group.
Thanks a bunch ;D
Logged

Nibbler

  • Guest
Re: displaying anycontent only for a certain group
« Reply #3 on: September 29, 2005, 03:20:20 pm »

Instead of using

Code: [Select]
if (USER_ID){
use

Code: [Select]
if (in_array(9, $USER_DATA['groups'])){
Where 9 is the group number of the group you want to allow.
Logged

celeritycat

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 33
Re: displaying anycontent only for a certain group
« Reply #4 on: September 29, 2005, 06:17:25 pm »

Instead of using

Code: [Select]
if (USER_ID){
use

Code: [Select]
if (in_array(9, $USER_DATA['groups'])){
Where 9 is the group number of the group you want to allow.

Just one more thing, what is the code to add a another group number
say like group 5 and administrator 1 (ME).
But otherwise that works great! Thank you so very much ;D
« Last Edit: September 29, 2005, 09:15:04 pm by celeritycat »
Logged

celeritycat

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 33
Re: displaying anycontent only for a certain group
« Reply #5 on: September 30, 2005, 04:41:01 am »

Hello, anybody can take a crack at my question above? I almost have everything just right, I just need that last bit of info.
I know the guys here are very busy so feel free to jump in and offer a suggestion, anybody? ;D
Logged

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Re: displaying anycontent only for a certain group
« Reply #6 on: September 30, 2005, 05:31:17 am »

I suppose you could try something like this..


if (in_array(9, $USER_DATA['groups'])){
    // do nothing - a user is logged in
    // we could print out anything here to say welcome to the logged in user

} else {
if (in_array(10, $USER_DATA['groups'])){
    // do nothing - a user is logged in
    // we could print out anything here to say welcome to the logged in user

} else {

    print 'You\'re not logged in. <br />Click <a href="login.php">login</a> if you already have an account for this site or <a href="register.php">register</a> to sign up for a new account.';
}


Dennis
Logged
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: displaying anycontent only for a certain group
« Reply #7 on: September 30, 2005, 08:34:54 am »

Hello, anybody can take a crack at my question above? I almost have everything just right, I just need that last bit of info.
I know the guys here are very busy so feel free to jump in and offer a suggestion, anybody? ;D
http://coppermine.sourceforge.net/faq.php#lamesupport
Logged

celeritycat

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 33
Re: displaying anycontent only for a certain group
« Reply #8 on: September 30, 2005, 09:21:50 am »

I was not implying that support was ignoring me or not providing support quick enouph. I was simply stating that you guys are really busy and asked if someone else had a suggestion.  That's all!  I kind of thought that is what support boards are for, if another user has some imput, they will help you out! I am sorry If I offended you. You have been very helpful and your script is outstanding.

Now Having said that, I tried the code the way madeinhawaii suggested, but I keep getting  Parse errors. This is what I have now and it works for the one group, but I would like to add me the admisitrator into the code. I am not very cody savy when it come to php, it's very new to me.

Code: [Select]
starttable("100%", "Welcome $user_name");

?>
<tr><td class="tableb" >
<?php
if (in_array(5$USER_DATA['groups'])){

echo 
' Family Links';

} else {



echo 
' Guest, Feel free to browse the public albums, post comments, and rate files, but you can not post images without logging in or registering. Click <a href="login.php">login</a> if you already have an account for this site or <a href="register.php">register</a> to sign up for a new account. <I>Please be aware that your IP will be banned if you post profanity and any abusive behavior</I>';

}
?>

</br></br>
<script src="http://www.velvet-peacock.com/cgi-bin/equotes/equotes.cgi?display=1&java=1"></script>
<img src="/images/space.gif" width="10" height="3"><span class="style12"><a href="http://velvet-peacock.com/cgi-bin/equotes/equotes.cgi?new=1" target="_blank">Add Your eQuote</a></span>
<img src="/emoticons/smile9.gif" width="15" height="15">
</td></tr></br>
<?php
endtable
();

?>
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: displaying anycontent only for a certain group
« Reply #9 on: September 30, 2005, 09:24:48 am »

doesn't
Code: [Select]
if (in_array(9, $USER_DATA['groups']) || in_array(1, $USER_DATA['groups'])){do what you're trying to accomplish? In case you're wondering: the
Code: [Select]
||reads as "OR".
Logged

celeritycat

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 33
Re: displaying anycontent only for a certain group
« Reply #10 on: September 30, 2005, 09:33:52 am »

Thank you so very much, it now works perfectly. And thank you for your patience.
Logged

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Re: displaying anycontent only for a certain group
« Reply #11 on: September 30, 2005, 10:53:03 am »

doesn't
Code: [Select]
if (in_array(9, $USER_DATA['groups']) || in_array(1, $USER_DATA['groups'])){do what you're trying to accomplish? In case you're wondering: the
Code: [Select]
||reads as "OR".

Thanks for covering me again, Gaugau.. I wasn't sure the || would work in that line.  Now I know. 

Dennis
Logged
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.
Pages: [1]   Go Up
 

Page created in 0.027 seconds with 15 queries.