Hi, I maintain the Drupal-based website www.wikinerds.org and I have a "Thanks" block where I write:

Wikinerds Portal is powered by Drupal 4.5.2.

.

The problem is: Everytime I upgrade Drupal I need to remember to change this text.

I tried to find the Drupal Version PHP variable in the 4.5.2 source code but I was unsuccessful. I also asked on the IRC channel. Where is this variable and what is its name?

I want to replace the above text by

Wikinerds Portal is powered by Drupal <?php echo $drupalversion; ?>.

What I need to know is the actual name of the variable.

Comments

Steven’s picture

There is no such variable available. I suppose you could do this, but it's a bit hackish:

$f = fopen('CHANGELOG.txt', 'r'); list(, $version) = explode(' ', fgets($f, 13)); fclose($f); print $version;

--
If you have a problem, please search before posting a question.

nsk’s picture

Can I submit a patch so that such a variable can be included in Drupal 4.5.3 and/or 4.6.0 ?

My idea is to use a version.inc file with the code:


$drupalversion = "4.5.2";

Another design would be to include the variable in bootstrap.inc or common.inc, but it should be in the very first lines in order to be changed easily.

Do you agree with the inclusion of the variable, and which design do you prefer?

What is the standard procedure of submitting patches here?

--
NSK, Admin of Drupal-based site http://www.wikinerds.org

sepeck’s picture

Read the contributers guide in the handbook for patches and coding standards
http://drupal.org/node/316

Anyone can submit a patch, just check up on the coding standards. Of course, this does not mean that the patch will be accepted. :)

You may wish to include the reason, etc in the submission. You may also wish to subscribe to drupal-devel to follow the development discussions.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide