[Solved]: Thumb by ID number [Solved]: Thumb by ID number
 

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

[Solved]: Thumb by ID number

Started by okiem, January 02, 2009, 11:28:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

okiem

I need to use on Forum code similar to this:

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


Joachim Müller

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.

okiem

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:


<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

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

Nibbler

#3
This should do the job.


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

okiem

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
http://www.genealogia.okiem.pl/foto2/thumbnails.php?id=1245

but it isn't source fot a thumb. Source is f.e.

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

Nibbler


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

okiem

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

Joachim Müller

Quote from: okiem on January 03, 2009, 07:57:17 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.

okiem

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

Joachim Müller

This is not the proper place to discuss moderation policies. Locking.