English (United Kingdom)
Jms Multi Site, formerly joomla multisite.
Create, share multiple joomla sites in few clicks !
Message
  • EU e-Privacy Directive

    This website uses cookies to manage authentication, navigation, and other functions. By using our website, you agree that we can place these types of cookies on your device.

    View e-Privacy Directive Documents

Welcome, Guest
Please Login or Register.    Lost Password?
Go to bottomPage: 12
TOPIC: Mosets Tree image problem
#10525
Mosets Tree image problem 12 Years, 5 Months ago Karma: 0
Hi Edwin,

I just discovered that each slave site's Mosets Tree directory is sharing a single set of image folders:

/components/com_mtree/img/listings/m
/components/com_mtree/img/listings/o
/components/com_mtree/img/listings/s

... and Mosets is renaming images using some internal counter that isn't creating unique file names. Images are named like this:

1.jpg
2.jpg
3.jpg
etc.

Now when I add/edit/delete images on one slave site's directory listing, it's affecting images on the other slave site (and on the master site.)

I could try to hack Mosets Tree to append the date and time to the image filenames, but is there another solution that you're aware of? For example, is there a way to configure JMS to allow different /components/com_mtree/img/listings/ folders for each slave site?

Cheers,
Chris
chrisjclay
Junior Boarder
Posts: 25
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2012/07/24 21:14 By chrisjclay.
The administrator has disabled public write access.
 
#10526
Re:Mosets Tree image problem 12 Years, 5 Months ago Karma: 0
I ended up hacking Mosets to use unique image filenames (via a timestamp) but I'm still curious if another solution is possible via JMS.

Thanks,
Chris
chrisjclay
Junior Boarder
Posts: 25
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#10527
Re:Mosets Tree image problem 12 Years, 5 Months ago Karma: 0
In case anyone else runs into this, here's how I solved the issue. In admin/components/com_mtree/admin.mtree.php I made the following changes...

I searched for this:

Code:

$img_id = $this->_db->insertid();


It's around line 1359. After that line I added a new line:

Code:

//DB Get Current Time
$DBtimestamp = time() . '_';




Then I updated a few lines below to include the timestamp:

Code:

// DB Add timestamp to filename
rename( $old_small_image_path, $mtconf->getjconf('absolute_path') . $mtconf->get('relative_path_to_listing_small_image') . $DBtimestamp . $img_id . '.' . $file_extension);
rename( $old_medium_image_path, $mtconf->getjconf('absolute_path') . $mtconf->get('relative_path_to_listing_medium_image') . $DBtimestamp . $img_id . '.' . $file_extension);
rename( $old_original_image_path, $mtconf->getjconf('absolute_path') . $mtconf->get('relative_path_to_listing_original_image') . $DBtimestamp . $img_id . '.' . $file_extension);

// DB Add timestamp to filename stored in database
$database->setQuery('UPDATE #__mt_images SET filename = ' . $database->quote($DBtimestamp . $img_id . '.' . $file_extension) . ' WHERE img_id = ' . $database->quote($img_id));
$database->query();



I had to do the same thing for the copy listing function in admin.mtree.class.php (around line 1435.)

Chris
chrisjclay
Junior Boarder
Posts: 25
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2012/07/24 22:57 By chrisjclay.
The administrator has disabled public write access.
 
#10530
Re:Mosets Tree image problem 12 Years, 5 Months ago Karma: 54
If you want to modify the Mosets extension, another scenarion would be to use a specific /img/ directory for each website.
You could use the "MULTISITES_ID" value that provide the Site ID to create variant of the /img depending on the website.

Perhaps you could create something like

/img_{site_id}
or
/img/{site_id}

As it seems that the path would be compute at a single place, you would just have to change the directory path.

Perhaps that this idea could help you.
edwin2win
Moderator
Posts: 5370
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#10532
Re:Mosets Tree image problem 12 Years, 5 Months ago Karma: 0
Thanks, a good suggestion. I'll keep it in mind if I discover any complications with the other method I tried above.

Cheers,
Chris
chrisjclay
Junior Boarder
Posts: 25
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#10866
Re:Mosets Tree image problem 12 Years, 2 Months ago Karma: 0
Edwin2win, can you expand on what you recommended below? I understand the part about creating a site specific location however how do we define this with the Multisites or Mosets Tree configuration to force it?
falsealarm
Fresh Boarder
Posts: 10
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 12
get the latest posts directly to your desktop
2Win, Multisite(s) are trademarks of Edwin2Win.
Joomla