MediaWiki/Mes Extensions

<keywords content="MediaWiki,extensions" />

Mon Skin

Voir   MediaWikiBootStrap5

Bilan de mes extensions à ce jour

voir aussi   Special:Version



Mes Extensions
Extension Description
La caractère |

est interprété dans les modèles comme séparateur de paramètres

exemple:
{{#!:  media|wikitext}}


=> media|wikitext

 
Masquer le titre d'une page
 


Incrémenter une variable statique dans les modèles
{{AUTOINCREMENT}}, {{AUTOINCREMENT}}, {{AUTOINCREMENT}}


=> 1,2,3

 
Ajouter un utilisateur
 


 
Créer un Plan de site
 
ex:  Plan du site 
 
Gérer les accès aux catégories suivant l'utilisateur
 




require_once("$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php");
function wfProfileIn( $arg) {};
function wfProfileOut( $arg) {};

wfLoadExtension("WikiEditor" );
$wgDefaultUserOptions['usebetatoolbar'] = 1;
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;
$wgDefaultUserOptions['wikieditor-highlight'] = 1;

#control categories
require_once("$IP/extensions/CategoryControl/CategoryControl.php");
require_once("$IP/extensions/CategoryControl/config.php");

#ajout de code HTML
#disabled require_once("$IP/extensions/easyaddHTML.php");


##Category Viewer
require_once("$IP/extensions/CategoryView/CategoryView.php");
wfLoadExtension( 'CategoryTree' );

#utilisé pour le plan du site
wfLoadExtension('NiceCategoryList');


#fonctions speciales
require_once("$IP/extensions/UserFunctions/UserFunctions.php");
wfLoadExtension("ParserFunctions");
$wgPFEnableStringFunctions = true;

$wgUFAllowedNamespaces[NS_MAIN] = true;
# User Functions enabled in User Mainspace, but not in Main one.
$wgUFAllowedNamespaces = array(
        NS_MAIN => false,
        NS_USER => true
);
# Enable all User Functions in all NS numbered from 0 to 200
$wgUFAllowedNamespaces = array_fill(0, 200, true);

#UserAdmin est une extension qui permet aux administrateurs d'ajouter des utilisateurs
//require_once("$IP/extensions/UserAdmin/UserAdmin.php");

#piwik => matomo
wfLoadExtension("Matomo");
$wgMatomoURL = "piwik.jltryoen.fr/";
$wgMatomoIDSite = "1";


#pour ajouter des keyword
require_once('extensions/MetaKeywordsTag.php');
wfLoadExtension('WikiSEO');
#pour ajouter des favoris
wfLoadExtension("Favorites");


#pour ajouter wikipedia
require_once("$IP/extensions/Wikipedia/wikipedia.php");
require_once("$IP/extensions/Wikipedia/wikipediaparser.php");


# DeleteHistory
$wgGroupPermissions['sysop']['DeleteHistory'] = true;
include('extensions/DeleteHistory/DeleteHistory.php');

#Extension DeleteOldRevisions obsolete with version 1.24.0
$wgGroupPermissions['sysop']['DeleteOldRevisions'] = true;
require_once("$IP/extensions/DeleteOldRevisions2/SpecialDeleteOldRevisions2.php");

#Extension ExpandTemplates
#require_once("$IP/extensions/ExpandTemplates/ExpandTemplates.php");

#purge
wfLoadExtension( "Purge" );
$wgGroupPermissions['user']['purge'] = false;
$wgGroupPermissions['sysop']['purge'] = true;

#htmltags
wfLoadExtension( "HTMLTags" );
$wgHTMLTagsAttributes['a'] = array( 'href', 'class' , 'data-bs-toggle','aria-expanded', 'aria-controls');
$wgHTMLTagsAttributes['img'] = array( 'src', 'style', 'width' );
$wgHTMLTagsAttributes['i'] = array( 'class' );
$wgHTMLTagsAttributes['div'] = array( 'class' );
$wgHTMLTagsAttributes['option'] = array( 'onClick' );
$wgHTMLTagsAttributes['select'] = array( 'width','style' );

#tabs
wfLoadExtension("Tabber");


#contactpage
wfLoadExtension("ContactPage");
$wgContactConfig['default'] = array(
        'RecipientUser' => 'root', // Must be the name of a valid account which also has a verified e-mail-address added to it.
        'SenderName' => 'Contact Form on ' . $wgSitename, // "Contact Form on" needs to be translated
        'SenderEmail' => null, // Defaults to $wgPasswordSender, may be changed as required
        'RequireDetails' => false, // Either "true" or "false" as required
        'IncludeIP' => true, // Either "true" or "false" as required
        'MustBeLoggedIn' => false, // Check if the user is logged in before rendering the form
        'AdditionalFields' => array(
                'Text' => array(
                        'label-message' => 'emailmessage',
                        'type' => 'textarea',
                        'rows' => 20,
                        'required' => true,  // Either "true" or "false" as required
                ),
        ),
        // Added in MW 1.26
        'DisplayFormat' => 'table',  // See HTMLForm documentation for available values.
        'RLModules' => array(),  // Resource loader modules to add to the form display page.
        'RLStyleModules' => array(),  // Resource loader CSS modules to add to the form display page.
);

#notitle
wfLoadExtension("NoTitle");

#PipeEscape
require_once("$IP/extensions/PipeEscape/PipeEscape.php");

##CSS  CSS extension
wfLoadExtension("CSS");



##slideshow
require_once("$IP/extensions/SlideShow/slideshowparser.php");

##categorycloud
wfLoadExtension("WikiCategoryTagCloud");

##variables
wfLoadExtension( 'Variables' );

##autoincrement
require_once "$IP/extensions/Autoincrement/Autoincrement.php";

##
require_once "$IP/extensions/Hello/helloparser.php";
require_once "$IP/extensions/Meteo/meteoparser.php";

##
#require_once( "$IP/extensions/FileSystemListing/FileSystemListing.php" );

##
#Semanti mediawiki
wfLoadExtension( 'SemanticMediaWiki' );
enableSemantics( $semanticURL, true );

$GLOBALS['sespSpecialProperties'] = array('_PAGEID');
define('NS_DEMO' , 202);
$wgExtraNamespaces[NS_DEMO] = "Demo";
define('NS_RACE' , 203);
$wgExtraNamespaces[NS_RACE] = "Race";
define('NS_MUSIC' , 204);
$wgExtraNamespaces[NS_MUSIC] = "Music";

$smwgNamespacesWithSemanticLinks[NS_DEMO] = True;
$smwgNamespacesWithSemanticLinks[NS_RACE] = True;
$smwgNamespacesWithSemanticLinks[NS_MUSIC] = True;
$smwgNamespacesWithSemanticLinks[NS_TEMPLATE] = True;

$smwgPageSpecialProperties = array( '_CDAT' );
$wgDisableCounters = False;
wfLoadExtension( 'SemanticResultFormats' );
wfLoadExtension( 'SemanticExtraSpecialProperties' );
wfLoadExtension( 'SemanticExtraSpecialProperties' );
wfLoadExtension( 'ModernTimeline' );
$srfgFormats = array('calendar', 'broadtable','outline', 'tagcloud', 'timeline', 'eventcalendar','table', 'eventline','list', 'icalendar','sparkline');
//require_once( "$IP/extensions/SMWAskAPI/SMWAskAPI.php" );

##
wfLoadExtension("DataTransfer");

##
wfLoadExtension("DeleteBatch");


##fullcalendar
require_once("$IP/extensions/FullCalendar/fullcalendarparser.php");

wfLoadExtension( 'MagicNoCache' );


wfLoadExtension( 'SecureInclude' );
$wg_include_allowed_features['iframe'] = true;


wfLoadExtension( 'AutoSitemap' );
require_once("$IP/extensions/AutoSitemap/config.php");

wfLoadExtension('FontAwesome');



Comment puis-je insérer des pages HTML dans les pages wiki

Une solution : l'extension addHTML


l'extension n'est plus compatible avec la version 1.19.1 Je l'ai remplacé par
 


cette extension n'est plus maintenue , en voila le code


$wgHooks['ParserFirstCallInit'][] = "efSampleSetup";
function efSampleSetup(Parser $parser) {
    $parser->setHook( 'addhtml', 'efSampleRender' );
        return true;
}

function checkPageEditRestriction( &$title )
        // v1.1 feature
        // where $title is a Mediawiki Title class object instance
{
        $proceed = false;
 
        $state = $title->getRestrictions('edit');
        foreach ($state as $index => $group )
                if ( $group == 'sysop' )
                        $proceed = true;

        return $proceed;               
}
 
function efSampleRender( $input, $args, $parser, PPFrame $frame  ) {
    // Nothing exciting here, just escape the user-provided
    // input and throw it back out again
        if (!checkPageEditRestriction( $parser->mTitle ))
                return "unauthorized usage of <b>addHtml</b> extension.";
    return $input;
}


  • exemple:
< addhtml>
<iframe src="http://stim.com/" width=600 height=500>
</iframe>
</ addhtml>