Some changes... and questions

This is a FORK of the CMS Made Simple project and is not oficially supported in any way by the CMS Made Simple development team.
Locked
Wiedmann
Forum Members
Forum Members
Posts: 233
Joined: Wed Mar 26, 2008 1:49 am
Location: Stuttgart / Germany

Some changes... and questions

Post by Wiedmann »

Hallo Alby,

first, thanks for this nice fork of the CMSMS. I've made 4 changes which I want share with you:

1.
{lang} was not working, if you enable cutom 404 error with template.

2.
A link to the default page is not working, if cookies are not enabled in the UA:
- old link syle: "http//example.com/"
- new link style "http//example.com/en/"

3.
In {lang}, if we are on the default page, the new stye link will also be used (so we have the same link as the menu):
- old link syle: "http//example.com/en/home/"
- new link style "http//example.com/en/"

4.
In {lang}, the current page is now not a link. Instead the text/image is inside a (for the class).


And now 2 questions :-)

1.
About "Tips and Tricks - #9". Is there a config switch to disable/enable the new behaviour?
There is IMHO also one problem with the new behaviour. The menu should also use the text from the default lang.

2.
As you have read above, the default page is now "http//example.com/en/". If a user request the page with "http//example.com/", there should be a redirect to "http//example.com/en/" ("en" is the reslut of the accept-language or default lang). Can you give me hint, in which file I must add this?

Regards,
Carsten

BTW:
Sorry for this topic. Do you know a better one?
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

[The extension txt has been deactivated and can no longer be displayed.]

[The extension txt has been deactivated and can no longer be displayed.]

[The extension txt has been deactivated and can no longer be displayed.]

alby

Re: Some changes... and questions

Post by alby »

Thank you  :D
Wiedmann wrote: 1.
{lang} was not working, if you enable cutom 404 error with template.

4.
In {lang}, the current page is now not a link. Instead the text/image is inside a (for the class).
Cool, I agree and add in SVN

Wiedmann wrote: 2.
A link to the default page is not working, if cookies are not enabled in the UA:
- old link syle: "http//example.com/"
- new link style "http//example.com/en/"

3.
In {lang}, if we are on the default page, the new stye link will also be used (so we have the same link as the menu):
- old link syle: "http//example.com/en/home/"
- new link style "http//example.com/en/"
Here I ask who uses rewrite / pretty_url to test this solution in different conditions

Wiedmann wrote: 1.
About "Tips and Tricks - #9". Is there a config switch to disable/enable the new behaviour?
There is IMHO also one problem with the new behaviour. The menu should also use the text from the default lang.
No, is default in 1.2.4
Serves to avoid a blank page (content and menus) or error in the case of empty language. You must always to use tips #4 for hide menus

Wiedmann wrote: 2.
As you have read above, the default page is now "http//example.com/en/". If a user request the page with "http//example.com/", there should be a redirect to "http//example.com/en/" ("en" is the reslut of the accept-language or default lang). Can you give me hint, in which file I must add this?
Try to add in include.php (around #222):
  if( (! isset($force_mle_default)) || (! $force_mle_default) ) $hl = language_user_setting($hls);
  else $hl = DEFAULT_LANG;

  setcookie('mle', $hl, time()+86400, '/');

  $contentops =& $gCms->GetContentOperations();
  redirect_to_alias($contentops->GetDefaultPageID());
  exit();
  }
Alby
Last edited by alby on Mon Apr 07, 2008 10:18 am, edited 1 time in total.
Wiedmann
Forum Members
Forum Members
Posts: 233
Joined: Wed Mar 26, 2008 1:49 am
Location: Stuttgart / Germany

Re: Some changes... and questions

Post by Wiedmann »

Here I ask who uses rewrite / pretty_url to test this solution in different conditions
If someone want test this, don't forgett to change your ".htaccess". Of course, you have the same effect without pretty url:
- old link syle: "http//example.com/"
- new link style "http://localhost/cmsmadesimple/index.php?page=&hl=en"

BTW ".htaccess":
Removing [NC] from "-f" and "-d" is just fixing a bug from base CMSMS.
--> "NC" is not valid for "-f" and "-d". Instead you have a lot of warnings in your error_log.
No, is default in 1.2.4 Serves to avoid a blank page (content and menus)
That's OK, and it works for the content, but I still have an empty menu.
Try to add in include.php (around #222):
Thanks for the hint :-) I have append the diffs, to make this also working.

One additional question about cookies... But I think, this is more a quetion for CMSMS dev? CMSMS don't use a cookiepath for (session-) cookies. You are using "/". IMHO the cookiepath should always be set to the cmsms root_url?

Regards,
Carsten
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

[The extension txt has been deactivated and can no longer be displayed.]

alby

Re: Some changes... and questions

Post by alby »

Wiedmann wrote: One additional question about cookies... But I think, this is more a quetion for CMSMS dev? CMSMS don't use a cookiepath for (session-) cookies. You are using "/". IMHO the cookiepath should always be set to the cmsms root_url?
Right!
In SVN I update setcookie (also to use https) and I have restored the old behavior and content GBC using the new parameter "view_default"


Alby
Last edited by alby on Wed Apr 09, 2008 10:24 am, edited 1 time in total.
Wiedmann
Forum Members
Forum Members
Posts: 233
Joined: Wed Mar 26, 2008 1:49 am
Location: Stuttgart / Germany

Re: Some changes... and questions

Post by Wiedmann »

In SVN I update setcookie (also to use https)
I see :)

Just a hint (see the appended file):
- $cookie_path now works also on windows (and in the root dir correct)
- if you set $cookie_domain to null, you don't override the setting from php.ini
- $cookie_secure: HTTPS is case insensitive and can also be "ON".

And know we must talk to the CMSMS devs, if they also want use session_set_cookie_params(), before they use session_start()  ;)
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

alby

Re: Some changes... and questions

Post by alby »

Wiedmann wrote: I see :)
Want you participate in MLE project?

Alby
Wiedmann
Forum Members
Forum Members
Posts: 233
Joined: Wed Mar 26, 2008 1:49 am
Location: Stuttgart / Germany

Re: Some changes... and questions

Post by Wiedmann »

Hi Alby,
Wiedmann wrote:Thanks for the hint :-) I have append the diffs, to make this also working.
Damn :( The change in "include.php" breaks the backend (sorry, have only test frontend).

With:

Code: Select all

    if(!isset($CMS_ADMIN_PAGE) && (empty($mle) || !in_array($mle, array_keys($hls)))) {
There is no stylesheet.

ok, change to:

Code: Select all

    if((!isset($CMS_ADMIN_PAGE) && !isset($CMS_STYLESHEET)) && (empty($mle) || !in_array($mle, array_keys($hls)))) {
i have the stylesheet. But preview or TinyMCE is broken.

Want you participate in MLE project?
Sounds interessting. But I'm really new to CMSMS. First installation at 2008-04-05. At the moment I walk through the api doku and try to understand what happens (some more/better docblocks would be nice ;))

Well, I need a cms for a project, and also need the changes I'm trying to do.

Regards,
Carsten
Wiedmann
Forum Members
Forum Members
Posts: 233
Joined: Wed Mar 26, 2008 1:49 am
Location: Stuttgart / Germany

Re: Some changes... and questions

Post by Wiedmann »

Damn Traurig The change in "include.php" breaks the backend (sorry, have only test frontend).
OK, I've moved the redirect from "include.php" to "index.php" and now it seams to work.

Should I make an all in one diff (against SVN), thus you can better test it?


(For me, CMSMS MLE with the above patches is more SEO (don't use different URIs for the same content).)
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

Last edited by Wiedmann on Fri Apr 18, 2008 4:50 pm, edited 1 time in total.
alby

Re: Some changes... and questions

Post by alby »

Wiedmann wrote: Should I make an all in one diff (against SVN), thus you can better test it?
Yes  :D

Alby
Wiedmann
Forum Members
Forum Members
Posts: 233
Joined: Wed Mar 26, 2008 1:49 am
Location: Stuttgart / Germany

Re: Some changes... and questions

Post by Wiedmann »

Here it is.
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

Wiedmann
Forum Members
Forum Members
Posts: 233
Joined: Wed Mar 26, 2008 1:49 am
Location: Stuttgart / Germany

Re: Some changes... and questions

Post by Wiedmann »

Here it is.
The patch is not working if you not also have config_lang.php/ALTER tables. I've attached a new diff..
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

alby

Re: Some changes... and questions

Post by alby »

Wiedmann wrote:
Here it is.
The patch is not working if you not also have config_lang.php/ALTER tables. I've attached a new diff..
I do not understand why you do not want to enter in MLE project?
This is really a good work  ;)

Alby
Locked

Return to “[locked] CMSMS MLE fork”