Well, please let me explain. The first subsite feature "prototype" was implemented in CMSimple_XH 1.5. This was merely a hack to augment the multilingual site feature. Rather soon it turned out, that there were several limitations and (minor) incompatibilities with existing plugins, however. CMSimple 4 has vitally improved this first "draft", but there are still some issues regarding the concept and some plugins. The basic problem is, that it's still not clear whether subsites models a multiple client capability (i.e. completely separated websites) or just the facility to divide a "large" website somehow. This affects the core functionality in a few cases (such as the search function) as well as (some) plugins.jpafonso wrote:[...]
So, I'm a buyer to CMSimple_XH 1.6 argument that it is doable to install different CMSimples to each subsite (if needed), because I already did that. It is not nice or easy, but if that prevents complications, I understand it.
I'm not aware of a more elegant way to do that; the introduction of the $li parameter to toc() was meant to help solve such issues, but it may not suffice for all cases. It would be nice to hear the details of your solution (preferably in a new thread in the Open Developement forum.jpafonso wrote:I'm explaining all this (sorry if it is long), because, maybe you know more elegant ways to do that. Or if not, perhaps you find it enough interesting to discuss it to be included in the future, or even in the 1.6. The changes to do in the li() are minimal, about 3 lines. [...]
If there is runkit installed on the server, you could replace hide() with a new definition (runkit_function_rename() and runkit_function_redefine() make it possible to override a function, somewhat similar to overriding a method in a subclass).jpafonso wrote:so, I cannot substitute hide() without substitute the toc
There are the plugins Memberpages, Register_XH and Membersarea which allow to control access to certain pages based on user login (I'm not sure, if the plugins already could be used with XH 1.6 yet; Register_XH probably needs some modifications).jpafonso wrote:A similar concern I solved in the past with another hack, is to differentiate pages inside the cmsimple which are public, from ones which are only accessible through an intranet. Can you tell me if there is an elegant way (an add-on or a feature usable under 1.6) I can use?
I have to admit that I have no experience with intranets, and if there's a simple possibility to distinguish intranet from internet clients. That might be reflected by the IP ($_SERVER['REMOTE_ADDR']); if so, it would be possible to modify one of the mentioned plugins accordingly (resp. reusing the necessary code/ideas in an own plugin). Basically, the intranet pages have to be marked somehow (for instance with a new page data attribute) and then the content has to be traversed to dynamically hide these pages for internet visitors. A rough outline:
Code: Select all
function hideIntranetPagesForExternalVisitors()
{
global $c, $cl;
for ($i = 0; $i < $cl; ++$i) {
if (isIntranetPage() && externalVisitor()) { // these two functions will have to be defined
// replace the contents of the page, hide it and send "403 Forbidden" response:
$c[$i] = '#CMSimple hide# #CMSimple shead(403)#';
}
}
}
if (!(XH_ADM && $edit)) {
hideIntranetPagesForExternalVisitors();
}
Thanks. It's always good to catch eventual bugs as early as possible.jpafonso wrote:I'm fated to find bugs if there are ones
Christoph