Changeset 261
- Timestamp:
- 07/04/08 20:32:54 (5 months ago)
- Files:
-
- trunk/Phergie/Plugin/Convert.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Phergie/Plugin/Convert.php
r248 r261 53 53 $xpath = new DomXPath($doc); 54 54 $result = $xpath->query('//h2/font/b'); 55 $text = $result->item(0)->nodeValue; 56 57 if (empty($text)) { 58 $this->doNotice($target, 'Computation error, nothing was returned, perhaps division by zero?'); 55 if ($result->length) { 56 $children = $result->item(0)->childNodes; 57 $text = str_replace(array(chr(195), chr(151)), array('x', ''), $children->item(0)->nodeValue); 58 $text .= '^' . $children->item(1)->nodeValue . $children->item(2)->nodeValue; 59 $this->doPrivmsg($this->event->getSource(), $target . ': ' . $text); 59 60 } else { 60 $this->do Privmsg($this->event->getSource(), $target . ': ' . $text);61 $this->doNotice($target, 'Computation error, nothing was returned'); 61 62 } 62 63 }