• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 52 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject: Re: Patriciaaaaaaaaa :D -- I got IT!!!
PostPosted: Tue Nov 08, 2005 1:49 am 
Just a bit more info about the disappearing slashes. I tried moving a subdomain cms.domain.com to www.domain.com and it still didn't work. But then when I moved it to a subdirectory www.domain.com/cms the problem disappeared. So it seems there must have been an assumption made somewhere that CMSMS would always be installed in a subdirectory...


Top
  
 
 Post subject: Re: Patriciaaaaaaaaa :D -- I got IT!!!
PostPosted: Tue Nov 08, 2005 5:29 am 
Offline
Power Poster
Power Poster

Joined: Sun Nov 21, 2004 6:35 am
Posts: 1469
Location: Geneva - Switzerland
My tests:

I tried comment that line 98
Code:
$offsetPath = substr($offsetPath, strpos($offsetPath, "/"));

and it solved the strip subfolder and slash issue.

but as this line must certainly be there for something.... I'm not sure what to do, and I tried on a subdomain, choosing image on subfolder of image.

Now without that there is still the thing that the runtime editor doesn't see the images created with TinyMCE (which path are uploads/images/... instead of sub/uploads/images/...), so not suitable for existing sites which were using TinyMCE or with choice for both editors. Also FCK  save sub/uploads/images/... in db, when I edit without wysiwyg I see that mistake.

and also, if I try to change some other lines around line 98 (my tests :) when I save firefox says: "a script on this page is causing mozilla to run slowly..."

So I know it's somewhere there, but I have no more idea, as how OffsetPath is then sent from php to javascript and where the runtime editor use that variable. Not much more idea about it.

_________________
Patricia


Top
 Profile  
 
 Post subject: Re: Patriciaaaaaaaaa :D -- I got IT!!!
PostPosted: Tue Nov 08, 2005 7:44 am 
Okay, thanks to Patricia for pointing me in the right direction. I think I've found why the slashes are being stripped. Here's how offsetPath is being obtained (some commented out lines omitted):

Code:
    $offsetPath = $this->cms->config["uploads_url"];
    $offsetPath = str_replace( 'http://', '', $offsetPath );
    $offsetPath = substr($offsetPath, strpos($offsetPath, "/"));
    $offsetPath = str_replace( 'uploads', '', $offsetPath );


Now, this deletes the http://, the domain, and the string 'uploads'. So if we don't use a subdirectory in the uploads URL (say 'http://www.domain.com/uploads') all that's left in $offsetPath is the slash.

Further down, here's what's being done:

Code:
      while (obj1.value.search(offsetPath) > 0)
        obj1.value = obj1.value.replace(offsetPath,"");


So, since $offsetPath is equal to "/", all slashes in the HTML are being deleted, including those in the tag endings.

Question to megabob3: is there a particular reason why the string 'uploads' needs to be deleted from $offsetPath? The only other place I can see that variable being used is here:

Code:
$oFCKeditor->Value = str_replace('src="uploads', 'src="'.$offsetPath.'uploads', $content) ;


and it seems 'uploads' is being added back on anyway?

Bear in mind that I've only looked at the code very superficially, and for all I know there might be a good reason. At this point though it seems to me that leaving 'uploads' in there would fix the problem.

As for Patricia's problem with compatibility with TinyMCE, you could probably hardcode $offsetPath to 'uploads' and that would give you a relative path from the current directory... (haven't tested, sorry)


Top
  
 
 Post subject: Re: Patriciaaaaaaaaa :D -- I got IT!!!
PostPosted: Tue Nov 08, 2005 8:23 am 
Oops, seems like I wasn't looking at the latest version of the code... But I think the analysis still holds.


Top
  
 
 Post subject: Re: Patriciaaaaaaaaa :D -- I got IT!!!
PostPosted: Tue Nov 08, 2005 8:35 am 
Okay, from my preliminary tests, this seems to do the trick. First comment out this line:

Code:
$offsetPath = str_replace( 'uploads', '', $offsetPath );


And then change this line:

Code:
$oFCKeditor->Value = str_replace('src="uploads', 'src="'.$offsetPath.'uploads', $content) ;


to this:

Code:
$oFCKeditor->Value = $content;


I just hope there are no unwanted side effects...


Top
  
 
 Post subject: Re: Patriciaaaaaaaaa :D -- I got IT!!!
PostPosted: Tue Nov 08, 2005 8:41 am 
Sorry, actually no, that doesn't work. I was testing the wrong site. Must be time to call it a day... :)


Top
  
 
 Post subject: Re: Patriciaaaaaaaaa :D -- I got IT!!!
PostPosted: Tue Nov 08, 2005 1:01 pm 
Offline
Power Poster
Power Poster

Joined: Sat Jan 08, 2005 11:11 pm
Posts: 498
Location: ITALY
I am doing ALL like if start all from beginning.

I am studying REGULAR EXPRESSION, into javascript.

And doing the replacement only into TAGs.

Like is now was the problem that replace everything.

For example into content one thing is replace into double quote the "e; from showed information and another thing is replace from {smarty tag}

Using regular expression will all different, please wait few days.

See You All ;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 52 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner