forum.coppermine-gallery.net
Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: okiem on January 02, 2009, 11:28:38 am
-
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?
-
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.
-
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.
-
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
-
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
-
<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?
-
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 :)
-
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.
-
Silly look post with mistakes wich cannot be corrected - it is normal, human activity.
-
This is not the proper place to discuss moderation policies. Locking.