Please login or register.

Login with username, password and session length
Advanced search  


You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: [IMPORTANT] Include php tags for standalone files  (Read 12066 times)

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
[IMPORTANT] Include php tags for standalone files
« on: December 10, 2006, 12:03:16 am »

Something to remember for all fellow translators and/or users of language variables:
In order for the code to work as a standalone file, i.e if you say "copy the code and save as snews_XX.php", it must include the opening and closing php tag, for example:

    sNews 1.5
    Developers version: 1.5.30 Stable
    Copyright (C) 2006
    sNews is licensed under a Creative Commons License
$l['home'] =
I know some of the translations already have this, but some don't so it might be worth knowing about.
(If the php tags aren't included, the translation must be pasted into snews.php, replacing the original language variables; it won't work as standalone file.)


  • Newbie
  • *
  • Karma: 0
  • Posts: 9
[IMPORTANT] Include php tags for standalone files
« Reply #1 on: May 15, 2007, 10:00:39 am »

if pasting as a sepereate php file, without any HTML in it please, do not include the ?> tag as this is not required by php for php-only files, and can fix possible future bugs

Note: The closing tag of a PHP block at the end of a file is optional, and in some cases omitting it is helpful when using include() or require(), so unwanted whitespace will not occur at the end of files, and you will still be able to add headers to the response later. It is also handy if you use output buffering, and would not like to see added unwanted whitespace at the end of the parts generated by the included files.


  • Guest
[IMPORTANT] Include php tags for standalone files
« Reply #2 on: May 15, 2007, 12:58:54 pm »

In pmwiki it is standard not to include the endtag in a file, for the same reason alexanderpas mentioned. Perhaps this should be discussed.


  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940
[IMPORTANT] Include php tags for standalone files
« Reply #3 on: May 15, 2007, 02:24:29 pm »

Theses translation files are meant for inclusion in php code and do not provide for direct generation of output; so, unwanted white spaces and headers aren't an issue.