Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: 1 [2] 3 4 5   Go Down

Author Topic: Photo of the day / week etc, with auto archive albums.  (Read 87071 times)

0 Members and 1 Guest are viewing this topic.

lovingcolorado

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: 1.3x 1.4x Photo of the day / week etc, with auto archive albums.
« Reply #20 on: June 27, 2005, 05:29:29 am »

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.
« Last Edit: June 27, 2005, 02:15:53 pm by lovingcolorado »
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: 1.3x 1.4x Photo of the day / week etc, with auto archive albums.
« Reply #21 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.

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

And change it to this;


Code: [Select]
<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.
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

leotan

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: 1.3x 1.4x Photo of the day / week etc, with auto archive albums.
« Reply #22 on: July 07, 2005, 05:09:01 pm »

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

What was wrong?
Thanks.
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: 1.3x 1.4x Photo of the day / week etc, with auto archive albums.
« Reply #23 on: July 09, 2005, 03:33:41 pm »

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.
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

xmystique

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Photo of the day / week etc, with auto archive albums.
« Reply #24 on: July 13, 2005, 05:09:34 am »

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
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Photo of the day / week etc, with auto archive albums.
« Reply #25 on: July 13, 2005, 08:56:43 pm »

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;

Code: [Select]
<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;

Code: [Select]
$lang_meta_album_names = array(
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

kieranmullen

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Photo of the day / week etc, with auto archive albums.
« Reply #26 on: July 21, 2005, 03:55:25 am »

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
Logged

kieranmullen

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Photo of the day / week etc, with auto archive albums.
« Reply #27 on: July 21, 2005, 04:15:56 am »

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
Logged

kieranmullen

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Photo of the day / week etc, with auto archive albums.
« Reply #28 on: July 21, 2005, 05:23:03 am »

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
Logged

Superior

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Photo of the day / week etc, with auto archive albums.
« Reply #29 on: July 23, 2005, 03:27:43 am »

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???
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Photo of the day / week etc, with auto archive albums.
« Reply #30 on: July 27, 2005, 10:30:45 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;

Code: [Select]
'potd' => 'Photo of the Day',
would be changed to this;

Code: [Select]
'potd' => 'Featured Picture',


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_'

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

graemerae

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Photo of the day / week etc, with auto archive albums.
« Reply #31 on: September 07, 2005, 10:38:07 pm »



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) 

Logged

graemerae

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Photo of the day / week etc, with auto archive albums.
« Reply #32 on: September 10, 2005, 08:02:19 pm »

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:
Code: [Select]
global  $prefix, $dbi; with
Code: [Select]
global  $HTTP_GET_VARS, $prefix, $dbi;
$albumid=$HTTP_GET_VARS['albumid'];

Change the SQL statement from this:


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

To This:

Code: [Select]
   
   $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

Code: [Select]
<?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;
?>





Logged

lovingcolorado

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Photo of the day / week etc, with auto archive albums.
« Reply #33 on: September 25, 2005, 08:42:04 pm »

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.

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

And change it to this;


Code: [Select]
<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.
Logged

leotan

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Photo of the day / week etc, with auto archive albums.
« Reply #34 on: October 01, 2005, 01:24:56 pm »

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

Code: [Select]
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.
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Photo of the day / week etc, with auto archive albums.
« Reply #35 on: October 01, 2005, 02:10:42 pm »

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;

Code: [Select]
cpg_db_query
Replace it with;

Code: [Select]
db_query
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

leotan

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Photo of the day / week etc, with auto archive albums.
« Reply #36 on: October 01, 2005, 06:59:47 pm »

Thanks.. it works now. ;)
Logged

DustyNine

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: Photo of the day / week etc, with auto archive albums.
« Reply #37 on: October 17, 2005, 02:02:00 am »

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?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Photo of the day / week etc, with auto archive albums.
« Reply #38 on: October 17, 2005, 07:37:21 am »

Are there benefits for using it with the PotD?
no
Logged

antisa33

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 181
    • Free french kids coloring
Re: Photo of the day / week etc, with auto archive albums.
« Reply #39 on: October 17, 2005, 07:02:59 pm »

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 !
Logged
Pages: 1 [2] 3 4 5   Go Up
 

Page created in 0.026 seconds with 21 queries.