CMSimple_XH 1.6

A place for general not CMSimple related discussions
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: CMSimple_XH 1.6

Post by cmb » Wed Jan 08, 2014 1:09 pm

tanavots wrote:I noticed that urichar not working in 1.6. Special characters not replaced as given in Settings --> Language --> Urichar.
I suppose you have not changed the separator character. Formerly it was a comma, but it was changed to a vertical bar (|) to be able to replace commas in the URL (was requested several times). If you want to stick with the comma, you can modify cmsimple/cms.php line 89:

Code: Select all

define('XH_URICHAR_SEPARATOR', ',');
Christoph M. Becker – Plugins for CMSimple_XH

tanavots
Posts: 72
Joined: Sat Feb 25, 2012 4:18 pm

Re: CMSimple_XH 1.6

Post by tanavots » Wed Jan 08, 2014 1:22 pm

cmb wrote: I suppose you have not changed the separator character. Formerly it was a comma, but it was changed to a vertical bar (|) to be able to replace commas in the URL (was requested several times). If you want to stick with the comma, you can modify cmsimple/cms.php line 89:

Code: Select all

define('XH_URICHAR_SEPARATOR', ','); 
Right! Then Wiki need update http://www.cmsimple-xh.org/wiki/doku.ph ... n_headings. ;)

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: CMSimple_XH 1.6

Post by cmb » Wed Jan 08, 2014 1:43 pm

tanavots wrote:Then Wiki need update http://www.cmsimple-xh.org/wiki/doku.ph ... n_headings. ;)
Done. Thanks for pointing that out.
Christoph M. Becker – Plugins for CMSimple_XH

Bob
Posts: 120
Joined: Sat Jun 14, 2008 8:30 am
Location: France
Contact:

Re: CMSimple_XH 1.6

Post by Bob » Thu Jan 09, 2014 9:02 am

Hello
It seems that the newsbox() function does'nt take care of scheduled dates. That has can be been already verified?
Bob

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: CMSimple_XH 1.6

Post by cmb » Thu Jan 09, 2014 12:26 pm

Bob wrote:It seems that the newsbox() function does'nt take care of scheduled dates.
Actually, it's even slightly worse: if a page is hidden, unpublishing it via page_params has no effect at all. To fix this issue, plugins/page_params/index.php line 208ff has to be changed:

Code: Select all

if (!(XH_ADM && $edit)) {
    $temp = $pd_router->find_all();
    foreach ($temp as $i => $j) {
        Pageparams_handleRelocation($i, $j);
        // unpublishing superseedes hiding:
        if (!Pageparams_isPublished($j)) {
            $c[$i] = '#CMSimple hide#';
            if ($i == $pd_s) {
                $c[$i] .= '#CMSimple shead(404);#';
            }
        } elseif ($j['linked_to_menu'] == '0') {
            $c[$i] = '#CMSimple hide#' . $c[$i];
        }
    }
}
As setting a publishing period for newsboxes is a very nice use-case (I haven't thought of it before), it seems we have to release XH 1.6.1 sooner than I had hoped.
Christoph M. Becker – Plugins for CMSimple_XH

Bob
Posts: 120
Joined: Sat Jun 14, 2008 8:30 am
Location: France
Contact:

Re: CMSimple_XH 1.6

Post by Bob » Thu Jan 09, 2014 4:48 pm

cmb wrote:it seems we have to release XH 1.6.1 sooner than I had hoped.
Sorry for that Christoph...
Publishing dates setting is really a great improvement and it is better if it is completely functional ;-)

Additionally I did not find either simple way to get back the date of edition (from a page) in the content file with a php script, what I managed to make easily with pagedata.php (to display this date near to the newsbox title). $s is the pointer of the shown page but not of the newsbox within the page...

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: CMSimple_XH 1.6

Post by cmb » Thu Jan 09, 2014 5:50 pm

Bob wrote:Additionally I did not find either simple way to get back the date of edition (from a page) in the content file with a php script, what I managed to make easily with pagedata.php (to display this date near to the newsbox title). $s is the pointer of the shown page but not of the newsbox within the page...
Hm, the latter problem already existed with former CMSimple_XH version, didn't it? Finding the correct page-data record could be solved by knowing the index of the news page, or by using the information in $page_data['url']. The latter method has some quirks, as this 'url' might not be correctly set (at least it is not guaranteed to, although I'm not aware that this actually happens), and because the page heading is not necessarily equal to the URL. However, usually the following function in userfuncs.php should suffice:

Code: Select all

function showLastEdit($heading)
{
    global $pd_router;

    $pages = $pd_router->find_field_value('url', $heading);
    $page = current($pages);
    $timestamp = $page['last_edit'];
    return date('Y-m-d', $timestamp);
} 
Then you can insert the appropriate plugin call in the newsbox:

Code: Select all

{{{showLastEdit('News01');}}}
Instead of reading pagedata.php as in former versions, you can use the following idiom (worked already in earlier versions, and is faster, because pagedata.php doesn't have to be read again):

Code: Select all

$page_data = $pd_router->find_all(); 
Christoph M. Becker – Plugins for CMSimple_XH

Bob
Posts: 120
Joined: Sat Jun 14, 2008 8:30 am
Location: France
Contact:

Re: CMSimple_XH 1.6

Post by Bob » Thu Jan 09, 2014 6:20 pm

A great thank you for this precision. I indeed used a searching loop with page_data [' url '] which worked well but my script was heavy and slower.
I am going to modify my script in this way.
Thank you again a lot for your time! :-)

svasti
Posts: 1659
Joined: Wed Dec 17, 2008 5:08 pm

Re: CMSimple_XH 1.6

Post by svasti » Thu Jan 09, 2014 6:48 pm

cmb wrote:it seems we have to release XH 1.6.1 sooner than I had hoped.
Unfortunately I also found some not so nice css setting in the mailform, which I should have improved, but somehow it escaped my notice. I'd like to fix this too. Will you start a 1.6.1 branch?

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: CMSimple_XH 1.6

Post by cmb » Thu Jan 09, 2014 7:03 pm

svasti wrote:Will you start a 1.6.1 branch?
It shouldn't be necessary to have a branch for 1.6.1. Just work in the TRUNK (you may have to check it out freshly); merging these changes to the 1.6 branch later should be easy (and maybe some of the modifications will make it to 1.5.x, too). When 1.6.1 will have been released, we will tag it (tags/1.6.1) for later reference.
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply