Difference between revisions of "My MediaWiki help"

From Sinfronteras
Jump to: navigation, search
(Página blanqueada)
Line 1: Line 1:
 +
===Errores solucionados===
 +
====Extensiones o configuraciones que podrían generar errores eventualmente====
 +
IndentSections Ver [[Help MediaWiki#Indent Sections|Indent Sections]]
  
 +
====Media Wiki Search Error====
 +
Cuando trataba de hacer una búsqueda en el MediaWiki (Search) se generaba un error que decía:
 +
 +
A database query syntax error has occurred. This may indicate a bug in the software.
 +
 +
Se ha producido un error en la consulta a la base de datos. Esto puede indicar un fallo en el software.
 +
 +
Esto se solucionó siguiendo lo explicado en esta página: http://clusterfrak.com/kb/apps_kb/mediawiki_search_error/#media-wiki-search-error
 +
 +
First you need to log into the database server hosting the database for the MediaWiki application. Select or "use" the database and remove the corrupted searchindex table, and create a fresh one to take it's place. This can be done by using the following sql statement:
 +
 +
<syntaxhighlight lang="sql">
 +
CREATE TABLE `es_searchindex` (`si_page` INT(10) UNSIGNED NOT NULL,`si_title` VARCHAR(255) NOT NULL DEFAULT '',`si_text` mediumtext NOT NULL,UNIQUE KEY `si_page` (`si_page`),FULLTEXT KEY `si_title` (`si_title`),FULLTEXT KEY `si_text` (`si_text`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 +
</syntaxhighlight>
 +
 +
Then, regen Search Index:
 +
 +
cd /var/www/html/mysite/mediawiki-1.19.1/maintenance
 +
 +
php rebuildtextindex.php
 +
 +
===Interesante===
 +
Como hacer una animación en matlab que retorna un .gif e incluir el archivo en una página en el Wiki: https://commons.wikimedia.org/wiki/File:Snells_law_wavefronts.gif
 +
 +
===Referencias cruzadas entre Figuras, Tablas, etc===
 +
Para realizar referencias con links entre Figuras y Tablas de forma similar a Latex, vamos a usar la '''Extension:CrossReference''':
 +
 +
https://www.mediawiki.org/wiki/Extension:CrossReference
 +
 +
<syntaxhighlight lang="mediawiki">
 +
LET’s look at the '''titles''' table in Figure <xr id="fig:dbscheme"/>.
 +
 +
...
 +
...
 +
...
 +
 +
<figure id="fig:dbscheme">
 +
[[File:Sample_database_scheme.png |950px | thumb | center |<caption>Esquema de la base de datos ''books''.</caption>]]
 +
</figure>
 +
</syntaxhighlight>
 +
 +
 +
LET’s look at the '''titles''' table in Figure <xr id="fig:dbscheme"/>.
 +
 +
...
 +
...
 +
...
 +
 +
<figure id="fig:dbscheme">
 +
[[File:Sample_database_scheme.png |950px | thumb | center | Esquema de la base de datos ''books''.]]
 +
</figure>
 +
 +
===Indent Sections===
 +
Extension:IndentSections: https://www.mediawiki.org/wiki/Extension:IndentSections
 +
 +
The IndentSections extension causes all sections to be automatically indented as if they were inside nested blockquotes.
 +
 +
Utilizando esta extensión, cada subsección será generada con una sangría (Indentation). Esto es muy conveniente para que la página pueda ser leída con facilidad.
 +
 +
La extensión que se encuentra en la link de arriba no funciona correctamente, pues no general la indentation de manera automática, sino que <nowiki>Se debe colocar <blockquote> antes de la parte que queremos identar y cerramos el bloque identado con </blockquote></nowiki>
 +
 +
La solución se encuentra descrita en la página «talk» de esta extensión: https://www.mediawiki.org/wiki/Extension_talk:IndentSections
 +
 +
El código propuesto en dicha página lo hemos colocado en la carpeta de la extensión en un archivo que hemos llamado: IndentSections2.php
 +
 +
El código propone dos formas de hacer la indentation. Además, el código es tan corto que es fácil editarlo para cambiar, por ejemplo, el tamaño de la indentation.
 +
 +
Este código podría generar errores en el MediaWiki ya que no es una extensión mantenida y actualizada. Sin embargo, parece estar funcionando correctamente.
 +
 +
For greater control over styling nested sections, see https://www.mediawiki.org/wiki/Extension:StyleByHeaderTree
 +
 +
==Tamaño de letra - font size==
 +
El tamaño de la letra puede ser cambiado a través de plantillas como esta:
 +
https://en.wikipedia.org/wiki/Template:Big
 +
 +
He importado la plantilla big
 +
 +
{{big|Will make the text here larger}}
 +
 +
==Subir archivos==
 +
 +
===Pré-requis et configuration===
 +
 +
Ver el handbook del stage
 +
 +
====S’assurer que l’option de chargement de fichiers est activée en PHP====
 +
 +
Pour cela il faut fixer '''file_uploads = On''' dans le fichier php.ini qui se trouve dans l’un des fichiers listé ci-dessous :
 +
 +
/etc/php/php.ini, /etc/php4/php.ini /etc/php5/cli/php.ini, /etc/php5/apache2/php.ini
 +
 +
OpenSUSE 11.2 : /usr/local/lib/php.ini
 +
 +
En Win32 C:\Windows\php.ini
 +
 +
====Vérifier les droits du répertoire====
 +
 +
Les droits du répertoire /images de MediaWiki doivent être configurer tel que 755.
 +
 +
Si l’option de save_mode est mise en place, on doit s’assurer que le répertoire /images appartient à l’utilisateur qui exécute le script php (c’est-à-dire, l’utilisateur Apache):
 +
 +
sudo chown -R www-data:www-data images/
 +
o
 +
sudo chown -R www-data images/
 +
 +
====Activer le chargement de fichiers en ligne====
 +
 +
En LocalSettings.php il faut configurer:
 +
 +
$wgEnableUploads = true; # Enable uploads
 +
 +
====Para permitir la subida de archivos con extensiones diferentes a las permitidas por defecto====
 +
 +
Se debe editar o agregar la siguiente variable al LocalSettings.php: https://www.mediawiki.org/wiki/Manual:$wgFileExtensions/fr
 +
 +
$wgFileExtensions = array(
 +
    'png', 'gif', 'jpg', 'jpeg', 'jp2', 'webp', 'ppt', 'pdf', 'psd',
 +
    'mp3', 'xls', 'xlsx', 'swf', 'doc','docx', 'odt', 'odc', 'odp',
 +
    'odg', 'mpp'
 +
    );
 +
 +
====Cambiar el tamaño máximo de los archivos cargados en el wiki====
 +
https://www.mediawiki.org/wiki/Manual:Configuring_file_uploads/fr#Set_maximum_size_for_file_uploads
 +
 +
By default, the configuration code in php.ini limits the size of files to be uploaded to 2 megabytes (and the maximum size of a post operation to 8 megabytes). To allow uploading of larger files, edit these parameters in php.ini:
 +
 +
    post_max_size = 8 megabytes large by default
 +
    upload_max_filesize = 2 megabytes large by default
 +
 +
'''Locating the php.ini file'''
 +
 +
The location of the php.ini file varies on the distribution you are using. (Try "locate php.ini" or "php -i" to find the location of your config file.)
 +
 +
It is important to change the php.ini file in the apache2 folder. For example, there may be a core default php.ini at:
 +
/etc/php5/cli/php.ini as well as one at /etc/php5/apache2/php.ini
 +
 +
If you are using mod_php (most common), the most likely location for the correct php.ini file is in:
 +
/etc/php5/apache2 or /etc/php/7.0/apache2
 +
 +
For php-fastcgi, edit /etc/php5/cgi/php.ini.
 +
 +
En mi caso el archivo '''php.ini''' se encuentra en: '''/etc/php5/apache2'''
 +
 +
You may need to '''restart Apache or IIS''' after altering your PHP or web server configuration. ('''sudo /etc/init.d/apache2 restart''' in Linux, for example.)
 +
 +
==Configurar la pemisología de los usuarios==
 +
Wiki privado o Wiki público
 +
 +
Para permitir que usuarios anónimos tengan acceso a visualizar o editar páginas, debemos editar las siguientes variables en el LocalSettings.php:
 +
 +
Para un Wiki Privado:
 +
# The following permissions were set based on your choice in the installer
 +
$wgGroupPermissions['*']['createaccount'] = false;
 +
$wgGroupPermissions['*']['edit'] = false;
 +
$wgGroupPermissions['*']['read'] = false;
 +
 +
Si queremos, por ejemplo, que usuarios anónimos puedan ver las páginas:
 +
$wgGroupPermissions['*']['read'] = true;
 +
 +
==Cambiar la página principal-mainpage-homepage==
 +
 +
Editar: MediaWiki:Mainpage
 +
 +
How do I change which page is the main page?
 +
 +
By default, MediaWiki looks for a page with the title Main Page and serves this as the default page. This can be changed by altering the contents of MediaWiki:Mainpage to point to a different title. If this does not change the 'Main Page' link included on the sidebar at install time, edit MediaWiki:Sidebar. https://www.mediawiki.org/wiki/Manual:FAQ#How_do_I_change_which_page_is_the_main_page.3F
 +
 +
Ver también: http://www.mediawiki.org/wiki/Thread:Project:Support_desk/How_to_change_the_default_Main_Page_title_and_the_URL
 +
 +
==Permitir la visualización de algunas páginas en un Wiki privado para usuarios sin cuentas==
 +
Colocar la siguiente orden en el LocalSettings.php http://stackoverflow.com/questions/18255768/how-to-deny-access-to-all-pages-and-allow-only-for-certain-on-wiki
 +
 +
# allow everyone read access to these pages:
 +
$wgWhitelistRead = array( "Main Page", "Public stuff" );
 +
 +
==Páginas especiales y .css==
 +
http://perso.sinfronteras.ws/index.php/Especial:PáginasEspeciales
 +
 +
http://perso.sinfronteras.ws/index.php/MediaWiki:Common.css
 +
 +
http://perso.sinfronteras.ws/index.php/Usuario:Adelo_Vieira/skin.css
 +
 +
===Para ver la versión de MediaWiki instalada y las extensiones adicionadas===
 +
http://perso.sinfronteras.ws/index.php/Especial:Versión
 +
 +
===Personalizar el formato de los títulos de las secciones===
 +
https://en.wikipedia.org/wiki/Help:Section
 +
 +
https://www.siteground.com/kb/how_to_change_the_font_color_for_the_headings_in_mediawiki/
 +
 +
===Customize the sidebar===
 +
http://perso.sinfronteras.ws/index.php/MediaWiki:Sidebar
 +
 +
https://www.mediawiki.org/wiki/Manual:Interface/Sidebar#Customize_the_sidebar
 +
 +
http://www.mediawiki.org/wiki/Manual:Interface/Sidebar#Sidebar_width_in_Vector_skin_.28CSS.29
 +
 +
====Cambiar el espesor de la sidebar in vector skin====
 +
En los dos links anteriores se muestra como hacerlo, pero los cambios se realizan en todas las páginas y yo quiero hacerlo sólo en una página.
 +
 +
===Oculta el título de una página===
 +
Colocar la siguiente línea en http://perso.sinfronteras.ws/index.php/MediaWiki:Common.css
 +
 +
<nowiki>body.page-Ciencia h1.firstHeading { display: none; }</nowiki>
 +
 +
===Realizar cambios en una sóla página===
 +
http://www.mediawiki.org/wiki/Manual:FAQ/tr
 +
 +
No tratra el caso específico del espesor de la sidebar
 +
 +
==Descargar extensiones del sitio oficial de MediaWiki==
 +
https://www.mediawiki.org/wiki/Special:ExtensionDistributor
 +
 +
==Editar y dar formato a las páginas==
 +
 +
https://www.mediawiki.org/wiki/Help:Formatting

Revision as of 19:43, 15 October 2017

Errores solucionados

Extensiones o configuraciones que podrían generar errores eventualmente

IndentSections Ver Indent Sections

Media Wiki Search Error

Cuando trataba de hacer una búsqueda en el MediaWiki (Search) se generaba un error que decía:

A database query syntax error has occurred. This may indicate a bug in the software.
Se ha producido un error en la consulta a la base de datos. Esto puede indicar un fallo en el software.

Esto se solucionó siguiendo lo explicado en esta página: http://clusterfrak.com/kb/apps_kb/mediawiki_search_error/#media-wiki-search-error

First you need to log into the database server hosting the database for the MediaWiki application. Select or "use" the database and remove the corrupted searchindex table, and create a fresh one to take it's place. This can be done by using the following sql statement:

CREATE TABLE `es_searchindex` (`si_page` INT(10) UNSIGNED NOT NULL,`si_title` VARCHAR(255) NOT NULL DEFAULT '',`si_text` mediumtext NOT NULL,UNIQUE KEY `si_page` (`si_page`),FULLTEXT KEY `si_title` (`si_title`),FULLTEXT KEY `si_text` (`si_text`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Then, regen Search Index:

cd /var/www/html/mysite/mediawiki-1.19.1/maintenance
php rebuildtextindex.php

Interesante

Como hacer una animación en matlab que retorna un .gif e incluir el archivo en una página en el Wiki: https://commons.wikimedia.org/wiki/File:Snells_law_wavefronts.gif

Referencias cruzadas entre Figuras, Tablas, etc

Para realizar referencias con links entre Figuras y Tablas de forma similar a Latex, vamos a usar la Extension:CrossReference:

https://www.mediawiki.org/wiki/Extension:CrossReference

LET’s look at the '''titles''' table in Figure <xr id="fig:dbscheme"/>.

...
...
...

<figure id="fig:dbscheme">
[[File:Sample_database_scheme.png |950px | thumb | center |<caption>Esquema de la base de datos ''books''.</caption>]]
</figure>


LET’s look at the titles table in Figure Figure 1.

... ... ...

Esquema de la base de datos books.

Indent Sections

Extension:IndentSections: https://www.mediawiki.org/wiki/Extension:IndentSections

The IndentSections extension causes all sections to be automatically indented as if they were inside nested blockquotes.

Utilizando esta extensión, cada subsección será generada con una sangría (Indentation). Esto es muy conveniente para que la página pueda ser leída con facilidad.

La extensión que se encuentra en la link de arriba no funciona correctamente, pues no general la indentation de manera automática, sino que Se debe colocar <blockquote> antes de la parte que queremos identar y cerramos el bloque identado con </blockquote>

La solución se encuentra descrita en la página «talk» de esta extensión: https://www.mediawiki.org/wiki/Extension_talk:IndentSections

El código propuesto en dicha página lo hemos colocado en la carpeta de la extensión en un archivo que hemos llamado: IndentSections2.php

El código propone dos formas de hacer la indentation. Además, el código es tan corto que es fácil editarlo para cambiar, por ejemplo, el tamaño de la indentation.

Este código podría generar errores en el MediaWiki ya que no es una extensión mantenida y actualizada. Sin embargo, parece estar funcionando correctamente.

For greater control over styling nested sections, see https://www.mediawiki.org/wiki/Extension:StyleByHeaderTree

Tamaño de letra - font size

El tamaño de la letra puede ser cambiado a través de plantillas como esta: https://en.wikipedia.org/wiki/Template:Big

He importado la plantilla big

Will make the text here larger

Subir archivos

Pré-requis et configuration

Ver el handbook del stage

S’assurer que l’option de chargement de fichiers est activée en PHP

Pour cela il faut fixer file_uploads = On dans le fichier php.ini qui se trouve dans l’un des fichiers listé ci-dessous :

/etc/php/php.ini, /etc/php4/php.ini /etc/php5/cli/php.ini, /etc/php5/apache2/php.ini

OpenSUSE 11.2 : /usr/local/lib/php.ini

En Win32 C:\Windows\php.ini

Vérifier les droits du répertoire

Les droits du répertoire /images de MediaWiki doivent être configurer tel que 755.

Si l’option de save_mode est mise en place, on doit s’assurer que le répertoire /images appartient à l’utilisateur qui exécute le script php (c’est-à-dire, l’utilisateur Apache):

sudo chown -R www-data:www-data images/
o
sudo chown -R www-data images/

Activer le chargement de fichiers en ligne

En LocalSettings.php il faut configurer:

$wgEnableUploads = true; # Enable uploads

Para permitir la subida de archivos con extensiones diferentes a las permitidas por defecto

Se debe editar o agregar la siguiente variable al LocalSettings.php: https://www.mediawiki.org/wiki/Manual:$wgFileExtensions/fr

$wgFileExtensions = array(
   'png', 'gif', 'jpg', 'jpeg', 'jp2', 'webp', 'ppt', 'pdf', 'psd',
   'mp3', 'xls', 'xlsx', 'swf', 'doc','docx', 'odt', 'odc', 'odp',
   'odg', 'mpp'
   );

Cambiar el tamaño máximo de los archivos cargados en el wiki

https://www.mediawiki.org/wiki/Manual:Configuring_file_uploads/fr#Set_maximum_size_for_file_uploads

By default, the configuration code in php.ini limits the size of files to be uploaded to 2 megabytes (and the maximum size of a post operation to 8 megabytes). To allow uploading of larger files, edit these parameters in php.ini:

   post_max_size = 8 megabytes large by default
   upload_max_filesize = 2 megabytes large by default

Locating the php.ini file

The location of the php.ini file varies on the distribution you are using. (Try "locate php.ini" or "php -i" to find the location of your config file.)

It is important to change the php.ini file in the apache2 folder. For example, there may be a core default php.ini at:

/etc/php5/cli/php.ini as well as one at /etc/php5/apache2/php.ini

If you are using mod_php (most common), the most likely location for the correct php.ini file is in:

/etc/php5/apache2 or /etc/php/7.0/apache2

For php-fastcgi, edit /etc/php5/cgi/php.ini.

En mi caso el archivo php.ini se encuentra en: /etc/php5/apache2

You may need to restart Apache or IIS after altering your PHP or web server configuration. (sudo /etc/init.d/apache2 restart in Linux, for example.)

Configurar la pemisología de los usuarios

Wiki privado o Wiki público

Para permitir que usuarios anónimos tengan acceso a visualizar o editar páginas, debemos editar las siguientes variables en el LocalSettings.php:

Para un Wiki Privado:

# The following permissions were set based on your choice in the installer
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['read'] = false;

Si queremos, por ejemplo, que usuarios anónimos puedan ver las páginas:

$wgGroupPermissions['*']['read'] = true;

Cambiar la página principal-mainpage-homepage

Editar: MediaWiki:Mainpage

How do I change which page is the main page?

By default, MediaWiki looks for a page with the title Main Page and serves this as the default page. This can be changed by altering the contents of MediaWiki:Mainpage to point to a different title. If this does not change the 'Main Page' link included on the sidebar at install time, edit MediaWiki:Sidebar. https://www.mediawiki.org/wiki/Manual:FAQ#How_do_I_change_which_page_is_the_main_page.3F

Ver también: http://www.mediawiki.org/wiki/Thread:Project:Support_desk/How_to_change_the_default_Main_Page_title_and_the_URL

Permitir la visualización de algunas páginas en un Wiki privado para usuarios sin cuentas

Colocar la siguiente orden en el LocalSettings.php http://stackoverflow.com/questions/18255768/how-to-deny-access-to-all-pages-and-allow-only-for-certain-on-wiki

# allow everyone read access to these pages:
$wgWhitelistRead = array( "Main Page", "Public stuff" );

Páginas especiales y .css

http://perso.sinfronteras.ws/index.php/Especial:PáginasEspeciales

http://perso.sinfronteras.ws/index.php/MediaWiki:Common.css

http://perso.sinfronteras.ws/index.php/Usuario:Adelo_Vieira/skin.css

Para ver la versión de MediaWiki instalada y las extensiones adicionadas

http://perso.sinfronteras.ws/index.php/Especial:Versión

Personalizar el formato de los títulos de las secciones

https://en.wikipedia.org/wiki/Help:Section

https://www.siteground.com/kb/how_to_change_the_font_color_for_the_headings_in_mediawiki/

Customize the sidebar

http://perso.sinfronteras.ws/index.php/MediaWiki:Sidebar

https://www.mediawiki.org/wiki/Manual:Interface/Sidebar#Customize_the_sidebar

http://www.mediawiki.org/wiki/Manual:Interface/Sidebar#Sidebar_width_in_Vector_skin_.28CSS.29

Cambiar el espesor de la sidebar in vector skin

En los dos links anteriores se muestra como hacerlo, pero los cambios se realizan en todas las páginas y yo quiero hacerlo sólo en una página.

Oculta el título de una página

Colocar la siguiente línea en http://perso.sinfronteras.ws/index.php/MediaWiki:Common.css

body.page-Ciencia h1.firstHeading { display: none; }

Realizar cambios en una sóla página

http://www.mediawiki.org/wiki/Manual:FAQ/tr

No tratra el caso específico del espesor de la sidebar

Descargar extensiones del sitio oficial de MediaWiki

https://www.mediawiki.org/wiki/Special:ExtensionDistributor

Editar y dar formato a las páginas

https://www.mediawiki.org/wiki/Help:Formatting