« MediaWiki/Mes Extensions » : différence entre les versions

Aucun résumé des modifications
Ligne 6 : Ligne 6 :
<br/>
<br/>
:{{code|collapse=Extrait de  {{img |/images/file.jpg|width=16}}LocalSettings.php| lang=php|code=
:{{code|collapse=Extrait de  {{img |/images/file.jpg|width=16}}LocalSettings.php| lang=php|code=
##joomla config
require_once("$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php");
require_once("$IP/extensions/AuthJoomla2/AuthJoomla2.php");
function wfProfileIn( $arg) {};
require_once("$IP/extensions/AuthJoomla2/joomlaconfig.php");
function wfProfileOut( $arg) {};


 
wfLoadExtension("WikiEditor" );
#extension for HTML
require_once("$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php");
require_once( "$IP/extensions/WikiEditor/WikiEditor.php" );
$wgDefaultUserOptions['usebetatoolbar'] = 1;
$wgDefaultUserOptions['usebetatoolbar'] = 1;
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;
Ligne 23 : Ligne 20 :


#ajout de code HTML
#ajout de code HTML
require_once("$IP/extensions/easyaddHTML.php");
#disabled require_once("$IP/extensions/easyaddHTML.php");
require_once("$IP/extensions/anysite.php");
 
#CategoryTree KO
 
require_once("$IP/extensions/CategoryTree/CategoryTree.php");
##Category Viewer
$wgUseAjax = true;
require_once("$IP/extensions/CategoryView/CategoryView.php");
$wgCategoryTreeDynamicTag=true;
wfLoadExtension( 'CategoryTree' );


#utilisé pour le plan du site
#utilisé pour le plan du site
require_once("$IP/extensions/NiceCategoryList/NiceCategoryList.php");
wfLoadExtension('NiceCategoryList');




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


$wgUFAllowedNamespaces[NS_MAIN] = true;
$wgUFAllowedNamespaces[NS_MAIN] = true;
Ligne 48 : Ligne 46 :


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


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


#piwik
require_once($IP.'/extensions/Piwik/Piwik.php');
$wgPiwikURL = "piwik1.jltryoen.fr/";
$wgPiwikIDSite = "1";


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


#pour ajouter des favoris
require_once("$IP/extensions/Favorites/favorites.php");
require_once("$IP/extensions/Favorites/favoritesparser.php");


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


# DeleteHistory
# DeleteHistory
Ligne 77 : Ligne 71 :


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


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


#purge
#purge
require_once( "$IP/extensions/Purge/Purge.php" );
wfLoadExtension( "Purge" );
 
$wgGroupPermissions['user']['purge'] = false;
$wgGroupPermissions['sysop']['purge'] = true;


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


#tabs
#tabs
include_once "$IP/extensions/Tabber/Tabber.php";
wfLoadExtension("Tabber");




#contactpage
#contactpage
require_once( "$IP/extensions/ContactPage/ContactPage.php" );
wfLoadExtension("ContactPage");
$wgContactConfig['default'] = array(
$wgContactUser = 'admin';
'RecipientUser' => 'root', // Must be the name of a valid account which also has a verified e-mail-address added to it.
$wgContactSender = $wgPasswordSender;
'SenderName' => 'Contact Form on ' . $wgSitename, // "Contact Form on" needs to be translated
$wgContactSenderName = 'Contact Form on ' . $wgSitename;
'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
#notitle
require_once( "$IP/extensions/NoTitle/NoTitle.php" );
wfLoadExtension("NoTitle");


#PipeEscape
#PipeEscape
Ligne 111 : Ligne 125 :


##CSS  CSS extension
##CSS  CSS extension
require_once("$IP/extensions/CSS/CSS.php");
wfLoadExtension("CSS");
 


##Category Viewer
require_once("$IP/extensions/CategoryView/CategoryView.php");
require_once("$IP/extensions/CategoryView/categoryparser.php");


##slideshow
##slideshow
Ligne 121 : Ligne 133 :


##categorycloud
##categorycloud
require_once "$IP/extensions/WikiCategoryTagCloud/WikiCategoryTagCloud.php";
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');





Version du 13 mai 2022 à 08:01

<keywords content="MediaWiki,extensions" />

Bilan de mes extensions à ce jour

voir   Special:Version



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');



Autoriser les pipes | dans les modèles

  • le caractère | est interprété dans les modèles comme séparateur de paramètres
Utiliser l'extension
ajouter {{#!: wiki text }} dans la partie qui contient le pipe pour que mediawiki ne l’interprète pas

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>


 


Masquer le titre d'une page

Utiliser l'extension

 


Comment ajouter un utilisateur

Voir l'extension