Jump to content

Need help with Wikipedia or maybe PHP


Recommended Posts

I am currently working on modifying WikiMedia and I am having issues. For example, I have a PHP script that attempts to get the title of the page, and then looks to see if there are images with that page title in a certain folder. If they do not exist, it loads the default images. This script works fine but I can't seem to get any Wiki vars to return anything but 0 or NULL.

Is there a place anyone can recommend regarding modifying Wikimedia? I am still not familiar with their built in support system, so I haven't tried posting directly into their site.

As an example, a lot of people use scripts that reference wgPageName, which should return a value, or the title of the page. In my case, it is not returning anything. I am simply trying to echo that value right now and I'm not sure why it isn't working. Here is some example code:

$PageTitle = $wgPageName;

<?php echo "Title: " . $PageTitle . " 1"; ?>

For other detailed information, if it provides useful, I have this code sitting in the skin file. My goal is if a user is using my custom skin, it pulls different skin images based upon the page you are viewing. Another example, the page I am testing on appears in the URL as such "http://intranet/wiki/index.php/0x80070002", so I would imagine that wgPageName should return a value '0x80070002' but it isn't. I've also tried wgTitle and others, including trims and without using $, and multiple ways to echo the data within.

I will concede, however, that if I change my code to the following:

$PageTitle = "my value";

It also does not echo the variable. Perhaps I am just not doing something right?

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...