modification of template-functions.php

Well, I know - I should not have to modify the file template-functions.php, all zp-core files.

But...

I needed to change the admin drop down menu and carefully add the "Add Files". Since I am new to php, I was looking for the simplest solution, and I found them in the line:

`

<? php printLink ($ zf. '/ admin.php', gettext ("Overview"), NULL, NULL, NULL);?>
</ li>


<? php printLink ($ zf. '/ admin-upload.php', gettext ("Add file"), NULL, NULL, NULL);?>
</ li>
<? php
`
Well and good - I got what I wanted, without much interference in the code, replacing what I do not need to drop down to what I needed.

But, of course, can not be too easily ...
There was a great message "Zenphoto has detected a change in your installation."
I read the forum and I know the court to take the message and understand the meaning of the display. Very too am glad that it is.
I would prefer to be flashed but then when I really need it.

Therefore, I have a question / request for help:

First How to modify the template I needed to add a drop down menu function outside the zp-core

or

Second Acceptance of the system as the cause for my modified template-functions.php
so that it no longer display the message, but the system remains alert to changes that I am not the author.

Cordially greet all
Adrian

Comments

  • acrylian Administrator, Developer
    The best way is to duplicate and rename the function you need to modify and move it either to your theme's functions.php or create a plugin. Then use that instead of the original in your theme. That is why those are possible.

    The above is one reason why you never should modify core files. Of course you can do but in any case you need to do your modifications again with every update.
  • Making a plugin for the time being is totally beyond my skills. Unless I decide to modify functions.php in /themes/zpArdoise.

    Unfortunately, PHP is not the same as html and I have to learn everything all over again: D

    Do I understand that I have to do:
    1. Restore the original file template-functions.php
    2. Copy all the code that handles the drop down toolbox
    3. Paste to /themes/zpArdoise/functions.php
    4. Change the name of the function of printAdminToolbox on their own (for example, printAdminToolboxMY)
    5. Enter my own name (echo gettext) for all menu items in my language (not connected with the function of language localization?)
    6. Make the necessary links menu and delete the ones I do not need.

    questions:
    1. How and where to disable/remove AdminToolbox global function call, because I guess no exemption will be displayed along with my new menu.
    I understand that if I simply removed the line of code from the file template-functions.php it again will display the message of the need to re-install.
    2. Does the addition of functions printAdminToolboxMY to /themes/zpArdoise/functions.php, it will automatically start on each page, or requires a call For all the individual pages as index.php, gallery.php, etc.. and there are calls to be placed.

    Sorry for my questions, that the lack of professionalism in them, but in spite of my lack of knowledge, everything will adapt itself to your needs than to ask the authors of a million modifications do not need anyone but me :-)
  • acrylian Administrator, Developer
    1.-4 Correct.
    5 Not necessary, standard terms are covered by the main translations, Just your own won't.

    Combined answer to the questions:
    The toolbox is a function call `printAdminToolbox();`. You have to replace all calls in the theme with your own function. It is generally placed at the end of each theme template file in official themes or in a general footer.php page. I am not familiar with zpArdoise so you will have to search where the call(s) are.
  • fotoADS:

    Well, the simplest way depends on your perspective. The simplest short them solution is to modify the template functions as you did. The message you get is simply a notification that something has changes. Since you know you made the change you do not have to worry about some compromise. But you do need to record the new status by running the setup scripts.

    If you perspective is at all long-term, then the above will cause you to go through this same process of changing the script and re-running setup each time you update Zenphoto. That may prove not so simple after all.

    Another possibility would be to try the development build. There have been some significant changes in "uploading" made there and along with that the upload link has been made global as you wish. (The significant changes are another reason why modifying the script might not be the simple solution--your modification will probably not work in the new code.)
  • Gentlemen, thank you for your help! I think with these descriptions I can. At the moment I correct in other parts of the page. Effects (despite the lack of knowledge) more and more I like. As soon as I will take for this piece of work and have problems, certainly I will more asking in this thread.

    I warmly greet
    Adrian
Sign In or Register to comment.