Extension:Licenses

This extension allows to license every article in mediawiki (you can see how mediawiki commons do with the files).

=version 1.6.8 = The only thing that you have to change on this version is the /includes/EditPage.php file.

You have to add this lines:

require_once 'Licenses.php'; var $mLicense= ''; $this->mLicense = $request->getVal ('wpLicense'); $this->mLicense = ''; $wgOut->redirect( $this->mTitle->getFullURL ); wfProfileOut( $fname ); return false; }   	$license= $this->mLicense; echo "Licencia1: ".$license; $licensetxt = "\n== ". wfMsgForContent( 'license' ). " ==\n". '' . "\n"; $isComment=($this->section=='new'); $this->mArticle->insertNewArticle( $this->textbox1.$licensetxt, $this->summary,				$this->minoredit, $this->watchthis, false, $isComment);
 * Line 17 (at the top of the file)
 * Line 38 (after var $autoSumm = '';  )
 * Line 349 (after $this->summary   = $wgLang->truncate( $request->getText( 'wpSummary'  ), 250 );  )
 * Line 407 (after $this->textbox2  = '';  )
 * Line 572 (after  if ( ( '' == $this->textbox1 ) ) {


 * Line 1051 after (scrolltop}\" name=\"wpScrolltop\" id=\"wpScrolltop\" />\n" );)

= Version 1.4.7= Todos los cambios hacen referencia a la versión de mediawiki 1.4.7 base.

Nota: Monitorización de cambios realizada con la herramienta diff de linux (diff -I RE Origen Origen). Su significado es:
 * > añadir una línea
 * < borrar una línea
 * 293c294,295 línea en el fichero original c linea en el fichero modificado, linea donde finaliza la modificacion

Cambios en includes/Article.php
"; > 		//} > 		$wgOut->addHTML( $prueba ); > 		> 		//consulta para los metadatos y RDF > 			> 		//Título del artículo		> 		$titulo=$this->mTitle->getDBkey; 824a899,955 > 		//Para el autor > 		$sql5 = "SELECT cur_user_text FROM cur WHERE cur_title = \"$titulo\""; > 		$res4 = $dbr->query( $sql5, "Article::view" ); > 		if (!(0 == $dbr->numRows( $res4 ) )) > 			{ > 			$usuario=mysql_result($res4,0,0);	> 			}else{ > 			$usuario="Anonimo"; > 			} > 				> 		//para la descripcción > 		> 		$sql6 = "SELECT cur_comment FROM cur WHERE cur_title = \"$titulo\""; > 		$res5 = $dbr->query( $sql6, "Article::view" ); > 			> 		$resultado=@mysql_result($res5,0,0); > 		if ( 0 == $dbr->numRows( $res5 ) ) > 			{ > 			$descripcion="Artículo perteneciente a la Commonpedia y a su autor. No tiene descripción"; > 			}else{ > 			$descripcion="Artículo perteneciente a la Commonpedia y a su autor. ".$resultado; > 			} > 					> 		//para los metadatos de la licencia		> 		$sql7 = "SELECT lic_rdf FROM license WHERE lic_id = ".$this->getLicId; > 		$res6 = $dbr->query( $sql7, "Article::view" ); > 								> 		if (!( 0 == $dbr->numRows( $res6 ) )) { > 		$Rdf=mysql_result($res6,0,0); > 		if (!(empty($Rdf))) { > 		$Rdf=$Rdf." > 				   $titulo >  				   Usuario de Comonpedia de la Universidad de Extremadura: $usuario > 				   $descripcion >  				   "; > 		$Rdf=$Rdf." --> "; > 				> 			} else { > 		$Rdf= "  > 				 > 				 > 				 > 				 > 				 > 				<meta name=\"DC.Type\" scheme=\"DCMIType\" content=\"Text\"> > 				<meta name=\"DC.Format.Medium\" content=\"text/html\"> > 				<meta name=\"DC.Relation.isPartOf\" content=\"http://reduex.unex.es/commonpedia/\"> > 				<meta name=\"DC.Identifier\" content=\"http://reduex.unex.es/commonpedia/\"> > 				<meta name=\"DC.Language\" content=\"es\"> > 				<meta name=\"DC.Rights\" content=\"CC-GPL 2005 by Universidad de Extremadura\"> "; > 			} > 			> 		} > 		$wgOut->addHTML( $Rdf ); > 		> 		#CAMBIO ******************************************************************************************* > 		842c973 < 	function insertNewArticle( $text, $summary, $isminor, $watchthis ) { --- > 	function insertNewArticle( $text, $summary, $isminor, $watchthis, $lic_id ) { 883a1015 > 			'cur_lic_id' => $lic_id, 1011c1143 < 	function updateArticle( $text, $summary, $minor, $watchthis, $forceBot = false, $sectionanchor =  ) { --- > 	function updateArticle( $text, $summary, $minor, $watchthis, $forceBot = false, $sectionanchor = ,$lic='' ) { 1018c1150 < --- > 		echo "principio"; 1048c1180 < --- > 		echo "hola uno"; 1055,1056c1187,1189 < < 			# First update the cur row --- > 	#Cambios > 			if (!(empty($lic))){ > 			# First update the cur row Con licencia 1068c1201,1202 < 					'inverse_timestamp' => $won --- > 					'inverse_timestamp' => $won, > 					'cur_lic_id'=> $lic 1074c1208,1228 < --- > 			}else{ //actualizamos sin licencia > 				# First update the cur row > 			$dbw->update( 'cur', > 				array( /* SET */ > 					'cur_text' => $text, > 					'cur_comment' => $summary, > 					'cur_minor_edit' => $me2, > 					'cur_user' => $wgUser->getID, > 					'cur_timestamp' => $dbw->timestamp($now), > 					'cur_user_text' => $wgUser->getName, > 					'cur_is_redirect' => $redir, > 					'cur_is_new' => 0, > 					'cur_touched' => $dbw->timestamp($now), > 					'inverse_timestamp' => $won, > 					), array( /* WHERE */ > 					'cur_id' => $this->getID, > 					'cur_timestamp' => $dbw->timestamp($this->getTimestamp) > 				), $fname > 			); > 			} > #Cambios 1144d1297 < 1168c1321 < --- > 		1182a1336 > 		1735a1890,1893 >                $curLicId = $dbw->selectField( 'cur', 'cur_lic_id', array( >                                    'cur_namespace' => $ns, >                                    'cur_title' => $t, >                                    ), $fname, array); 1747a1906 >                                'ar_lic_id' => 'cur_lic_id', 1779a1939 >                                        'ar_lic_id' => $curLicId, 2328a2489 >

Cambios en includes/ImagePage.php
"; < 		< 			$wgOut->addHTML( $prueba ); < 			< 			//consulta para los metadatos y RDF < 			< 			//Título de la imagen < 			$titulo=$this->mTitle->getDBkey;; < 			< 			//autor < 			$sql6 = "SELECT img_user_text FROM image WHERE img_name = \"".$this->img->getName."\""; < 			$res5 = $dbr->query( $sql6, "Article::view" ); < 			< 			$autor=mysql_result($res5,0,0); < 			< 			// Descripcción de la imagen < 			< 			$sql7 = "SELECT img_description FROM image WHERE img_name = \"".$this->img->getName."\""; < 			$res6 = $dbr->query( $sql7, "Article::view" ); < 			$descripcion=mysql_result($res6,0,0); < 			< 			$descripcion="Fichero perteneciente a la Commonpedia y a su autor. ".$descripcion; < 			< 			< 			$sql5 = "SELECT lic_rdf FROM license WHERE lic_id = ".$this->img->imageLicense; < 			$res4 = $dbr->query( $sql5, "Article::view" ); < 			< 			< 			if (!( 0 == $dbr->numRows( $res4 ) )) { < 									$Rdf=mysql_result($res4,0,0); < 			if (!(empty($Rdf))) { < 			$Rdf=$Rdf." < 	 				  $titulo</dc:title> < 	 				   $autor</dc:creator> < 	 				  $descripcion</dc:description> < 	 				   </rdf:Description>"; < 			$Rdf=$Rdf."</rdf:RDF> --> "; < 					< 				} else { < 			$Rdf= " <meta name=\"DC.Title\" content=\" Commonpedia de la Universidad de Extremadura \"> < 					<meta name=\"DC.Creator\" content=\"Grupo MediaWiki, Secretariado Nuevas Tecnologías de la UNEX\"> < 					<meta name=\"DC.Subject\" content=\"Metadatos\"> < 					<meta name=\"DC.Description\" content=\"Página perteneciente a Commonpedia, diccionario de la Universidad de Extremadura\"> < 					<meta name=\"DC.Publisher\" content=\"Secretariado de Nuevas Tecnologías de la Universidad de Extremadura\"> < 					<meta name=\"DC.Date\" content=\"2005-09-01\"> < 					<meta name=\"DC.Type\" scheme=\"DCMIType\" content=\"Text\"> < 					<meta name=\"DC.Format.Medium\" content=\"text/html\"> < 					<meta name=\"DC.Relation.isPartOf\" content=\"http://reduex.unex.es/commonpedia/\"> < 					<meta name=\"DC.Identifier\" content=\"http://reduex.unex.es/commonpedia/\"> < 					<meta name=\"DC.Language\" content=\"es\"> < 					<meta name=\"DC.Rights\" content=\"CC-GPL 2005 by Universidad de Extremadura\"> "; < 				} < 			}						< 						< 			$wgOut->addHTML( $Rdf ); < 						< 			#CAMBIO < 522,530c415 < 		< 		< 		#Cambio < 		$licencia = $dbr->selectField( 'oldimage', 'oi_lic_id','oi_archive_name=\'' . < 		$dbr->strencode( $oldimage ) . "'" ); < 		< 		wfRecordUpload( $name, $oldver, $size, wfMsg( "reverted" ),"","",$licencia); < 		#Cambio < --- > 		wfRecordUpload( $name, $oldver, $size, wfMsg( "reverted" ) );

Artículos relacionados

 * Licencias Mediawiki