createOption('CreateTitle', _CLT_TITLE, 'yesno', 'yes'); $this->createOption('Split', _NOTE_SPLT, 'yesno', 'no'); } function getEventList() { $events = array ( 'PreItem', 'PreSkinParse' ); return $events; } function init() { $language = ereg_replace( '[\\|/]', '', getLanguageName()); if (file_exists($this->getDirectory() . $language . '.php')) { include_once($this->getDirectory() . $language . '.php'); }else { include_once($this->getDirectory() . 'english.php'); } } function event_PreSkinParse($data) { $this->skinType = $data['type']; } function event_PreItem($data) { $skinType = $this->skinType; $this->nodeId = 0; $this->noteList = array(); $this->itemId = $data['item']->itemid; $cData = array( &$this, 'footnote' ); $iBody =& $data['item']->body; $iMore =& $data['item']->more; $iBody = preg_replace_callback("/\(\((.*)\)\)/Us", $cData, $iBody); $nsplit = $this->getOption('Split'); if ($nsplit == 'yes' && $skinType != 'item') { if ($footNote = implode('', $this->noteList)) { $iBody .= ''; } $this->noteList = array(); } if ($iMore) { $iMore = preg_replace_callback("/\(\((.*)\)\)/Us", $cData, $iMore); if ($footNote = implode('', $this->noteList)) { $iMore .= ''; } } elseif ($footNote = implode('', $this->noteList)) { $iBody .= ''; } } function footnote($matches){ global $manager; $this->nodeId++; $iid = intval($this->itemId); $bid = getBlogIDFromItemID($iid); $b =& $manager->getBlog($bid); $bsname = $b->getShortName(); if ($this->getOption('CreateTitle') == 'yes') { $fNote = htmlspecialchars(strip_tags($matches[1])); $fNote = preg_replace('/\r\n/s', '', $fNote); $fNote = ' title="' . $fNote . '"'; }else{ $fNote = ''; } $footNoteID = $bsname . $iid . '-' . $this->nodeId; $note = '' . '' . '*' . $this->nodeid . '' . ''; $this->noteList[] = '
  • ' . '' . _NOTE_WORD . $this->nodeId . '' . $matches[1] . '
  • '; return $note; } }