Extension talk:Chklist

About this board

Are other icons possible?

3
Fustbariclation (talkcontribs)

Is it possible to substitute another icon for [] and [x]?

I'd like to be able to have, for example, a tick and a cross, or a green button or a red one.

Kosibar (talkcontribs)

For my own personal use I've substituted the "create_list()" function with the following code to provide my own graphical checkboxes:

function create_list($input) {
    $i = 1;
    $temp = explode('[', $input);
    $str = "";
    while ($temp[$i] != NULL) {
        $content = explode(']', $temp[$i++]);
        switch(strtolower(substr($content[0], 0, 1))) {
            case "x": $check_type = "Checked"; break;
            case "-": $check_type = "Mixed"; break;
            default: $check_type = "Empty";
        }
        $str .= '<div class="chklist"><img src="'.$GLOBALS["wgScriptPath"].'/images/Checkbox-'.$check_type.'.png">'.$content[1].'</div>';
    }
    return $str;
}

Then I have three images in my "images" directory:

  • Checkbox-Checked.png
  • Checkbox-Empty.png
  • Checkbox-Mixed.png

A "mixed" checkbox is a box with a dash in it.

Fustbariclation (talkcontribs)

Thank you - that looks ideal - how do you call the function from the wiki?

Reply to "Are other icons possible?"

Can you save the result?

1
Fustbariclation (talkcontribs)

This is a nice easy extension. It works.

What I'd like to be able to do is set a property based on whether the box is ticked or not. For example:

<chklist> [x] a checked element one [] an unchecked element [] and another </chklist>

Can I get anything that tells me the status - 100 (for ticked, not ticked, not ticked) would be enough. Even better would be:

<chklist> answer_1=[x] a checked element one answer_2=[] an unchecked element answer_3=[] and another </chklist>

Then I could get a ask:

{{#ask: [category:whatever_it_is] [answer::true] |? Page Name }}

Which would tell me which pages had that as an answer.

Any chance?

Reply to "Can you save the result?"

Fatal exception of type MWException - different

3
94.36.239.32 (talkcontribs)

Hello,

I have 1.22.2, Mysql 5.1.66, php 5.2

Basically, I tried to install this extension http://www.mediawiki.org/wiki/Extension:Chklist

I'm sure I did it right (uploading, editing the settings) as I have several others. Unfortunately unless I remove it from the local settings it shows me

[letters and numbers that are always different] 2014-02-20 02:59:30: Fatal exception of type MWException

is it because it can't work on mediawiki 1.22.2?

Thanks

94.36.239.32 (talkcontribs)

After a some thinking, I tried removing $wgParser->disableCache();

and it did the trick.

86.173.52.65 (talkcontribs)

Hi if you have Mediawiki 1.22 you would have php 5.3. 5.2 is not supported on Mediawiki 1.20 or higher.

Reply to "Fatal exception of type MWException - different"
There are no older topics