download manager image/icon path incorrect

Creating and modifying plugins.
Post Reply
d_cee
Regular
Posts: 603
Joined: Wed Jan 18, 2006 6:32 pm
Location: UK
Contact:

download manager image/icon path incorrect

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: download manager image/icon path incorrect

Post by garvinhicking »

Hi!

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

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
d_cee
Regular
Posts: 603
Joined: Wed Jan 18, 2006 6:32 pm
Location: UK
Contact:

Post 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
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post 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...
d_cee
Regular
Posts: 603
Joined: Wed Jan 18, 2006 6:32 pm
Location: UK
Contact:

Post by d_cee »

Hi Matt
thanks for your help
Dave
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
d_cee
Regular
Posts: 603
Joined: Wed Jan 18, 2006 6:32 pm
Location: UK
Contact:

Post 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
doug2168
Regular
Posts: 16
Joined: Sun Nov 05, 2006 8:36 pm

Post 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.
doug2168
Regular
Posts: 16
Joined: Sun Nov 05, 2006 8:36 pm

Post 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.
Post Reply