forum.coppermine-gallery.net
Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: hama on November 21, 2004, 11:04:02 am
-
I found a nice preview of coppermine pictures.
Do you know the code for this preview? I don't think it is the flash movie code from rphMedia.
--> http://demo.pragmamx.de/?name=Gallery (Zufallsbilder)
Would it be possible to put this code into an anycontent 2.php?
Thanks a lot
hama
-
That site is using coppermine with pragma mx. You should ask on their forums how they apply that preview, and if it could be used by a standalone version without pragma mx.
-
I found the script and it is for coppermine with pragma mx. Is it a very hard job to change the code so that it gives at the end an anycontent2.php?
<?php // $Id: block-Gallery-scroll-Random_pictures.php,v 20.1 2004/08/29 22:04:32 EllselAn Exp $
/************************************************************************/
/* mX / pragmaMx Content Management System Platform */
/* ==================================================================== */
/* Copyright (C) 2004 by the vkpMx & pragmaMx Developer Team */
/* email: team@pragmamx.org */
/* homepage: http://www.maax-design.de & http://www.pragmaMx.org */
/************************************************************************/
// Coppermine Photo Gallery for mX //
// required version: >= 1.3.1 //
// ---------------------------------------------------------------------//
// Copyright (C) 2002,2004 Grégory DEMAR <gdemar@wanadoo.fr> //
// http://www.chezgreg.net/coppermine/ //
// -------------------------------------------------------------------- //
// Updated by the Coppermine Dev Team //
// (http://coppermine.sf.net/team/) //
// see /docs/credits.html for details //
// -------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// -------------------------------------------------------------------- //
if (!defined("mxMainFileLoaded")) die ("You can't access this file directly...");
#error_reporting(E_ALL); $GLOBALS['mxSqlErrorDebug'] = true;
global $CONFIG, $cpg_name, $lang_get_pic_data;
$cpg_name = "Gallery";
if (@file_exists('modules/'.$cpg_name.'/blocks.inc.php')) {
include('modules/'.$cpg_name.'/blocks.inc.php');
}
else {
if (mxIsAdmin()) {
$content = 'The module "'.$cpg_name.'" doesn\'t exist or is not correctly installed. Please install this module or change the Variable $cpg_name in file blocks/'.basename(__file__).'.';
}
return;
}
// BEGINN USER DEFINEABLES
$limit = $CONFIG['thumbcols']-1; //number of thumbs
$scrollheight = '145';
$title_length = 17; //length of title below thumb
// END USER DEFINEABLES
$output = '';
$result = sql_query("
SELECT COUNT(*)
FROM $CONFIG[TABLE_PICTURES] as p INNER JOIN $CONFIG[TABLE_ALBUMS] AS a ON (p.aid = a.aid)
WHERE p.approved='YES' AND ".$vis_groups."
GROUP BY p.pid");
$nbEnr = sql_fetch_row($result);
$pic_count = $nbEnr[0];
// if we have more than 1000 pictures, we limit the number of picture returned
// by the SELECT statement as ORDER BY RAND() is time consuming
if ($pic_count > 1000) {
$result = sql_query("
SELECT COUNT(*) from $CONFIG[TABLE_PICTURES]
WHERE approved = 'YES'");
$nbEnr = sql_fetch_row($result);
$total_count = $nbEnr[0];
$granularity = floor($total_count / 1000);
$cor_gran = ceil($total_count / $pic_count);
srand(time());
for ($i = 1; $i <= $cor_gran; $i++) $random_num_set = rand(0, $granularity) . ', ';
$random_num_set = substr($random_num_set, 0, -2);
$result = sql_query("
SELECT p.pid, p.url_prefix, p.filepath, p.filename, p.aid
FROM $CONFIG[TABLE_PICTURES] AS p INNER JOIN $CONFIG[TABLE_ALBUMS] AS a ON (p.aid = a.aid)
WHERE randpos IN ($random_num_set) AND p.approved='YES' AND ".$vis_groups."
ORDER BY RAND() DESC
LIMIT $limit");
} else {
$result = sql_query("
SELECT p.pid, p.url_prefix, p.filepath, p.filename, p.aid
FROM $CONFIG[TABLE_PICTURES] AS p INNER JOIN $CONFIG[TABLE_ALBUMS] AS a ON (p.aid = a.aid)
WHERE p.approved='YES' AND ".$vis_groups."
ORDER BY RAND() DESC
LIMIT $limit");
}
$rowset = array();
while ($row = sql_fetch_array($result)) {
if (empty($row['title'])) $row['title'] = substr($row['filename'], 0, -4);
$output .= '<p align="center"><a href="modules.php?name='.$cpg_name.'&file=displayimage&album='.$row['aid'].'&pos=-' . $row["pid"] . '"><img src="' .get_pic_url($row, 'thumb') . '" border="0" alt="' . $row['title'] . '" title="' . $row['title'] . '"><br />' . mxCutString($row['title'], $title_length) . '</a></p>';
}
// marquee info at http://www.faqs.org/docs/htmltut/_marquee.html
if ($output) {
$content = '<div align="center" style="overflow: hidden; height: '.$scrollheight.'px;">
<marquee loop="0" behavior="scroll" direction="up" height="'.$scrollheight.'" scrollamount="1" scrolldelay="1" onmouseover="this.stop()" onmouseout="this.start()">
'.$output.'
</marquee>
</div>
<p align="center"><a href="modules.php?name='.$cpg_name.'">' . $CONFIG['gallery_name'] . '</a></p>';
}
?>
hama
-
Hello hama :)
I rewrote the block for the Stand-Allone version of Coppermine.
I hope it please you.
Greetings from Germany ;)
EDIT:
only for Coppermine 1.4.alpha
-
Hello hama :)
I rewrote the block for the Stand-Allone version of Coppermine.
I hope it please you.
Greetings from Germany ;)
thanks for the re-code, however, i change the file to anycontent2.php, added to index.php, but no working for me...i messed around with the table closing, but still no work.
snork
-
@Andi
I rewrote the block for the Stand-Allone version of Coppermine.
Thanks! I'll try it next week, at the moment I'm too busy.
I'll give you a feedback soon.
See you
Hans
-
Hi :)
@ Hans
Oki ;) ;D
@ Snork
Sorry it's a misstake from me. I've only test it under Coppermine 1.4.alpha, not on 1.3.x....
Here is the Version for Coppermine 1.3.x
-
When i tried to load it into anycontent.php I am getting "You can't access this file directly..."
What am I doing wronng?
~fare
http://www.AlaskaStudio.com
-
Hi :)
@ Hans
Oki ;) ;D
@ Snork
Sorry it's a misstake from me. I've only test it under Coppermine 1.4.alpha, not on 1.3.x....
Here is the Version for Coppermine 1.3.x
Andi,
i figured that was the problem ;), thanks for the super fast fix for 1.3.x... I have it running well on my gallery..thanks so much for sharing...i have the flash scroll above if anybody wishes to see both in action
snork
-
I made a few little mods to this code, but now I cant get it to work.. It looks correct to me, can anyone help? This is the error:
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/virtual/site33/fst/var/www/html/cpg132/anycontent.php on line 103
Here is the code:
<?php
// -------------------------------------------------------------------------
//
// Coppermine Photo Gallery 1.3.2
//
// -------------------------------------------------------------------------
//
// Copyright (C) 2002-2004 Gregory DEMAR
//
// http://www.chezgreg.net/coppermine/
//
// -------------------------------------------------------------------------
//
// Updated by the Coppermine Dev Team
//
// (http://coppermine.sf.net/team/)
//
// see /docs/credits.html for details
//
// -------------------------------------------------------------------------
//
// This program is free software; you can redistribute it and/or modify
//
// it under the terms of the GNU General Public License as published by
//
// the Free Software Foundation; either version 2 of the License, or
//
// (at your option) any later version.
//
// -------------------------------------------------------------------------
//
// CVS version: $Id: anycontent.php,v 1.5 2004/07/24 15:03:52 gaugau Exp $
// -------------------------------------------------------------------------
//
starttable("100%", "Welcome to AlaskaStudio.com");
?>
<tr><td class="tableb" >
<a href="mailto:travis@alaskastudio.com?subject=Comments about
AlaskaStudio.com &body=Thank you for taking the time to send me an email. I
will respond as soon as possable. Please erase this text before sending your
message. ">mail me</a>
<br>
<br>
<?php
if (USER_ID) {
print 'Welcome to AlaskaStudio.com, and thank you for logging in. As a member
of AlaskaStudio.com you have full access to all functions of this site. We
recently added <b>ecards</b>! Please tell your freinds about this site by
sending them an ecard.';
// 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. If you were, you could do so many things you
currently can\'t.<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.';
}
?>
</td></tr>
<?php
endtable();
?>
Thanks,
~fare
http://www.alaskastudio.com
-
Hi fareforce,
When i tried to load it into anycontent.php I am getting "You can't access this file directly..."
don't use the above posted code, use the attached file from my last post ;)
-
I have played with it some more.
I did use your last file, I just added :
<br>
<tr align="left">
Thank you for visiting AlaskaStudio.com. We strive to bring you the most
unique shots of Alaska day in and day out. If you have any comments,
questions, or request please send me an
<a href="mailto:travis@alaskastudio.com?subject=Comments about
AlaskaStudio.com &body=Thank you for taking the time to send me an email. I
will respond as soon as possable. Please erase this text before sending your
message. ">e-mail.</a> Thank you, and enjoy our site!
<br>
that part works great, but I can't get this next part code to mix with yours for some reason. It works if I don't use yours.
Here is the code I am having problems adding:
<?php
if (USER_ID) {
print 'Welcome to AlaskaStudio.com, and thank you for logging in. As a member of AlaskaStudio.com you have full access to all functions of this site. We recently added <b>ecards</b>! Please tell your freinds about this site by sending them an ecard.';
// do nothing - a user is logged in
} else {
print 'You\'re not logged in. If you were, you could do so many things you currently can\'t.<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.';
}
?>
It will be sweet if I can get it working!
~fare
http://www.AlaskaStudio.com
-
I don't know why you decided to jump in and out of php. Try this:
<?php
// -------------------------------------------------------------------------
//
// Coppermine Photo Gallery 1.3.2
//
// -------------------------------------------------------------------------
//
// Copyright (C) 2002-2004 Gregory DEMAR
//
// http://www.chezgreg.net/coppermine/
//
// -------------------------------------------------------------------------
//
// Updated by the Coppermine Dev Team
//
// (http://coppermine.sf.net/team/)
//
// see /docs/credits.html for details
//
// -------------------------------------------------------------------------
//
// This program is free software; you can redistribute it and/or modify
//
// it under the terms of the GNU General Public License as published by
//
// the Free Software Foundation; either version 2 of the License, or
//
// (at your option) any later version.
//
// -------------------------------------------------------------------------
//
// CVS version: $Id: anycontent.php,v 1.5 2004/07/24 15:03:52 gaugau Exp $
// -------------------------------------------------------------------------
//
starttable("100%", "Welcome to AlaskaStudio.com");
echo '
<tr><td class="tableb" >
<a href="mailto:travis@alaskastudio.com?subject=Comments about
AlaskaStudio.com &body=Thank you for taking the time to send me an email. I
will respond as soon as possable. Please erase this text before sending your
message. ">mail me</a>
<br>
<br>
';
if (USER_ID) {
echo 'Welcome to AlaskaStudio.com, and thank you for logging in. As a member
of AlaskaStudio.com you have full access to all functions of this site. We
recently added <b>ecards</b>! Please tell your freinds about this site by
sending them an ecard.';
// do nothing - a user is logged in
// we could print out anything here to say welcome to the logged in user
} else {
echo 'You\'re not logged in. If you were, you could do so many things you
currently can\'t.<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.';
}
echo '
</td></tr>
';
endtable();
?>
-
Whew! Ok, I got everything lined up correctly, and working right.. To see what it looks like visit
http://www.AlaskaStudio.com
This is the code that I ended up with:
<?php
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery 1.3.x //
// ------------------------------------------------------------------------- //
// Copyright (C) 2002-2004 Gregory DEMAR //
// http://www.chezgreg.net/coppermine/ //
// ------------------------------------------------------------------------- //
// Updated by the Coppermine Dev Team //
// see /docs/credits.html for details //
// ------------------------------------------------------------------------- //
// Ported to mX/pragmaMx by the pragmaMx Dev Team //
// (http://www.pragmaMx.org) //
// ------------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// ------------------------------------------------------------------------- //
// base-ID: block-Gallery-center-scroll-Random_pictures.php,v 20.0 2004/08/21 22:14:37 EllselAn
// ------------------------------------------------------------------------- //
/*
* 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
*/
if (!defined("IN_COPPERMINE")) die('Not in Coppermine...');
#error_reporting(E_ALL);
// BEGINN USER DEFINEABLES
$limit = 25; // number of thumbs
$blockcaption = 'Welcome to AlaskaStudio.com'; // caption for the Block
// END USER DEFINEABLES
if ($USER_DATA['can_see_all_albums']) {
$vis_groups = 'visibility > -1';
}
else {
$vis_groups = implode(',',$USER_DATA['groups']).','.(FIRST_USER_CAT+$USER_DATA['user_id']);
$vis_groups = 'visibility IN (0,'.$vis_groups.')';
}
$result = db_query("SELECT COUNT(*)
FROM $CONFIG[TABLE_PICTURES] as p INNER JOIN $CONFIG[TABLE_ALBUMS] AS a ON (p.aid = a.aid)
WHERE p.approved='YES' AND ".$vis_groups."
GROUP BY p.pid");
$nbEnr = mysql_fetch_row($result);
$pic_count = $nbEnr[0];
// if we have more than 1000 pictures, we limit the number of picture returned
// by the SELECT statement as ORDER BY RAND() is time consuming
if ($pic_count > 1000) {
$result = db_query("SELECT COUNT(*) from $CONFIG[TABLE_PICTURES] WHERE approved = 'YES'");
$nbEnr = mysql_fetch_row($result);
$total_count = $nbEnr[0];
$granularity = floor($total_count / 1000);
$cor_gran = ceil($total_count / $pic_count);
srand(time());
for ($i = 1; $i <= $cor_gran; $i++) $random_num_set = rand(0, $granularity) . ', ';
$random_num_set = substr($random_num_set, 0, -2);
$result = db_query("SELECT p.pid, p.url_prefix, p.filepath, p.filename, p.aid
FROM $CONFIG[TABLE_PICTURES] AS p INNER JOIN $CONFIG[TABLE_ALBUMS] AS a ON (p.aid = a.aid)
WHERE randpos IN ($random_num_set) AND p.approved='YES' AND ".$vis_groups."
ORDER BY RAND() DESC
LIMIT $limit");
}
else {
$result = db_query("SELECT p.pid, p.url_prefix, p.filepath, p.filename, p.aid
FROM $CONFIG[TABLE_PICTURES] AS p INNER JOIN $CONFIG[TABLE_ALBUMS] AS a ON (p.aid = a.aid)
WHERE p.approved='YES' AND ".$vis_groups."
ORDER BY RAND() DESC
LIMIT $limit");
}
$output = '';
while ($row = mysql_fetch_assoc($result)) {
if (empty($row['title'])) $row['title'] = substr($row['filename'], 0, -4);
$output .= '<td align="center" valign="baseline"><a href="displayimage.php?album='.$row['aid'].'&pos=-' . $row["pid"] . '"><img src="' . get_pic_url($row, 'thumb') . '" border="0" alt="' . $row['title'] . '" title="' . $row['title'] . '" class="image" /><br />' . $row['title'] . '</a></td>';
}
// marquee info at http://www.faqs.org/docs/htmltut/_marquee.html
if ($output) {
starttable("100%", $blockcaption);
echo '<tr>
<td align="center" class="thumbnails">
<marquee loop="0" behavior="SCROLL" direction="left" width="90%" scrollamount="1" scrolldelay="1" onmouseover="this.stop()" onmouseout="this.start()">
<table width="100%" cols="' . $limit . '" border="0" cellpadding="4" cellspacing="0" align="center">
<tr align="center">'
.$output.
'</tr>
</table>
</marquee>
<br>
';
if (USER_ID) {
echo 'Welcome to AlaskaStudio.com, and thank you for logging in. As a member
of AlaskaStudio.com you have full access to all functions of this site. We
recently added <b>ecards</b>!';
// do nothing - a user is logged in
// we could print out anything here to say welcome to the logged in user
} else {
echo '<b />You\'re not logged in</b />. <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.';
}
echo '
<tr align="left">
Thank you for visiting AlaskaStudio.com. We strive to bring you the most unique shots of Alaska day in and day out. New photos are added almost daily, so check back often for new photos! Thank you, and enjoy our site!
<br>
</td>
</tr>';
endtable();
}
?>
Thanks for everyones help!
~fare
http://www.AlaskaStudio.com