*/
if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/');
if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'inc/plugins/');
require_once(DOKU_PLUGIN.'syntax.php');
// require_once('/usr/share/pear/PHP/Compat/Function/file_put_contents.php');
require_once('class.xmlreader.php');
/**
* All DokuWiki plugins to extend the parser/rendering mechanism
* need to inherit from this class
*/
class syntax_plugin_amazon extends DokuWiki_Syntax_Plugin {
function getInfo(){
return array(
'author' => 'Thomas Baumann',
'email' => 'tom@tiri.li',
'date' => '2005-10-31',
'name' => 'Amazon Plugin',
'desc' => 'Search and display Amazon link',
'url' => 'https://www.dokuwiki.org/plugin:amazon_heavy'
);
}
/**
* What kind of syntax are we?
*/
function getType(){
return 'protected';
}
/**
* Where to sort in?
*/
function getSort(){
return 400;
}
/**
* Connect pattern to lexer
*/
function connectTo($mode) {
$this->Lexer->addEntryPattern('
".$item["#"]["ProductName"][0]["#"]."(Autor: ".$item["#"]["Authors"][0]["#"]["Author"][0]["#"].")"; $html .= " "; $html .= "Art.# ".$item["#"]["Asin"][0]["#"]; if ($item["#"]["Isbn"][0]["#"]) $html .= " (ISBN: ".$item["#"]["Isbn"][0]["#"].")"; $html .= " "; if ($item["#"]["BrowseList"][0]["#"]["BrowseNode"][0]["#"]["BrowseName"][0]["#"]) $html .= " ".$item["#"]["BrowseList"][0]["#"]["BrowseNode"][0]["#"]["BrowseName"][0]["#"]." "; if ($item["#"]["Media"][0]["#"]) $html .= " ".$item["#"]["Media"][0]["#"]." "; if ($item["#"]["Reviews"][0]["#"]["CustomerReview"][0]["#"]["Comment"][0]["#"]) $html .= " ".$item["#"]["Reviews"][0]["#"]["CustomerReview"][0]["#"]["Comment"][0]["#"]." "; /* $amazon[]= $item["#"]["Asin"][0]["#"]; $amazon[]= $item["#"]["ProductName"][0]["#"]; $amazon[]= $item["#"]["ImageUrlSmall"][0]["#"]; $amazon[]= $item["#"]["OurPrice"][0]["#"]; $amazon[]= $item["#"]["BrowseList"][0]["#"]["BrowseNode"][0]["#"]["BrowseName"][0]["#"]; $amazon[]= $item["#"]["Isbn"][0]["#"]; $amazon[]= $item["#"]["Media"][0]["#"]; $amazon[]= $item["#"]["Reviews"][0]["#"]["CustomerReview"][0]["#"]["Comment"][0]["#"]; */ $html .= " | \n";
}
$html .= "