$filter_art = trim($filter_art); // wipe out spaces
$filter_art = str_replace(" ", "", $filter_art);
$filter_artArray = explode(",", $filter_art); // array with excluded articles
$filter_cat = trim($filter_cat); // wipe out spaces
$filter_cat = str_replace(" ", "", $filter_cat);
$filter_catArray = explode(",", $filter_cat); // array with excluded categories
$filter_sec = trim($filter_sec); // wipe out spaces
$filter_sec = str_replace(" ", "", $filter_sec);
$filter_secArray = explode(",", $filter_sec); // array with excluded sections
// get Joomla's view variable
$this->_currentView = JRequest :: getVar('view');
if ($this->_currentView == "frontpage") { // case frontpage view
if ($show_front != "1") { // only if frontpage display is enabled
if ($filter_art != "" or $filter_cat != "" or $filter_sec != "") {
if (!in_array($article->catid, $filter_catArray) and !in_array($article->sectionid, $filter_secArray) and !in_array($article->id, $filter_artArray)) { // display plugin in article if its ID or category and section it belongs to are not excluded
$display = true;
}
} else {
$display = true;
}
}
} elseif ($this->_currentView == "section" and $article->sectionid != "") { // case section view
if ($show_sec != "1") { // only if section display is enabled
if ($filter_art != "" or $filter_cat != "" or $filter_sec != "") {
if (!in_array($article->catid, $filter_catArray) and !in_array($article->sectionid, $filter_secArray) and !in_array($article->id, $filter_artArray)) { // display plugin in article if section it belongs to is not excluded
$display = true;
}
} else {
$display = true;
}
}
} elseif ($this->_currentView == "category" and $article->catid != "") { // case category view
if ($show_cat != "1") { // only if category display is enabled
if ($filter_art != "" or $filter_cat != "" or $filter_sec != "") {
if (!in_array($article->catid, $filter_catArray) and !in_array($article->sectionid, $filter_secArray) and !in_array($article->id, $filter_artArray)) { // display plugin in article if category and section it belongs to are not excluded
$display = true;
}
} else {
$display = true;
}
}
} elseif ($this->_currentView == "article") { // case article view
if ($filter_art != "" or $filter_cat != "" or $filter_sec != "") {
if (!in_array($article->catid, $filter_catArray) and !in_array($article->sectionid, $filter_secArray) and !in_array($article->id, $filter_artArray)) { // display plugin in article if its ID or category and section it belongs to are not excluded
$display = true;
}
} else {
$display = true;
}
} else {
$display = false;
}
if ($display) { // display plugin if appropriate
if ($addthis_position == "0") { // position plugin on top of the article
//-----pass localization variables for AddThis captions
if ($this->_text_share_caption != "" or $this->_text_email_caption != "" or $this->_text_email != "" or $this->_text_favorites != "" or $this->_text_more != "") {
$output .= "var addthis_localize = {
share_caption: \"{$this->_text_share_caption}\",
email_caption: \"{$this->_text_email_caption}\",
email: \"{$this->_text_email}\",
favorites: \"{$this->_text_favorites}\",
more: \"{$this->_text_more}\"
};\n";
}
//-----pass global congiguration variables to AddThis script
$output .= "var addthis_config = {";
if ($this->_ui_language != "") { // Default language
$output .= "<a alt=\"Subscribe using any feed reader!\" href=\"http://www.addthis.com/feed.php?pub={$this->_addthis_pub}&h1={$this->_rssfeed_url}&t1=\" ";