Author Topic: how can I extract all my MODs to a template folder?  (Read 6126 times)

0 Members and 1 Guest are viewing this topic.

Offline a6504150

  • Pre-Newbie
  • Posts: 9
    • View Profile
how can I extract all my MODs to a template folder?
« 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!

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: how can I extract all my MODs to a template folder?
« Reply #1 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?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline a6504150

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: how can I extract all my MODs to a template folder?
« Reply #2 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?

Offline a6504150

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: how can I extract all my MODs to a template folder?
« Reply #3 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?