L.S.,
I'm using mediawiki 1.6.3 and I've hooked in an RSS feed on page level.
However, the feed icon (firefox) only shows when I do something with the
page: Edit it e.g.
Does anyone know how can I change this behaviour?
Thanks in advance for your answers,
Hans Oesterholt-Dijkema
Code follows:
*************************************************************
<?php
#########################################################
# Configure here
#########################################################
$wgBlog_MaxRSSEntries=10;
$wgBlog_RSS_Location="/feeds/rss";
$wgBlog_RSS_Prefix="http://sample.sa/rss/";
$wgBlog_RSS_Title_Prefix="Sample Intranet - ";
$wgBlog_RSS_Prefix="/rss";
$wgBlog_HTTP="http://";
#########################################################
$wgExtensionFunctions[] = "wfBlogExtension";
$blogEntries=0;
$blogRSSFile="NoFile";
$blogRSS_URL="";
function wfBlogExtension() {
global $wgParser;
global $wgHooks;
$wgHooks['ArticleSave'][]='blogEntries';
$wgParser->setHook("blog-entry",'blogPEntry');
$wgHooks['ParserBeforeTidy'][]='blogRSSLink';
}
function blogPEntry($input,$argv,$parser) {
global $blogEntries;
$blogEntries+=1;
return "<A NAME=\"$blogEntries\"></A>";
}
function blogRSSLink(&$parser,&$text) {
global $wgOut;
global $blogRSS_URL;
global $wgBlog_HTTP;
global $wgBlog_RSS_Prefix;
global $wgBlog_RSS_Location;
global $_SERVER;
$mTitle=$parser->getTitle();
$title=blogTidyTitle($mTitle->mTextform);
$host=$_SERVER['SERVER_NAME'];
$filename="$wgBlog_RSS_Location/$title.rss";
if (file_exists($filename)) {
$blogRSS_URL="$wgBlog_HTTP$host$wgBlog_RSS_Prefix/$title.rss";
$wgOut->addLink(array('rel' => 'alternate','type' =>
'application/rss+xml', 'title' => "RSS 2.0",
'href' => "$blogRSS_URL"));
}
}
function blogTidyTitle($title) {
return preg_replace("/[^a-zA-Z0-9]/","_",$title);
}
function
blogEntries(&$article,&$user,&$_text,&$summary,&$minoredit,&$watchthis,&$sectionanchor)
{
global $wgBlog_RSS_Location;
global $wgBlog_HTTP;
global $_SERVER;
$text=$_text;
preg_match_all("|[{][{]blog[^}]+[}][}]|",$text,$blogs,PREG_SET_ORDER);
$count=0;
if (count($blogs)>0) {
$mTitle=$article->getTitle();
$title=$mTitle->mTextform;
$title=blogTidyTitle($title);
$urlTitle=$mTitle->mUrlform;
$fh=initRSS($title);
$request_uri=$_SERVER['REQUEST_URI']; //QUERY_STRING'];
$vars=explode('?',$request_uri,2);
$request=$vars[0];
$host=$_SERVER['SERVER_NAME'];
foreach($blogs as $blogentry) {
$entry=$blogentry[0];
$vars=explode("|",$entry);
$header="";
$dt="";
$link="";
$text="";
foreach ($vars as $v) {
$vv=explode("=",$v,2);
if ($vv[0]=="h") { $header=trim($vv[1]); }
else if ($vv[0]=="d") { $dt=trim($vv[1]); }
else if ($vv[0]=="t") { $text=trim($vv[1]); }
else if ($vv[0]=="l") { $link=trim($vv[1]); }
}
$count+=1;
blogEntry($fh,$header,$dt,"$wgBlog_HTTP$host$request/$urlTitle#$count");
}
endRSS($fh);
}
return true;
}
function blogEntry($fh,$header,$dt,$link) {
$xml=" <item>\n".
" <title>$header</title>\n".
" <link>$link</link>\n".
" <pubDate>$dt</pubDate>\n".
" </item>\n";
fwrite($fh,$xml);
}
function initRSS($mTitle) {
global $wgBlog_RSS_Location;
global $_SERVER;
global $wgBlog_RSS_Title_Prefix;
global $wgBlog_HTTP;
global $wgBlog_RSS_Prefix;
global $blogRSS_URL;
$host=$_SERVER['SERVER_NAME'];
$dt=date("r");
$xml="<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n".
"<rss version=\"2.0\">\n".
" <channel>\n".
" <title>$wgBlog_RSS_Title_Prefix$mTitle</title>\n".
" <link>http://$host</link>\n".
" <lastBuildDate>$dt</lastBuildDate>\n".
" <generator>MediaWiki Blog RSS Generator v0.1</generator>\n".
"";
$blogRSSFile=fopen("$wgBlog_RSS_Location/$mTitle.rss","wt");
fwrite($blogRSSFile,$xml);
$blogRSS_URL="$wgBlog_HTTP$host$wgBlog_RSS_Prefix/$mTitle.rss";
return $blogRSSFile;
}
function endRSS($blogRSSFile) {
$xml=" </channel>\n".
"</rss>\n".
"";
fwrite($blogRSSFile,$xml);
fclose($blogRSSFile);
}
I changed user.php as stated below. went to preferences. unchecked jump to
navigation, clicked save and received the following error.
"Undefined variable wgSessionsInMemcached in C:\wiki\Mediawiki\mediawiki-
1.6.3\includes\User.php on line 1693"
------
ipbwiki list ipbwiki.list at gmail.com
Sat Apr 8 13:27:31 UTC 2006
Hi,in the function matcheditToken there is a call to a function only
availableif you use memcached. The line in question is
$mckey = memsess_key( session_id() );
the memsess_key function is registered in the function "SetupSession"
(alsoin user.php). This function is only included if $wgSessionsInMemcached
istrue tough (as it should).
to solve the problem the function matcheditToken has to be
altered.searchfor the line:
if ( $val != $sessionToken ) {
and change this to:
if ( $val != $sessionToken and $wgSessionsInMemcached ) {
This change will avoid the error "call to undefined function
memsess_key"when the session is lost.
Best regards,
Peter.
<http://mail.wikipedia.org/pipermail/mediawiki-l/2006-April/011236.html>
I am attempting to upgrade Mediawiki 1.5.6 to the latest (1.6.3). I have
backed up all files and the MySQL database. I then copied over the original
1.5.6 directory with the new 1.6.3 directory. Next, I ran php -cli
./maintenance/update.php and get the following error:
Fatal error: Call to undefined function socket_sendto() in
<MEDIAWIKI>/includes/GlobalFunctions.php on line 1506
I have also tried using the web interface to run the upgrade and the same
error message appears. I have also tried just upgrading to Mediawiki
1.6.2and the same isue persists. Below is the versions of applicable
software I
have:
Mediawiki: 1.5.6
PHP 5.0.5 (apache2handler)
MySQL 4.1.15-Max
OS: Redhat Enterprise 3AS
I'd really appreciate it if someone can point out what I'm doing wrong and
recommend how to complete the upgrade. Thanks in advance!!
I'm running close to a limit of mySQL database size for the level of
hosting service I'm on.
I bet there's some unused records in there taking up unnecessary space.
Can anybody suggest an easy, safe way of compacting the database
somehow please?
The mediawiki was set up as a 1.3, upgraded to 1.5 and current versions are
# MediaWiki: 1.5.0
# PHP: 4.4.1 (apache)
# MySQL: 4.0.26-standard-log
--
Andy Roberts
Bonjour,
Nous venons de mettre en place un wiki qui devait à l'origine être
accessible uniquement sur Intranet. Pour des raisons techniques, nous allons
devoir le transférer sur Internet, ce qui pose certains problèmes notamment
en matière de sécurité.
J'aimerais donc savoir quels sont les problèmes de sécurité que vous avez
déjà éventuellement rencontrés avec Mediawiki ? Quels sont les moyens pour
s'en prémunir ? L'historique des pages peut-il, par exemple, être supprimé ?
Existe-t-il notamment un système de "back-doors" ?
Merci d'avance pour vos réponses.
Valérie Huchette
CETE Nord-Picardie - DIODé
Point d'Appui National Documentaire
2, rue de Bruxelles
BP 275
59019 LILLE CEDEX
Tél : 03 20 49 63 34
Fax : 03 20 49 63 80
Hello,
I have an issue with Mediawiki 1.5.x and yes I have read through the forum and
found similar postings but the answers do not apply to my case. I do not have
checked "use external editor".
So since a week or two nobody is able to post anything in our wiki - nor
anonymous user nor logged-in users. The programme always wants to
open/download index.php. Mac-Users often get a white page when saving
The only thing which happened during this time is that our provider updated
his software (Plesk 7.5 ->8, Fedora 3 -> 4 including an php update to 5.04)
Any suggestions?
--
[OCon] Marc Muller
marc(a)openconsult.org
I just installed a new version of MediaWiki on a RH Linux box. The
install went fine. I copied Local Settings.php to the main directory,
deleted the config directory, and set $wgserver to our test server's IP
address. It's now running, but all I'm getting is a blank page. In
other words, if I go to:
http:/ouripaddress/mediawiki/index.php/Main_Page
Or
http:/ouripaddress/mediawiki/index.php
I get nada. No errors -- but view source shows nothing there.
Just to make sure, I also put a test HML page in the directory:
http:/ouripaddress/mediawiki/test.html
And it works fine. Any idea what I'm doing wrong? If there is
documentation that explains what to do next, just point in the right
direction -- I didn't see anything.
Thanks,
Anders Schneiderman
Hi,
We have installed the wiki page on one linux server, and the database on
another windows machine. Everytime the wiki needs to retrieve contents from
the remote database. The response time is tooooo long, we can't bear with
it anymore.
I noticed there are some softwares for php caching. However, we don't have
administrator's rights on the linux server. Is there any other caching
program that can be installed by a regular user?
Thanks
Roy
I am having problems setting up custom User Groups.
I have added the new User Group to LocalSettings.php (as shown on
http://meta.wikimedia.org/wiki/Help:User_levels), and the new user
group shows up on Special:Userrights. However, after i have assigned
a user to this new custom group now of the new privileges are
actually active for that user.
Is there anything else besides:
$wgGroupPermissions['ninja']['delete'] = true;
that needs to be added to LocalSettings to enable a new user group?
thanks
On 1 May 2006, at 12:06, mediawiki-l-request(a)Wikimedia.org wrote:
>> Hi to all the experts here,
>>
>> I am running a wikimedia server at http://www.oriredler.com
>>
>> For some reason, unknown to me, WM stopped allowing me to upload
>> files. Any image file I try to upload, including files formerly
>> uploaded to my server, is invariably ending with a "uploadcorrupt"
>> message and the upload does not come through.
>>
>> I did not change on my own accord any of the parameters. The last
>> changes are:
>> A. Switched database server a few weeks ago (did not upload images
>> since).
>> B. Upgraded to MW 1.6.3
>> C. Installed the "cite.php" extension a few days ago.
>>
>> None of those should affect the uploads, in my view.
>>
>> Any advise on this?
>>
>> Ori Redler
>
> I had a similar experience, mine turned out that my hosting provider
> had turned on PHP's open_basedir restrictions. You might check that
> and the other PHP security settings.
>
> Peter
Thank you Peter (and Brion Vibber earlier): Your suggestions were
both prompt and to the point.
Peter's advice here led me in the right direction: it was indeed an
open_basedir problem.
The only actual change was the one recommended by the PHPMyAdmin
documentation: "all you have to do is create a 'tmp' directory under
the phpMyAdmin install directory, with permissions 777 and the same
owner as the owner of your phpMyAdmin directory. The uploaded files
will be moved there, and after execution of your SQL commands,
removed." I think that's something anyone in this situation can
probably apply him/herself.
Thanks for the help again.
Ori