URL Rewriting created problems with thumbnails

Any tips and tricks that has to with the ADDT that doesn't fit into one of the other categories
iKollect
Posts: 7
Joined: 2011-05-22 19:09

URL Rewriting created problems with thumbnails

Post by iKollect » 2011-07-13 17:30

I've used ADDT Server Behavior to generate Thumbnails ( InterAkt probably looks the same:Server Behaviors->+->Developer Toolbox->File Upload->Show Thumbnail)
I have changed the way the links of my project look, using a .htaccess file like this:

Code: Select all

RewriteEngine On RewriteRule ^page_name/([0-9-/|]+)/([0-9-]+)/?$ /Page.php?this=$1&that=$2 [NC,L] 
old url:

Code: Select all

http://www.mysite.com/mypage.php?this=1&that=2
new url:

Code: Select all

http://www.mysite.com/keywords/this/that 
but now the thumbnails I had aren't showing anymore: (must be because I'm using relative paths). Here is how ADDT code looks like:

// Show Dynamic Thumbnail
$objDynamicThumb1 = new tNG_DynamicThumbnail("", "KT_thumbnail1");
$objDynamicThumb1->setFolder("images/article/");
$objDynamicThumb1->setRenameRule("{rsArticle.Picture}");
$objDynamicThumb1->setResize(200, 0, true);
$objDynamicThumb1->setWatermark(false);

and lower in the php page to show the thumbnail:
<div><img border="0" src="<?php echo $objDynamicThumb1->Execute(); ?>" />bla bla bla

QUESTION: Is there a way to put absolute links here:
$objDynamicThumb1->setFolder("images/article/");
I've tried it, didn't work, or maybe i'm doing it wrong. Please give example.
Or if smbd has another solution, ANY SOLUTION, PLEASE POST, and stay on this topic cause i'll post answers quite fast.

iKollect
Posts: 7
Joined: 2011-05-22 19:09

Re: URL Rewriting created problems with thumbnails

Post by iKollect » 2011-07-13 19:59

Just found out that in order to put an absolute path, modifications have to be made into the tNG_DynamicThumbnail.class.php from the includes/tng/triggers folder, but I don't know what should be done.

User avatar
Fred
Site Admin
Posts: 491
Joined: 2010-02-15 12:10
Location: Armagh, Northern Ireland
Contact:

Re: URL Rewriting created problems with thumbnails

Post by Fred » 2011-07-14 17:37

You are loosing the paths to the included js files

You have two options.
1. Use the html <base> tag

Code: Select all

<head>
<base href="http://www.invaliddomain.co.uk/your_includes_folder/" />
</head>
2. Specify the actual path for each file

Post Reply