4images Forum & Community

4images Modifications / Modifikationen => Templates & Styles (Requests & Discussions) => Topic started by: a6504150 on September 29, 2010, 06:16:46 AM

Title: how can I extract all my MODs to a template folder?
Post by: a6504150 on September 29, 2010, 06:16:46 AM
Hi all,


I've done a very cool template for my gallery, with many modifications, but I want now to separate design from code and to minimize the modification of initial files.

Are there some approaches, how to extract all the changes done in includes or admin- or lang- files to the template folder?


Some ideas?

Thanks in advance!
Title: Re: how can I extract all my MODs to a template folder?
Post by: V@no on September 29, 2010, 06:49:26 AM
mmm...I'm not sure what changes you are referring to, but 4images uses template tags that being replaced by the data generated in .php files.
Can you give some examples of what you've done and what you need to transfer into templates?
Title: Re: how can I extract all my MODs to a template folder?
Post by: a6504150 on September 29, 2010, 08:51:20 AM
mmm...I'm not sure what changes you are referring to, but 4images uses template tags that being replaced by the data generated in .php files.
Can you give some examples of what you've done and what you need to transfer into templates?

Hi Vano,


there are many changes done, I'll give here for example such a small and simplified functionality (file register.php):

There are some additional fields to be filles during the registration, then they have to be mailed to admin:

Code: [Select]
 $user_organisation = (isset($HTTP_POST_VARS['user_organisation'])) ? trim($HTTP_POST_VARS['user_organisation']) : "";

    if ($user_organisation == "") {
      $msg .= (($msg != "") ? "<br />" : "").$field_error = preg_replace("/".$site_template->start."field_name".$site_template->end."/siU", str_replace(":", "", $lang['organisation']), $lang['field_required']);
      $error = 1;
    }


      if ($config['account_activation'] == 1) {
        $site_email->reset();
        $site_email->set_to($config['site_email']);
        $site_email->set_subject($lang['admin_activation_emailsubject']);
        $site_email->register_vars(array(
          "user_email" => $user_email,
          "user_organisation" => $user_organisation,
        ));
        $site_email->set_body("admin_information", $config['language_dir_default']);
        $site_email->send_email();
      }


      "user_organisation" => format_text(stripslashes($user_organisation), 2),

      "lang_organisation" => $lang['organisation'],


So, how could this be extracted from register.php into my template folder?
Title: Re: how can I extract all my MODs to a template folder?
Post by: a6504150 on October 02, 2010, 04:17:54 AM
any ideas about the subject? :(


I've thougth, it could be possible to do some "installer", that will add all my functions/changes to the original files.. Could it be the solution? Will it be any collisions by update?