/**
  * static entry point for hook
  *
  * @static
  * @access public
  */
 public static function ArticleFromTitle(&$title, &$article)
 {
     if (!AutoHubsPagesHelper::isHubsPage($title)) {
         return true;
     }
     $article = new AutoHubsPagesArticle($title);
     return true;
 }
Esempio n. 2
0
/**
 * @param string $first_chunk
 * @return bool
 */
function wfAdProviderDARTFirstChunkForHubs(&$first_chunk)
{
    global $wgTitle;
    if (!AutoHubsPagesHelper::isHubsPage($wgTitle)) {
        return true;
    }
    $first_chunk = 'wka.' . AutoHubsPagesHelper::getSiteForHub($wgTitle) . '/_' . AutoHubsPagesHelper::getHubNameFromTitle($wgTitle) . '/hub';
    return true;
}
 * @author: Jakub Kurcek <*****@*****.**>
 *
 * @usage: SERVER_ID=177 php PartnerFeedContentImageGenerator.php --conf /usr/wikia/docroot/wiki.factory/LocalSettings.php
 */

ini_set( "include_path", dirname(__FILE__)."/../" );

require_once( 'commandLine.inc' );

echo( "Starting cache... \n\n" );

$PartnerFeedGenerator = new PartnerFeed;

foreach ( $PartnerFeedGenerator->allowedHubs() as $key => $val ){

	try {
		if ( !is_array($val) ){
			$oTitle = Title::newFromText( $key, 150 );
			$hubId = AutoHubsPagesHelper::getHubIdFromTitle( $oTitle );
			$PartnerFeedGenerator->ReloadHotContentFeed( $hubId );
			echo " {$key} | {$hubId} | {$oTitle->getText()} - ok \n";
		}
		
	} catch ( Exception $e ) {
		echo " {$val} | {$key} - Caught exception: $e->getMessage() \n";
	}
}
echo( "\n My job is done here \n" );

?>
Esempio n. 4
0
	</section><!-- END: #hub-top-wikis -->

</div><!-- END: #hub-featured-box -->

<div id="hub-side-box">
	<?php 
$hidetopblogs = '';
if (!$wgUser->isAllowed('corporatepagemanager')) {
    // normal user that will have it disabled/enabled
    if (!$data['var_feeds']['topblogs']) {
        $hidetopblogs = 'class="hiddenSection"';
    }
}
?>
	<?php 
if (AutoHubsPagesHelper::showAds()) {
    /* move to AdEngine, use hooks */
    ?>
	<div id='CORP_TOP_RIGHT_BOXAD' style='margin-top:-15px'><?php 
    echo AdEngine::getInstance()->getAd('CORP_TOP_RIGHT_BOXAD');
    ?>
</div>
	<?php 
}
?>


	<section id="hub-blogs"<?php 
echo $hidetopblogs;
?>
>
Esempio n. 5
0
 /**
  * @author Jakub Kurcek
  * @param format string 'rss' or 'atom'
  */
 private function FeedHotContent($format, $forceReload = false)
 {
     global $wgRequest;
     $defaultHubTitle = 'tv';
     $hubTitle = $wgRequest->getVal('hub');
     $allowedHubs = $this->allowedHubs();
     if (isset($allowedHubs[$hubTitle]) && !is_array($allowedHubs[$hubTitle])) {
         $oTitle = Title::newFromText($hubTitle, 150);
     } else {
         $oTitle = Title::newFromText($defaultHubTitle, 150);
     }
     $hubId = AutoHubsPagesHelper::getHubIdFromTitle($oTitle);
     $feedArray = $this->PrepareHotContentFeed($hubId, $forceReload);
     $this->showFeed($format, wfMsg('feed-title-hot-content', $oTitle->getText()), $feedArray);
 }
 public function executeSlider()
 {
     global $wgOut, $wgTitle, $wgParser;
     if (BodyController::isHubPage()) {
         $this->slider_class = "small";
         $tag_name = AutoHubsPagesHelper::getHubNameFromTitle($wgTitle);
         // Beware: the true/false at the end is important, it actually changes the return format slightly
         $this->slider = CorporatePageHelper::parseMsgImg('hub-' . $tag_name . '-slider', false);
         // render slider's HTML using WikiaPhotoGallery (BugId:8478)
         $slider = new WikiaPhotoGallery();
         $slider->setParser($wgParser);
         $wgParser->startExternalParse($wgTitle, new ParserOptions(), Parser::OT_HTML);
         $slider->parseParams(array('type' => 'slider', 'orientation' => 'bottom'));
         // add images
         $sliderWikitext = '';
         foreach ($this->slider as $image) {
             // ElmoControlRoom.jpg|Label|link=http://wikia.com|linktext=Link text
             // if parsgMsgImg has a thumbnail or the 2nd param=true (and right now it is not) then the return vals move around
             if (isset($image['param'])) {
                 // no thumbnail in msg
                 $sliderWikitext .= "{$image['param']}|{$image['title']}|link={$image['href']}|linktext={$image['imagetitle']}\n";
             } else {
                 // has thumbnail in msg
                 $sliderWikitext .= "{$image['imagetitle']}|{$image['title']}|link={$image['href']}|linktext={$image['desc']}\n";
             }
         }
         // set the content and parse it
         $slider->setText($sliderWikitext);
         $slider->parse();
         // render it
         $this->sliderHtml = $slider->toHTML();
     }
     if (WikiaPageType::isMainPage()) {
         $this->isMainPage = true;
         $this->slider_class = "big";
         $this->slider = CorporatePageHelper::parseMsgImg('corporatepage-slider', true);
     } else {
         $this->isMainPage = false;
     }
 }