Photo of the day / week etc, with auto archive albums. - Page 2 Photo of the day / week etc, with auto archive albums. - Page 2
 

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

Main Menu

Photo of the day / week etc, with auto archive albums.

Started by Casper, February 07, 2005, 01:16:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lovingcolorado

#20
I followed the instructions for my installed version of coppermine (was an autoinstall through my webhosting).  I had the same problems as MonkeyManx.  After fixing the Archive problem, I still get the dreaded red x where my POTW picture should be.  

Is there something else in the php code that I need to change for the image to show properly?

I followed the instructions to the letter for my version, and only uploaded the two files I needed to be able to show POTW on the index ( page of the website (on the same server as coppermine).  

Coppermine version 1.3.2 with the eyeball theme    http://www.violetaholicsanonymous.org/museum/
The page I am trying to get to show my POTW is here:    http://www.violetaholicsanonymous.org

Sorry if this is a stupid question, but this is a great mod and I would like to figure out what I am doing wrong.

Casper

The only thing you are doing wrong is trying to use a photo that has no 'normal' and 'full size' version.

Because the photo you are trying to display is smaller than the size you set for intermediate pics, coppermine does not create an intermediate version.  But this mod uses that version.

Try it with a larger pic.

Alternatively, you could edit your showweekpic.php.  Find this.

<img src=\"albums/{$picture['filepath']}normal_{$picture['filename']}\"


And change it to this;


<img src=\"albums/{$picture['filepath']}{$picture['filename']}\"

The mod will then show the full size pic, whatever the size.  But this may give you formatting problems if you use a large photo.
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

leotan

I got the message the 'The selected album/file does not exist ! '
when I try to go to the archive...

What was wrong?
Thanks.

Casper

Don't know.  You'll have to give more info than that, such as what files are you using.  What archive are you trying to view?  Have you replaced all the files with the ones in the download?

A link would help.
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

xmystique

i tried to install this, but stopped after the last find/replace on editpics.php and the first find/add on english.php couldnt be found at all. i searched the entire files and the code listed in the doc is nowhere to be found.

i am using version 1.33

Casper

You have found an error in my code for the last find in editpics php.  It includes one line that is only in version 1.4 files.

The code you need to replace is this, which in an unmoded file will be about line 254;

<tr>
                <td class="tableb" colspan="3" align="center">
                    <table border="0" cellspacing="0" cellpadding="0" width="100%">
                        <tr>
                            <td width="20%" align="center"><input type="checkbox" name="delete{$CURRENT_PIC['pid']}" id="delete{$CURRENT_PIC['pid']}" value="1" class="checkbox"><label for="delete{$CURRENT_PIC['pid']}" class="clickable_option">{$lang_editpics_php['del_pic']}</label></td>
                            <td width="20%" align="center"><input type="checkbox" name="reset_vcount{$CURRENT_PIC['pid']}" id="reset_vcount{$CURRENT_PIC['pid']}" value="1" class="checkbox"><label for="reset_vcount{$CURRENT_PIC['pid']}" class="clickable_option">{$lang_editpics_php['reset_view_count']}</label></td>
                            <td width="20%" align="center"><input type="checkbox" name="reset_votes{$CURRENT_PIC['pid']}" id="reset_votes{$CURRENT_PIC['pid']}" value="1" class="checkbox"><label for="reset_votes{$CURRENT_PIC['pid']}" class="clickable_option">{$lang_editpics_php['reset_votes']}</label></td>
                            <td width="20%" align="center"><input type="checkbox" name="del_comments{$CURRENT_PIC['pid']}" id="del_comments{$CURRENT_PIC['pid']}" value="1" class="checkbox"><label for="del_comments{$CURRENT_PIC['pid']}" class="clickable_option">{$lang_editpics_php['del_comm']}</label></td>
                        </tr>
                    </table>
                </td>
        </tr>

EOT;
        }
}



I don't see how you cannot find this code, which is in all language files;

$lang_meta_album_names = array(

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

kieranmullen

I edited the pics fine but then when I go tot he main page

Fatal error: Call to undefined function cpg_db_query() in /home/virtual/site30/fst/var/www/html/potd.php on line 39

I have the page uploaded.  I am sure I did somethign wrong of course.


Another problem. IN order to work with mod you must edit pics in the albums. Would it be good to have the move to file of the day directly in the picture itself when editing description instead?  I only want to have file of the day on my main page.  I have a html based menu for the rest.

Thanks

Kieran Mullen

kieranmullen

OK I am ansering my own question > I didnt make the changes to the other files as I am running 1.3  However I think my last point is still valid.

Also when I go to edit pics and I click "Add to archive and add to file of the day. Hit apply and basically the screen just refreshes. Nothing changes

Also how could I change it from File of the day to something like featured picture etc?

I managed to upload one before I had my previous error but there is no picture of it on the main page however theempy image (as a X on ie) is still a valid link to the right file.

Any ideas?

Thanks!

KM

kieranmullen

OK I found out what it was. It was a gif problem. 

So now that I also edit the sql to show a thumb instead of a normal image and a title...

How can I edit albums without having the albums in the config?

Thanks!

KM

Superior

Dear,
I want to show My POTD on my websites main page.My template does not allow me to add large pics. So can i resize my pictures to show on main page???

Casper

Quote from: kieranmullen on July 21, 2005, 04:15:56 AM
Also how could I change it from File of the day to something like featured picture etc?

In the changes you made to the language file, just change that accordingly, i.e., this;

'potd' => 'Photo of the Day',

would be changed to this;

'potd' => 'Featured Picture',



Quote from: Superior on July 23, 2005, 03:27:43 AM
I want to show My POTD on my websites main page.My template does not allow me to add large pics. So can i resize my pictures to show on main page???

The mod uses the 'normal', (intermediate) size picture stored on the server.  It cannot re-size photos, but it can be changed to use the full-sized pic or the thumb.  To use the thumb, just search the hack code for all cases of 'normal_' and replace it with 'thumb_'.  To use the full-size, just remove the 'normal_'

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

graemerae



OK - Feature request :

I've got POTD/POTW running beautifully on my coppermine - photos.surfline.com - (Locked at the moment until I bridge it to vbulletin) - Is there any chance of this feature being expanded to have a POTD or POTW on a per ALBUM basis, not just one for an entire gallery.  For example, I've got a dozen galleries for different regions of the world and I'd love to be able to specify different pics for different regions (that then appear on a separate website)

Any clues?  I managed to hack the code of menalto to do this, but the php and sql of coppermine are a little beyond my standard skills. 

We'd actually be willing to (gasp) pay someone to make this change - within reason.

PM for login password if you're interested in helping out.

(Running cpg134) 


graemerae

OK I figured this out myself -

I only did it in weekthumb.php - I imagine modifying the others is simple, but this is the only
one I wanted:

replace:
global  $prefix, $dbi;
with
global  $HTTP_GET_VARS, $prefix, $dbi;
$albumid=$HTTP_GET_VARS['albumid'];


Change the SQL statement from this:


   
   $result = db_query("SELECT pid, aid, filepath, filename, owner_name, owner_id from {$CONFIG['TABLE_PICTURES']} WHERE potw='1', $dbi);


To This:

   
   $result = db_query("SELECT pid, aid, filepath, filename, owner_name, potw_date, owner_id, caption from {$CONFIG['TABLE_PICTURES']} WHERE potw='1' AND aid='{$albumid}' ORDER BY 'potw_date' DESC", $dbi);


I added caption and ORDER BY ''potw_date', as I wanted the last POTW to always appear and I wanted the caption too.


Then call it as weekthumb.php?albumid=###

Where ### is the ID of the album you want.


If you want to see it in action:

photos.surfline.com has all my albums.

www.surfline.com has a random featured photo pulled into it (middle bottom)

And if you go to any regional surf page (Southern California for example) it only pulls the POTW for that region.


Here's the full code of weekthumb.php


<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2005 Coppermine Dev Team
  v1.1 originaly 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 as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.1
 
**********************************************/

/**
* Coppermine Photo Gallery 1.4.1 weekthumb.php
*
* This file can be called using an iframe into any other page
*
* @copyright 2002,2005 Gregory DEMAR, Coppermine Dev Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Lic
ense V2
* @package Coppermine


{$lang_meta_album_names['by']}</small><b> <a href=\"thumbnails.php?album=lastupb
y&uid={$picture['owner_id']}\" target=\"new\">{$picture['owner_name']}</a></b>


*/

define('WEEKTHUMB_PHP'true);
define('IN_COPPERMINE'true);

require(
'include/init.inc.php');

global  $HTTP_GET_VARS$prefix$dbi
$albumid=17;

print 
$HTTP_GET_VARS['albumid'];
$albumid=$HTTP_GET_VARS['albumid'];


{
    
   $result 
db_query("SELECT pid, aid, filepath, filename, owner_name, potw_dat
e, owner_id, caption from 
{$CONFIG['TABLE_PICTURES']} WHERE potw='1' AND aid='{$
albumid}' ORDER BY 'potw_date' DESC"$dbi);

    
  $picture 
mysql_fetch_array($result); 
  
 
  $aid
=$picture['aid'];
  
  $result2 
db_query("SELECT title from {$CONFIG['TABLE_ALBUMS']} WHERE aid='{$
aid}'"$dbi);
   
  $album 
mysql_fetch_array($result2); 
   
   
   
   
  $img 
"<img src=\"/albums/{$picture['filepath']}thumb_{$picture['filename']}\
"
  border=\"0\">"
   


   $content 
.= "<table><tr><td><center><a href=\"http://photos.surfline.com/disp
layimage.php?album=
{$picture['aid']}&pos=-{$picture['pid']}\" target=\"new\">$im
g</a><br /><br /> 
 
{$picture['caption']}
 
<br /> 
 From: <a href=\"http://photos.surfline.com/thumbnails.php?album=
{$aid}\"> {$alb
um
['title']}
 </a>
<br /><br />

 

 </center></td></tr></table>

"

$stop++; 


print 
$content;
?>







lovingcolorado

Quote from: Casper on July 01, 2005, 12:49:10 AM
The only thing you are doing wrong is trying to use a photo that has no 'normal' and 'full size' version.

Because the photo you are trying to display is smaller than the size you set for intermediate pics, coppermine does not create an intermediate version. But this mod uses that version.

Try it with a larger pic.

Alternatively, you could edit your showweekpic.php. Find this.

<img src=\"albums/{$picture['filepath']}normal_{$picture['filename']}\"


And change it to this;


<img src=\"albums/{$picture['filepath']}{$picture['filename']}\"

The mod will then show the full size pic, whatever the size. But this may give you formatting problems if you use a large photo.


Thanks Casper!  I finally got it to work.  I had to leave it alone for a long while after being too frustrated with it...but once I took a fresh look at it with your help, it works great now.  Thanks a ton!  You are awesome! 

Lori
lovingcolorado in Denver, Co.

leotan

I have got this error while trying to view the archive.

Fatal error: Call to undefined function: cpg_db_query() in /var/www/html/gallery/include/functions.inc.php on line 706

Anyone can help me?
Thanks.

Casper

That error is likely if you have version 1.3x of coppermine, and did not change the queries.

If you do have 1.3x, open include/functions.inc.php and find;

cpg_db_query

Replace it with;

db_query
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

leotan


DustyNine

Although there's possibly bugs and no support, does it make sense to upgrade to 1.4? Are there benefits for using it with the PotD?

Joachim Müller


antisa33

Hello
I dont understand if you mod can do that i want !
I would like to put a photo of the day but automatically.
I have seen a website where we can put our script and the website run the cron automatically.
Did somebody do the photo of the day automatically ?
Thanks !