Wikia code/includes/MediaTransformOutput.php
< Wikia code | includes
This page is obsolete. It is being retained for archival purposes. It may document extensions or features that are obsolete and/or no longer supported. Do not rely on the information here being up-to-date. The information shown below refers to the now unmaintained 1.16 MediaWiki release. The current stable release number is 1.42.3. |
--- D:\Programming\SVN\mediawiki\branches\REL1_16\phase3\includes\MediaTransformOutput.php 2011-07-18 22:31:28.366211000 +0100
+++ D:\Programming\SVN\wikia\trunk\includes\MediaTransformOutput.php 2011-08-17 15:28:46.719726600 +0100
@@ -110,7 +110,7 @@
*/
function ThumbnailImage( $file, $url, $width, $height, $path = false, $page = false ) {
$this->file = $file;
- $this->url = $url;
+ $this->url = wfReplaceImageServer( $url, $file->getTimestamp() );
# These should be integers when they get here.
# If not, there's a bug somewhere. But let's at
# least produce valid HTML code regardless.
@@ -151,6 +151,13 @@
$alt = empty( $options['alt'] ) ? '' : $options['alt'];
+ /**
+ * Note: if title is empty and alt is not, make the title empty, don't
+ * use alt; only use alt if title is not set
+ * wikia change, Inez
+ */
+ $title = !isset( $options['title'] ) ? $alt : $options['title'];
+
$query = empty( $options['desc-query'] ) ? '' : $options['desc-query'];
if ( !empty( $options['custom-url-link'] ) ) {
@@ -166,8 +173,16 @@
);
} elseif ( !empty( $options['desc-link'] ) ) {
$linkAttribs = $this->getDescLinkAttribs( empty( $options['title'] ) ? null : $options['title'], $query );
+ /* Wikia change begin - @author: Marooned, Federico "Lox" Lucignano */
+ /* Images SEO project */
+ if (Wikia::isOasis()) {
+ $linkAttribs['data-image-name'] = $this->file->getTitle()->getText();
+ $linkAttribs['href'] = $this->file->getFullUrl();
+ if (!empty($options['id'])) $linkAttribs['id'] = $options['id'];
+ }
+ /* Wikia change end */
} elseif ( !empty( $options['file-link'] ) ) {
- $linkAttribs = array( 'href' => $this->file->getURL() );
+ $linkAttribs = array( 'href' => wfReplaceImageServer( $this->file->getURL(), $this->file->getTimestamp() ) );
} else {
$linkAttribs = false;
}