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: 1
TOPIC: Remository 3.52.8
#2349
Remository 3.52.8 14 Years, 6 Months ago Karma: 0
hi there,

I have installed Remository on my test session now

Joomla Multi Sites version: 1.2.10 (Latest available: 1.2.10)
Patches definition version: 1.2.13 (Latest available: 1.2.13)

after adjusting the config I went to tools and selected my dummy site

here I selected to install Remository from master and ticked the checkbox to propagate to children

then I went to the two slaves and created component type menu items

I submitted a file with 1 image each on either of the slave sites

iwent and checked the files in filelist which looked ok. I can see the file with the appropriate title, the image I added and the download is working

however when going to fileinfo I noticed that each of the files displays 2 image, i.e. all the images with ID 1 are being displayed on either slave site

checking the db shows that table slv000_downloads_files & slv001_downloads_files hold the correct data - both files come with fileID = 1

checking the file structure shows that both images are in ../components/com_remository_files/file_image_1

also despite having disabled database storage of files I cannot find them anywhere on the server

could you please advice what I'm doing wrong?
chrissy6930
Senior Boarder
Posts: 58
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#2353
Re:Remository 3.52.8 14 Years, 6 Months ago Karma: 54
No idea.
The only solution that I see would be to debug on your environment and try identifying the peace of code that produce those 2 infos.
Once identified, it will be more easier to understand the origin of this issue.

If you want that we debug on your environment, this is possible with our billable support that you can order on www.jms2win.com/download?page=shop.produ...35&category_id=1
edwin2win
Moderator
Posts: 5370
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#2365
Re:Remository 3.52.8 14 Years, 6 Months ago Karma: 0
I will start with images::

when saving a submission there is first
the savefile_controller which is being called (com_remository/c-classes)
which in turn is calling the savethumb_controller (c-classes)
which is calling function addImage in remositoryThumbnails (p-classes)

Code:

public function addImage ($physicalFile, $fileid, $legend='', $remositoryFile=false) {
$interface = remositoryInterface::getInstance();
if ($nextfree = $this->getNextFree()) {
$filepath = $interface->getCfg('absolute_path').$this->filepath;
if (!is_dir($filepath)) mkdir($filepath);
$file_to_fix = $filepath.time().$physicalFile->proper_name;
if ($remositoryFile) $physicalFile->copyToFileSystem($file_to_fix);
else $physicalFile->fileToFile($file_to_fix, 0, false, false);
$file_ext = remositoryAbstract::lastPart($file_to_fix,'.');
if ($file_ext != 'png' AND $file_ext != 'jpg' AND $file_ext != 'jpeg' AND $file_ext != 'gif') {
if (!$remositoryFile) echo _DOWN_THUMB_WRONG_TYPE;
}
elseif (file_exists($file_to_fix)) {
$large_image = $filepath.'img_'.$fileid.'_'.$nextfree.'.'.$file_ext;
$small_image = $filepath.'th_'.$fileid.'_'.$nextfree.'.'.$file_ext;
$repository = remositoryRepository::getInstance();
$this->imgresize($file_to_fix, $large_image, $repository->Large_Image_Width, $repository->Large_Image_Height, true);
$physicalimage = new remositoryPhysicalFile();
$physicalimage->setData($large_image);
$physicalimage->setPerms();
$this->imgresize($file_to_fix, $small_image, $repository->Small_Image_Width, $repository->Small_Image_Height, true);
$physicalimage->setData($small_image);
$physicalimage->setPerms();
unlink ($file_to_fix);
if ($legend) {
    $legend_path = $filepath.'txt_'.$fileid.'_'.$nextfree.'.'.$file_ext;
    if ($fp = fopen($legend_path, 'wb')) {
        fputs($fp, $legend);
        fclose($fp);
    }
}
}
else echo '<h3>'._ERR1.'</h3>';
}
}




there are some other snippets in p-classes/remositoryThumbnails that might be relevant for this matter:

Code:

public function __construct ($file) {
$interface = remositoryInterface::getInstance();
srand((double)microtime()*1000000);
$this->fileid=$file->id;
$repository = remositoryRepository::getInstance();
$this->maxcount = $repository->Max_Thumbnails;
$this->allow_large = $repository->Allow_Large_Images;
$this->filepath = remositoryThumbnails::baseFilePath().remositoryThumbnails::dirPattern().$file->id.'/';
if ($this->maxcount) $this->findFiles();
elseif ($file->screenurl) {
$this->thumb_URLs[] = $file->screenurl;
$this->img_URLs[] = $file->screenurl;
$filepath = str_replace($interface->getCfg('live_site'), $interface->getCfg('absolute_path'), $file->screenurl);
$this->thumb_paths[] = $filepath;
$this->img_paths[] = $filepath;
$this->count = 1;
}
else $this->count = 0;
}



Code:

public static function baseFilePath () {
return '/components/com_remository_files/';
}



Code:

public static function dirPattern () {
return 'file_image_';
}


and

Code:

private function findFiles () {
$interface = remositoryInterface::getInstance();
$thumb_pattern = 'th_'.$this->fileid.'_';
$dir = new remositoryDirectory($interface->getCfg('absolute_path').$this->filepath);
$thumbfiles = $dir->listFiles($thumb_pattern);
$this->count = 0;
foreach ($thumbfiles as $i=>$thumb) {
$numberandext = remositoryAbstract::lastPart($thumb,'_');
$k = intval(remositoryAbstract::allButLast($numberandext,'.'));
$marker[$k] = 'X';
$thumbpath = $this->filepath.$thumb;
$this->thumb_paths[$i] = $interface->getCfg('absolute_path').$thumbpath;
$this->thumb_URLs[$i] = $interface->getCfg('live_site').$thumbpath;
$imagefile = str_replace('th_','img_',$thumbpath);
$textfile = $interface->getCfg('absolute_path').str_replace('th_', 'txt_', $thumbpath);
if (file_exists($interface->getCfg('absolute_path').$imagefile)) {
$this->img_paths[$i] = $interface->getCfg('absolute_path').$imagefile;
$this->img_URLs[$i] = $interface->getCfg('live_site').$imagefile;
}
else {
$this->img_paths[$i] = $this->thumb_paths[$i];
$this->img_URLs[$i] = $this->thumb_URLs[$i];
}
if (file_exists($textfile)) {
    if ($fp = fopen($textfile, 'rb')) {
        $this->img_texts[$i] = fgets($fp);
        fclose($fp);
    }
}
$this->count = $i+1;
}
$freecount = 0;
unset($this->allfree);
for ($i=1; $i<=$this->maxcount AND ($this->count + $freecount) < $this->maxcount; $i++) {
if (!isset($marker[$i])) {
$this->allfree[] = substr($i+100,1);
$freecount++;
}
}
$this->freecount = $freecount;
}




I will be posting code for saving file in a separate post
chrissy6930
Senior Boarder
Posts: 58
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2009/10/22 10:36 By chrissy6930.
The administrator has disabled public write access.
 
Go to topPage: 1
get the latest posts directly to your desktop
2Win, Multisite(s) are trademarks of Edwin2Win.
Joomla