#145 Custom.php


In addition to (or in stead of) some of the previous
RFE's, I would like to suggest an additional module:

In the custom.php could be stored some variables to
override variables with the same name, declared
elsewhere in the program.

For example:
Each GEDCOM has one title. So, whatever language is
chosen, the title remains the same, which is not very
A title like this you can not put simply in the language
module, since everyone uses different titles and the
language module would not be exchangeable anymore.

Boudewijn Sjouke mentioned in a previous RFE the text
of some buttons.
If some admin likes to have a different text on a button,
it could be changed here.

It would be good place for customized text for email

Customized text for an intro page (also mentioned by
Boudewijn) can be stored here.

In this way the admin can do what he wants (within
limits, of course :-), without polluting the language files,
or without the need the change some parts of text in
the other php's.


  • John Finlay

    John Finlay - 2003-12-09
    • assigned_to: nobody --> yalnifj
    • status: open --> open-works-for-me
  • John Finlay

    John Finlay - 2003-12-09

    Logged In: YES

    There is already a method to extend the language files. This
    is not a documented feature yet so it is no surprise that you
    don't know about it.

    Suppose you wanted to add some of your own english text or
    replace some of the text with your own. You would create a
    file in the languages directory called lang.en.extra.php.

    If this file exists for the language that is chosen, it is the
    very last thing that is loaded before the display starts.
    These files were disigned to be language file extensions, but
    you could easily use it to make settings changes based on
    the chosen language.

    So, in your example of the GEDCOM title, you could change
    the title for each language by adding the following line to
    your lang.xx.extra.php:

    $GEDCOMS["surname.ged"]["title"] = "Title in Chinese";

    In this file you could also change the text on the buttons:

    The only settings that you could not override in this file are
    the privacy settings. With this file you could also change the
    gedcom that is displayed per language. Suppose I had a
    gedcom that was in german and one that was in english. In
    the lang.ge.extra.php file I would add the following lines:
    if ($GEDCOM=="english.ged") {
    header("Location: $PHP_SELF?

    These lines say that if we are using the german language
    files, but are using the english gedcom, then we need to
    reload the page with the german gedcom. You need to
    reload the page so that the configuration settings for the
    gedcom get loaded. This assumes that you have
    both "english.ged" and "german.ged" imported into the
    database and that the english.ged and the german.ged have
    the same people in them, just in a different language. Thus
    I1 in english.ged should refer to the same I1 in german.ged.

    Of course I haven't tested these things, but I believe that
    they will do all that you have requested in this RFE.


  • Jans

    Jans - 2003-12-09

    Logged In: YES

    OK John,
    It's beautiful. I will start testing it.
    I wonder if you can still make it to The Project of the Year. :-)

    In the Open Discussion forum I posted a thread about
    changing the link to the Home-page, when the language is
    I suppose I can do that in the lang.xx.extra.php as well.


  • KosherJava

    KosherJava - 2003-12-09

    Logged In: YES

    How many undocumented features are in place waiting to be
    discovered? :)

  • John Finlay

    John Finlay - 2003-12-09

    Logged In: YES

    If I could remember all of them, then I could document
    them ;)

    There are many features that I don't view as important
    enough to document, but we come up with a unique way to
    use them (as in this case) and suddenly documentation would
    be very helpful.

    I wish that I had a good way to document all of the
    features. I don't think the readme file is the right place to
    tell everything little thing that you can do with the program.

    I should probably start using Roland's users guide as the
    place to document things like this.


  • Jans

    Jans - 2003-12-09

    Logged In: YES

    Hi John,

    It's f.... beautiful (excuse my language :-)

    I made some lang.xx.extra.php files, like you said.
    For testing I tried three languages.

    Together with changing the language, now the Titel in the
    header is changing, and also the link to my Main Site is
    changing with it.

    I think this is a very strong part and it should me mentioned
    at least in the readme file.

    This feature serves the title of "Feature of the month".


    Thank God I decided a couple of weeks ago NOT to go for
    TNG :-)

  • Boudewijn Sjouke

    Logged In: YES

    Hi all,

    It's a good plan to start documenting the features of PHPGV.
    Although it will take a considerable amount of time, it will
    prevent many questions posed over and over again. This
    particular feature is engraved in my memory, because I use it
    to translate custom-events from PAF.
    One remark about text on buttons: it is true that the text can
    be changed either in lang.xx or in lang.xx.extra. But that is
    not what I meant in RFE 855259.


  • John Finlay

    John Finlay - 2003-12-19
    • status: open-works-for-me --> closed-works-for-me

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks