e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
320 stars 214 forks source link

membersonly templating suggestion #5077

Open Jimmi08 opened 1 year ago

Jimmi08 commented 1 year ago

Motivation

To clean and simplify membersonly templating See https://github.com/e107inc/e107/issues/4349

Proposed Solution

Use only membersonly template

Example:

    $MEMBERSONLY_TEMPLATE['signup']['header'] = "<div class='container'><div class='text-center'>{LOGO=login}</div>";
    $MEMBERSONLY_TEMPLATE['signup']['footer'] = "</div>";

    $MEMBERSONLY_TEMPLATE['login']['header'] = "";
    $MEMBERSONLY_TEMPLATE['login']['footer'] = "";

    $MEMBERSONLY_TEMPLATE['fpw']['header'] = "<div class='container'><div class='text-center'>{LOGO=login}</div>";
    $MEMBERSONLY_TEMPLATE['fpw']['footer'] = "</div>";

Unify to check where to use it (it is already done in signup file:

if (($pref['membersonly_enabled']))
{
    e107::coreLan('membersonly');
    $template = e107::getCoreTemplate('membersonly','signup');
    define('e_IFRAME',true);
    define('e_IFRAME_HEADER', $template['header'] );
    define('e_IFRAME_FOOTER', $template['footer'] );
    unset($template);

}

in login.php $template = e107::getCoreTemplate('membersonly','login'); in fwp.php $template = e107::getCoreTemplate('membersonly','fwp');

test legacy theme by THEME_LEGACY not by BOOTSTRAP constant

Additional Context

I don't ask for change now, there is a lot of legacy code.

I want to know if this can be correct/approved approach and I can continue this way.

For signup it is only template source change. For login it is about adding check and correct legacy test For fpw - it is full of legacy stuff,

Thanks

Jimmi08 commented 7 months ago

Solved with custom plugin. Not needed anymore. Invalid issue.

Moc commented 7 months ago

Reopening as this could definitely use some clean up

Jimmi08 commented 7 months ago

@Moc I am moving this topic to the discussion because this is not a single issue... As soon as I do it, I will close this again, But true is, that you should create your own issue if you want to solve this.

Moc commented 7 months ago

I'm leaving this as an issue because I just confirmed the need for clean up. The discussion board is not monitored as closely so please keep it centralised here.

Moreover, your issue reports also benefit others. Just link to discussion topics from here.