Jump to content

where is the image file name?


XpertWorlock

Recommended Posts

Hi, I have a wiki and when an image loads I'm trying to single out where in the script is the exact file name for the image i.e.  name.jpg

 

/* private */ var $img;  // Image object this page is shown for
/* private */ var $repo;
var $mExtraDescription = false;

function __construct( $title, $time = false ) {
	parent::__construct( $title );
	$this->img = wfFindFile( $this->mTitle, $time );
	if ( !$this->img ) {
		$this->img = wfLocalFile( $this->mTitle );
		$this->current = $this->img;
	} else {
		$this->current = $time ? wfLocalFile( $this->mTitle ) : $this->img;
	}
	$this->repo = $this->img->repo;

 

If I echo ($this->title); I get image:name.jpg  (that's just how wiki does it)

for example, blue_hills.jpg

when echoed would be image:blue hills.jpg

 

I have 2 choices

 

#1.  In that script is the actual filename (which would be easiest).

#2.  PHP scripting to change image:blue hills.jpg to blue_hills.jpg (Later on in the page I need to get info from the database)

 

Anyone able to help me out where I should go or if they can figure out the script above better than I can.

 

Thanks

Mike

Link to comment
https://forums.phpfreaks.com/topic/111073-where-is-the-image-file-name/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.