Page 1 of 1

download manager image/icon path incorrect

Posted: Tue Sep 12, 2006 7:34 pm
by d_cee
Hi

I've installed the download manager on my site but the path to the images/icons is incorrect. It's looking for images at
myurl.com/mounted-storage/plugins/serendipity_event_downloadmanager/img/xxx.png
'mounted-storage' seems to have been added to the actual path.

Any ideas how I can change this?

Dave

Re: download manager image/icon path incorrect

Posted: Tue Sep 12, 2006 7:49 pm
by garvinhicking
Hi!

Did you look into the downloadmanagers plugin configuration? I beleive there you can adjust paths.

HTH,
Garvin

Posted: Tue Sep 12, 2006 11:15 pm
by d_cee
Hi Garvin
Did you look into the downloadmanagers plugin configuration
first place I looked - you can only adjust the paths to the folders the plugin uses for uploading and downloading files.

I don't think i explained well enough what's wrong so I've done a screenshot to show which icon images are missing. It's the path to these missing icons that has an unwanted 'mounted-storage/' in.

Image

thanks
Dave

Posted: Wed Sep 13, 2006 12:18 am
by mgroeninger
I think the problem is the getRelPath() function (I'll post it below). I don't actually ever use this plugin, so I'm not sure of all its intricacies, but it appears to call this function everytime it generates an output path.

Code: Select all

	function getRelPath() {
		global $serendipity;
		$c_path = dirname(__FILE__);
		$b_path = $serendipity['serendipityPath'];
		if ($b_path[(strlen($b_path)-1)] == "/")
			$b_path = substr($b_path, 0, strlen($b_path)-1);
		$r_path = ".".str_replace($b_path, "", $c_path);
		return $r_path;
	}
I would think there is a simpler way to do it, but I'm guessing, especially since I haven't looked at why it was done this way...

Alexander's last post was back in May, so I'm not sure he is following the forums anymore... I might try to figure out what he is using this for, but it will take me a little while...

Posted: Wed Sep 13, 2006 12:23 am
by d_cee
Hi Matt
thanks for your help
Dave

Posted: Wed Sep 13, 2006 10:24 am
by garvinhicking
Hi!

I think we will need to introduce a new variable to configure the HTTP path to the plugin, like in other plugins. Theres technical no save way to deduce a filesystem path into a HTTP path, so you need to enter it.

I can look into that after my holiday.

Best regards,
Garvin

Posted: Wed Sep 13, 2006 1:09 pm
by d_cee
Hi

I've temporarily partially 'fixed' this so that it works on my site by setting $r_path as follows

Code: Select all

$r_path = "http://mywebsite.com/plugins/serendipity_event_downloadmanager";
It works for the folder icons but the plugin seems unable to detect the filetype and allocate the correct icon to the file. But at least my clients can download.

My themes site also uses this plugin and I have no path issues there at all. I'm running Serendipity v.1.0 on the themes site and v1.1alpha4 on my company site.

cheers

Dave

Posted: Mon Nov 06, 2006 11:35 pm
by doug2168
was there ever a fix for this? i've installed this today and i'm missing the icons due to "wrong path" issues. have yet to try up or download.

Posted: Tue Nov 07, 2006 12:34 am
by doug2168
mgroeninger wrote:I think the problem is the getRelPath() function (I'll post it below). I don't actually ever use this plugin, so I'm not sure of all its intricacies, but it appears to call this function everytime it generates an output path.

Code: Select all

	function getRelPath() {
		global $serendipity;
		$c_path = dirname(__FILE__);
		$b_path = $serendipity['serendipityPath'];
		if ($b_path[(strlen($b_path)-1)] == "/")
			$b_path = substr($b_path, 0, strlen($b_path)-1);
		$r_path = ".".str_replace($b_path, "", $c_path);
		return $r_path;
	}
I would think there is a simpler way to do it, but I'm guessing, especially since I haven't looked at why it was done this way...

Alexander's last post was back in May, so I'm not sure he is following the forums anymore... I might try to figure out what he is using this for, but it will take me a little while...
since you had posted this info and i had the time to look @ it and wanted this to work correctly i figured i'd take a shot @ it myself. i don't know anything about php, code or anything of the sort BUT, i did notice that the "." in this statement was being put in the path of the missing pictures: $r_path = ".".str_replace($b_path, "", $c_path); and all i did was delete it from the php file, save it and viola! it worked!

thanks for posting the info.