We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

help with path OW::getPluginManager() | Forum

Ken
Ken Oct 22 '20
someone help how come I use this 


$thumb = OW::getPluginManager()->getPlugin( 'pluginkey' )->getUserFilesDir() . $item->id . '.jpg';

it works because it the right path but doesn't work to display image because it display the whole host path  /home/host/public_html/ow_userfiles/plugins/pluginkey/86.jpg

instead I need it to be like this

website.com/ow_userfiles/plugins/pluginkey/86.jpg

what am I doing wrong

The Forum post is edited by Ken Oct 22 '20
Marcus
Marcus Oct 22 '20
change home path in config.php or simply use str_replace or preg_replace
The Forum post is edited by Marcus Oct 22 '20
Patricia Zorrilla Leader
Patricia Zorrilla Oct 22 '20

You are not confusing the URL with the PATH?


$url = 'ow_userfiles' .DS. 'plugins' .DS. 'miplugin' .DS. $itemId . ".jpg";


$path = OW::getPluginManager()->getPlugin(''miplugin')->getUserFilesDir() . $itemId . ".jpg";


Ken
Ken Oct 22 '20
Tried them doesn’t work 
why this code worked with path not url any other suggestions 
The Forum post is edited by Ken Oct 22 '20
Dev Forward
Dev Forward Oct 22 '20
I believe what you are looking for is getUserFilesUrl:



$thumb = OW::getPluginManager()->getPlugin( 'pluginkey' )->getUserFilesUrl() . $item->id . '.jpg';

Ken
Ken Oct 22 '20
ok thanks Patricia so much I got it to work using this

  $item->hasImage = OW::getPluginManager()->getPlugin( 'pluginkey' )->getUserFilesDir() . $item->id . '.jpg';


    if (file_exists($item->hasImage)) {        $thumb = 'ow_userfiles' .DS. 'plugins' .DS. 'pluginkey' .DS. $item->id . ".jpg";    } else {        $thumb = OW::getPluginManager()->getPlugin( 'pluginkey' )->getStaticUrl() . 'images/default.png';    }

Ken
Ken Oct 24 '20
Thanks too dev forward yours actually is way better across the site the one that I found worked Works on certain pages not all thanks A lot dev forward 
REHMAN
REHMAN Apr 19
Are not they in a hurry? Do not they want to find the outpost? Need not Kirk get back to the ship? Yet they sit there, having a talk and barbecue around a log fire. tydo88
REHMAN
REHMAN Apr 19
Are not they in a hurry? Do not they want to find the outpost? Need not Kirk get back to the ship? Yet they sit there, having a talk and barbecue around a log fire. tydo88
REHMAN
REHMAN Apr 19
Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me. kids smartwatch
REHMAN
REHMAN Apr 25
That are most certainly awesome. A great number of tiny details are designed needing lot of qualifications ability. We're attracted in the piece many. natraj pencil packing job
REHMAN
REHMAN Apr 25
That are most certainly awesome. A great number of tiny details are designed needing lot of qualifications ability. We're attracted in the piece many. natraj pencil packing job