How can I display the selected value of the option using PHP?
For example I have this code:
<script language=javascript>
function sevent()
{
var xx = document.xx.sbox;
if(document.xx.sbox.selectedIndex != 0)
alert("selected is "+xx.selectedIndex);
else alert("None is selected");
}
</script>
<form name=xx>
<select name=sbox onChange="sevent()">
<option value="default">Select Option</option>
<option value="option 1">option 1</option>
<option value="option 2">option 2</option>
</select>
</form>
Here, it prompts whatever option you select. What I wanted to do is to display
the value of the selected option using PHP. How can do it?
Thanks. ^_^
Why is it that there's a conflict on submit buttons between the page of
creating/ editing articles and to the special page that i've created. What i
mean is that after clicking the 'Save Page' button on the creating/editing page,
i am redirected to a blank page. But when I reload that blank page, i can now
view the page i just created/edited.
Is there something that I have to add to my special page to avoid this one? The
special pages that i've created are working. It's just strange seeing the blank
page because a user is supposed to be redirected properly to the page that they
just created/edited.
As of r55615 [1], which has gone live on Wikipedia yesterday, the
maximum limit for list=search is 50 results for regular users and 500
for sysops and bots. This is down from 500/5000 because search queries
using the maximum limit were causing performance issues.
If you specify srlimit=100 or any number higher than your new maximum
limit, you'll get an error message. If you specify srlimit=max ,
everything will keep working, but you'll get fewer results.
Roan Kattouw (Catrope)
_______________________________________________
Mediawiki-api-announce mailing list
Mediawiki-api-announce(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce
Dear API hackers,
I am trying to restrict query results by namespace.
In the following query, there are some members of namespace 6. However,
there are many members in namespace 14.
http://commons.wikimedia.org/w/api.php?action=query&generator=categorymembe…
I have prefixed the cmnamespace with "g" for use as a generator. Leaving
the "g" off produces the same results.
Have I stumbled upon a bug?
Thanks for your help,
Karl
Hi I have a problem with the timezone in the api,
I have a time diff over 2 hours in my installation to system time, so
I added the following [1]
$wgLocaltimezone = "Asia/Taipei";
$oldtz = getenv("TZ");
putenv("TZ=$wgLocaltimezone");
# Versions before 1.7.0 used $wgLocalTZoffset as hours.
# After 1.7.0 offset as minutes
$wgLocalTZoffset = date("Z") / 60;
putenv("TZ=$oldtz");
but this affected only the "regular" part of mediawiki not the time in
the api ... any ideas ?
-- Loki
_________________
[1] http://www.mediawiki.org/wiki/Manual:Timezone
Would anyone object to changing the output mime type of
ApiFormatJson.php from "application/json" to 'text/javascript' ?
committed in r55084
This is needed for iframe target background upload tasks. ie you upload
a file and then you want to take the name of the file you uploaded and
use that to insert the image into the edit window. With mime as
"application/json" the browser promts the user to "save" the file and we
can't eval the document text result in the iframe.
--michael
I'm making my mediawiki-driven senior project for this semester. It is about
creating a thesaurus for bikol languages. I started editing pages and also
importing pages manually. So far, all the changes work. Now, I'm making the core
function of my project-thesaurus. I implemented a string search algorithm in a
php file(but not yet on the special file), which I will be using in the search
function on the SpecailThesaurus.php file. I'm making a special page on the
/includes directory and also on the /extensions directory named
"SpecialThesaurus.php".
Problems:
-How can I set the action attribute in "form" so that it displays all the output
on the page $SERVER['PHP_SELF'];
-How can I enable this script "SpecialThesaurus.php" so that it shows after a
user adds/edit a page?
Thanks. (^_^)
On the /extensions directory, the "SpecialThesaurus.php" includes this code:
---------------
<?php
$wgExtensionFunctions[] = "wfExtensionSpecialThesaurus";
function wfExtensionSpecialThesaurus()
{
global $wgMessageCache;
$wgMessageCache->addMessages(array('thesaurus' => 'WikiBiTs Thesaurus page'));
require_once('includes/SpecialPage.php');
SpecialPage::addPage(new SpecialPage('Thesaurus'));
}
?>
---------------
On the /includes directory, the "SpecialThesaurus.php" includes this code:
---------------
<?php
if( !defined( 'MEDIAWIKI' ) )
die();
$wgExtensionCredits['validextensionclass'][] = array(
'name' => 'Thesaurus for Biko languages',
'author' =>'Kathleen Jane P. Borja',
'url' => 'http://www.mediawiki.org/wiki/User:Kathjane',
'description' => 'This Extension searches for bikol word for a given
literary input (poems, short stories, etc.), tags the searched word with bikol
synonym according to origin (Bikol-Naga, Bikol-Masbate, etc.) and user type
(Student, College Graduate, or Professional). '
);
function wfSpecialThesaurus()
{
$searchboxtext = "Search for Bikol words";
$tagboxtext = "Tag with Bikol Synonym";
global $wgOut;
$result=<<<ENDFORM
<!-- Thesaurus Extension by Borja, Kathleen -->
<table border="0" align="left" width="650" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" align="left" bgcolor="">
<form name="searchbox" action="" method="get" class="searchbox">
Search : <input class="searchboxinput" name="searchkword" type="text"
value="{$searchboxtext}" size="50" />
<input type="submit" name="submitsearch" value="Go" />
<input type="reset" name="cancelsearch" value="Cancel"/><br><br>
Results:<br>
<textarea name="resultarea" cols="60" rows="10"></textarea><br><br>
Tag with: <input type="text" name="tagbox" value={$tagboxtext}" size="50" />
Origin: <select>
<option name="default" />Bicol-Naga
<option name="bicolmasbate" />Bicol-Masbate
<option name="bicolragay" />Bicol-Ragay
<option name="bicollegazpi" />Bicol-Legazpi
<option name="others" />Others
</select>
User Category:
<select>
<option name="student" />Student
<option name="collegegraduate" />College Graduate
<option name="professional" />Professional
<option name="others" />Others
</select><br><br>
<input type="submit" name="saveall" value="Save" />
<input type="reset" name="cancelall" value="Cancel" />
</form>
</td>
</tr>
</table>
<!-- Thesaurus Extension End - -->
ENDFORM;
$wgOut->addHTML($result);
return true;
}
?>
---------------
I find it hard to make the pop up window work on mediawiki although I made it
possible on the separate php files. It did work. Why is it that I could not make
it on mediawiki? How can I make it using the $wgOut method?
What shall I do?
Thanks guys.^_^