<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://htyp.org/mw/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mykaila298</id>
	<title>HTYP - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://htyp.org/mw/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mykaila298"/>
	<link rel="alternate" type="text/html" href="https://htyp.org/Special:Contributions/Mykaila298"/>
	<updated>2026-09-11T09:21:35Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://htyp.org/mw/index.php?title=MediaWiki/archive/embedding/old/extract.php/v2&amp;diff=15880</id>
		<title>MediaWiki/archive/embedding/old/extract.php/v2</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=MediaWiki/archive/embedding/old/extract.php/v2&amp;diff=15880"/>
		<updated>2011-09-01T15:51:27Z</updated>

		<summary type="html">&lt;p&gt;Mykaila298: /* About */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==About==&lt;br /&gt;
&#039;&#039;&#039;This version is obsolete&#039;&#039;&#039;; it is being kept primarily for archival purposes.&lt;br /&gt;
&lt;br /&gt;
The code is based on index.php from MediaWiki (I&#039;m not sure which version, but probably later than 1.7.1 and earlier than 1.11). Some code may be redundant, but I was trying to make the fewest possible changes in order to avoid breaking anything.&lt;br /&gt;
&lt;br /&gt;
As of 2011-03-12, it&#039;s in use as the front page for [http://outside-life.com Outside Life], a [[webcomic]], which runs on MediaWiki 1.10.&lt;br /&gt;
&lt;br /&gt;
* [[/examples]] - also from Outside Life&lt;br /&gt;
*&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://www.mycaal.com/&amp;lt;span style=&amp;quot;color:blue;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;&amp;quot;&amp;gt;loan modification&amp;lt;/span&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
==Contents==&lt;br /&gt;
&amp;lt;php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/*&lt;br /&gt;
 This is essentially index.php with some minor tweaks&lt;br /&gt;
 TWEAKS:&lt;br /&gt;
	these lines commented out:&lt;br /&gt;
		$action = $wgRequest-&amp;gt;getVal( &#039;action&#039;, &#039;view&#039; );&lt;br /&gt;
		$title = $wgRequest-&amp;gt;getVal( &#039;title&#039; );&lt;br /&gt;
	this line commented out&lt;br /&gt;
		$wgTitle = $mediaWiki-&amp;gt;checkInitialQueries( $title,$action,$wgOut, $wgRequest, $wgContLang );&lt;br /&gt;
	this line inserted immediately after:&lt;br /&gt;
		$wgTitle = Title::newFromURL( $title );&lt;br /&gt;
*/&lt;br /&gt;
# Initialise common code&lt;br /&gt;
require_once( &#039;./includes/WebStart.php&#039; );&lt;br /&gt;
&lt;br /&gt;
# Initialize MediaWiki base class&lt;br /&gt;
require_once( &amp;quot;includes/Wiki.php&amp;quot; );&lt;br /&gt;
$mediaWiki = new MediaWiki();&lt;br /&gt;
&lt;br /&gt;
wfProfileIn( &#039;main-misc-setup&#039; );&lt;br /&gt;
OutputPage::setEncodings(); # Not really used yet&lt;br /&gt;
&lt;br /&gt;
$maxLag = $wgRequest-&amp;gt;getVal( &#039;maxlag&#039; );&lt;br /&gt;
if ( !is_null( $maxLag ) ) {&lt;br /&gt;
	if ( !$mediaWiki-&amp;gt;checkMaxLag( $maxLag ) ) {&lt;br /&gt;
		exit;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Query string fields&lt;br /&gt;
//$action = $wgRequest-&amp;gt;getVal( &#039;action&#039;, &#039;view&#039; );&lt;br /&gt;
//$title = $wgRequest-&amp;gt;getVal( &#039;title&#039; );&lt;br /&gt;
&lt;br /&gt;
//$wgTitle = $mediaWiki-&amp;gt;checkInitialQueries( $title,$action,$wgOut, $wgRequest, $wgContLang );&lt;br /&gt;
$wgTitle = Title::newFromURL( $title );&lt;br /&gt;
if ($wgTitle == NULL) {&lt;br /&gt;
	unset( $wgTitle );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Send Ajax requests to the Ajax dispatcher.&lt;br /&gt;
#&lt;br /&gt;
/*&lt;br /&gt;
if ( $wgUseAjax &amp;amp;&amp;amp; $action == &#039;ajax&#039; ) {&lt;br /&gt;
	require_once( $IP . &#039;/includes/AjaxDispatcher.php&#039; );&lt;br /&gt;
&lt;br /&gt;
	$dispatcher = new AjaxDispatcher();&lt;br /&gt;
	$dispatcher-&amp;gt;performAction();&lt;br /&gt;
	$mediaWiki-&amp;gt;restInPeace( $wgLoadBalancer );&lt;br /&gt;
	exit;&lt;br /&gt;
}&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
wfProfileOut( &#039;main-misc-setup&#039; );&lt;br /&gt;
&lt;br /&gt;
# Setting global variables in mediaWiki&lt;br /&gt;
$mediaWiki-&amp;gt;setVal( &#039;Server&#039;, $wgServer );&lt;br /&gt;
$mediaWiki-&amp;gt;setVal( &#039;DisableInternalSearch&#039;, $wgDisableInternalSearch );&lt;br /&gt;
$mediaWiki-&amp;gt;setVal( &#039;action&#039;, $action );&lt;br /&gt;
$mediaWiki-&amp;gt;setVal( &#039;SquidMaxage&#039;, $wgSquidMaxage );&lt;br /&gt;
$mediaWiki-&amp;gt;setVal( &#039;EnableDublinCoreRdf&#039;, $wgEnableDublinCoreRdf );&lt;br /&gt;
$mediaWiki-&amp;gt;setVal( &#039;EnableCreativeCommonsRdf&#039;, $wgEnableCreativeCommonsRdf );&lt;br /&gt;
$mediaWiki-&amp;gt;setVal( &#039;CommandLineMode&#039;, $wgCommandLineMode );&lt;br /&gt;
$mediaWiki-&amp;gt;setVal( &#039;UseExternalEditor&#039;, $wgUseExternalEditor );&lt;br /&gt;
$mediaWiki-&amp;gt;setVal( &#039;DisabledActions&#039;, $wgDisabledActions );&lt;br /&gt;
&lt;br /&gt;
$wgArticle = $mediaWiki-&amp;gt;initialize ( $wgTitle, $wgOut, $wgUser, $wgRequest );&lt;br /&gt;
$mediaWiki-&amp;gt;finalCleanup ( $wgDeferredUpdateList, $wgLoadBalancer, $wgOut );&lt;br /&gt;
&lt;br /&gt;
# Not sure when $wgPostCommitUpdateList gets set, so I keep this separate from finalCleanup&lt;br /&gt;
$mediaWiki-&amp;gt;doUpdates( $wgPostCommitUpdateList );&lt;br /&gt;
&lt;br /&gt;
$mediaWiki-&amp;gt;restInPeace( $wgLoadBalancer );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/php&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mykaila298</name></author>
	</entry>
	<entry>
		<id>https://htyp.org/mw/index.php?title=MediaWiki/archive/embedding&amp;diff=15879</id>
		<title>MediaWiki/archive/embedding</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=MediaWiki/archive/embedding&amp;diff=15879"/>
		<updated>2011-09-01T14:54:05Z</updated>

		<summary type="html">&lt;p&gt;Mykaila298: /* PHP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
This page is about embedding [[MediaWiki]] content within non-MediaWiki sites, or as standalone pages without the standard navigation and control links provided by most [[MediaWiki skin]]s.&lt;br /&gt;
==non-PHP==&lt;br /&gt;
This is easiest to do if the other application is also written in [[PHP]], but it is possible to do this using other languages as well. [[Perl]] has a library, [http://search.cpan.org/~gschloss/PHP-Interpreter-1.0.1/lib/PHP/Interpreter.pm PHP::Interpreter], that allows it to execute PHP code; other languages may have similar capabilities.&lt;br /&gt;
&lt;br /&gt;
If they do not, then one can still accomplish a certain amount by loading MediaWiki pages using [[http]] and the &amp;quot;?action=render&amp;quot; directive, which displays the page&#039;s bare contents without any of the navigation aids. (This method is not recommended if you have any alternatives, as it is slow and wasteful of CPU resources.)&lt;br /&gt;
==PHP==&lt;br /&gt;
This works with MediaWiki v&#039;&#039;&#039;1.16&#039;&#039;&#039;:&lt;br /&gt;
* [[/1.16/index.php]]&lt;br /&gt;
These have been tested with MediaWiki v&#039;&#039;&#039;1.14&#039;&#039;&#039;.&lt;br /&gt;
* [[/1.14/index.php]] is a usage example; as given, it provides a standalone page, but it also shows the code needed to retrieve page content&lt;br /&gt;
* [[/1.14/extract.php]] is the code which actually does the work of extraction; the function GetWikiPage($iTitle) returns the page&#039;s contents as a string.&lt;br /&gt;
Configuration info is in index.php. Note that this has not been tested &#039;&#039;very much&#039;&#039;; I got it working on my server, then posted it.&lt;br /&gt;
&lt;br /&gt;
Works on MW &#039;&#039;&#039;1.10&#039;&#039;&#039;:&lt;br /&gt;
* [[/old/extract.php/v2]]&lt;br /&gt;
&lt;br /&gt;
Based on MW somewhere around &#039;&#039;&#039;1.7&#039;&#039;&#039;:&lt;br /&gt;
* [[/old/extract.php/v1]]&lt;br /&gt;
===To Do===&lt;br /&gt;
* I need to work out the code for detecting if a given page exists in the wiki, so the main application can display default values other than the wiki&#039;s default (&amp;quot;This page doesn&#039;t exist yet...&amp;quot;). Detecting this with the method below may or may not be possible; if MediaWiki returns a 404 code for non-existent articles, then that could be used, but I don&#039;t yet know if it does. --[[User:Woozle|Woozle]] 18:52, 15 October 2006 (EDT)&#039;&#039;&lt;br /&gt;
* We don&#039;t yet know how to get MediaWiki to emit fully-qualified URLs; it is currently necessary to do a search-and-replace to fix links targeting the wiki. (It&#039;s probably a configuration thing -- $wgArticlePath, I&#039;d guess. Don&#039;t know if link URLs get cached, though, so that might not work reliably. --[[User:Woozle|Woozle]] 19:29, 6 June 2009 (EDT))&lt;br /&gt;
*&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://www.diamondlinks.net/&amp;lt;span style=&amp;quot;color:blue;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;&amp;quot;&amp;gt;link building&amp;lt;/span&amp;gt;]&lt;/div&gt;</summary>
		<author><name>Mykaila298</name></author>
	</entry>
</feed>