coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: jms1989 on June 06, 2008, 09:56:22 PM

Title: [Solved]: How to show specific messages to different groups in Coppermine with anycontent
Post by: jms1989 on June 06, 2008, 09:56:22 PM
Hi, I was wonder how can one show a specific massage to multiple groups in coppermine. I want to put the text in a div container.

My current file;

Code (anycontent.php) Select

<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2008 Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License version 3
  as published by the Free Software Foundation.
  
  ********************************************
  Coppermine version: 1.4.18
  $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.4.x/anycontent.php $
  $Revision: 4380 $
  $Author: gaugau $
  $Date: 2008-05-06 12:00:19 +0200 (Sa, 6 Jun 2008) $
**********************************************/

/**
* Coppermine Photo Gallery 1.4.14 anycontent.php
*
* This file file gets included in the index.php if you set the option in admin
* can be used to display any content from any program, it is always to be edited
* according to tastes and then used
*
* @copyright 2002,2007 Gregory DEMAR, Coppermine Dev Team
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License V3
* @package Coppermine
* @version $Id: anycontent.php 4380 2008-04-12 10:00:19Z gaugau $
*/

if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

starttable("100%""Welcome");

?>

<tr><td class="tableb">
<div>Welcome to Michael's Gallery. This gallery is for me to share my favorites and perhaps even my own images.
All of the anime and space images have been downloaded from other sites and reposted here.
They are also on my hard drives to local viewing.<br/></div>
<!-- <div id="guest"> <br/></div> -->
<!-- <div id="member"> <br/></div> -->
</td></tr>
<?php
endtable
();

?>



Can this be done with css and php code? If so, how can I do this?

Thanks to anyone who can help.
Title: Re: How to show specific messages to different groups in Coppermine with anycontent
Post by: just_some_guy on June 06, 2008, 11:01:20 PM
Yes it can be done with PHP.


<?php

if (USER_GROUP == 'Registered') {
echo <<< EOT
<div id="members"> Hello registered member. </div> 
EOT;
} elseif (
USER_GROUP == 'Group 2') {
echo <<< EOT
<div id="group2"> Hello Group 2 member. </div> 
EOT;
} else {
echo <<< EOT
<div id="guests"> Hello guest. </div> 
EOT;
?>


Title: Re: How to show specific messages to different groups in Coppermine with anycont
Post by: jms1989 on June 06, 2008, 11:15:11 PM
Hmm, I tried the code but now I get (Parse error: syntax error, unexpected $end in /home/jms1989/domains/michaelsweb.uni.cc/public_html/gallery/anycontent.php on line 59).

Current code;

Code (anycontent.php) Select

<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2008 Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License version 3
  as published by the Free Software Foundation.
  
  ********************************************
  Coppermine version: 1.4.18
  $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.4.x/anycontent.php $
  $Revision: 4380 $
  $Author: gaugau $
  $Date: 2008-04-12 12:00:19 +0200 (Sa, 12 Apr 2008) $
**********************************************/

/**
* Coppermine Photo Gallery 1.4.14 anycontent.php
*
* This file file gets included in the index.php if you set the option in admin
* can be used to display any content from any program, it is always to be edited
* according to tastes and then used
*
* @copyright 2002,2007 Gregory DEMAR, Coppermine Dev Team
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License V3
* @package Coppermine
* @version $Id: anycontent.php 4380 2008-04-12 10:00:19Z gaugau $
*/

if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

starttable("100%""Welcome");

?>

<tr><td class="tableb">
<div>Welcome to Michael's Gallery. This gallery is for me to share my favorites and perhaps even my own images.
All of the anime and space images have been downloaded from other sites and reposted here.
They are also on my hard drives to local viewing.<br/></div>

<?php if (USER_GROUP == 'Registered') {
echo <<< EOT
<div id="members"> Hello registered member. </div> 
EOT;
} elseif (
USER_GROUP == 'Administrators') {
echo <<< EOT
<div id="admin"><b>Global Announcement for the Admins.</b></div> 
EOT;
} else {
echo <<< EOT
<div id="guests">Hello visitor. I see you are not <a href="login.php?referer=index.php">logged</a> in or registered. Please <a href="register.php?referer=index.php">join</a> to access the members only areas and maby share some of your own images.</div> 
EOT; ?>


</td></tr>
<?php
endtable
();
?>



Did I do something wrong?
Title: Re: How to show specific messages to different groups in Coppermine with anycontent
Post by: just_some_guy on June 06, 2008, 11:33:27 PM
oops, sorry i forgot to add the ending curly brace to the last else statement, try this -


<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2008 Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License version 3
  as published by the Free Software Foundation.
  
  ********************************************
  Coppermine version: 1.4.18
  $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.4.x/anycontent.php $
  $Revision: 4380 $
  $Author: gaugau $
  $Date: 2008-04-12 12:00:19 +0200 (Sa, 12 Apr 2008) $
**********************************************/

/**
* Coppermine Photo Gallery 1.4.14 anycontent.php
*
* This file file gets included in the index.php if you set the option in admin
* can be used to display any content from any program, it is always to be edited
* according to tastes and then used
*
* @copyright 2002,2007 Gregory DEMAR, Coppermine Dev Team
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License V3
* @package Coppermine
* @version $Id: anycontent.php 4380 2008-04-12 10:00:19Z gaugau $
*/

if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

starttable("100%""Welcome");

?>

<tr><td class="tableb">
<div>Welcome to Michael's Gallery. This gallery is for me to share my favorites and perhaps even my own images.
All of the anime and space images have been downloaded from other sites and reposted here.
They are also on my hard drives to local viewing.<br/></div>

<?php if (USER_GROUP == 'Registered') {
echo <<< EOT
<div id="members"> Hello registered member. </div> 
EOT;
} elseif (
USER_GROUP == 'Administrators') {
echo <<< EOT
<div id="admin"><b>Global Announcement for the Admins.</b></div> 
EOT;
} else {
echo <<< EOT
<div id="guests">Hello visitor. I see you are not <a href="login.php?referer=index.php">logged</a> in or registered. Please <a href="register.php?referer=index.php">join</a> to access the members only areas and maby share some of your own images.</div> 
EOT; 
}
?>

</td></tr>
<?php
endtable
();
?>

Title: Re: How to show specific messages to different groups in Coppermine with anycont
Post by: jms1989 on June 07, 2008, 12:26:46 AM
Got it working. Thanks for the help.