Exemple #1
0
function setupMwRdf()
{
    global $wgParser, $wgMessageCache, $wgRequest, $wgOut, $wgHooks;
    $wgMessageCache->addMessages(array('rdf' => 'Rdf', 'rdf-inpage' => "Embedded In-page Turtle", 'rdf-dcmes' => "Dublin Core Metadata Element Set", 'rdf-cc' => "Creative Commons", 'rdf-image' => "Embedded images", 'rdf-linksfrom' => "Links from the page", 'rdf-links' => "All links", 'rdf-linksto' => "Links to the page", 'rdf-history' => "Historical versions", 'rdf-interwiki' => "Interwiki links", 'rdf-categories' => "Categories", 'rdf-target' => "Target page", 'rdf-modelnames' => "Model(s)", 'rdf-format' => "Output format", 'rdf-output-rdfxml' => "RDFXML", 'rdf-output-turtle' => "Turtle", 'rdf-output-ntriples' => "NTriples", 'rdf-instructions' => "Select the target page and RDF models you're interested in."));
    $wgParser->setHook('rdf', 'renderMwRdf');
    SpecialPage::addPage(new SpecialPage('Rdf', '', true, 'wfRdfSpecialPage', 'extensions/Rdf/Rdf.php'));
    SpecialPage::addPage(new SpecialPage('RdfQuery', '', true, 'wfSpecialRdfQuery', 'extensions/Rdf/Rdf.php'));
    # next we set some hooks for saving and clearing RDF data.  Each
    # hook is called on the same ModelingAgent object as it preserves
    # the list of pages we link to in its state
    $wgHooks['ArticleSave'][] = array('wfRdfOnArticleSave');
    $wgHooks['ArticleSaveComplete'][] = array('wfRdfOnArticleSaveComplete');
    $wgHooks['TitleMoveComplete'][] = array('wfRdfOnTitleMoveComplete');
    $wgHooks['ArticleDeleteComplete'][] = array('wfRdfOnArticleDeleteComplete');
    # Add an RDF metadata link if requested
    $action = $wgRequest->getText('action', 'view');
    # Note: $wgTitle not yet set; have to get it from the request
    $title = $wgRequest->getText('title');
    if (!isset($title) || strlen($title) == 0) {
        return true;
    }
    $nt = Title::newFromText($title);
    if (!isset($nt) || $nt->getNamespace() == NS_SPECIAL) {
        return true;
    }
    # finally *if* this is a page view we need to add the link
    if (!$action == 'view') {
        return true;
    }
    $rdft = Title::makeTitle(NS_SPECIAL, "Rdf");
    $target = $nt->getPrefixedDBkey();
    $linkdata = array('title' => 'RDF Metadata', 'type' => 'application/rdf+xml', 'href' => $rdft->getLocalURL("target={$target}"));
    $wgOut->addMetadataLink($linkdata);
    return true;
}
 function efEventsExtn()
 {
     global $wgMessageCache;
     SpecialPage::addPage(new EventsExtn());
     $wgMessageCache->addMessage('events', 'Events');
     $wgMessageCache->addMessage('events-header', '');
 }
Exemple #3
0
function wfExtensionAWCMultiFileUploader()
{
    global $wgMessageCache;
    $wgMessageCache->addMessages(array('awcmultifileuploader' => 'Multi-File Uploader'));
    //will expand
    SpecialPage::addPage(new SpecialPage('AWCMultiFileUploader', 'MultiFileUploader', true));
}
function wfCreatePageSetup()
{
    global $IP, $wgMessageCache, $wgOut;
    require_once $IP . '/includes/SpecialPage.php';
    /* add messages to all the translator people out there to play with */
    $wgMessageCache->addMessages(array('createpage' => 'Create a new article', 'createpage_button' => 'Create a new article', 'createpage_help' => '', 'createpage_caption' => 'title', 'createpage_button_caption' => 'Create!', 'createpage_title' => 'Create a new article', 'createpage_categories' => 'Categories:', 'createpage_title_caption' => 'Title:', 'createpage_loading_mesg' => 'Loading... please wait...', 'createpage_enter_text' => 'Text:', 'createpage_here' => 'here', 'createpage_show_cloud' => '[show category cloud]', 'createpage_hide_cloud' => '[hide category cloud]', 'createpage_alternate_creation' => 'or click $1 to use original editor', 'createpage_categories_help' => 'Categories help organize information in this wiki. Please choose from the list below or type a new one.'));
    SpecialPage::addPage(new SpecialPage('Createpage', '', true, 'wfCreatePageSpecial', false));
}
Exemple #5
0
function wfExtensionSpecialGoogleSitemap()
{
    global $wgMessageCache;
    $wgMessageCache->addMessages(array('googlesitemap' => 'Google Sitemap'));
    $wgAvailableRights[] = 'googlesitemap';
    $wgGroupPermissions['bureaucrat']['googlesitemap'] = true;
    SpecialPage::addPage(new SpecialPage('GoogleSitemap', 'userrights'));
}
function wfSpamRegexSetup()
{
    global $IP, $wgMessageCache;
    if (!wfSimplifiedRegexCheckSharedDB()) {
        return;
    }
    require_once $IP . '/includes/SpecialPage.php';
    wfLoadExtensionMessages('Spamregex');
    SpecialPage::addPage(new SpecialPage('Spamregex', 'spamregex', true, 'wfSpamRegexSpecial', false));
}
function wfRegexBlockSetup()
{
    global $IP;
    if (!wfSimplifiedRegexCheckSharedDB()) {
        return;
    }
    require_once $IP . '/includes/SpecialPage.php';
    SpecialPage::addPage(new SpecialPage('Regexblock', 'regexblock', true, 'wfRegexBlockSpecial', false));
    wfLoadExtensionMessages('RegexBlock');
}
function wfRebuildMessagesSetup()
{
    global $IP, $wgMessageCache;
    require_once $IP . '/includes/SpecialPage.php';
    require_once $IP . "/extensions/RebuildMessages/InitialiseMessages.inc";
    /* add messages to all the translator people out there to play with */
    $wgMessageCache->addMessages(array('rebuildmessages_button' => 'Go', 'rebuildmessages_help' => "This script is used to update the MediaWiki namespace after changing site language. You can choose either \n''update'' - Update messages to include latest additions to MessagesXX.php, or ''rebuild'' - Delete all messages and reinitialise namespace.\n\nIf a message dump file is given, messages will be read from it to supplement\nthe defaults in MediaWiki's Language*.php. The file should contain a serialized\nPHP associative array, as produced by dumpMessages.php.\n\n", 'rebuildmessages_caption' => "Message dump file", 'rebuildmessages_title' => "Rebuild Messages", 'rebuildmessages_this' => "this wiki", 'rebuildmessages_local' => "all local wikis", 'rebuildmessages_all' => "all wikis from a shared database", 'rebuildmessages_action' => "Options", 'rebuildmessages_options' => 'Choose action', 'rebuildmessages_success_title' => "Cleanup Spam Succedeed", 'rebuildmessages_success_subtitle' => "for \$1", 'rebuildmessages_error_not_valid' => "Not a valid hostname specification", 'rebuildmessages_error_empty' => "Please provide a file", 'rebuildmessages_count_zero' => "There are no articles containing links to \$1", 'rebuildmessages_cleanup_finished' => "The cleanup process has finished.", 'rebuildmessages_processing' => "cleaning up links to \$1", 'rebuildmessages_link_back' => "You can go back to the extension ", 'rebuildmessages_none_found' => "No articles found containing links to \$1.", 'rebuildmessages_no_local' => "There are no local wikis here. Try other modes.", 'rebuildmessages_update' => "running in update mode", 'rebuildmessages_rebuild' => "running in rebuild mode"));
    SpecialPage::addPage(new SpecialPage('Rebuildmessages', 'rebuildmessages', true, 'wfRebuildMessagesSpecial', false));
    $wgMessageCache->addMessages(array('rebuildmessages' => 'rebuild Messages'));
}
function wfCleanupSpamSetup()
{
    global $IP, $wgMessageCache;
    require_once $IP . '/includes/SpecialPage.php';
    require_once "{$IP}/extensions/SilentArticle.php";
    /* add messages to all the translator people out there to play with */
    $wgMessageCache->addMessages(array('cleanupspam_button' => 'Clean up spam', 'cleanupspam_help' => 'This special page provides means to revert back all pages containing a given url back to their non-contaminated states, or even blank them if no clean revisions exist. It allows a cleanup of this particular wiki, cleanup of all local wikis, or cleanup of all wikis in a shared database.', 'cleanupspam_caption' => 'Containing ', 'cleanupspam_file' => 'Against SpamBlacklist file', 'cleanupspam_title' => 'Cleanup Spam', 'cleanupspam_this' => 'this wiki', 'cleanupspam_total' => 'Found $1 link(s) total.', 'cleanupspam_local' => 'all local wikis', 'cleanupspam_all' => 'all wikis from a shared database', 'cleanupspam_on' => 'Clean up articles on', 'cleanupspam_or' => '<b>OR</b>', 'cleanupspam_action' => 'Choose action', 'cleanupspam_success_title' => 'Cleanup Spam Succedeed', 'cleanupspam_success_subtitle' => 'for $1', 'cleanupspam_error_not_valid' => 'Not a valid hostname specification', 'cleanupspam_both_modes' => 'Pick either mode: provide a link considered as spam or check whether to use Spam Blacklist.', 'cleanupspam_error_empty' => 'Please specify a url to cleanup', 'cleanupspam_count_zero' => 'There are no articles containing links to $1', 'cleanupspam_cleanup_finished' => 'The cleanup process has finished.', 'cleanupspam_processing' => 'cleaning up links to $1', 'cleanupspam_link_back' => 'You can go back to the extension ', 'cleanupspam_none_found' => 'No articles found containing links to $1.', 'cleanupspam_no_local' => 'There are no local wikis here. Try other modes.', 'cleanupspam_bad_regex' => 'Please specify more complete url'));
    SpecialPage::addPage(new SpecialPage('Cleanupspam', 'cleanupspam', true, 'wfCleanupSpamSpecial', false));
    $wgMessageCache->addMessage('cleanupspam', 'Clean up spam');
}
function wfRegexBlockStatsPageSetup()
{
    global $IP;
    if (!wfSimplifiedRegexCheckSharedDB()) {
        return;
    }
    require_once $IP . '/includes/SpecialPage.php';
    /* name, restrictions, */
    SpecialPage::addPage(new SpecialPage('Regexblockstats', 'regexblock', false, 'wfRegexBlockStatsCore', false));
}
 function setup()
 {
     global $IP;
     require_once "{$IP}/includes/SpecialPage.php";
     require_once $this->file;
     if (!is_array($this->params)) {
         $this->params = array($this->params);
     }
     $className = array_shift($this->params);
     $obj = extCreateObject($className, $this->params);
     SpecialPage::addPage($obj);
 }
Exemple #12
0
 /**
  * Extension setup
  */
 function setup()
 {
     global $wgParser, $wgLanguageCode, $wgMessageCache, $wgContLang;
     $this->cat = $wgContLang->getNsText(NS_CATEGORY);
     # Add the messages used (todo: move into i18n)
     if ($wgLanguageCode == 'en') {
         $wgMessageCache->addMessages(array('workflow' => $this->magic, 'workflowMissingStates' => "No workflow states defined", 'workflowStateUpdated' => "\$1 {$this->magic} state set to [[{$this->cat}:\$2|\$2]]."));
     }
     # Add the specialpage to the environment
     SpecialPage::addPage(new SpecialWorkflow());
     # Add the parser-function hook
     $wgParser->setFunctionHook($this->magic, array($this, 'expandMagic'));
     # Add the client-side scripts for changing states
     $this->addJS();
 }
Exemple #13
0
        function execute($par)
        {
            global $wgRequest, $wgEmailImage;
            $size = 4;
            $text = $wgRequest->getText('img');
            /* decode this rubbish */
            $text = rawurldecode($text);
            $text = str_rot13($text);
            $text = base64_decode($text);
            $text = str_replace($wgEmailImage['ugly'], "", $text);
            $fontwidth = imagefontwidth($size);
            $fontheight = imagefontheight($size);
            $width = strlen($text) * $fontwidth + 4;
            $height = $fontheight + 2;
            $im = @imagecreatetruecolor($width, $height) or exit;
            $trans = imagecolorallocate($im, 0, 0, 0);
            /* must be black! */
            $color = imagecolorallocate($im, 1, 1, 1);
            /* nearly black ;) */
            imagecolortransparent($im, $trans);
            /* seems to work only with black! */
            imagestring($im, $size, 2, 0, $text, $color);
            //header ("Content-Type: image/png"); imagepng($im); => IE is just so bad!
            header("Content-Type: image/gif");
            imagegif($im);
            exit;
        }
    }
    /* class */
    SpecialPage::addPage(new Email());
}
<?php

if (!defined('MEDIAWIKI')) {
    die;
}
global $IP;
require_once "{$IP}/includes/SpecialPage.php";
function doSpecialAddEditSitting()
{
    $MV_SpecialAddSitting = new MV_SpecialEditSitting();
    $MV_SpecialAddSitting->execute();
}
SpecialPage::addPage(new SpecialPage('Mv_add_edit_Sitting', '', true, 'doSpecialAddEditSitting', false));
//SpecialPage::addPage( new SpecialPage('Mv_add_edit_Sitting','',true,'doSpecialAddSitting',false) );
class MV_SpecialEditSitting extends SpecialPage
{
    function execute()
    {
        global $wgRequest, $wgOut, $wgUser, $wgArticle;
        $sitting_of = $wgRequest->getVal('sitting_of');
        $session_number = $wgRequest->getVal('session_number');
        $sitting_start_date_time = $wgRequest->getVal('sitting_start_date_and_time');
        $sitting_end_date_time = $wgRequest->getVal('sitting_end_date_and_time');
        $sitting_session_number = $wgRequest->getVal('sitting_session_number');
        $wpEditToken = $wgRequest->getVal('wpEditToken');
        $sitting_desc = $wgRequest->getVal('sitting_desc');
        $sitting_start_date = substr($sitting_start_date_time, 0, strpos($sitting_start_date_time, ' '));
        $sitting_start_time = substr($sitting_start_date_time, strpos($sitting_start_date_time, ' ') + 1);
        $sitting_end_date = substr($sitting_end_date_time, 0, strpos($sitting_end_date_time, ' '));
        $sitting_end_time = substr($sitting_end_date_time, strpos($sitting_end_date_time, ' ') + 1);
        $sitting_name = $sitting_of . '-' . $sitting_start_date;
<?php

if (!defined('MEDIAWIKI')) {
    die;
}
global $IP;
//require_once( "$IP/includes/SpecialPage.php" );
function doSpecialSittingTypes()
{
    $MV_SpecialSittingTypes = new MV_SpecialSittingTypes();
    $MV_SpecialSittingTypes->execute();
}
SpecialPage::addPage(new SpecialPage('Mv_Sitting_Types', '', true, 'doSpecialSittingTypes', true));
class MV_SpecialSittingTypes
{
    function __construct()
    {
    }
    function displayTypes()
    {
        global $sittingTypesTable, $mvgScriptPath;
        $html = '';
        $html = '<fieldset><legend>Add a Sitting Type</legend>';
        $dbr = wfGetDB(DB_SLAVE);
        $result = $dbr->select($sittingTypesTable, '*');
        if ($result == 0) {
            $html = 'There are currently no sitting types';
        } else {
            while ($row = $dbr->fetchobject($result)) {
                $html .= '<a title="Remove sitting type"' . ' href="' . $wgRequest->getRequestURL() . '&mv_action=rm_sitting_type&rid=' . $row->id . '"><img src="' . $mvgScriptPath . '/skins/images/delete.png"></a>';
                $html .= $row->type . "<br>";
Exemple #16
0
                        }
                    } else {
                        $sql = "UPDATE site_view_feeds SET \n\t\t\t\t\t\t\t\t`feed_title` = '" . addslashes($_POST["feedtitle"]) . "',\n\t\t\t\t\t\t\t\t`feed_ctg` = '" . addslashes($_POST["ctg"]) . "',\n\t\t\t\t\t\t\t\t`feed_order_by` = '" . addslashes($_POST["orderby"]) . "',\n\t\t\t\t\t\t\t\t`feed_count` = " . $_POST["show"] . "\n\t\t\t\t\t\t\t\tWHERE feed_id = " . $_POST["id"];
                        echo $sql;
                        $res = $dbr->query($sql);
                    }
                } else {
                    if ($_GET["Action"] == 2) {
                        if ($_POST["feed_id"]) {
                            $sql = "DELETE FROM `site_view_feeds` WHERE feed_id = " . $_POST["feed_id"];
                            echo $sql;
                            $res = $dbr->query($sql);
                        }
                    } else {
                        if (isset($_POST["items"]) && is_array($_POST["items"])) {
                            foreach ($_POST["items"] as $id => $itemOrder) {
                                $sql = "UPDATE site_view_feeds SET feed_item_order = " . $itemOrder . " WHERE feed_id = " . $id;
                                $res = $dbr->query($sql);
                                //echo $sql;
                            }
                        }
                    }
                }
            }
            $wgOut->setArticleBodyOnly(true);
        }
    }
    SpecialPage::addPage(new FeedAction());
    global $wgMessageCache, $wgOut;
    $wgMessageCache->addMessage('feedaction', 'just a test extension');
}
 */
if (!defined('MEDIAWIKI')) {
    die;
}
global $IP, $smwgIP;
//require_once($smwgIP . '/includes/SMW_Storage.php');
require_once "{$IP}/includes/SpecialPage.php";
require_once "{$IP}/includes/Title.php";
require_once "{$IP}/includes/QueryPage.php";
function doSpecialListStreams($par = null)
{
    list($limit, $offset) = wfCheckLimits();
    $rep = new MV_SpecialListStreams();
    return $rep->doQuery($offset, $limit);
}
SpecialPage::addPage(new SpecialPage('Mv_List_Streams', '', true, 'doSpecialListStreams', false));
class MV_SpecialListStreams extends QueryPage
{
    function getName()
    {
        return "List_Streams";
    }
    function isExpensive()
    {
        return false;
    }
    function isSyndicated()
    {
        return true;
    }
    function getPageHeader()
<?php

if (!defined('MEDIAWIKI')) {
    die;
}
global $IP;
require_once "{$IP}/includes/SpecialPage.php";
function doSpecialManageReaders()
{
    $MV_SpecialManageReaders = new MV_SpecialManageReaders();
    $MV_SpecialManageReaders->execute();
}
SpecialPage::addPage(new SpecialPage('Mv_manage_readers', '', true, 'doSpecialManageReaders', false));
class MV_SpecialManageReaders
{
    function execute()
    {
        global $wgOut, $wgJsMimeType, $mvgScriptPath;
        $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/managerandr.js\"></script>");
        $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_stream.js\"></script>");
        $html = '<div id="response"></div>';
        $html .= '<form name=test >';
        $html .= '<table>';
        $html .= '<tr><td>Editors</td><td></td><td>Readers assigned to the editor</td><td></td><td>Unassigned Readers</td></tr>';
        $html .= '<tr><td>';
        $html .= '<select name="editor" size=20 onchange=load()>';
        $html .= '</select>';
        $html .= '</td>';
        $html .= '<td>-></td>';
        $html .= '<td>';
        $html .= '<select name="assigned" size=20 width=20>';
 */
if (!defined('MEDIAWIKI')) die();

global $IP, $smwgIP;
//export types:
function doExportStream($par = null){$MvSpecialExport = new MV_SpecialExport('stream',$par);}
function doExportCat($par = null){$MvSpecialExport = new MV_SpecialExport('category',$par);}
function doExportSeq($par = null){$MvSpecialExport = new MV_SpecialExport('sequence',$par);}
function doExportSearch($par = null){$MvSpecialExport = new MV_SpecialExport('search',$par);}
function doExportAsk($par =null){$MvSpecialExport = new MV_SpecialExport('ask',$par);}

SpecialPage::addPage( new SpecialPage('MvVideoFeed','',true,'doExportCat',false) );
SpecialPage::addPage( new SpecialPage('MvExportStream','',true,'doExportStream',false) );
SpecialPage::addPage( new SpecialPage('MvExportSequence','',true,'doExportSeq',false) );
SpecialPage::addPage( new SpecialPage('MvExportSearch','',true,'doExportSearch',false) );
SpecialPage::addPage( new SpecialPage('MvExportAsk','',true,'doExportAsk',false) );

//extend supported feed types:
$wgFeedClasses['cmml']='CmmlFeed';
$wgFeedClasses['podcast']='PodcastFeed';

class MV_SpecialExport {
	var $feed = null;
	function __construct($export_type, $par){
		$this->export_type=$export_type;	
		$this->par = $par;	
		$this->execute();
	}
	//@@todo think about integration into api.php	
	function execute() {
		global $wgRequest, $wgOut, $wgUser, $mvStream_name, $mvgIP;
             $newtext = $epage->mArticle->preSaveTransform($newtext);
             $oldtitle = wfMsgExt('currentrev', array('parseinline'));
             $newtitle = wfMsgExt('yourtext', array('parseinline'));
             if ($oldtext !== false || $newtext != '') {
                 $de = new DifferenceEngine($epage->mTitle);
                 $de->setText($oldtext, $newtext);
                 $difftext = $de->getDiff($oldtitle, $newtitle);
             } else {
                 $difftext = '';
             }
             $diffdiv = '<div id="wikiDiff">' . $difftext . '</div>';
             $wgOut->addHTML($diffdiv);
         }
     }
     global $wgMessageCache;
     SpecialPage::addPage(new PocketDiff());
     $wgMessageCache->addMessage('pocketdiff', 'retrieves difference');
 }
 function wfWikiwygToggle($toggles)
 {
     global $wgMessageCache, $wgWysiwygEnabled;
     $wgMessageCache->addMessages(array('tog-in-page' => 'use in-page editor', 'wysiwygdef' => 'wysiwyg default mode', 'wikitextdef' => 'wikitext default mode'));
     $toggles["in-page"] = "in-page";
 }
 function wfWikiwygAddEditingPrefs($prefsForm, $prefs)
 {
     global $wgWysiwygEnabled;
     $prefs = array_merge($prefs, array('in-page'));
 }
 function wfWikiwygHandleEditingPrefs()
 {
Exemple #21
0
		  <tr>
		    <td class="challenge-form"><span class=req>*</span>the event date (mm/dd/yyyy)<br>
			<input type="text" class="createbox" size="10" name=date id=date value="' . $this->challenge_event_date . '"/></td>
		  </tr>
		  <tr>
		    <td class="challenge-form">description (ex: I\'m taking the Eagles w/ the spread (+3))<br>
			<textarea class="createbox" name=description id=description rows=1 cols=50>' . $this->challenge_description . '</textarea></td>
		  </tr>
		  <tr>
		    <td width="200" class="challenge-form"><span class=req>*</span>win terms (ex: My opponent must fill out the 1991 roster page)<br>
			<textarea class="createbox" name=win id=win rows=2 cols=50>' . $this->challenge_win_terms . '</textarea></td>
		  </tr>
		  <tr>
		    <td class="challenge-form"><span class=req>*</span>lose terms (ex: I am willing to edit the 2005 team results page)<br>
			<textarea class="createbox" name=lose id=lose rows=2 cols=50>' . $this->challenge_lose_terms . '</textarea></td>
		  </tr>
		  <tr>
		    <td colspan="2">
			<input type=hidden name=id value=' . $this->challenge_id . '>
			<input type="button" class="createbox" value="submit" size="20" onclick=challengeSend() />
			</td>
		  </tr>
		  </table>
	</form>';
            return $form;
        }
    }
    SpecialPage::addPage(new ChallengeUser());
    global $wgMessageCache, $wgOut;
    $wgMessageCache->addMessage('challengeuser', 'Challenge a User');
}
Exemple #22
0
        function execute()
        {
            global $wgUser, $wgOut;
            $wgOut->setPagetitle("Top Users");
            $dbr =& wfGetDB(DB_MASTER);
            $sql = "SELECT stats_user_id,stats_user_name, stats_total_points from user_stats where stats_year_id = 1 and stats_user_id <> 0 ORDER BY stats_total_points DESC LIMIT 0,50";
            $res = $dbr->query($sql);
            $header = wfMsg("topusersheader");
            if ($header != "&lt;topusersheader&gt;") {
                $out = $header;
            }
            // $out = "<span style='font-size:11px;color:#666666;'>Here are the top users since the new \"season\" started on March 7th, 2007.  Points are based on a super secret formula.<p><a href=\"index.php?title=ArmchairGM Top Users: Year 1\">Click here for the Top Users of the Inaugural Year</a></span><p>";
            $x = 1;
            $out .= "<div class=\"top-users\">\n    <div class=\"top-user-header\"><span class=\"top-user-num\">#</span><span class=\"top-user\">User</span><span class=\"top-user-points\">Points</span></div>";
            while ($row = $dbr->fetchObject($res)) {
                $user_name = $row->stats_user_name;
                $user_title = Title::makeTitle(NS_USER, $row->stats_user_name);
                $avatar = new wAvatar($row->stats_user_id, "s");
                $CommentIcon = $avatar->getAvatarImage();
                $out .= "<div class=\"top-user-row\">\n\t    \t\t<span class=\"top-user-num\">{$x}</span><span class=\"top-user\"><img src='images/avatars/" . $CommentIcon . "' alt='' border=''> <a href='" . $user_title->getFullURL() . "' class=\"top-user-link\">" . $row->stats_user_name . "</a><a href='" . $user_title->getTalkPage()->getFullURL() . "' class=\"top-user-talk\"><img src=\"images/commentIcon.gif\" border=\"0\" hspace=\"3\" align=\"middle\" alt=\"\" /></a>\n\t\t\t</span>";
                $out .= "<span class=\"top-user-points\">" . $row->stats_total_points . "</span>\n\t    \t</div>";
                $x++;
            }
            $out .= "</div>";
            $wgOut->addHTML($out);
        }
    }
    SpecialPage::addPage(new TopUsersPoints());
    global $wgMessageCache, $wgOut;
    //$wgMessageCache->addMessage( 'commenteaction', 'comment action' );
}
Exemple #23
0
                                $link2 = $skin->makeLinkObj($wgTitle, wfMsgForContent('review_user_details_link'), "mode=view_user_reviews&" . $user_link . "&page_id={$pid}");
                                $data2[] = $link1 . " " . $link2;
                            }
                            asort($data2);
                            if (count($data2) > 0) {
                                $out .= "<ol><li>" . implode("</li>\n<li>", $data2) . "</li></ul>";
                            }
                        }
                        $page_title = wfMsgForContent('review_for_user', $theuser->getName());
                    } else {
                        if ($mode == 'review') {
                            $out = $this->review_page($page_id, $rev_id);
                            $page_title = wfMsgForContent('review_page_review', $title->getPrefixedText());
                        } else {
                            $error = true;
                        }
                    }
                }
            }
            $this->setHeaders();
            if ($error) {
                $wgOut->addHTML(wfMsgForContent('review_error'));
            } else {
                $wgOut->setPageTitle($page_title);
                $wgOut->addHTML($out);
            }
        }
    }
    # end of class SpecialReview
    SpecialPage::addPage(new SpecialReview());
}
Exemple #24
0
        }
        function execute()
        {
            require_once 'includes/PageHistory.php';
            global $wgOut, $wgTitle;
            if ($_GET["pid"] != "") {
                $dbr =& wfGetDB(DB_SLAVE);
                $sql = "SELECT page_namespace,page_title FROM {$dbr->tableName('page')} WHERE page_id = " . $_GET["pid"];
                $res = $dbr->query($sql);
                while ($row = $dbr->fetchObject($res)) {
                    $title = Title::makeTitle($row->page_namespace, $row->page_title);
                    $title2 = $title->getText();
                }
            }
            if ($title2 != "") {
                $wgTitle = Title::newFromURL($title2);
                $wgArticle = new Article($wgTitle);
                $wgOut->setSquidMaxage($wgSquidMaxage);
                $h = new PageHistory($wgArticle);
                $h->History();
            }
            // This line removes the navigation and everything else from the
            // page, if you don't set it, you get what looks like a regular wiki
            // page, with the body you defined above.
            $wgOut->setArticleBodyOnly(true);
        }
    }
    SpecialPage::addPage(new PageHistoryAJAX());
    global $wgMessageCache, $wgOut;
    $wgMessageCache->addMessage('pagehistoryajax', 'just a test extension');
}
                return $s->admin_user_id;
            }
        }
        function execute()
        {
            global $wgRequest, $wgOut, $wgSiteView, $wgUser;
            if (!$wgSiteView->isUserAdmin() && !($wgUser->mId == $this->getOwnerID($wgRequest->getVal('name')))) {
                $wgOut->addHTML("Invalid Page");
                return;
            }
            $wgOut->addHTML("<span class=title>Add/Edit Site Logo</span><br><a  href=index.php?title=Special:ViewManager&method=edit&name=" . $_GET["name"] . ">Back to Edit Settings</a><br><br>");
            $form = new ViewLogo($wgRequest);
            $form->execute();
        }
    }
    SpecialPage::addPage(new ViewManagerLogo());
    global $wgMessageCache, $wgOut;
    $wgMessageCache->addMessage('viewmanagerlogo', 'just a test extension');
}
/**
 *
 * @package MediaWiki
 * @subpackage SpecialPage
 */
class ViewLogo
{
    /**#@+
     * @access private
     */
    var $mUploadFile, $mUploadDescription, $mIgnoreWarning;
    var $mUploadSaveName, $mUploadTempName, $mUploadSize, $mUploadOldVersion;
                print '<p><b>Please check there were no errors</b></p>';
                $returntitle = Title::newFromText('Special:MVAdmin');
                print '<p> Return to <a href="' . htmlspecialchars($returntitle->getFullURL()) . '">Special:MVAdmin</a></p>';
                print '</body></html>';
                ob_flush();
                flush();
                return;
            }
        }
        /**** Normal output ****/
        $html = '<p>This special page helps you during installation and upgrade of 
					<a href="http://metavid.ucsc.edu/wiki/index.php/MetaVidWiki">MetaVidWiki</a>. Remember to backup valuable data before 
					executing administrative functions.</p>' . "\n";
        // creating tables and converting contents from older versions
        $html .= '<form name="buildtables" action="" method="POST">' . "\n" . '<input type="hidden" name="action" value="updatetables" />' . "\n";
        $html .= '<h2>Preparing database for  MetaVidWiki</h2>' . "\n" . '<p>MetaVidWiki requires some minor extensions to the MediaWiki database in 
				order to store the video data. The below function ensures that your database is
				set up properly. The changes made in this step do not affect the rest of the 
				MediaWiki database, and can easily be undone if desired. This setup function
				can be executed multiple times without doing any harm, but it is needed only once on
				installation or upgrade.<p/>' . "\n";
        $html .= '<p>If the operation fails with obscure SQL errors, the database user employed 
				by your wiki (check your LocalSettings.php) probably does not have sufficient 
				permissions. Either grant this user additional persmissions to create and delete 
				tables, or temporarily enter the login of your database root in LocalSettings.php.<p/>' . "\n" . '<input type="hidden" name="udsure" value="yes"/>' . '<input type="submit" value="Initialise or upgrade tables"/></form>' . "\n";
        $wgOut->addHTML($html);
        return true;
    }
}
SpecialPage::addPage(new MVAdmin());
 * @author Michael Dale
 * @email dale@ucsc.edu
 * @url http://metavid.ucsc.edu
 * 
 */
if (!defined('MEDIAWIKI')) {
    die;
}
global $IP;
require_once "{$IP}/includes/SpecialPage.php";
function doSpecialAddSitting()
{
    $MV_SpecialAddSitting = new MV_SpecialAddSitting();
    $MV_SpecialAddSitting->execute();
}
SpecialPage::addPage(new SpecialPage('Mv_Add_Sitting', '', true, 'doSpecialAddSitting', false));
class MV_SpecialAddSitting
{
    function execute()
    {
        global $wgRequest, $wgOut, $wgUser, $mvSitting_name, $mvgIP, $wgJsMimeType, $mvgScriptPath, $wgArticle, $sittingTypesTable;
        $sitting_of = $wgRequest->getVal('sitting_of');
        $session_number = $wgRequest->getVal('session_number');
        $sitting_start_date_time = $wgRequest->getVal('sitting_start_date_and_time');
        $sitting_end_date_time = $wgRequest->getVal('sitting_end_time');
        $sitting_session_number = $wgRequest->getVal('sitting_session_number');
        $wpEditToken = $wgRequest->getVal('wpEditToken');
        $sitting_desc = $wgRequest->getVal('sitting_desc');
        //$sitting_of.'-'.$sitting_start_date_time.'-'
        if ($sitting_of != '') {
            $sitting_name = $sitting_of . '-' . $sitting_start_date_time;
function wfSetupEasyGallery()
{
    global $wgLanguageCode, $wgMessageCache, $wgUser, $wgRequest;
    # Ensure the code only runs if it is a Easygallery and the user is logged in
    $sgnewtitle = Title::newFromText($wgRequest->getText('title'));
    if (preg_match('%(EasyGallery)(.*)%', $sgnewtitle) && !$wgUser->isAnon()) {
        # Add the messages used by the specialpage
        #	if ($wgLanguageCode == 'en') {
        $wgMessageCache->addMessages(array('easygallery' => 'EasyGallery Specialpage', 'easygalleryMessage' => "EasyGallery: <tt>Use this special page to create a gallery</tt>", 'easygallerySuccessMessage' => "<br /><b>EasyGallery has successfully posted your data.</b><br />"));
        #	}
        # Add the special page to the environment
        SpecialPage::addPage(new SpecialEasyGallery());
    }
}
 */
if ($mgVersion < 10700) {
    if (!function_exists('__autoload')) {
        function __autoload($class_name)
        {
            global $wgAutoloadClasses;
            if (array_key_exists($class_name, $wgAutoloadClasses)) {
                require_once $wgAutoloadClasses[$class_name];
            }
        }
    }
    if (!class_exists('SpecialPage')) {
        require_once dirname(__FILE__) . '/../../includes/SpecialPage.php';
    }
    $manager = new MultiLanguageManager();
    SpecialPage::addPage($manager);
} else {
    $wgSpecialPages['MultiLanguageManager'] = 'MultiLanguageManager';
}
$wgExtensionFunctions[] = "wfMultiLanguageManagerExtension";
function wfMultiLanguageManagerExtension()
{
    MultiLanguageManager::loadMessages();
}
/**
 * Register the Hooks used by this extension
 */
$wgHooks['LoadAllMessages'][] = 'mlLoadMessages';
//1.8.0
$wgHooks['SkinTemplateContentActions'][] = 'mlAddLanguageAction';
//1.5.0
<?php

if (!defined('MEDIAWIKI')) {
    die;
}
global $IP;
require_once "{$IP}/includes/specials/SpecialUpload.php";
function doSpecialUpload()
{
    global $wgRequest;
    $form = new MV_SpecialUpload($wgRequest);
    $form->execute();
}
SpecialPage::addPage(new SpecialPage('Mv_special_upload', '', false, 'doSpecialUpload', false));
class MV_SpecialUpload extends UploadForm
{
    //	function MV_SpecialUpload($wgRequest)
    //	{
    //	$this->wg = $wgRequest;
    //		parent :: MV_SpecialUpload($wgRequest);
    //	}
    function uploadWarning($warning)
    {
        global $wgOut;
        global $wgUseCopyrightUpload;
        $this->mSessionKey = $this->stashSession();
        if (!$this->mSessionKey) {
            # Couldn't save file; an error has been displayed so let's go.
            return;
        }
        $wgOut->addHTML(Xml::element('h2', null, wfMsg('uploadwarning')) . "\n");