Closed (won't fix)
Project:
Image
Version:
4.5.x-1.x-dev
Component:
gd toolkit
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
4 Jan 2005 at 16:41 UTC
Updated:
29 Nov 2005 at 16:48 UTC
The image.module does not use any filters to display the node's body, which deprecates the use of the weblink,module somewhat.
I patched two functions in the image.module file to remedy this. For this to work the default format must allow the
tag.
function image_view(&$node, $main = 0, $page = 0) {
$rand = "";
// If random suffix is enabled or we have a new image add random suffix.
if (variable_get("image_random_suffix", "0") || $node->image_id) {
$rand = rand();
}
node_image_content($node, $rand, $main, $page);
// added to run through filters
node_prepare($node);
}
and
function node_image_content(&$node, $rand, $main = 0, $page = 0) {
global $base_url;
if ($main) {
// check if the thumbnail file exists, and create it if it doesn't
if (!file_exists($node->thumb_path)) {
_image_make_thumbnail($node->image_path, $node->thumb_path);
}
if($rand) {
$node->teaser = "<img class=\"thumb\" src=\"$base_url/$node->thumb_path?".$rand."\" />" . $node->teaser;
}
else {
$node->teaser = "<img class=\"thumb\" src=\"$base_url/$node->thumb_path\" />" . $node->teaser;
}
// filter the teaser
node_prepare($node,true);
}
.
.
.
Comments
Comment #1
jhm commentedI just posted this a little prematurely and it stripped out some important information. Here is a paragraph with the missing piece:
Comment #2
slower commentedThis doesn't seem to work for me. I have both the glossary and contentlinks modules which should apply to a couple of my image descriptions, but neither are being filtered in. I don't think I fully understand when/where/how the filters apply -- for instance, why isn't there a "filter_form" function beneath the Description textarea? If it's missing, does only the default filter apply in those cases? Anyway, node_prepare isn't doing the trick -- any suggestions?
Comment #3
basicmagic.net commentedhello all-
i am running drupal 4.5.2 with image.module 1.138.
made the following two fixes to image.module (#1 and #2 at bottom)-
and now i have at least the weblink and inline filters working great in all of the teasers / descriptions for images.
please note that the two hacks account for getting input filters to be processed correctly-
in both the image taxonomy / term generated views like:
http://www.ralphdeluca.com/taxonomy/term/12
and also in any of the image module / node generated views like:
http://www.ralphdeluca.com/node/12
http://www.ralphdeluca.com/12?res=640x480
http://www.ralphdeluca.com/node/12?res=800x600
finally- i had to make the following settings in input formats (#3 at bottom).
next up is i am hacking the web link module- with a similar issue- that in the weblink teasers and descriptions (module view) the filters are not working- although they are working in the taxonomy views.
if anybody has any insight or comments on what i am doing right or wrong here... please advise and comment.
i am just a hacker- trying to get something to work like i need / want it to...
#1 find this original code in image.module:
change to:
#2 find this original code in image.module:
change to:
#3 input format settings- (set filtered html as default)
1. default filtered html:
- filter html tags (strip tags)
- add the follwing tags to the allowed html tags:
<br><p><img><class><src>- html style attributes allowed
- arrange filter order and weights like this:
line break conv -10
inline -9
weblink -8
html 0
2. php:
- arrange filter order and weights like this:
inline -10
weblink -9
php 0
3. full html:
- arrange filter order and weights like this:
line break conv -10
inline -9
weblink -8
Comment #4
walkah commented