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: Nice preview of coppermine pictures  (Read 8547 times)

0 Members and 1 Guest are viewing this topic.

hama

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 229
Nice preview of coppermine pictures
« 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
Logged
Get up, stand up, stand up for your rights! - Get up, stand up, don't give up the fight!

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Nice preview of coppermine pictures
« Reply #1 on: November 21, 2004, 12:48:59 pm »

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.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

hama

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 229
Re: Nice preview of coppermine pictures
« Reply #2 on: November 21, 2004, 09:19:26 pm »

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?

Code: [Select]
<?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_set0, -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.'&amp;file=displayimage&amp;album='.$row['aid'].'&amp;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
Logged
Get up, stand up, stand up for your rights! - Get up, stand up, don't give up the fight!

Andi

  • VIP
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 85
  • Join the Future
    • www.pragmamx.org
Re: Nice preview of coppermine pictures
« Reply #3 on: December 12, 2004, 08:14:39 pm »

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
« Last Edit: December 12, 2004, 09:58:27 pm by Andi »
Logged
hope, I could help you... :)

snork13

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 260
  • Internet! Is that thing still around?
    • Gallery
Re: Nice preview of coppermine pictures
« Reply #4 on: December 12, 2004, 08:41:14 pm »

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
Logged

hama

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 229
Re: Nice preview of coppermine pictures
« Reply #5 on: December 12, 2004, 09:13:44 pm »


@Andi

Quote
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
Logged
Get up, stand up, stand up for your rights! - Get up, stand up, don't give up the fight!

Andi

  • VIP
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 85
  • Join the Future
    • www.pragmamx.org
Re: Nice preview of coppermine pictures
« Reply #6 on: December 12, 2004, 09:57:26 pm »

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

Logged
hope, I could help you... :)

fareforce

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 66
  • Who are you calling a weasel?
    • Alaska Studio
Re: Nice preview of coppermine pictures
« Reply #7 on: December 12, 2004, 10:04:53 pm »

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
Logged
~fareforce
Anchorage, AK
Home of the frozen weasel
http://www.alaskastudio.com

snork13

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 260
  • Internet! Is that thing still around?
    • Gallery
Re: Nice preview of coppermine pictures
« Reply #8 on: December 12, 2004, 10:17:05 pm »

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
Logged

fareforce

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 66
  • Who are you calling a weasel?
    • Alaska Studio
Re: Nice preview of coppermine pictures
« Reply #9 on: December 12, 2004, 10:46:33 pm »

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:

Quote
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:

Code: [Select]
<?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
Logged
~fareforce
Anchorage, AK
Home of the frozen weasel
http://www.alaskastudio.com

Andi

  • VIP
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 85
  • Join the Future
    • www.pragmamx.org
Re: Nice preview of coppermine pictures
« Reply #10 on: December 12, 2004, 10:59:09 pm »

Hi fareforce,
Quote
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 ;)

Logged
hope, I could help you... :)

fareforce

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 66
  • Who are you calling a weasel?
    • Alaska Studio
Re: Nice preview of coppermine pictures
« Reply #11 on: December 12, 2004, 11:04:58 pm »

I have played with it some more.

I did use your last file, I just added :

Code: [Select]
<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:
Code: [Select]
<?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
Logged
~fareforce
Anchorage, AK
Home of the frozen weasel
http://www.alaskastudio.com

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Nice preview of coppermine pictures
« Reply #12 on: December 12, 2004, 11:12:05 pm »

I don't know why you decided to jump in and out of php.  Try this:

Code: [Select]
<?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();
?>
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

fareforce

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 66
  • Who are you calling a weasel?
    • Alaska Studio
Re: Nice preview of coppermine pictures
« Reply #13 on: December 12, 2004, 11:43:21 pm »

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:

Code: [Select]
<?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_set0, -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'].'&amp;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
Logged
~fareforce
Anchorage, AK
Home of the frozen weasel
http://www.alaskastudio.com
Pages: [1]   Go Up
 

Page created in 0.034 seconds with 20 queries.