catch functions in one file...

Hey there,

im working on a better system to catch functions i've most seen on some ZenPhoto pages and got some questions. Maybe here i find other guys which try to modificate the theme system over a special theme.

The plan is to use the pages.php file for functions like: register, verify, home, contact, imprint and so on. So nobody need to change 100 files to style them or maybe change something.
It use functions which request if the plugin is used and activated on the special theme. Later it will open an insert field to add the text and so on.

But the problem is, when i insert the registration part (printRegistrationForm();) it dont print the login when i use the verify link to validate a user. The verify works with an: if ($_GET['verify']))

So the question is, is it possible to change out of the themes folder the link from:
/page/register?verify=hash
to:
/page/pages?verify=hash

All other things works great, i just have to check which link is used so i can change the title, index and so on. And if you want to ask "why do you do that" think about changing up to 15 files or one. Its easier, faster and not so confusing ;)

Greez

Comments

  • acrylian Administrator, Developer
    I am not sure what you are trying to do. `pages.php` is for pages managed by the Zenpage CMS plugin. So it is directly meant to be used for contact, imprint and whatever and only one file (which is how our own site uses it). That also has a codeblock you can enter basically enter any function into (given the theme supports it).

    `/pages/` is a static custom theme page not managed by the backend.
  • I know, but take a look at some/the most themes. Without any idea about "how to add functions/links" and so on you can't use all you need. Maybe the login, it isnt includet in all themes, or the register when you dont have a register.php in your theme.
    Let's say one guy makes an awesome theme, but dont include some files or functions, you can't use it and without the knowledge you can't add this stuff to this theme. And when you know how, you have to include and style it to your needs.

    Your right, it isnt, not now! But over special theme settings i can do all i need. Like sort links, check if someone need contact, imprint and give the opportunity to add the needet text. All out of one admin page into one page in the frontend. But atm not for news, while the function set the handles where we move when we use a link...
    So i also can include css files which say where our sidebar is, where the contend, which color our theme has. And that will happen over one file, not over 20 you know what i mean?

    And pages.php will manage the zenpage pages too.
    -----------------------------------------------
    if (($zpmas_useregister == true) && ($site == gettext("Verify"))) { echo gettext("Verify"); } else {
    printPageTitle(); }
    -----------------------------------------------
    ...in this way. So i can also say, print in the sidebar a on contact, and b on imprint. But the question i've got is:
    How can i manipulate the links to my needs:
    from:
    /page/register?verify=hash
    to:
    /page/pages?verify=hash

    greez
  • acrylian Administrator, Developer
    Well, as you say it is up to the theme developer what he includes and how he includes it. Zenphoto has - besides the default structure - a quite flexible way of theming. Different than other CMS we don't require special html, css or else. So you of course can setup it all like you need it and given your level of coding knowledge even leave the default way.

    One note `($site == gettext("Verify")))` you reallly should think about that check... you need to check for the fixed name of an item, never translatable text that changes with each langauge (you hopefully know what gettext is about?).

    I don't know offhand about the links, but probably the register functions have parameters for the link. Maybe review the documentation on that. Otherwise you need to make your own custom versions.
  • I know, it was the gallery-index print ive shown. It's not the link or linkecheck itself. For the linkcheck ive used $_Get['verify']:
    <? if (($zpmas_useregister == true) && ($site == gettext("Register")) || ($_GET['verify'])){ ?>
    <div class="post"><h1><?php echo gettext('User Registration') ?></h1>
    <?php printRegistrationForm(); ?></div>
    <? } elseif { ?>
    NEXT item
    <? } else { ?>
    DO NORMAL THINGS HERE
    <? } ?>

    So if the user use the link out of the email he get verified but not get the needet login under the line:
    "Thanks for the Register.

    You can sign up on the page and verify your personal details now."

    The login under these lines needs the register.php i think so this link is static?! In my idea the functions should be more flexible and dont need the register.php.

    And by the way, why a user have to login with his email and not with the username?! At the Master it works with the username, why not for all users? Is it a bug or have you forgotten to switch it to user?

    Greez
  • acrylian Administrator, Developer
    e-mail or user name is an option of the plugin as is the registration page url actually. I am not directly familiar with the plugin and I never used it myself actually.
  • Mhm, found it but it dont work for me. I just can login with the email. Maybe broken with an update?
    *EDIT*
    Works just if i register new. For all other old accounts you have to login with the email.
    He also print the login form under the confirmation lines. But he jumps to the admin login after login with the user. There must be something wrong with the plugin i think?!

    But back to the question, how i can get the right path without the register.php or maybe album.php. So that i can manage all over the pages.php with the right features like the login field?

    Greez
  • acrylian Administrator, Developer
    The register_user plugin has an option to set the register page. As said I am not familiar with this plugin in details so my colleague later one might have more to say.
  • And by the way, why a user have to login with his email and not with the username?! At the Master it works with the username, why not for all users? Is it a bug or have you forgotten to switch it to user?
    Well.... because you said that was what his user code should be when you selected the plugin options. If you want him to be able to create his unique user name, then you must tell the plugin so.

    Of course if someone has registered with his e-mail as his user id then he will have to use that to log in. What else would you expect?

    If you want a registration form as part of (Zenpage) pages content you will have to code that yourself. Otherwise the script name is settable by an option of the plugin, but it cannot be set to one of the script names used in the Zenphoto rewrite rules as those rules do not permit that.
Sign In or Register to comment.