Jump to content

Extension talk:InputBox/Archive

From mediawiki.org
Latest comment: 13 years ago by 75.85.127.249 in topic InputBox/Align Wrap Text
The following discussion has been transferred from Meta-Wiki.
Any user names refer to users of that site, who are not necessarily users of MediaWiki.org (even if they share the same username).
Is it possible to use this input box on other wiki's because i've tried it and the raw syntax displays as text, any idea's/help plese?

Installation

Download the file inputbox.php to the folder extensions of your MediaWiki installation. Add the line require_once("extensions/inputbox.php"); to LocalSettings.php.



I HOPE INPUTBOX can preload any word

such as [[Category:xxx]] {{xxxx}} [[xxxx]].....

Amen to that!

It would be good if ...

the button label "create article" can be customized, like "create city article".--Patrick 6 July 2005 10:22 (UTC)

Yes, that idea is good! I'd also like to be able to define a prefix for the created page. That way, I could place it on, say, Wikipedia:Votes for deletion and only need to enter "Alpha" to create Wikipedia:Votes for deletion/Alpha. As it is I'd have to manually enter the prefix each and every time I wanted to add a page. Master Thief Garrett 7 July 2005 21:10 (UTC)
Yup that is definitely a nice way to go, and furthermore you could customize the prefix at will, so you can create, for instance, a category by only putting the name, and the page Category:name would be created. 82.242.132.211 21:45, 8 October 2005 (UTC)Reply

Copied from Talk:Inputbox

Yes, I would like to have an input box to create a page in a specific namespace, so the prefix idea would be really useful. —Celtic Minstrel 13:41, 11 March 2008 (UTC)Reply

In w:Wikipedia:Village pump (proposals)#User talk inputbox, Angela proposes using this extension to add messages to user talk pages, with the note that it only works for previously blank talk pages. To make this truly effective, it would seem expedient to add a third type, corresponding to the new section "+" functionality of talk pages. Arguably, such a type should insert " talk" into the namespace if not already present.

And would it be hard to add the facility to use an explicit message string rather than just a reference to a template?

Bovlb 04:55, 6 Jul 2005 (UTC)

bugzilla references

  1. bugzilla:02805 (fixed) – "<inputbox> should allow to set predefined titles"
  2. bugzilla:02847 – "<inputbox> usage of template constructs to generate the "default" option"
  3. bugzilla:02842 – "<inputbox> should allow alternatively to place the header *between* the inputbox and the button not only above the inputbox"
  4. bugzilla:02844 (fixed) – "<inputbox> should allow allow to label a button differently then MediaWiki:Createarticle"
"Amike" Gangleri | Th | T 18:32, July 13, 2005 (UTC)

undefined function: wfmsghtml()

Fatal error: Call to undefined function: wfmsghtml() in /var/www/.../extensions/inputbox.php on line 124

Where this wfMsgHtml come from ?

Which MediaWiki version is required ? I've 1.4.4, I'll try to upgrade.

Iubito 07:53, 30 July 2005 (UTC)Reply

I found that said function is only present since version 1.5alpha2. For 1.4.x, you'll need inputbox.php version 1.3 (this is the last one without the wfMsgHtml() call)
Have fun!
Wolfram. 217.5.190.74 06:56, 3 August 2005 (UTC)Reply

Preload Function does not work.

I have Mediawiki version 1.4.7. I use version 1.3 of the extension. Any suggestions on what could be a problem? Oh, and the "default" option is not working either. But create new page and search work fine. Also, the button text is enclosed between < > brackets. Such as "<searchfulltext>". Any idea how to get rid of the brackets? Thank you. Your help is appreciated.

You won't be able to use preload without MediaWiki 1.5, as this part of the code resides in MediaWiki itself and does not exist in 1.4. However, you should be able to get the correct messages by editing (creating) MediaWiki:text in brackets, e.g. MediaWiki:Searchfulltext. In 1.5, these already exist.--Eloquence 01:57, 25 August 2005 (UTC)Reply
I have sort of a similar problem, except the angle brackets are displaying as raw HTML. I already made sure the MediaWiki messages (Searchfulltext, tryexact, createarticle) exist and have the proper messages; they do (and the messages are just text, with no brackets), but the buttons won't change. Any idea? I'm running 1.11.0. Also, my site is here, for reference's sake. --Azurite 23:59, 28 October 2007 (UTC)Reply

Integration with Multiple Starting Text Hack

(Or: how I got the same functionality with 1.4)
Well, I really wanted this and I'm scared @#$%less of upgrading, so I downloaded and tried it. As noted in the previous comment, preload doesn't work. However, if you add a couple lines to the inputbox.php files in the right places, you can use the multiple starting text hack to do your preloading for you.

This is somewhat dependent on how you have that particular hack installed, but for me it was the following:

  1. Add a getBoxOption. Not too difficult, just add it where the others are.
       getBoxOption($inputbox->starttext,$input,"starttext");
  1. In Class InputBox, where the variables are given, just add $starttext in one of the lines.
  2. Where the HTML to be rendered for the CreateBox is given, just add this in the input box stuff.

<input type="hidden" name="starttext" value="{$this->starttext}_StartText">

Note that on my Wiki, I use many namespaces and thus have a {{NAMESPACE}}_StartText theme going. See the Multiple Starting Text Hack discussion for more information.

So that's what works for me. Not sure, but there might be a way to implement the editintro parameter in a similar way. It doesn't really fit my needs, though, so I haven't mucked with it.

I hope that helps someone, and (as per usual) I am extremely hopeful that I didn't just point out something that's extremely obvious.

Umvalid!

http://validator.w3.org/check?uri=http%3A%2F%2Fmeta.wikimedia.org%2Fwiki%2FHelp%3AInputbox --Paddy 10:42, 25 November 2005 (UTC)Reply

The code created by the extension isn't invalid, but when you place more than one box of the same type on a page, all that boxes have got the same id --Three Of Twelve 13:21, 21 February 2006 (UTC)Reply
The code outputted isn't valid in general. I'm getting errors.
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="center" bgcolor="#eeeeff">
<p><form name="createbox" action="/index.php" method="get" class="createbox">
	<input type='hidden' name="action" value="edit">
	<input type="hidden" name="preload" value="StoryTemplate" />
	<input type="hidden" name="editintro" value="" />	
</p><p>	<input class="createboxInput" name="title" type="text"
	value="Enter Title Here" size="50"/><br />	
	<input type='submit' name="create" class="createboxButton"
	value="Create Story With Title Above"/>	
</form>
</p>
</td>
</tr>
</table>
This is still an issue. My wiki's main page is invalidated only because of this create form. Not sure about what is wrong, I believe a form can't be placed in a p, but I'm not 100% sure. Patheticcockroach 09:27, 23 March 2009 (UTC)Reply

Inputbox on Meta

I found this extension on the very day I started looking for such a feature -- but only thanks to luck -- it'd be very neat if the page showed up in the search results for 'forms' or 'html forms' or 'HTML forms'!!! -- yet I don't know if it's possible?

type=comment

It would be great if you could choose to add the comment at the top instead of the bottom to get a list with the most reasent comments at the head. --213.115.0.20 13:46, 1 December 2005 (UTC)Reply

+1! --80.109.61.51 10:39, 19 June 2006 (UTC)Reply

Namespace Specific Searches

Does/could this extension support a parameter listing a set of specific namespaces to be searched? The URL for such searches appears to be in the form: ".../index.php/Special:Search?ns110=1&search=SEARCHTERM&searchx=Search"

Tdoyle 14:16, 17 January 2006 (UTC)Reply

I second this! We would specifically like it for the b:Cookbook (namespace 102!). Also, we would like a FULLTEXT-only search box (like search2, but reversed) since searching for an article name in the cookbook is rather pointless. Kellen T 80.229.36.69 18:03, 6 April 2006 (UTC)Reply

define namespace (type=create)

I added a couple of lines that allow to define the namespace the article will be created in. Could it also be included in regulary versions? I added a "namespace" parameter and changed the HTML-Code in getCreateForm() as follows:

<form name="createbox" action="$action" method="get" class="createbox" onsubmit="if (document.createbox.pagename.value.substring(0,'{$this->namespace}:'.length) != '{$this->namespace}:') {document.createbox.title.value = '{$this->namespace}:' + document.createbox.pagename.value;} else {document.createbox.title.value = document.createbox.pagename.value;}">
	<input type='hidden' name="action" value="edit">
	<input type="hidden" name="preload" value="{$this->preload}" />
	<input type="hidden" name="editintro" value="{$this->editintro}" />	
	<input type="hidden" name="title" value="" />
	{$comment}
	<input class="createboxInput" name="pagename" type="text"
	value="{$this->defaulttext}" size="{$this->width}"/>{$this->br}	
	<input type='submit' name="create" class="createboxButton"
	value="{$this->buttonlabel}"/>	
</form>

(maybe, you might be able to realize that function easier ;) --Three Of Twelve 21:21, 24 January 2006 (UTC)Reply

by removing the colon the subpage-function could be integrated and other prefixes, too --Three Of Twelve 18:18, 25 January 2006 (UTC)Reply

MediaWiki v1.5: Output error

I'm getting a strange error running Inputbox with MediaWiki v1.5 ...

when i add a text inputbox to a page using the syntax described on the Help page i get the following output instead of a textbox when the page is rendered:
NaodW29-inputbox319e48674cc47cb700000001

I'm very new to all of this but haven't any trouble installing extensions in the past. Unfortunately i don't even know where to begin looking for a solution. 72.139.230.29 22:16, 28 January 2006 (UTC)Reply

  I had the same problem. I solved it by moving the InputBox code to a template. The problem occured when the 
  InputBox code was on the same page as a call to a template with m:MenuTabs code. 
  Now both MenuTabs code and InputBox code are in templates and I can use them on the same page. 
  Michiel.82.170.134.93 20:56, 5 February 2006 (UTC)Reply

editintro

Could this box be modified, so that the 'editintro' does work on existing articles? Currently, when editing existing articles, no header text appears, but I'd like for it to be possible for editors to specify that text should appear in special cases. For example, on the Wikipedia Reference Desk, it would be possible to include a reminder of the rules in a header above each edit window, so that newbies can be gently guided.

Is there a reason the editintro is ignored by default when editing existing pages? -- Ec5618 00:07, 29 January 2006 (UTC)Reply

This is something that we at the Vietnamese Wikipedia would much like, because there's obviously a lot more you can do in wikitext than in HTML comments to make editing a page more user-friendly. – Minh Nguyễn (talk, contribs) 06:18, 18 February 2006 (UTC)Reply

Add to a defined category

who use this? in my mediawii,1.82 i can't find this  $text=$this->getPreloadedText($preload); 

I wanted the extension to work from a category page and make a new page within the category from which it is created. I made the following changes and thought they may be useful to others. This is very much a hack, but feel free to incorporate it properly into the software if it's seen to be a good feature.

First, change the inputbox extension to include the following lines: In the function "renderinputbox" add this line near the others:

   getBoxOption($inputbox->catname,$input,'catname');

This allows you to pass the variable 'catname', which you define when you write the extension.

Under "class InputBox', add $catname to the variable listing.

Then, near the bottom of the file, add this line near the others for the form creation: <input type="hidden" name="catname" value="{$this->catname}" />

Then, in article.php (in the includes folder), add in the following: Under "function getContent" add in:

    $catname = $wgRequest->getText( 'catname' );

So it reads in the variable.

Then, change:

     $text=$this->getPreloadedText($preload);

to:

     $text=$this->getPreloadedText($preload,$catname);

And another version about 15 lines down, to pass the variable to the function.

In function getPreloaded text, change the function call from: getPreloadedText($preload) to getPreloadedText($preload,$catname)

And finally, change:

           if($rev) {
               return $rev->getText();
               }
           }

to this:

           if($catname) {
               $cattext = "\n\n[[Category:" . $catname . "]]";
           }
           else {
               $cattext = "";
           }
           if($rev) {
               return $rev->getText() . $cattext;
               }
           }

That's it, you should be able to pass a category now. Change as you see fit to pass another variable to the page you're creating. Good luck!

Pre-box label

Can we get a label before the input box? æle 01:09, 17 February 2006 (UTC)Reply

Take a look at the code - you should easily be able to hack that yourself, even without understanding PHP.--Eloquence 02:29, 17 February 2006 (UTC)Reply
Curiously enough, the most recent code already has a "labeltext" option for boxes of type "search2":
 
This made my job a lot easier. :) æle 20:12, 18 February 2006 (UTC)Reply

bug? inputbox interrupts a numbered list

The inputbox is great but it seems to interrupt a numbered list:

# Green
# Red
# Blue
# New colors (add your own):<inputbox>type=create</inputbox>
# Purple
# Orange
  1. Green
  2. Red
  3. Blue
  4. New colors (add your own):

  5. Purple
  6. Orange

Any idea on how to fix? Arghman 22:35, 23 February 2006 (UTC)Reply

The InputBox is wrapped in a <div> element, forcing it to be block level. The sanitiser is probably cleaning up what it sees as a still-open <ol> container; or the browser is ignoring the invalid XHTML. This isn't an InputBox-specific problem. Rob Church Talk 07:30, 9 March 2006 (UTC)Reply

error message

Hi I'm *very* new to MediaWiki and installing an inputbox is my first ever extension, but I get the following warnings when I try to save the page (I've followed the instructions on uploading inputbox.php and edited LocalSettings.php),

Warning: Missing argument 3 for renderInputbox() in /home/.../public_html/extensions/inputbox.php on line 42

Fatal error: Call to a member function getText() on a non-object in /home/.../public_html/extensions/inputbox.php on line 60

Any pointers would be much appreciated

Hello, I get the exact same error and to be honest I have no idea where to look to solve it. Please help. jrleonard@gmail.com

--CMacedo 08:32, 4 March 2006 (UTC) I also get the same error message. Are you two using EasyPHP? This is the only thing I can see that may be affecting the functioning of the extension.Reply

PHP Version: 4.3.10

I've got the same message too with easyphph AND on my distant website with Mw 1.5.6 (PHP: 4.4.0 (apache2handler) MySQL: 4.1.10a-log ), thanks for help. --Henrique 01:42, 3 March 2006 (UTC)Reply

[ 3/3/2006 ] Same error here, using php on Solaris:

PHP 5.0.4 (cli) (built: Jun 28 2005 22:24:45)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies

Getting the same error on RHEL 3, Apache 2, PHP 4.3.2. I am not using EasyPHP. --Bradley Holt 18:09, 3 March 2006 (UTC)Reply


Same error here, PHP 5.0.5/Netware - this file needs to be rewritten to be compatible with the latest versions of PHP.

See http://www.gurusnetwork.com/discussion/thread/2109/ and http://www.ozoneasylum.com/5733 for some hints to fix it

Same here - I tried php 4.4.2 and 5.0.4 ... 63.229.127.222

Quick Fix

After some browsing around and quick hashing of the code I found that the following addressed the issue. However, please note that this has not yet been tested fully. Please add any issues you encounter.

Line 40: Delete variable &$parser so the function now looks like this

function renderInputbox($input, $params)

Line 60: Comment out the entire line starting $boxhtml=str_replace...:

        # Maybe support other useful magic words here
        # $boxhtml=str_replace("{{PAGENAME}}",$parser->mTitle->getText(),$boxhtml);

--CMacedo 08:32, 4 March 2006 (UTC)Reply

Does this disable the parser? Because that could be dangerous (allowing sql injection, html tags, etc)

Extensions don't have the power to totally disable the parser; this is just ignoring the reference to the parser passed to all parser hooks. Rob Church Talk 07:32, 9 March 2006 (UTC)Reply

That fixes the problem. Thanks. Looks like lots of people are having this same issue, trying to perform a non-object operation on that variable.

MediaWiki 1.5: inputbox is not working

MediaWiki v1.5

I'm sure i followed the instructions, but when i added the inbox code into a page, the browser just hung up at .....wiki/index.php?title=Test&action=submit

Doesn't work with any other browser. Can someone give me a hand? I don't know whereelse to put this. Thanks.

First of all, upgrade from 1.5.0 to 1.5.7; your version of MediaWiki contains about four largish bugs or security issues. Next; we'll need more information in order to diagnose the problem. What you actually did; what your Apache/other HTTPD/PHP error logs state (if at all, if not, turn them on and see what comes up) etc. Rob Church Talk 07:34, 9 March 2006 (UTC)Reply

MediaWiki 1.5.7: inputbox.php 1.20 hangs up while 1.19 works

MediaWiki 1.5.7 on Red Hat Enterprise 4 WS: With inputbox.php 1.20 version you can observe on /var/log/httpd/error_log

[client 160.xxx.yyy.zzz] PHP Warning: Missing argument 3 for renderinputbox() in /var/www/html/wiki/extensions/inputbox_1.20.php on line 42

[client 160.xxx.yyy.zzz] PHP Fatal error: Call to a member function on a non-object in /var/www/html/wiki/extensions/inputbox_1.20.php on line 60</nowiki>

I downloaded version 1.9 from MediaWiki's SourceForge CVS and it seems to work alright.

--Canne 23:27, 4 March 2006 (UTC)Reply

Exactly like you said. Thanks Canne! It's working now.

--Ming 23:27, 4 March 2006 (UTC)Reply

Windows?

I have a windows installation, with IIS, which otherwise works fine. I installed Inputbox.php etc, no errors, but it just doesn't work. It seems to be running the script ok, it just doesn't render the box or translate the tags. Any ideas?

What version of MediaWiki? Confirm that the extension is installed; check Special:Version and see what extensions are registered. Consider adding a line like
echo( "Hook run!\n" );
to the parser hook function, to prove that's being executed. Rob Church Talk 07:28, 9 March 2006 (UTC)Reply

Inputbox on the sidebar?

I just installed this extension, and it's working great.

My question is; is it possible to put a "Create Article" inputbox on the sidebar? I tried to just add one beneath the last link, but the sidebar doesn't seem to recognize it. When viewed as an article, the MediaWiki:Sidebar page displays the inputbox fine.

Is there something different I have to do, or is this just not possible. If it's not possible, is there another way to have some kind of "create article" link on the sidebar?

The sidebar doesn't interpret wiki text quite as you seem to expect. You could add such a box via edits to the skin file. Another semi-solution might be to set $wgGoToEdit = true; in LocalSettings.php, which causes the user to be taken to an edit form if entering a nonexisting title and clicking Go. Rob Church (talk) 12:48, 13 June 2006 (UTC)Reply
“You could add such a box via edits to the skin file”
can you elaborate for those who are new users...

noinclude and includeonly

I created a fairly simply set up to add creatures to a database on SporeWiki.com. The section " Create a creature portal page" preloads MediaWiki:Content base/creature portal as I wanted it to, when setting it up I was really hoping that includeonly would work so that it didn't sort the mediawiki pages (since the portal template has a cat tag in it) and I found out that it does work (as you can see if you test the inputbox on the creature database page yourself). Then I wanted to be able to keep all of the messages related to adding creatures in the same place, so I figured I'd just categorize them with noinclude, but if you test out the inputbox you'll see that that portion of the code doesn't do what I thought it might... Is there any reason why that would happen, is it a mediawiki bug or an inputbox bug? Is there any temporary fix to get around it (I already set up an if template if that could be useful) for now until noinclude works in that manner? It'd be appreciated, thanks! 69.183.38.170 17:30, 7 June 2006 (UTC)Reply

All I can say is "interesting problem". Apparently the includeonly tags are stripped keeping the content, but noinclude tags + content are kept as is (?). Maybe an oddity in the inputbox extension, you could report it as "bug" / missing feature / oddity at mediazilla: (component "extensions" "inputbox").
And / or try a workaround based on #ifeq: MediaWiki | {{NAMESPACE}}. But I've never seen a category for system messages, better test first if that's possible at all. If not you could use an ordinary template message instead of a system message for your inputbox - the help page only uses MediaWiki examples because they are guaranteed to exist and can't be vandalized. -- Omniplex (w:t) 20:30, 12 June 2006 (UTC)Reply
I don't know how to report bugs, and I'm not sure what you mean by a a workaround with that, but I moved it to a template and preloaded the template again and it did the same that it did earlier, loading the noinclude tag and it's text also. 69.183.39.72 05:54, 13 June 2006 (UTC)Reply
I updated the page after trying it out with m:Template:Preload demo.--Patrick 14:10, 13 June 2006 (UTC)Reply
See Bug #5210.
--99.236.115.46 05:20, 10 October 2007 (UTC)Reply
See my comments Noninclude confusion below. Users need to be able to choose when to use noinclude and when to ignore it, especial for nested activities.12.235.121.75 17:34, 11 November 2010 (UTC)Reply
See my new solution to this Noinclude issue in Noninclude confusion below. 12.235.121.75 16:45, 12 November 2010 (UTC)Reply

using an imageTEMPLATE with parameters as the 'preloaded' thing

Is it possible? All this subst and includeonly is starting to get to me, along with nested templates...

I'm trying to simplify the process of nominating an image for FPC. see here: commons:User:Pfctdayelise/test. Any tips welcome. This is a really handy extension BTW. pfctdayelise 12:11, 15 June 2006 (UTC)Reply

I do not think that is possible. As a minor typing aid you can preload m:Template:T image preload, that is all I can think of.--Patrick 13:04, 15 June 2006 (UTC)Reply

You can also preload m:Template:T image preload 2 containing subst of m:Template:T image preload 3. Here you fill in the image name as parameter of the latter. There is still some duplication: the Subject/headline probably has to contain the image name too, but this is not automated.

Patrick 13:23, 15 June 2006 (UTC)Reply

Using inputbox to subscribe to a mailing list?

I'm looking for an extension which will allow a user to enter his/her email adress and submit the value to an external http address. I already got the HTML code for this from the mailing list service, but have trouble building it into MW properly. Could inputbox (currently or potentially) be used for this? --MortenB 21:18, 29 July 2006 (UTC)Reply

make a modifies version of inputbox.php that will post the input boxes contents to the php page you wish, then have the php page do whatever with the email then redirect them wherever. ;) --71.217.192.176 00:01, 7 February 2007 (UTC)Reply

downloading problems?

I've been trying to download the inputbox.php from the links here, but it never loads for me. Is anyone else getting this problem? Or is there a different link someone can show me to get this file?

The download is still broken! -- 193.254.183.243 08:34, 24 February 2009 (UTC)Reply

Editintro does not work for comments

Even the example fails. pfctdayelise 15:26, 21 October 2006 (UTC)Reply


Target =new

Is there a way to add a parameter to the inputbox so when doing page creation, the form gets posted to a new window?

This is useful for creating a page that's been populated with a list of inputboxes preloaded with titles of new pages to create.

So this way, I can go down the list and create new pages and not loose the page I'm on. You see, this is the script I'm using; so you know why this is useful for me.

This handy script will be useful for anyone who needs to create lots of these inputboxes preloaded with their topic titles so they can add a bunch of pages all at once, easily. Just edit wherever you see "TOPIC TITLE" with the respective text you need.

<html> 
<head>  
</head> 
<body> 
<?php
$script = $_SERVER['PHP_SELF'];
if (!isset($_POST['submit']))
    {
        echo "<font face=verdana>Enter a list of TOPIC TITLES to generate code to mass create pages<br>
            <form name='form' action='$script' method='POST'>
            <table>
                <tr>
                    <td>
                        <textarea cols='80' rows='20' name='names'></textarea>
                    </td>
                </tr>
                <tr>
                    <td>
                        <input type='submit' value=' Do It ' name='submit'>
                    </td>
                </tr>
            </table>
        </form></font>
            ";
    }
    else
    {
        $namelist=explode("\n",$_POST['names']);
echo " <form name='form' action='$script' method='POST'><textarea name='textarea' cols='80' rows='20'>";
        for($i = 0;$i < sizeof($namelist);$i++)
        {
echo "<inputbox>
type=create
preload=Template:TOPICTEMPLATE
default=".str_replace("\r","",$namelist[$i])."
buttonlabel=Add New TOPICTITLE
</inputbox>
";

        }
echo " </textarea><br><input type='button' value='Highlight Text' onClick='javascript:this.form.textarea.focus();this.form.textarea.select();'></form><br><a href=/index.php?title=Template:TopicTitle&action=edit>Go to TOPICTITLE to add this code!</a>";
    }
?>
</body> 
</html>

Maybe somebody will have fun with this code... Anyway, I would like each inputbox thats created to open the page to be created in a new window. Is there a way to specify a target for the inputbox form? Thanks, MediaHound 15:09, 30 October 2006 (UTC)Reply

default target

I think it would be useful to be able to specify a default page that it goes to if the user clicks the button when the text field is blank. Currently, it goes to Main_Page, but I think project:sandbox would be more useful. -Sanbeg 23:08, 2 November 2006 (UTC)Reply

Full text search in input=search does not work

In the below box, press either button, and you get back to this page. Full text search does not work, and I don't know why. The input name is "searchx" for this button, but "fulltext" for the search button in the sidebar - which still works.

The reason for the problem is probably easy to fix.

--Barklund 19:47, 9 November 2006 (UTC)Reply

MediaWiki 1.8.2: Unable to install

I am unable to install the extension (inputbox.php 0.1.1) as well as the hack from Algorithm. I'm pretty new to mediawiki. Any clue?

Currently using:

  • MediaWiki 1.8.2
  • PHP 5.2
  • MySQL 5.0.27

Hiding the input box, or having only the button

It would be extremely nice to be able to hide the input box somehow, and default it to a certain value in the form. The reason for this would be if I wanted to comment, and I wanted to hard code where the user could comment to. Understandably, it wouldn't be secure (javascript overwriting) but still, it would be a nice addition! -- Silivrenion Jan 1 2006

See #Namespace Search, Hide Checkboxes Patch below. 69.138.163.138 01:57, 5 February 2009 (UTC)Reply

Mediawiki 1.9.0: Positioning the create box

I am using Mediawiki 1.9.0 and this wonderfull extansion. I have noticed that by default, the extansion put itself centered on a page. I found that nice for the seach function or when you put it in a tab but I wanted that the create function and box be left positioned on the page.

To acheive this, located in the code the section (At the botom):

<td align="center" bgcolor="{$this->bgcolor}">
<form name="createbox" action="$action" method="get" class="createbox">

And replace by :

<td align="left" bgcolor="{$this->bgcolor}">
<form name="createbox" action="$action" method="get" class="createbox">

Or replace left by whatever you want (center is the default).

--Romainp 16:47, 12 January 2007 (UTC)Reply

MediaWiki: 1.6.8: ERROR On Line 67

it says Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/codev/public_html/en/w/extensions/inputbox.php on line 67 please help--71.217.192.176 00:09, 4 February 2007 (UTC)Reply

heres my version info:
MediaWiki: 1.6.8
PHP: 4.4.2 (cgi)
MySQL: 5.0.27-standard
--71.217.192.176 00:30, 4 February 2007 (UTC)Reply
I got my host to set me up an account on their PHP5 server, and i just finished moving all the data to all my sites over and just upgraded the wiki to 1.9.2 and re-downloaded inputbox.php and all appears to be working fine now.--71.217.192.176 23:59, 6 February 2007 (UTC)Reply

Reason for the above given error is PHP Version 4. You need V5 - then the error will not appear on line 67.

I fixed this error pretty easily, by unchaining the -> operators on that line, using a temp variable instead; i.e. I replaced
 $boxhtml=str_replace("InputBox/Archive",$parser->getTitle()->getText(),$boxhtml);

with:

 $title = $parser->getTitle();
 $boxhtml=str_replace("InputBox/Archive",$title->getText(),$boxhtml);
I haven't tested thoroughly for any other PHP4 incompatibilities, but it seems to work, so it's probably worth putting that fix into SVN for those of us still running PHP4 (it's not that much uglier :)).
- IMSoP 17:55, 19 February 2007 (UTC)Reply
  • I am also under PHP vers.4 and have the same syntax error, but showing on line 77. I could not find the line indicated by IMSoP to try his workaround, any idea of what might be the issue? Did the inputbox extension change since Feb. 2007?
80.80.162.148 14:53, 22 February 2008 (UTC)Reply

MediaWiki: 1.6.9: inputbox "breaking" script

I am having problems with the inputbox extension. When I add it and the entry to LocalSettings, no pages will load. I just get a blank page. I have been able to add other extensions without problems.

I am using version 1.6.9 with Linux and a MySQL backend.

Any suggestions?

Thanks

I'm guessing this is the PHP4 compatibility problem (see section above, including fix) - if you can find your PHP error log, it's probably logging the same parse error that others have reported, it's just suppressing it from display on your live host. - IMSoP 09:37, 20 February 2007 (UTC)Reply

Borders

Is there any way to have a border around the input box without putting the whole thing into a table?

Defining Alignment

I have found the need to define the alignment for the inputbox on my wikipages, so i hae made a small modification that allows you to specify the alignment as a paramater, see this.--RyanB88 01:06, 14 February 2007 (UTC)Reply

Followed all the instructions, so why is it still just code?

I followed all the instructions for installing the Inputbox and altering the ActionCreate (from Algorithm), but the page still appears as code. Did I forget something somewhere? I don't get an error; it's just that the inputboxes don't show up. --Azurite 01:59, 25 March 2007 (UTC)Reply

dynamic default text

hi, I want to have as default text the current date, so

how to implement?

--08:25, 16 April 2007 (UTC)

Variables and parser functions are not supported in inputbox parameters. A cumbersome workaround is to make a big switch with for every day the full wikitext of an inputbox:


Patrick 10:13, 16 April 2007 (UTC)Reply
Right. Thanks. So that would mean 365 different inputboxes for a year, maybe not then :/. --217.64.242.138 10:39, 16 April 2007 (UTC)Reply

combining several small fields

I want to make a field similar to http://wikimaas.org/AddEvent. So how to connect several small boxes, to add them together to form one page title, eg. YYYY-MM-DD The launch of the new inputbox. And can I apply a maxwidth?

For filling in it is easier to type a number - <tab> - next, instead of replacing already formatted numbers in one line. Oh, and they should also have a connected tab-order :)

--217.64.242.138 10:19, 19 April 2007 (UTC)Reply

MediaWiki does not allow variables in the computer programming sense, so the inputbox cannot be applied to assign a value to a variable.--Patrick 11:21, 19 April 2007 (UTC)Reply
What about a sort of redirecting to a template-page which receives these different variables, and then redirects to the to-be created page? --217.64.242.138 13:42, 19 April 2007 (UTC)Reply
You may be interested in Simple Forms (though I can't get it to work with MW 1.9.3) and/or Semantic Forms (but it requires the cumbersome Semantic MediaWiki). -Eep² 13:57, 3 August 2007 (UTC)Reply

Background color?

Is there any way to to put background color on the inputbox? I'm using it on a table that has a background, and it' kind of strange to see only the inputbox with a white background. --219.121.89.169 11:27, 7 May 2007 (UTC)Reply

Yes you can change the background color: It is a parameter that you can set, just like "type" or "buttonlabel" - you would add the phrase bgcolor= and then add a color code

see below

<inputbox>
type=create
'''bgcolor=#eeeeff'''
buttonlabel=Create New Page
</inputbox>

Looks Like This:


To figure out a color code, you just add in the hex numbers - as described here: http://html-color-codes.com/

Idea for easy extension

To make a button which runs a PHP script, eg. for sending a message using a textarea:

Add to "function render()" another type "php":

elseif($this->type=='php') {return $this->runPHP() ...


Add a function "runPHP" like this:

function runPHP() {
$createform=<<<ENDFORM
<form name="runPHP" action="xxx.php" method="post">
<textarea rows="3" name="textareaPHP"></textarea>
<input type='submit' value="xxx" />
</form>
ENDFORM;
return $createform;
}


Perhaps action="xxx.php" must be sth. like this: action="http://xxx/xxx.php", because otherwise, a new Wiki page will be opened.

Preload Upload File

I wanted to try and preload a template into the upload page, much like commons dose. I tried the commons irc and they couldn't tell me how they are doing it. So I tried at test.W with no results as you can find out yourself:

testwiki:Special:Upload?action=edit&preload=Template:Dead

Any ideas? --is:Notandi:Steinninn 194.144.110.1 15:46, 20 June 2007 (UTC)Reply

Adding text into Summary field on commons:Special:Upload is done with Javascript and has nothing to do with Input box. See commons:MediaWiki:Upload.js which is called from commons:MediaWiki:Common.jsAlex Smotrov 15:58, 20 June 2007 (UTC)Reply
I can't tough JS, every time I do I break more then I fix. Maybe you, or someone els want's to do this on en:? It has been suggested at least once. --Steinninn 16:32, 20 June 2007 (UTC)Reply
I'm not sure where to start, en:MediaWiki talk:Common.js or en:Wikipedia:Village pump (proposals)‎, but in any case you need consensus first. Coding is the easy part ;) Also, I would suggest that the script doesn't insert the text automatically (like on Commons) but rather provide a link in en:MediaWiki:Fileuploadsummary that would insert it when user wants it ∴ Alex Smotrov 20:07, 20 June 2007 (UTC)Reply
I made a propossal at The Village Pump. --Steinninn 00:54, 21 June 2007 (UTC)Reply

Mediawiki 1.9.3 and 1.10: Namespace Searching not working

I have not used Inputbox before with the namespace attribute and have been unsuccessful to get it working. I have tried some of the tips posted here still with no success. I have tried using it on a couple different installs and of recent versions of Mediawiki (1.9.3 and 1.10) (PHP 5.2.2 and MySQL 5.0.24a) but with no success. It looks like it runs successfully on Wikimedia? So what am I doing wrong?! Related extensions I need to install to get it working? Ideas? Is this due to custom namespaces?
Example of what I am adding:


<inputbox>
type=search
namespaces=Winner,Nomination
</inputbox>

--Myotus 13:54, 19 July 2007 (UTC)Reply

I experienced the same issue and found the solution. Open inputbox.php and goto line 132
<input type='submit' name="fulltext" class="searchboxSearchButton" value="{$this->searchbuttonlabel}" />
and change it to
<input type='submit' name="searchx" class="searchboxSearchButton" value="{$this->searchbuttonlabel}" />
Works for me!
--Mark P. 20:22, 22 October 2007 (UTC)Reply


--Rob Terzi 00:09, 4 March 2008 (UTC)Reply

I needed this fix as well for Mediawiki 1.11, which brings up some questions:
  • Did the search interface change in some version of Mediawiki?
  • Is anyone maintaining this extension, that could make this fix permanent, or add a check for MW version?
  • Note: Search2, which doesn't seem to be documented doesn't do anything with name spaces, so that is a little trap for anyone trying to search specific name spaces.

Worked for me too, but:

  • in the most current version, the suspect line is 138,
  • had to close my browser and come back for changes to work.

--Furboy 18:53, 18 April 2008 (UTC)Reply

Multiply fields

I'd like the function to have multiple input fields on the same submit button and the content of these fields to be applied to a pre-set template. This way it becomes like a 'wizard' for creating pages that has basic set content but with only say a few parameters of the subject being different.

For example fish profiles, these pages are often 95% identical expect for the species name, common name, colour, etc.

Can this extension do this?

--Quatermass 11:59, 30 July 2007 (UTC)Reply

I'm looking for something similar to this as well, except being able to put in multiple page names in an input box and having them all get created with the same content. --Bluesoju 04:38, 28 June 2009 (UTC)Reply

Suggestions from CreateArticle

CreateArticle is based off Inputbox but my suggestions for it apply to Inputbox (and other extensions based off it, like CreateBox) as well. -Eep² 07:49, 7 August 2007 (UTC)Reply

Transparent

Hi!, I want to know how can I configure the inputbox to match with the background color without using the parameter bgcolor, like, make it transparent. Also, I want to know if it's possible put it under the search bar in the sidebar. This is an example of what I'm talking about:


And it should look like:


Without using bgcolor

As you can see, the background color of the box (black) does not affect the input box background color and this gives me problems when I try to put it in the sidebar. Thank you very much. Thunder26 (talk) 00:59, 31 August 2007 (UTC)Reply

I would try global CSS: give your table some id and then use something like table.yourid form {background:color:transparent}. As for sidebar, do you mean editing Mediawiki:Sidebar? I don't think it will accept inputbox. Note that if you type something in the usual search field and press Go, and the phrase is not found, then there are two links to create an article, you could make on of those links to really stand out ∴ Alex Smotrov 02:12, 1 September 2007 (UTC)Reply
Thank yo very much. Thunder26 (talk) 05:17, 1 September 2007 (UTC)Reply
If you add $wgGoToEdit = true; to your LocalSettings.php, typing a nonexistent article name in the search box and clicking "Go" will create that article. —Celtic Minstrel 13:38, 11 March 2008 (UTC)Reply

please add 'summary='-Option

Hey guys, wouldn't it be usefull if you would add an option, witch sets the summary-text of the created edit. I'd need it for german WP, for example. Thanks for ths tool. Greetings, Michi —The preceding unsigned comment was added by 88.217.29.241 (talkcontribs) 14:01, 5 October 2007 (UTC). Please sign your posts!Reply

Bug report Inputbox revision 27198

I am using PHP version 5.2.4 (cgi-fcgi) on a Windows machine. Inputbox (search) seems to be working ok, but I do see the following note in a small font at the bottom of the wiki page on which I use the Inputbox:

PHP Notice: Undefined property: Inputbox::$labeltext in C:\iWiki\extensions\Inputbox\inputbox.php on line 153

If you need more info, let me know. 80.127.78.73 01:19, 10 November 2007 (UTC)Reply

Another namespace issue

I have tried following the above guidelines about changing line 132 but it did not work, the extension won't search in a specific namespace for me, here is an example: here Does anyone know what could be the cause? Thanks very much 60.50.173.98 00:10, 16 November 2007 (UTC)Reply

MediaWiki 1.11.0: Create Article issue

I have recently upgraded to MediaWiki 1.11.0 and although the inputbox function still works, the button labels are labeled as &lt;createarticle&gt; and &lt;searchfulltext&gt; - where should that be fixed? --90.200.52.95 14:37, 30 December 2007 (UTC)Reply

Hi. I had the same problem at http://www.appropedia.org. I fixed it by uploading the newest code (liked on extension page) and adding the inputbox directory to the include code. I.e. I changed require_once(/extensions/inputbox.php'); to require_once($IP.'/extensions/inputbox/inputbox.php');. If that does not work, you could always just add the extension markup to label the buttons as you like. Good luck, --LRG 22:05, 31 December 2007 (UTC)Reply

Call to undefined function wfloadextensionmessages() in wiki/extensions/InputBox/InputBox.classes.php on line

Installation Issue with mediawiki 1.9.3

I am trying to add this extension to MediaWiki 1.9.3 with no success.

I have downloaded inputbox.php and InputBox.i18n.php and placed them in /extensions/inputbox.

At the bottom of LocalSettings.php I have added

require_once($IP.'/extensions/inputbox/inputbox.php'); .

In MediaWiki I now receive:

'Fatal error: Call to undefined function wfLoadExtensionMessages() in C:\webdocs\pitawiki\extensions\inputbox\inputbox.php on line 38.

I have been doing quite a bit of research on Google to find the answer myself, but it is beginning to look like I am either the only one or nobody has documented this problem before. Can someone please help? Chad.cdmtech 22:46, 7 January 2008 (UTC)Reply

I still am not sure what the problem was, but I have upgraded to MediaWiki 1.11 and now all works fine. --Chad.cdmtech 17:19, 9 January 2008 (UTC)Reply
Same problem, a year later:
  1. MediaWiki: 1.7.1
  2. PHP: 5.2.5 (cgi)
  3. MySQL: 4.1.22-standard-log
For me the problem is on line 40. Line 40 is:
wfLoadExtensionMessages( 'InputBox' );
Line 38 is:
public function render() {
Line 58 (next section) is:
),
The entire section which is having problems is:
public function render() {
		// Internationalization
		wfLoadExtensionMessages( 'InputBox' );

		// Handle various types
		switch( $this->mType ) {
			case 'create':
			case 'comment':
				return $this->getCreateForm();
			case 'commenttitle':
				return $this->getCommentForm();
			case 'search':
				return $this->getSearchForm();
			case 'search2':
				return $this->getSearchForm2();
			default:
				return Xml::tags( 'div', null,
					Xml::element( 'strong',
						array(
							'class' => 'error'
						),
Odessaukrain 02:17, 31 December 2008 (UTC)Reply

Extension Inputbox fault

  • MediaWiki: 1.9.3
  • PHP: 5.2.5 (cgi)
  • MySQL: 4.1.22-standard-log

I am trying to install extension:Inputbox but I am getting this error while using it:

Fatal error: Call to undefined function wfloadextensionmessages() in /home/gidelimm/public_html/wiki/extensions/Inputbox/inputbox.php on line 58

Is there anybody whop can help me to sort out this problem? Thanks in advance --Plenumchamber 11:27, 19 April 2008 (UTC)Reply

See below for a reply. --Sayuri 14:30, 19 January 2009 (UTC)Reply

undefined function wfloadextensionmessages

I'm also getting the undefined function wfloadextensionmessages error.

  • MediaWiki: 1.9.3
  • PHP: 5.2.5 (cgi-fcgi)
  • MySQL: 5.0.41-log

The php error log entry:

[23-Apr-2008 19:35:31] PHP Fatal error:  Call to undefined function
wfloadextensionmessages() in .../mediawiki/extensions/inputbox/inputbox.php
on line 58
You're trying to use too up-to-date version of InputBox with a legacy version of MediaWiki; function wfLoadExtensionMessages() didn't exist prior to MW 1.11. You'll either need to upgrade your MediaWiki to a newer version, which is the preferred solution, or to use an older version of the extension. --Sayuri 14:30, 19 January 2009 (UTC)Reply

Version history

I suppose the latest version of extension:InputBox is not compatible with older versions of MediaWiki. It seems that only the latest version of InputBox is available on the Mediawiki SVN. For example q:en:Help:Inputbox#Installation and testwiki:Extension:Inputbox refer to the SourceForce CVS, which doesn't seem to exist anymore. Is there any public repository of older versions of this extension? --Samuel —The preceding unsigned comment was added by 213.28.6.132 (talkcontribs) . Please sign your posts with ~~~~!

That is exactly what svn.wikimedia.org is for. It's there so that you can download older versions of files. Extensions have been branched since MediaWiki 1.10 (REL1_10). The 1.10 branched version of Inputbox is supposed to work with MediaWiki 1.10.
In any case, I just can't understand why you are using old and outdated pages like Wikiquote's and test.wikipedia's pages as a reference when it comes to MediaWiki extensions. In most cases if an extension can be found at svn.wikimedia.org, its documentation can be found at MediaWiki.org — this is especially true when it comes to extensions that are used on Wikimedia sites. --Sayuri 14:30, 19 January 2009 (UTC)Reply

Adding NameSpace when creating articles

I'd like to combine the functionalities of search and create article...
I mean there should be an input box, radiobuttons with my predefined namespaces and a button. Is there allready someone who did this?
Because I tried it and for some reason it doesn't work.
Can someone please help me?

Version number please

It would be helpful if the developers of this extension assigned a version number to this extension. This could be in both the code (so it shows up in special:version) and the {{Extension }} infobox on this extension page. This way at a glance we can know if our MediaWiki installations are up to to date. --Maxelrod 22:04, 25 February 2008 (UTC)Reply


Namespace Search, Hide Checkboxes Patch

I needed to search specific namespace for particular pages, so I didn't want the checkbox to show, or give the user the opportunity to uncheck the box which would cause the search to fail. Here is a patch (context diff) against Version 0.1.1 that adds a parameter namespacehide which will prevent the checkboxes from being displayed.

-- Rob Terzi 15:24, 4 March 2008 (UTC)Reply

*** inputbox.php        2008/03/04 00:19:05     1.3
--- inputbox.php        2008/03/04 00:27:06
***************
*** 103,108 ****
--- 103,109 ----
        getBoxOption($inputbox->buttonlabel,$input,'buttonlabel',$parser);
        getBoxOption($inputbox->searchbuttonlabel,$input,'searchbuttonlabel',$parser);
        getBoxOption($inputbox->namespaces,$input,'namespaces',$parser);
+       getBoxOption($inputbox->namespacehide,$input,'namespacehide',$parser);
        getBoxOption($inputbox->id,$input,'id',$parser);
        getBoxOption($inputbox->labeltext,$input,'labeltext',$parser);
        getBoxOption($inputbox->br, $input, 'break',$parser);
***************
*** 203,214 ****
                                                $name='Main';
                                        }
                                        if ($usernamespace == $name) {
                                                $searchform2 .= "<input type=\"checkbox\" name=\"ns{$i}\" value=\"1\"{$checked}>{$usernamespace}";
                                        }
                                }
                        }
                        //Line feed
!                       $searchform2 .= $this->br;
                        //If namespaces are defined remove the go button
                        //because go button doesn't accept namespaces parameters
                        $gobutton='';
--- 204,221 ----
                                                $name='Main';
                                        }
                                        if ($usernamespace == $name) {
+                                           if (!$this->namespacehide) {
                                                $searchform2 .= "<input type=\"checkbox\" name=\"ns{$i}\" value=\"1\"{$checked}>{$usernamespace}";
+                                           } else {
+                                               $searchform2 .= "<input type=\"hidden\" name=\"ns{$i}\" value=\"1\">";
+                                           }
                                        }
                                }
                        }
                        //Line feed
!                       if (!$this->namespacehide) {
!                         $searchform2 .= $this->br;
!                       }
                        //If namespaces are defined remove the go button
                        //because go button doesn't accept namespaces parameters
                        $gobutton='';

I don't understand how to fix it but would like to see this option to hide the checkbox(es). SO what about a Version 0.1.2? --Subfader 20:49, 16 March 2008 (UTC)Reply

patch for current revision

Perhaps they've made a revision without changing the version number, but the code above does not match version 0.1.1 that is available currently at SVN. To make Rob Terzi's patch work with the current revision, make the following changes:

make the namespace selection work

Follow Mark P.'s patch (above) and replace

<input type='submit' name="fulltext" class="searchboxSearchButton" value="{$this->searchbuttonlabel}" />

with

<input type='submit' name="searchx" class="searchboxSearchButton" value="{$this->searchbuttonlabel}" />

introduce a new variable

I've called it '$showboxes' instead of 'namespacehide' because the patch hides the boxes by default and the parameter is used only to "show" the boxes. Find:

class Inputbox {
	var $type, $width, $preload, $editintro, $br;
	var $defaulttext,$bgcolor,$buttonlabel,$searchbuttonlabel,$labeltext;
	var $hidden, $namespaces,;

and replace it with

class Inputbox {
	var $type, $width, $preload, $editintro, $br;
	var $defaulttext,$bgcolor,$buttonlabel,$searchbuttonlabel,$labeltext;
	var $hidden, $namespaces, $showboxes;

hook the new parameter

Find:

		$options = array(
			'type' => 'type',
			'width' => 'width',
			'preload' => 'preload',
			'editintro' => 'editintro',
			'default' => 'defaulttext',
			'bgcolor' => 'bgcolor',
			'buttonlabel' => 'buttonlabel',
			'searchbuttonlabel' => 'searchbuttonlabel',
			'namespaces' => 'namespaces',
			'id' => 'id',
			'labeltext' => 'labeltext',
			'break' => 'br',
			'hidden' => 'hidden',
		);

and replace it with

		$options = array(
			'type' => 'type',
			'width' => 'width',
			'preload' => 'preload',
			'editintro' => 'editintro',
			'default' => 'defaulttext',
			'bgcolor' => 'bgcolor',
			'buttonlabel' => 'buttonlabel',
			'searchbuttonlabel' => 'searchbuttonlabel',
			'namespaces' => 'namespaces',
			'id' => 'id',
			'labeltext' => 'labeltext',
			'break' => 'br',
			'hidden' => 'hidden',
			'showboxes' => 'showboxes',
		);

add new conditional rendering

Find:

if ($usernamespace == $name) {
	$searchform2 .= "<input type=\"checkbox\" name=\"ns{$i}\" value=\"1\"{$checked}>{$usernamespace}";
}

and replace it with

if ($usernamespace == $name) {
   if ($this->showboxes == 'yes') {
       $searchform2 .= "<input type=\"checkbox\" name=\"ns{$i}\" value=\"1\"{$checked}>{$usernamespace}";
   } else {
       $searchform2 .= "<input type=\"hidden\" name=\"ns{$i}\" value=\"1\">";
   }
}

And find:

//Line feed 
$searchform2 .= $this->br;

and replace it with

//Line feed 
if ($this->showboxes == 'yes') {
  $searchform2 .= $this->br;
}

--Furboy 20:53, 18 April 2008 (UTC)Reply

Search this category?

Would it be possible to have the Inputbox being display as search box on all category pages so you can search the category (only consider the articles in this category)?
Had the idea when testing Extension:Multi-Category Search. This adds a special page and will search those article pages which are included in the category you've entered in the search fields. But you cannot enter normal search terms, only category names. So it would be nice to search articles in only 1 category. --Subfader 20:29, 16 March 2008 (UTC)Reply

I second this. It'd be a great idea.

Default value

It would be nice if the default value in the box would disappear by clicking into it in order to type. --Subfader 20:32, 16 March 2008 (UTC)Reply

Can you use Inputbox to use an external search engine?

I'd like to be able to use inputbox to search an external search engine. Is that possible? Would be great if that was built in. --Apolloni 09:52, 25 March 2008 (UTC)Reply



Parsing

Has anyone looked into adding the capability to allow for parser functions inside the <inputbox> tags?

Kay

Searching in namespaces

On the TiddlyWiki community wiki we're using this extension to create the following search form:

<inputbox>
type=search
searchbuttonlabel=Search Developers Documentation
width=24
namespaces=Dev**,Dev_talk**
</inputbox>

However, this doesn't actually search the specified namespaces.

Any help would be greatly appreciated.

-- FND 08:57, 14 July 2008 (UTC)Reply

Invalid Parameters

Some parameters became invalid. What's wrong?--百楽兎 01:51, 26 October 2008 (UTC)Reply


Inputbox + AJAX Search Suggestion?

Hi, I like this extension very much - one question: Is there any possibility to combine the search inputbox with the AJAX search suggestion on MediaWiki 1.13 or with the extension Search Suggest? I've already tried various things, but I haven't found a proper solution yet. I think it would be very useful... Thank you. --Filburt 07:43, 29 October 2008 (UTC)Reply

PHP warning

With the latest svn revision of inputbox working over the latest svn revision of mediawiki 1.14alpha, I see the php warning: PHP Warning: call_user_func_array() [<a href='function.call-user-func-array'>function.call -user-func-array</a>]: Unable to call InputBoxHooks::render() in includes/p arser/Parser.php on line 3330. NSK Nikolaos S. Karastathis 14:15, 4 November 2008 (UTC)Reply

Bug with "default" parameter

Hi,

There seems to be a problem with the default parameter. Look at Extension:InputBox#Parameters : below this code :

<inputbox>
type=comment
default=User talk:Eloquence
</inputbox>

... there is no text in the inputbox :


Delhovlyn 20:52, 4 November 2008 (UTC)Reply

Fixing the broken InputBox

The current checked in version simply doesn't load as people have pointed out. This is easy to fix, and you can simplify the code. Basically get rid of the Inputbox.hooks.php.

1. In Inputbox.php replace everything from line 50 on with:

// Register parser hook
if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
        // Modern
        $wgHooks['ParserFirstCallInit'][] = 'wfInputBox';
} else {
        // Legacy
        $wgExtensionFunctions[] = 'wfInputBox';
}

function wfInputBox ()
{
  new InputBox;
  return true;
}

2.In Inputbox.classes.php get rid of the __construct function and replace it with:

        function InputBox() {
                global $wgParser;

                $wgParser->setHook( 'inputbox' , array( &$this, 'render' ) );
        }

        public function render( $input, $args, $parser ) {              
                $this->mParser = $parser;              

                // Configure InputBox
                $this->extractOptions( $parser->replaceVariables( $input ) );

                // Return output
                return $this->render();
        }

and you're done! — Preceding unsigned comment added by Thempel (talkcontribs) 16:49, 6 November 2008

You need to be more specific is the construct function the following:
        public function __construct( $parser ) {
                $this->mParser = $parser;
        }
 
        public function render() {
                // Internationalization
                wfLoadExtensionMessages( 'InputBox' );
 
                // Handle various types
                switch( $this->mType ) {
                        case 'create':
                        case 'comment':
                                return $this->getCreateForm();
                        case 'commenttitle':
                                return $this->getCommentForm();
                        case 'search':
                                return $this->getSearchForm();
                        case 'search2':
                                return $this->getSearchForm2();
                        default:
                                return Xml::tags( 'div', null,
                                        Xml::element( 'strong',
                                                array(
                                                        'class' => 'error'
                                                ),
                                                strlen( $this->mType ) > 0
                                                ? wfMsgForContent( 'inputbox-error-bad-type', $this->mType ) 
                                                : wfMsgForContent( 'inputbox-error-no-type' ) 
                                        )
                                );
                }
        }
I get another error message:
Fatal error: Call to a member function replaceVariables() on a non-object in /home/(mywikiname)/public_html/wiki/extensions/InputBox/InputBox.classes.php on line 45
Line 45 is:
// Configure InputBox
Again, I am using mediawiki 1.7.1. Odessaukrain 02:55, 31 December 2008 (UTC)Reply

In subpages

Hello,
I'm a french wikibookian... I would like to know if it can be possible to search in the subpages. Thanks ! --79.87.132.217 12:26, 20 November 2008 (UTC)Reply

The link to the current code in the Align section of this page is broken. — Preceding unsigned comment added by 76.191.159.88 (talkcontribs) 01:00, 13 December 2008

I changed Inputbox.classes.php to put this feature back in. I think the other align code was lost in the move.
Sorry I didn't do this via svn, but I don't have enough time to set svn up right now.Wezelboy 18:23, 19 December 2008
<?php
/**
 * Classes for InputBox extension
 *
 * @file
 * @ingroup Extensions
 */

// InputBox class
class InputBox {

        /* Fields */

        private $mParser;
        private $mType = '';
        private $mWidth = 50;
        private $mPreload = '';
        private $mEditIntro = '';
        private $mPage = '';
        private $mBR = 'yes';
        private $mDefaultText = '';
        private $mBGColor = 'transparent';
        private $mButtonLabel = '';
        private $mSearchButtonLabel = '';
        private $mFullTextButton = '';
        private $mLabelText = '';
        private $mHidden = '';
        private $mNamespaces = '';
        private $mID = '';
        private $mInline = false;
        private $mAlignment = 'center';

        /* Functions */

        public function __construct( $parser ) {
                $this->mParser = $parser;
        }

        public function render() {
                // Internationalization
                wfLoadExtensionMessages( 'InputBox' );

                // Handle various types
                switch( $this->mType ) {
                        case 'create':
                        case 'comment':
                                return $this->getCreateForm();
                        case 'commenttitle':
                                return $this->getCommentForm();
                        case 'search':
                                return $this->getSearchForm();
                        case 'search2':
                                return $this->getSearchForm2();
                        default:
                                return Xml::tags( 'div', null,
                                        Xml::element( 'strong',
                                                array(
                                                        'class' => 'error'
                                                ),
                                                strlen( $this->mType ) > 0
                                                ? wfMsgForContent( 'inputbox-error-bad-type', $this->mType ) 
                                                : wfMsgForContent( 'inputbox-error-no-type' ) 
                                        )
                                );
                }
        }

        /**
         * Generate search form
         */
        public function getSearchForm() {
                global $wgContLang;

                // Use button label fallbacks
                if ( !$this->mButtonLabel ) {
                        $this->mButtonLabel = wfMsgHtml( 'tryexact' );
                }
                if ( !$this->mSearchButtonLabel ) {
                        $this->mSearchButtonLabel = wfMsgHtml( 'searchfulltext' );
                }

                // Build HTML
                $htmlOut = Xml::openElement( 'div',
                        array(
                                'align' => $this->mAlignment,
                                'style' => 'background-color:' . $this->mBGColor
                        )
                );
                $htmlOut .= Xml::openElement( 'form',
                        array(
                                'name' => 'searchbox',
                                'id' => 'searchbox',
                                'class' => 'searchbox',
                                'action' => SpecialPage::getTitleFor( 'Search' )->escapeLocalUrl(),
                        )
                );
                $htmlOut .= Xml::element( 'input',
                        array(
                                'class' => 'searchboxInput',
                                'name' => 'search',
                                'type' => $this->mHidden ? 'hidden' : 'text',
                                'value' => $this->mDefaultText,
                                'size' => $this->mWidth,
                        )
                );
                $htmlOut .= $this->mBR;

                // Determine namespace checkboxes
                $namespaces = $wgContLang->getNamespaces();
                $namespacesArray = explode( ',', $this->mNamespaces );
                if ( $this->mNamespaces ) {
                        foreach ( $namespacesArray as $userNamespace ) {
                                $checked = array();
                                // Namespace needs to be checked if flagged with "**" or if it's the only one
                                if ( strstr( $userNamespace, '**' ) || count( $namespacesArray ) == 1 ) {
                                        $userNamespace = str_replace( '**', '', $userNamespace );
                                        $checked = array( 'checked' => 'checked' );
                                }

                                // Namespace checkboxes
                                foreach ( $namespaces as $i => $name ) {
                                        if ( $i < 0 ) {
                                                continue;
                                        } elseif ( $i == 0 ) {
                                                $name = 'Main';
                                        }
                                        if ( $userNamespace == $name ) {
                                                // Checkbox
                                                $htmlOut .= Xml::element( 'input',
                                                        array(
                                                                'type' => 'checkbox',
                                                                'name' => 'ns' . $i,
                                                                'value' => 1,
                                                                'id' => 'mw-inputbox-ns' . $i
                                                        ) + $checked
                                                );
                                                // Label
                                                $htmlOut .= '&nbsp;' . Xml::label( $userNamespace, 'mw-inputbox-ns' . $i );
                                        }
                                }
                        }

                        // Line break
                        $htmlOut .= $this->mBR;
                } else {
                        // Go button
                        $htmlOut .= Xml::element( 'input',
                                array(
                                        'type' => 'submit',
                                        'name' => 'go',
                                        'class' => 'searchboxGoButton',
                                        'value' => $this->mButtonLabel
                                )
                        );
                        $htmlOut .= '&nbsp;';
                }

                // Search button
                $htmlOut .= Xml::element( 'input',
                        array(
                                'type' => 'submit',
                                'name' => 'fulltext',
                                'class' => 'searchboxSearchButton',
                                'value' => $this->mSearchButtonLabel
                        )
                );
                $htmlOut .= Xml::closeElement( 'form' );
                $htmlOut .= Xml::closeElement( 'div' );

                // Return HTML
                return $htmlOut;
        }

        /*
         * Generate search form version 2
         */
        public function getSearchForm2() {

                // Use button label fallbacks
                if ( !$this->mButtonLabel ) {
                        $this->mButtonLabel = wfMsgHtml( 'tryexact' );
                }

                $id = Sanitizer::escapeId( $this->mID );
                $htmlLabel = '';
                if ( isset( $this->mLabelText ) && strlen( trim( $this->mLabelText ) ) ) {
                        $this->mLabelText = $this->mParser->recursiveTagParse( $this->mLabelText );
                        $htmlLabel = Xml::openElement( 'label', array( 'for' => 'bodySearchInput' . $id ) );
                        $htmlLabel .= $this->mLabelText;
                        $htmlLabel .= Xml::closeElement( 'label' );
                }
                $htmlOut = Xml::openElement( 'form',
                        array(
                                'name' => 'bodySearch' . $id,
                                'id' => 'bodySearch' . $id,
                                'class' => 'bodySearch',
                                'action' => SpecialPage::getTitleFor( 'Search' )->escapeLocalUrl(),
                                'style' => $this->mInline ? 'display: inline;' : ''
                        )
                );
                $htmlOut .= Xml::openElement( 'div',
                        array(
                                'class' => 'bodySearchWrap',
                                'style' => 'background-color:' . $this->mBGColor . ';' .
                                        $this->mInline ? 'display: inline;' : ''
                        )
                );
                $htmlOut .= $htmlLabel;
                $htmlOut .= Xml::element( 'input',
                        array(
                                'type' => $this->mHidden ? 'hidden' : 'text',
                                'name' => 'search',
                                'size' => $this->mWidth,
                                'id' => 'bodySearchInput' . $id
                        )
                );
                $htmlOut .= Xml::element( 'input',
                        array(
                                'type' => 'submit',
                                'name' => 'go',
                                'value' => $this->mButtonLabel,
                                'class' => 'bodySearchBtnGo' . $id
                        )
                );

                // Better testing needed here!
                if ( !empty( $this->mFullTextButton ) ) {
                        $htmlOut .= Xml::element( 'input',
                                array(
                                        'type' => 'submit',
                                        'name' => 'fulltext',
                                        'class' => 'bodySearchBtnSearch',
                                        'value' => $this->mSearchButtonLabel
                                )
                        );
                }

                $htmlOut .= Xml::closeElement( 'div' );
                $htmlOut .= Xml::closeElement( 'form' );

                // Return HTML
                return $htmlOut;
        }

        /**
         * Generate create page form
         */
        public function getCreateForm() {
                global $wgScript;

                if ( $this->mType == "comment" ) {
                        if ( !$this->mButtonLabel ) {
                                $this->mButtonLabel = wfMsgHtml( "postcomment" );
                        }
                } else {
                        $comment = '';
                        if ( !$this->mButtonLabel ) {
                                $this->mButtonLabel = wfMsgHtml( 'createarticle' );
                        }
                }

                $htmlOut = Xml::openElement( 'div',
                        array(
                                'align' => $this->mAlignment,
                                'style' => 'background-color:' . $this->mBGColor
                        )
                );
                $htmlOut .= Xml::openElement( 'form',
                        array(
                                'name' => 'createbox',
                                'id' => 'createbox',
                                'class' => 'createbox',
                                'action' => $wgScript,
                                'method' => 'get'
                        )
                );
                $htmlOut .= Xml::openElement( 'input',
                        array(
                                'type' => 'hidden',
                                'name' => 'action',
                                'value' => 'edit',
                        )
                );
                $htmlOut .= Xml::openElement( 'input',
                        array(
                                'type' => 'hidden',
                                'name' => 'preload',
                                'value' => $this->mPreload,
                        )
                );
                $htmlOut .= Xml::openElement( 'input',
                        array(
                                'type' => 'hidden',
                                'name' => 'editintro',
                                'value' => $this->mEditIntro,
                        )
                );
                if ( $this->mType == 'comment' ) {
                        $htmlOut .= Xml::openElement( 'input',
                                array(
                                        'type' => 'hidden',
                                        'name' => 'section',
                                        'value' => 'new',
                                )
                        );
                }
                $htmlOut .= Xml::openElement( 'input',
                        array(
                                'type' => $this->mHidden ? 'hidden' : 'text',
                                'name' => 'title',
                                'class' => 'createboxInput',
                                'value' => $this->mDefaultText,
                                'size' => $this->mWidth
                        )
                );
                $htmlOut .= $this->mBR;
                $htmlOut .= Xml::openElement( 'input',
                        array(
                                'type' => 'submit',
                                'name' => 'create',
                                'class' => 'createboxButton',
                                'value' => $this->mButtonLabel
                        )
                );
                $htmlOut .= Xml::closeElement( 'form' );
                $htmlOut .= Xml::closeElement( 'div' );

                // Return HTML
                return $htmlOut;
        }

        /**
         * Generate new section form
         */
        public function getCommentForm() {
                global $wgScript;

                if ( !$this->mButtonLabel ) {
                                $this->mButtonLabel = wfMsgHtml( "postcomment" );
                }

                $htmlOut = Xml::openElement( 'div',
                        array(
                                'align' => $this->mAlignment,
                                'style' => 'background-color:' . $this->mBGColor
                        )
                );
                $htmlOut .= Xml::openElement( 'form',
                        array(
                                'name' => 'commentbox',
                                'id' => 'commentbox',
                                'class' => 'commentbox',
                                'action' => $wgScript,
                                'method' => 'get'
                        )
                );
                $htmlOut .= Xml::openElement( 'input',
                        array(
                                'type' => 'hidden',
                                'name' => 'action',
                                'value' => 'edit',
                        )
                );
                $htmlOut .= Xml::openElement( 'input',
                        array(
                                'type' => 'hidden',
                                'name' => 'preload',
                                'value' => $this->mPreload,
                        )
                );
                $htmlOut .= Xml::openElement( 'input',
                        array(
                                'type' => 'hidden',
                                'name' => 'editintro',
                                'value' => $this->mEditIntro,
                        )
                );
                $htmlOut .= Xml::openElement( 'input',
                        array(
                                'type' => $this->mHidden ? 'hidden' : 'text',
                                'name' => 'preloadtitle',
                                'class' => 'commentboxInput',
                                'value' => $this->mDefaultText,
                                'size' => $this->mWidth
                        )
                );
                $htmlOut .= Xml::openElement( 'input',
                        array(
                                'type' => 'hidden',
                                'name' => 'section',
                                'value' => 'new',
                        )
                );
                $htmlOut .= Xml::openElement( 'input',
                        array(
                                'type' => 'hidden',
                                'name' => 'title',
                                'value' => $this->mPage
                        )
                );
                $htmlOut .= $this->mBR;
                $htmlOut .= Xml::openElement( 'input',
                        array(
                                'type' => 'submit',
                                'name' => 'create',
                                'class' => 'commentboxButton',
                                'value' => $this->mButtonLabel
                        )
                );
                $htmlOut .= Xml::closeElement( 'form' );
                $htmlOut .= Xml::closeElement( 'div' );

                // Return HTML
                return $htmlOut;
        }

        /**
         * Extract options from a blob of text
         *
         * @param string $text Tag contents
         */
        public function extractOptions( $text ) {
                wfProfileIn( __METHOD__ );

                // Parse all possible options
                $values = array();
                foreach ( explode( "\n", $text ) as $line ) {
                        if ( strpos( $line, '=' ) === false )
                                continue;
                        list( $name, $value ) = explode( '=', $line, 2 );
                        $values[ strtolower( trim( $name ) ) ] = trim( $value );
                }

                // Build list of options, with local member names
                $options = array(
                        'type' => 'mType',
                        'width' => 'mWidth',
                        'preload' => 'mPreload',
                        'page' => 'mPage',
                        'editintro' => 'mEditIntro',
                        'break' => 'mBR',
                        'default' => 'mDefaultText',
                        'bgcolor' => 'mBGColor',
                        'buttonlabel' => 'mButtonLabel',
                        'searchbuttonlabel' => 'mSearchButtonLabel',
                        'fulltextbutton' => 'mFullTextButton',
                        'namespaces' => 'mNamespaces',
                        'labeltext' => 'mLabelText',
                        'hidden' => 'mHidden',
                        'id' => 'mID',
                        'inline' => 'mInline',
                        'align' => 'mAlignment',
                );
                foreach ( $options as $name => $var ) {
                        if ( isset( $values[$name] ) ) {
                                $this->$var = $values[$name];
                        }
                }

                // Insert a line break if configured to do so
                $this->mBR = ( strtolower( $this->mBR ) == "no" ) ? '' : '<br />';

                // Validate the width; make sure it's a valid, positive integer
                $this->mWidth = intval( $this->mWidth <= 0 ? 50 : $this->mWidth );

                wfProfileOut( __METHOD__ );
        }

}

Latest Extension of InputBox doesn't work with MediaWiki 1.13.3

I've added this to my Wiki as per the install instructions and using:

<inputbox>
type=search
width=42
buttonlabel=Go
searchbuttonlabel=Search
break=no
</inputbox>


I get :

Fatal error: Call to undefined method Inputbox::extractOptions() 
in /home/mywiki/public_html/extensions/InputBox/InputBox.hooks.php on line 31

Well all 4 files are in there and I added the line in my LocalSettings.


I also see it's not available via the Snapshot link.

Does the author still support this extension?


--Stuart Halliday 16:57, 21 February 2009 (UTC)Reply


I cannot download this extension. The link does not work. -- 213.39.139.251 23:09, 24 February 2009 (UTC)Reply

Serious Bug

There is a serious bug with this extension! Whenever I use it, a bunch text fills the page. What is wrong?

68.157.59.222 02:28, 9 March 2009 (UTC)Reply

Localize namespace names

Is it possible to localize the names in the checkboxes? 143.107.45.13 20:24, 27 June 2009 (UTC)Reply

how to interwiki search ?

I want to add inputbox on mr language wikipedia page but purpose is to search is only to search Template Namespace of en wikipedia. is that possible & if yes how ?

Mahitgar 07:25, 27 July 2009 (UTC)Reply

Can Inputbox hide preloaded text?

I would like to see inputbox be able to preload any text without actually displaying it to the user.This way the article created will use the preloaded text and users can't delete the preloaded text accidentally prior to article creation.--Iloveemeryville 21:07, 2 August 2009 (UTC)Reply

I agree! We have a need for this enhancement as well. 66.37.129.226 22:46, 30 October 2009 (UTC)Reply

Request for a new parameter

It would be very helpful to have a parameter in InputBox that appends text to the beginning of the string that is submitted. Therefore, if an inputbox is intended to create pages within a main page, only the extension would need to be typed in the field.

This may not be clear, so as an example: If we wished to create an inputbox on the Extension:InputBox page that would allow users to create the page Extension:InputBox/newpage, a parameter could be added so that the user would just have to type newpage in the entry field instead of Extension:InputBox/newpage.

Any thoughts on this proposed parameter? --Zach425 23:41, 29 August 2009 (UTC)Reply
This seems to be really difficult to do with media wiki at the moment. Please add support for this parameter! UserUserSwidnikk

Note: This is a suggestion that has at least one specific application, at Wikipedia's Abuse Reports page. Were the parameter instituted, I'm sure it would be used here and on many other pages. --Zach425 05:16, 7 September 2009 (UTC)Reply

Adding A New Text At The Top Of A Page

The InputBox type=comment enables to add a new section at the bottom of an existing page. I'm searching for a possibility for adding the new text automatically at the top of the page.

Has anyone a good idea to do this in an elegant way? --Bluejack 20:42, 30 August 2009 (UTC)Reply

I'd like add a new subsection at the top of existing section. Malarz pl 21:17, 29 September 2009 (UTC)Reply

I would like to do the same! 91.50.240.138 08:42, 15 October 2010 (UTC)Reply

Adding a comment to a section of a page

I have a similar query to the one above - but in my case I am looking to add my comment to a particular section of an existing page rather than at the very bottom of the page as is the default using type=comment. Any thoughts? --204.40.1.129 17:53, 3 September 2009 (UTC)Reply

I have the same concern. Currently, the only way I could do this to make a separate page for the section and transclude it, but it would be nice to not have to do that if possible.--173.18.51.13 17:51, 3 March 2010 (UTC)Reply

Preload issue - Extension conflict

I'm running MW 1.15 but the preload-function isn't working. The problem is that I can't preload on a page that doesn't already exist. It works fine when doing comments on existing pages in a new section.

Any thoughts on how to deal with this?

Solved it. Turns out my problem was that I had defined a template for my main-namespace to be included on all new pages. This was done using an extension called NewArticleTemplate that overrides a preload. Incidentally, my template for the main-NS was empty.
I hope no one wasted any time on this. And now we know that the two extensions in question can conflict.
--Martin, 23:47, 6 September 2009 (UTC)

type=search2

The parameter type=search2 isn't listed on the extension's page, but it does have a function. However, when search2 is used, I don't think any other parameter can be altered. Maybe this is something that could be worked on. Killiondude 07:57, 24 November 2009 (UTC)Reply

Type "create" generates invalid HTML code

If the type is set to create the output HTML Code would be invalid. The closing tags of <input> elements are missing.

I checked the source code and think i have found the mistake. I located the bug in the getCreateForm methode of the file InputBox.classes.php. I changed every "Xml::openElement" methode, between the lines 299 to 360, to "Xml::element" and it works.

Is it possible to fix this bug in the trunk? I could also send my code by mail. --Aebi 14:45, 25 November 2009 (UTC)Reply

Suffix=

The research by "suffix=" is now needed: for example to find something in a multilingual wikt:Wiktionary:Wikisaurus, which has just begun at least on wikt:fr:Catégorie:Thésaurus with the languages suffixes into parenthesis (and maybe after a slash later). JackPotte 23:02, 27 November 2009 (UTC)Reply

Example:

<inputbox>
namespaces=Wikisaurus
suffix=English
</inputbox>

JackPotte 23:11, 27 November 2009 (UTC)Reply

Actually "prefix=" works with the pages names suffixes, but we can maybe search simultaneously in some preformated suffixes articles (eg: the languages codes) like for "namespaces=". JackPotte 00:32, 1 December 2009 (UTC)Reply

Let's add a multi-prefix options too. JackPotte 19:21, 16 May 2010 (UTC)Reply

Sorting by date

For n:wikinews, we need a search engine which sorts the most recent articles at the top. JackPotte 19:13, 16 December 2009 (UTC)Reply

help request jan 2010 One


I've added "bgcolor=transparent" above and in mr.w but unfortunately it doesn't work: it seems to be a useless field. JackPotte 11:20, 2 January 2010 (UTC)Reply

Requested Feature: make "prefix" parameter operable with "create" type box

It would be great if a prefix for the text that gets entered by the box user could be set by the "prefix" parameter (or some other parameter) in the code for the design of a "create" type box. That way, the box designer could ensure that an article gets created in a proper namespace or as an approriate subpage. For example, the code below could prompt a user to type the word "Mickey Mouse" in the input box to create an article named "Disney characters/Mickey Mouse":

<inputbox>
type=create
buttonlabel=Add a new character
prefix=Disney characters/
</inputbox>

Or the code below could prompt a user to type the word "Sample Text" in the input box to create a template named "Template:Sample Text":

<inputbox>
type=create
buttonlabel=Create a new template
prefix=Template:
</inputbox>

I recognize that it is currently possible for the box designer to use the "default" parameter to prompt a user to enter his/her text following the default prefix text. However, there are disadvantages to this method:

  • the default prefix text can be confusing to some users in some situations,
  • the default prefix text method requires the box designer to include instructions if the expected input is not intuitive,
  • the default prefix text can easily be overwritten instead of appended,
  • if the user accidentally alters or deletes the default text, the page needs to be refreshed to get it back (that is, if the user realizes the text was changed AND knows to refresh),
  • long default prefix text strings require extremely wide boxes in order to view the insertion point.

Thanks for this extension.

--PerkinsTaylor 19:45, 22 January 2010 (UTC)] --User:Swidnikk I'd also like to see this featureReply

If this were implemented, it would simplify the process of creating userspace drafts. --Trevj 14:59, 18 February 2011 (UTC)Reply
Oh, is this already implemented? --Trevj 15:04, 18 February 2011 (UTC)Reply
Apparently so. It's now included in the parameters table. User:Happy-melon, thanks for the code revision.--Trevj 22:00, 18 February 2011 (UTC)Reply
I think the prefix option does not work :-( (Great Extension!)--Houyadda 23:06, 14 October 2011 (UTC)Reply

How to specify which website you want to search?

How do you make it so that it search's on a specified website? 64.222.253.63 20:49, 8 March 2010 (UTC)Reply

MediaWiki:Noexactmatch? JackPotte 00:02, 10 March 2010 (UTC)Reply

ExtensionDistributor not working for this extension

I've tried several times, but it just takes me round in circles - so I'll get it from Subversion.

Does this work with Extension:EzMwLucene.

I've looked at the Lucene:search extension and it recommends EzMwLucene for small sites. Has anyone tried it with that, please?

Andthepharaohs 12:31, 26 April 2010 (UTC)Reply

Basic features should work, but more advanced one (like prefix queries) work only with Extension:lucene-search. --Rainman 12:53, 26 April 2010 (UTC)Reply

set default preloadtitle

Is it possible to set a default &preloadtitle ? Xeno 15:46, 6 May 2010 (UTC)Reply

Like that?

JackPotte 17:34, 6 May 2010 (UTC)Reply

Kindof-thanks. I figured it out with help from en:User:MSGJ (I needed to use commenttitle rather than comment). –xeno (talk) 19:07, 6 May 2010 (UTC)Reply

namespaces= customizations

Do we have to open a bugzilla ticket to add the function "namespaces=" + them in color or hidden? JackPotte 17:52, 2 June 2010 (UTC)Reply

type=comment - can it use L3, L4, L5, etc. headers instead ?

This would be nice for en:WP:PERM. –xeno (talk) 17:33, 15 June 2010 (UTC)Reply

mediawiki 1.16.0

Inputbox doesn't work under mediawiki 1.16.0. Does the author continue to support this extension? Inputbox is really useful, I think.

However Wikipedia is 1.16 and it works. JackPotte 18:32, 17 August 2010 (UTC)Reply
no, it doesnt work.. got mediawiki 1.16 and i get a uniq qinu error.. Flipp0 9:22, 28 Sept 2010

How to use to create a custom User subpage

How could this be used to create a user subpage? For example, for me it should create User:Alecmconroy/pagename, but it should vary based on user's username. Alecmconroy 07:48, 18 August 2010 (UTC)Reply

Like that?

JackPotte 18:12, 18 August 2010 (UTC)Reply
User:Swidnikk I'd also like to see this functionality as a few other users have mentioned above

Add text to a page

What I want to do is have a user write their name in the textbox and click the button to add their name to the page. The same ideas as them editing the page and writing 'Daviddoria 16:50, 2 September 2010 (UTC)', but without making them go through that process (needs to be VERY quick and easy).Reply

Here is my page: http://www.vtk.org/Wiki/VTK/Sandbox/InputBox

I've manually added a name to the page - this is what I would like to happen when the button is clicked.

Any suggestions?

Thanks,

Daviddoria 16:50, 2 September 2010 (UTC)Reply

I'm sure that your request is not for the "inputbox" but the JavaScript: actually I'm also trying to install a similar thing from this existing script (you can test it, for example by in this paragraph). JackPotte 20:32, 2 September 2010 (UTC)Reply
I'm not sure what I'm supposed to type in those two boxes (I tried "test" and "(fr)testB" but I keep getting "Please use a language code. (fr, es, aaa)"). But if it adds the pair to the list, yes, that is exactly what I want. I don't see on that page how you added the input box? You can set it to point to a java script that you can put on the wiki (i.e. if I don't have access to the "backend" of the MediaWiki install, I can still play with this?) Thanks for your help so far! Daviddoria 11:56, 3 September 2010 (UTC)Reply

Google?

Is there a way to configure an input box to use Google instead? For instance, I'd like to search all talk pages related to a particular WikiProject. For instance, site:http://en.wikipedia.org/wiki/Wikipedia_talk:WikiProject_Video_games SharkD 00:37, 10 September 2010 (UTC)Reply

Please see w:MediaWiki:Gadget-externalsearch.js. JackPotte 09:05, 10 September 2010 (UTC)Reply
I still don't get the process. Do you have to save the java code as an actual .js file on the server? Or can you host it directly on a wiki page? Can the .js file be on an external server? How you do point the input box to it? Daviddoria 12:06, 10 September 2010 (UTC)Reply
Sorry, there are at least 6 solutions to install it on another wiki:
Copy/paste the content into your Mediawiki:Common.js add into this page: importScriptURI('http://en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-externalsearch.js&action=raw&ctype=text/javascript');
Copy/paste the content into your special:mypage/monobook.js (or vector according to what is selected in the appearance preferences) add into this page: importScriptURI('http://en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-externalsearch.js&action=raw&ctype=text/javascript');
Copy/paste the content into your Mediawiki:Gadget-externalsearch.js (the extension is needed) add into this page: importScriptURI('http://en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-externalsearch.js&action=raw&ctype=text/javascript');
Ok, so it looks like they have "locked" that page on my wiki: http://www.vtk.org/Wiki/MediaWiki:Common.js (there is no "edit" link at the top). Once I get them to add MediaWiki:Gadget-externalsearch.js to that page, I want to demo it here: http://www.vtk.org/Wiki/VTK/Sandbox/Search - how do I tell the input box to use the new external search instead of the "normal" search?
Actually this gadget won't change your input box but this kind of search engines, which appear during each search (when clicking on the "Search" button and not "Go"). JackPotte 16:25, 10 September 2010 (UTC)Reply
Ok, try not to get annoyed, but I'm still lost :) - It looks like the input box has a search option by default.
  • Is there a way to specify "only search in Wiki/Something and below" (that is, restrict the search rather than searching the whole wiki).
  • Is there a way to hide the "try exact match" button?
  • What does all the java script stuff buy you? Is using a google search to search the wiki better than using this built in search of the input box extension? Daviddoria 22:12, 10 September 2010 (UTC)Reply
Yes, yes, no: please tell us which option in the recto you want to add, and the Google search is to my mind less precise that the wiki advanced search with its buttons to tick. JackPotte 21:44, 10 September 2010 (UTC)Reply
1) I found the "prefix" option, but it doesn't seem to work : http://www.vtk.org/Wiki/VTK/Sandbox/Search - search for "vtkPolyData" - you'll see there are lots of results that are not subpages of VTK/Examples/Cxx (the value I set 'prefix' to).
It's normal: actually it suggests some intuitive near answers under an error message, which isn't defined on your site.
Then what is the point of the prefix if it doesn't search only in the prefix??
Yes but like Google it used to suggest some other results if rare. On the contrary the namespace search don't do it.
2) In the "namespaces" section of the extension main page, the "type=search" input box with a namespace defined does not have the "Try exact match" button, but the "type=search" input box right below it (the example of 'prefix') does NOT have the "Try exact match" button, but I don't see what specified that behavior!? Daviddoria 22:12, 10 September 2010 (UTC)Reply
A link would be more helpful please. JackPotte 23:03, 10 September 2010 (UTC)Reply
I was simply referring to the last two rows of this table Extension:InputBox#Parameters
This button is probably absent because of the reason above.
PS: any new namespace should be created by editing a .php. JackPotte 09:50, 11 September 2010 (UTC)Reply

194.176.105.41 09:55, 17 September 2010 (UTC)Reply

non-object?

Hai, when i use the "inputbox type=create /inputbox" the wiki gives me this:
Fatal error: Call to a member function replaceVariables() on a non-object in (Root)\mediawiki\extensions\Inputbox\InputBox.hooks.php on line 29
this is line 29:
$inputBox->extractOptions( $parser->replaceVariables( $input ) );
i got mediawiki 1.16.0, PHP 5.3.1 and MySQL 5.1.41
any ideas?

Thanks,
Flipp0 14-10-2010 @ 14:54

Apparently, you need to use Extension:CreateBox for that now. 84.194.235.204 12:47, 29 January 2011 (UTC)Reply

Noninclude confusion

I just updated a wiki with the current version Bugfix to support noinclude tag. However, I am now faced with a problem that I need noinclude ignored sometimes, and implemented at other times. Inputbox should offer an option to allow the user to decide when to use noinclude and when to ignore noinclude. 12.235.121.75 17:25, 11 November 2010 (UTC)Reply

I found a cheat that allows the user to include a noinclude tag within the preload page that they want transfered over to the destination article. Nest a noinclude tag within the noinclude tag with an extra space that breaks up the first tag until it is entered into the destination article: <<noinclude> </noinclude>noinclude>. This tricks mediawiki into copying over a noinclude tag from the preload article. (This solution requests that Bugfix at bugfix files is installed.)12.235.121.75 16:44, 12 November 2010 (UTC) (fcsuper no wikipedia)Reply


Hide namespace check box

Hi, is there a way to hide the check boxes displayed on the front of the search when searching predefined namespaces? Thank you 67.169.112.215 01:37, 19 November 2010 (UTC)Reply

Inputbox height

Does anyone know how to change the height of inputbox?I only know how to change the width.Thank you very much.

Please add an "align" parameter

Supporting something like: align=left would be wonderful!

<inputbox>
type=fulltext
width=40
align=left
break=no
</inputbox>

Set the width of the inputbox in pixel

Sorry for my bad english.--LikeLifer 19:18, 11 August 2011 (UTC)Reply

Strange syntax

<inputbox>
type=search
width=42
break=no
</inputbox>

Is there a good reason why the syntax of this extension was made to resemble HTML as closely as possible whilst not actually being valid HTML?

Wouldn't

<inputbox type="search" width="42" />

have been more intuitive, more standard, and better in just about every other respect? Gurch 13:58, 19 September 2011 (UTC)Reply

Go button only

It is possible to have search and go.. or search without go. How about go without search? I thought maybe putting nothing in searchbuttonlabel would do it but that didn't work. i also tried type=search2. type=create works in that it sends you to the correct page and just shows 1 button BUT you end up in the edit page. Is it possible?

<span style="font-size:10pt;">Browse the Indices: </span>
<inputbox>
type=search
buttonlabel=Go
searchbuttonlabel=
hidden=yes
default=Site:Indices
</inputbox>

--Kay 17:05, 18 October 2011 (UTC)Reply

InputBox/Align Wrap Text

Added the code to Align the Input box but I was wondering if there is a way to wrap text when you right or left align. Similar to when you right align an image. Would also like for there to be a way to center the Go and Search button under the search box even though I'm using right and left align. Maybe this is asking to much? --75.85.127.249 06:43, 25 October 2011 (UTC)Reply