[Mediawiki-l] Passing and dispalying interwiki links

Filip Maljkovic dungodung at gmail.com
Fri Mar 24 06:03:20 UTC 2006


[page] is syntax for external links. Use [[Main Page]] for local pages.

Amruta Lonkar wrote:

>Thanks a lot for the help. I had one more question the link part is still
>not working. If I want to Dispaly say the link to Main_Page I am dispalying
>it as [Main_Page], however its still not showing it as a link it just shows
>it as is in text form. Do I haveto add anything else in  this other than
>page name  [page_name] ?
>
>
>
>-Amruta
>
>On 3/23/06, Jama Poulsen <jama at debianlinux.net> wrote:
>  
>
>>On Thu, Mar 23, 2006 at 05:22:32PM -0500, Amruta Lonkar wrote:
>>    
>>
>>>Hi,
>>>
>>>I am using the following code to create pages in a given namespace and
>>>      
>>>
>>am
>>    
>>
>>>passing some text as links, and i want them to be shown as links however
>>>      
>>>
>>the
>>    
>>
>>>mediawiki code is not parsing the <a href></a> tags. Is there some other
>>>      
>>>
>>wau
>>    
>>
>>>to do this?
>>>
>>>function createWikiPage($pageTitle,$pageText,$refid)
>>>{
>>>$pageText = $pageText."<h1>".text."</h1>"."<a href=some
>>>      
>>>
>>http>".text."</a>";
>>    
>>
>>>      $dbw =& wfGetDB(DB_MASTER);
>>>
>>>      //Process each message
>>>      $title = new Title();
>>>      $title = $title->newFromText($pageTitle,102);
>>>
>>>      $article = new Article($title);
>>>      $newid = $article->insertOn($dbw);
>>>
>>>      $revision = new Revision(array('page' => $newid, 'text' =>
>>>$pageText, 'user' => 0, 'user_text' =>"This page automatically created
>>>by "._FILE_,'comment' => ''));
>>>      $revid = $revision->insertOn($dbw);
>>>      $article->updateRevisionOn($dbw,$revision);
>>>      $dbw->commit();
>>>
>>>}
>>>      
>>>
>>You are creating new _Wiki_ text articles using these functions. HTML is
>>not
>>Wiki text. You can just use normal Wiki syntax, like [[myinternallink
>>foo]] or
>>[myexternallink bar].
>>
>>Its also a good idea to check the return status of some functions (and
>>report
>>it when problems do happen), eg:
>>
>>$ok = $article->updateRevisionOn( $dbw, $revision );
>>
>>$dbw->commit();
>>
>>if( !$ok ) {
>>   $dbw->rollback();
>>   // report problem
>>}
>>} else {
>>   ...
>>   $dbw->commit();
>>}
>>
>>Jama Poulsen
>>_______________________________________________
>>MediaWiki-l mailing list
>>MediaWiki-l at Wikimedia.org
>>http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>>
>>    
>>
>_______________________________________________
>MediaWiki-l mailing list
>MediaWiki-l at Wikimedia.org
>http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>
>  
>



More information about the MediaWiki-l mailing list