display size of inline image attachments (screenshots)

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
atomoid
Posts: 108
Joined: 18 Aug 2005, 00:46
Location: santa cruz, ca

display size of inline image attachments (screenshots)

Post by atomoid »

According to the new feature for Mantis 1.1 as outlined in Mantis bug http://bugs.mantisbt.org/view.php?id=6252

I tried the quick manual patch by editing the core/file_api.php in my Mantis 1.0.1 installation

Code: Select all

Replace:
PRINT "
<img src=\"file_download.php?file_id=$v_id&type=bug\" />";

With:
PRINT "
$t_href_start<img style="border:0; max-width:500; max-height:250;" src=\"file_download.php?file_id=$v_id&type=bug\" />$t_href_end";
...however, this results in the error:
Parse error: parse error, unexpected T_STRING in /home/httpd/mantis/core/file_api.php on line 193

Is there something else i need to do to get this to work?
vboctor
Site Admin
Posts: 1304
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Post by vboctor »

Try the following:

Code: Select all

PRINT "
$t_href_start<img style=\"border:0; max-width:500; max-height:250;\" src=\"file_download.php?file_id=$v_id&type=bug\" />$t_href_end";
atomoid
Posts: 108
Joined: 18 Aug 2005, 00:46
Location: santa cruz, ca

Post by atomoid »

Thanks,
I gave it a few tries and the parse error is gone, but existing images arent resized. If i upload a new image it isnt resized either.

Is editing this line in the "file_api.php" all that i should need to do?
I dont think i quite understand whats going on with the "$t_href_start" variable, is it hooked into another file that needs to be tweaked as well?

do i need other changes from 1.0.3 (im using 1.0.1) to make this work?
Thanks for the help!
Post Reply