Active
Project:
Fotonotes
Version:
6.x-1.1-beta1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Nov 2008 at 18:16 UTC
Updated:
16 Nov 2008 at 18:16 UTC
I have installed Fotonotes into my intranet site. I am able to add/edit fotonotes but there are a couple of issues displaying my images using bb code [inote=%image_nid%] (both concerns fotonotes_bbcode function).
So, the first issue is that Fotonotes uses preview size of an image to add/edit notes but further replaces [inote] with _original size (it leads to invalid dimensions for notes), to fix this I have replaced
$r = db_fetch_object(db_query("SELECT f.filepath FROM {image} i INNER JOIN {files} f ON f.fid = i.fid WHERE i.image_size = '_original' AND i.nid = %d", $nid));
with
$r = db_fetch_object(db_query("SELECT f.filepath FROM {image} i INNER JOIN {files} f ON f.fid = i.fid WHERE i.image_size = 'preview' AND i.nid = %d", $nid));
It uses "preview" size of an image for add/edit and preview image with fotonotes.
The second issue goes with spaces in image filename. The fix is also a simple one, just replace the
$x = "<img src=" . base_path() . $r->filepath . " class=fn-image id=inote" . $nid . ">";
with
$x = "<img src='" . base_path() . $r->filepath . "' class=fn-image id=inote" . $nid . ">";
I hope this was helpful.
This module rocks! Thanks