User:Nx/Extensions/wigo3/wigo3.php

" .               " " .                "" .                  "{$votes} " .                " " .                "" .                  "$output" .                " " .              " " .            " ";  } else {    //get up-down images    //static improves performance a bit    static $up = null;    static $down = null;    static $reset = null;    static $altup = null;    static $altdown = null;    static $altreset = null;    static $titleup = null;    static $titledown = null;    static $titlereset = null;

if ( is_null($up) || is_null($down) || is_null($reset)         || is_null($altup) || is_null($altdown) || is_null($altreset)          || is_null($titleup) || is_null($titledown) || is_null($titlereset) ) { wfLoadExtensionMessages('wigo3'); $up = wfFindFile(wfMsg('wigouparrow')); $up = $up ? $up->getFullUrl : ''; $down = wfFindFile(wfMsg('wigodownarrow')); $down = $down ? $down->getFullUrl : ''; $reset = wfFindFile(wfMsg('wigoresetvote')); $reset = $reset ? $reset->getFullUrl : ''; $altup = wfMsgHtml('wigoaltup'); $altdown = wfMsgHtml('wigoaltdown'); $altreset = wfMsgHtml('wigoaltreset'); $titleup = wfMsgHtml('wigotitleup'); $titledown = wfMsgHtml('wigotitledown'); $titlereset = wfMsgHtml('wigotitlereset'); }

return " ". " " .               "". "{$votes} ". " " .               "". "$output". " " .             " " .            " ";  } }

function wigo3rendercapture($input, $args, $parser) { $output = $parser->recursiveTagParse($input); $matchi = preg_match_all('/(]*href="([^"]*)"[^>]*>(?:[^<]|<[^\/]|<\/[^a]|<\/a[^>])*<\/a>)(?! )/i', $output,$matches,PREG_OFFSET_CAPTURE); if ($matchi > 0) $newoutput = substr($output,0,$matches[1][0][1]);  for ($i=0; $i<$matchi;++$i) {    $imgname = 'capture_' /*. $args['poll'] . '_'*/ . /*crc32*/ /*md5*/ sha1($matches[2][$i][0]) . '.png';    $text = $matches[1][$i][0];    $img = $parser->recursiveTagParse("img ");    $nextlength = (($i == $matchi-1) ? (strlen($output) - ($matches[1][$i][1] + strlen($text))) : ($matches[1][$i+1][1] - ($matches[1][$i][1] + strlen($text))));    $newoutput .= substr($output,$matches[1][$i][1],strlen($text)) . $img .                   substr($output,$matches[1][$i][1]+strlen($text),$nextlength);  }  if ($matchi > 0) $output = $newoutput;  return $output; }