G2image img/anchor tags: can we put the hostname in somehow?

belloq

Joined: 2004-06-03
Posts: 43
Posted: Tue, 2007-09-04 18:09

Love the v3 interface. Nice stuff. I am using Drupal 5.2 with Gallery 2.2.3, and Gallery plugin 5.x-2.x-dev.

I have a request (not sure if it's out there) for the inserted HTML tags (not the filter), both img and anchor: The links are inserted with a absolute pathname without the hostname. When blogs are viewed in some web-based feed readers, the images are not viewable because the source is pulled over and displayed as-is. Therefore, the image fails to display because the reader is looking for /index= ... which it can't resolve on the web-based reader's site. It would be great if we could manually configure the pathname the G2image plugin uses to include the hostname.

I am not sure, however, if this is something which should be addressed rather in the Drupal feeds module or in the G2image plugin.

Oh, also, I have manually configured the Gallery plugin for Drupal with the full hostname path to the embedded and standalone Gallery. I was hoping G2image would pick up and use these settings as well, but it doesn't seem to.

Thanks for considering options for me or code changes to the plugin to address this request.

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Tue, 2007-09-04 18:21

Try changing forceServerRelativeUrl to forceFullUrl in lines 94, 235, 239, and 240 of g2image.php. (EDIT: Those line numbers have probably changed, now that I think about it, due to post-beta bug fixes in my working copy. But that gives you an idea about where to look. You can do a global search-and-replace in g2image.php, since those are the only four occurrences of forceServerRelativeUrl.)

For 3.1, I'll add an option in config.php to use full URLs which will automate this switch. It's an easy add.

Anyone's thoughts on which way it should default? My thought is to default to full, with the option to back down to server relative. That way, blog entries will show images in web-based readers by default, but if someone doesn't need it and wants to save the few characters in the generated HTML, they can go to server relative.

Thanks,
Kirk

 
belloq

Joined: 2004-06-03
Posts: 43
Posted: Thu, 2007-09-06 17:31

Thanks Captain. I'll give that a try next time I have a few minutes to do so, and post back the results.