Advanced search  

News:

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

Pages: [1]   Go Down

Author Topic: [Solved]: Thumb by ID number  (Read 5263 times)

0 Members and 1 Guest are viewing this topic.

okiem

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 40
[Solved]: Thumb by ID number
« on: January 02, 2009, 11:28:38 am »

I need to use on Forum code similar to this:

Code: [Select]
<a href="http://mygallery.com/displayimage.php?pos=-{NUMBER}"><img src="http://mygallery.com/blabla_thumb?id={NUMBER}"/></a>
Important is that {NUMBER} is the same in both code. Link is already done and used. but I cannot get thumb by ID-NUMBER

Could someone help me to add this opportunity to the gallery?

« Last Edit: January 03, 2009, 11:14:20 pm by Nibbler »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Thumb by ID number
« Reply #1 on: January 03, 2009, 11:27:05 am »

Depends on where you want to add this. Post details, like a link to your gallery, the exact URL you want that piece of code to reside on and especially in which section of the screen that piece of code is suppossed to show up.
Related to theming, moving accordingly.
Logged

okiem

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 40
Re: Thumb by ID number
« Reply #2 on: January 03, 2009, 07:57:17 pm »

sorry - once more - because I cannot edit post (why?!?)

I think it doesn't matter where I want to post this code - just on the regular html page. Actually I want to use it on the forum (www.genealogia.okiem.pl/forum) and my gallery is here: www.genealogia.okiem.pl/foto2

So: I need to have code like:


Code: [Select]
<a href="http://www.genealogia.okiem.pl/displayimage.php?pos=-1234"><img src="http://www.genealogia.okiem.pl/blabla_thumb?id=1234"/></a>

Using those code I can prepare BBCode on Forum looked like

Code: [Select]
[th]1234[/th]

First part of html code I can take from info table below picture, but there is no possibility to get a thumb the same way. So I thought about preparing small php page "blabla_thumb.php" where question of "id" will find exact thumb - the same as question "pos" in href code.

The way how I can gat it is not important.

On finish I need to have thumb linking to picture page - seeing on the regular html page, and have to prepare simple BBCode.
Logged

Nibbler

  • Guest
Re: Thumb by ID number
« Reply #3 on: January 03, 2009, 10:11:54 pm »

This should do the job.

Code: [Select]
<?php

define
('IN_COPPERMINE'true);

require 
'include/init.inc.php';

$pid = (int) $_GET['id'];

$result cpg_db_query("SELECT filename, filepath, url_prefix FROM {$CONFIG['TABLE_PICTURES']} WHERE pid = $pid $ALBUM_SET");

if (!
mysql_num_rows($result)) {
    die(
'Unknown picture');
}

$row mysql_fetch_assoc($result);

$thumb get_pic_url($row'thumb');

$type cpg_get_type($row['filename']);

header('Content-type: ' $type['mime']);

readfile(urldecode($thumb));


Edited to fix bug with special chars in filenames - Nibbler 02/03/09
« Last Edit: March 02, 2009, 09:13:18 pm by Nibbler »
Logged

okiem

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 40
Re: Thumb by ID number
« Reply #4 on: January 03, 2009, 10:29:41 pm »

hmmm... this doesn't work ....

result is a code - but i need a URL (source to the thumb)
if I use right code a need to see a picture on this html page where I put a code:   ...../thumb.php?id=1234

this what I see is a place for picture with a code
Code: [Select]
http://www.genealogia.okiem.pl/foto2/thumbnails.php?id=1245
but it isn't source fot a thumb. Source is f.e.

Code: [Select]
http://www.genealogia.okiem.pl/foto2/albums/userpics/10353/thumb_Kalusz_-_ul__Micewicza_1916.jpg
"Kalusz_-_ul__Micewicza_1916.jpg" - is taking from a database by ID
Logged

Nibbler

  • Guest
Re: Thumb by ID number
« Reply #5 on: January 03, 2009, 10:54:27 pm »

Code: [Select]
<a href="http://www.genealogia.okiem.pl/foto2/displayimage.php?pos=-1234"><img src="http://www.genealogia.okiem.pl/foto2/thumb.php?id=1234" /></a>

That's what you asked for isn't it?
Logged

okiem

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 40
Re: Thumb by ID number
« Reply #6 on: January 03, 2009, 11:08:13 pm »

oh - I am sorry - I didn't refresh all pages

yes - it looks working - Thank you very much - I hope I will have no more problem with this :)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Thumb by ID number
« Reply #7 on: January 04, 2009, 02:11:47 pm »

because I cannot edit post (why?!?)
Because we don't want you to edit your postings, making the replies to them look silly. The feature to edit postings has been disabled deliberately.
Logged

okiem

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 40
Re: [Solved]: Thumb by ID number
« Reply #8 on: January 05, 2009, 12:01:02 am »

Silly look post with mistakes wich cannot be corrected - it is normal, human activity.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: [Solved]: Thumb by ID number
« Reply #9 on: January 05, 2009, 07:51:03 am »

This is not the proper place to discuss moderation policies. Locking.
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.