Steve,
You could accomplish that by using
$text = str_replace(". ", ". ", $text); //replace two spaces after
period with one
$text = str_replace(": ", ": ", $text); //replace two spaces after
colon with one
$text = str_replace("\"\,", ",\"", $text); //replace a comma outside a
quote with one inside
$text = str_replace("\".", ".\"", $text); //replace a period outside a
quote with one inside
I'm not positive about the escaping on the last two examples (the slash
before the quote and comma). That should basically fix the issues you
mentioned. I'm still working on getting the data to save correctly. I took
Joshua's suggestion to use the ArticleSave hook but it keeps returning with
a conflicting edits error. I'll keep you posted as to what I can find/figure
out. If anyone out there has any ideas as to how to avoid the conflict,
please let me know so we can wrap up both my project and Steve's.
Thanks,
Kevin
On Mon, Aug 18, 2008 at 3:54 PM, Steve VanSlyck <s.vanslyck(a)spamcop.net>wrote:
> Thanks - what sort of search-and-replace are you doing? All I would want to
> do would be to force single spaces instead of double after periods and
> colons and to force commas and periods inside double quotes. In most cases
> anyway.
>
>
> kevinaj(a)gmail.com wrote:
>
> Steve,
>>
>> I still haven't fixed the session issue yet, so I can't vouch for how
>> complicated this may become. :-) So far, you could accomplish the basic
>> POST
>> to a separate PHP page with very little work. I can post the modifications
>> I
>> made to EditPage.php if you'd like; that's a simple copy and paste. In
>> your
>> case, the more complicated part would be the code to correct punctuation.
>> To
>> the best of my knowledge there is no premade functions in PHP to do that.
>> As
>> I stated before, I still can't maintain the session so it's impossibe
>> actually save the punctuation corrections yet. Once I can figure that out
>> I'll post the code to make it all work.
>>
>> Thanks,
>> Kevin
>>
>> On Mon, Aug 18, 2008 at 10:16 AM, Steve VanSlyck <s.vanslyck(a)spamcop.net
>> >wrote:
>>
>> Kevin,
>>>
>>> Sounds like the sort of thing I would like to do. I'm not a coder in any
>>> sense but if this could be used to correct punctuation blunders I might
>>> want
>>> to give it a shot. Is it the sort of thing an unlettered person like me
>>> might be able to put into place?
>>>
>>> kevinaj(a)gmail.com wrote:
>>>
>>> Hi,
>>>
>>>>
>>>> I am trying to intercept page edits and send them to a PHP page that
>>>> will
>>>> make some modifications to the text and test to see if various
>>>> conditions
>>>> have been satisfied.
>>>>
>>>> I have changed the post action of the edit form to point to
>>>> 'modify.php'.
>>>> I
>>>> also added another hidden form field with the original action ($action)
>>>> as
>>>> it's value.
>>>>
>>>> This way I'm able to use cURL to pass along the modified $_POST data to
>>>> the
>>>> page contained in $action. This all works fine until cURL passes the
>>>> data
>>>> on. At which point I'm redirected to a preview page that states:
>>>>
>>>> *"**Sorry! We could not process your edit due to a loss of session data.
>>>> Please try again. If it still doesn't work, try logging out and logging
>>>> back
>>>> in."
>>>>
>>>> Does anyone know how I can maintain the session data throughout this
>>>> process? I have verified that $_COOKIE still contains the appropriate
>>>> values. However $_SESSION does not. This seems to be the cause of the
>>>> problem. Any comments and/or suggestions are welcome.
>>>>
>>>> Thanks,
>>>> Kevin
>>>> *
>>>> _______________________________________________
>>>> MediaWiki-l mailing list
>>>> MediaWiki-l(a)lists.wikimedia.org
>>>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>>>
>>>>
>>>>
>>>
>>
>
Hello, i'd like to use my own skin as defalut skin nammed vbwikiskin.
In localsetting.php :
I have : $wgDefaultSkin = 'vbwikiskin';
In my file VbWikiSkin.php :
I have : $this->skinname = 'vbwikiskin';
But still the old skin you can see here :
http://www.baldursgateworld.com/wiki/
An idee ? Thanks
---
Bonjour, je souhaite mettre ma propre skin par défaut vbwikiskin.
Dans localsetting.php :
J'ai bien mis : $wgDefaultSkin = 'vbwikiskin';
Dans mon fichier VbWikiSkin :
j'ai bien : $this->skinname = 'vbwikiskin';
Pourtant c'est toujour une skin de base qui s'affiche.
http://www.baldursgateworld.com/wiki/
Une idée ? Merci
HI all...
I'd like to create a page where i can put a 2 columns table.
In the first column i'd like to collect data from a RSS fedd and in
the second one each wiki user can put his name to say that he's going
to manage that information.
Obiovusly every single data from the feed must always match the name
put in front of it (table should scroll...). Any chance to do that?
Thanx
Max
--
#####
* Al fine di preservare il nostro ambiente naturale, non stampare
questa email se non e' necessario.
* Act for the environmental protection don't print this mail if it's
not essential.
#####
----------------------------------------------------------------------------------------------------
"Se non hai dato tutto, non hai dato ancor..."
Linux Registered User #398708 - http://counter.li.org
Ubuntu Hardy Heron v. 8.04 LTS
Ubuntu Registered User #253 - http://ubuntucounter.geekosophical.nethttp://iparalipomenidi.vagamente.net
Io uso Linux. Voi... riavviate Windows in modalità provvisoria.
----------------------------------------------------------------------------------------------------
Hello, i'd like to use my own skin as defalut skin nammed vbwikiskin.
In localsetting.php :
I have : $wgDefaultSkin = 'vbwikiskin';
In my file VbWikiSkin.php :
I have : $this->skinname = 'vbwikiskin';
But still the old skin you can see here :
http://www.baldursgateworld.com/wiki/
An idee ? Thanks
Hi,
I am trying to intercept page edits and send them to a PHP page that will
make some modifications to the text and test to see if various conditions
have been satisfied.
I have changed the post action of the edit form to point to 'modify.php'. I
also added another hidden form field with the original action ($action) as
it's value.
This way I'm able to use cURL to pass along the modified $_POST data to the
page contained in $action. This all works fine until cURL passes the data
on. At which point I'm redirected to a preview page that states:
*"**Sorry! We could not process your edit due to a loss of session data.
Please try again. If it still doesn't work, try logging out and logging back
in."
Does anyone know how I can maintain the session data throughout this
process? I have verified that $_COOKIE still contains the appropriate
values. However $_SESSION does not. This seems to be the cause of the
problem. Any comments and/or suggestions are welcome.
Thanks,
Kevin
*
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I am creating a numbered list with a code snippit between two of the
items and having problems with MediaWiki resetting the numbering
after the code snippit. Here is an example:
- ------------------------------------------------------
# Item 1
# Item 2 <pre>Some code here
Some code here
Some code here
Some code here</pre>
# Item 3
# Item 4
- ------------------------------------------------------
The way it comes out is:
- ------------------------------------------------------
1. Item 1
2. Item 2
Some code here
Some code here
Some code here
Some code here
1. Item 3
2. Item 4
- ------------------------------------------------------
How do I tell it to continue using the same list? We're running
MediaWiki 1.1.2.0
Thanks,
Chris Miller
ServerMotion
www.servermotion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)
iD8DBQFIpzoRxBwlCB7CRwsRAqjIAJ4nODb+woia8ojBaM2Gk718botQhgCfTtaj
ZqyvILUMhj8cZILTD/XTWGY=
=e+P7
-----END PGP SIGNATURE-----
Guten Tag,
ich habe ein Wiki über ein spezielles Thema. Alle Seiten, die nichts mit dem Thema zu tun haben, werden per Vorlage auf Wikipedia verlinkt.
Ich möchte nun aber, dass diese Seiten bei {{NUMBEROFARTICLES}} nicht mitgezählt werden. Außerdem befinden sich in anderen Namensräumen
Artikel, dich ich ebenfalls mitzählen möchte. Da diese Variable bei mir sowieso nicht richtig funktioniert, möchte ich diese umschreiben. Ich habe bereits
desn richtigen Code:
<?
include ('dbpass.php');
@mysql_connect($dbhost, $dbuser, $dbpass);
@$x=mysql_select_db($dbdata);
if (empty($x)) {
echo "Fehler beim Verbinden mit dem Datenbankserver<br>";
exit;
}
$sql = "SELECT page_namespace FROM page WHERE page_namespace = 0 OR page_namespace = 4;";
$result = mysql_query($sql);
$a = 0;
while ($resuld = mysql_fetch_array($result, MYSQL_NUM)) {
$a++;
}
$sql = "SELECT page_namespace FROM page WHERE page_is_redirect > 0;";
$result = mysql_query($sql);
$c = 0;
while ($resuld = mysql_fetch_array($result, MYSQL_NUM)) {
$c++;
}
$sql = "SELECT page_namespace FROM page WHERE page_len = 5;";
$result = mysql_query($sql);
$d = 0;
while ($resuld = mysql_fetch_array($result, MYSQL_NUM)) {
$d++;
}
$summe = $a + $b;
$summe -= $c + $d;
?>
Der Code funktioniert problemlos, nur weiß ich nicht, wo ich ihn einbinden soll. Etwa in die Seite initStats.inc im maintenance-Ordner, oder direkt in SpecialStatistics?
Bitte helft mir, damit ich die Variable {{NUMBEROFARTICLES}} weiterbenutzen kann.
MfG
Steffen Grimm
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I turned on file uploads tonight:
- ------------------------------------------------------
$wgEnableUploads = true;
$wgCheckFileExtensions = false;
$wgStrictFileExtensions = false;
$wgUseImageResize = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/local/bin/convert";
- ------------------------------------------------------
I have verified ImageMagick is installed and that is the correct path
for convert. Anytime we upload any file (image or otherwise), we get
the following error:
- ------------------------------------------------------
The file has no extension (like ".jpg").
- ------------------------------------------------------
I have tried multiple files of different file types. I have no clue
what to do to make this work. File uploads just do not work. We're
running MediaWiki 1.12.0. Any input would be appreciated.
Thanks,
Chris Miller
ServerMotion
www.servermotion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)
iD8DBQFIpzmAxBwlCB7CRwsRAoxJAJ9v4sISSwunTOmsdgauXhTRLxGv7ACfUKEq
YhDymYrsvOTi+O6wlhlmIC8=
=BT20
-----END PGP SIGNATURE-----
Thanks again for the help with the heading numbers; it was very useful.
Sadly, when I cut+paste from a mediawiki page, the [edit] link is invisibly
preserved and appears in my text. Others on the web have noticed this when
exporting pages to some other CMS.
Any ideas would be helpful, but I am afraid that a solution will mean a code
hack.
~~John
Hi
I'm in the process of installing MediaWiki and am interested in using the
Liquid Threads extension to replace the standard talk pages:
http://www.mediawiki.org/wiki/Extension:LiquidThreads
It states on the extension page that this extension is being developed with
the aim of being integrated into MW 2.0 - is this an aspiration of just the
extension developers, or also of the MW developers themselves?
I'm concerned about what would happen if development on this extension
stopped one day, and the extension then became incompatible with future
versions of MW. If I had to uninstall the extension, does any one know what
would happen to the discussions up to that point?
Thanks
Derrick