Witam, mam zbyt niechciany problem, dodatkowo nie wiem jak go rozwiązać, otóż gdy wchodzę do Panelu Administratora i piszę przykładowy artykuł + chcę dodać grafikę, to mam błędy (informację iż czegoś brakuje lub zmieniona jest treść)
http://s2.ifotos.pl/img/bladJPG_rrwpawh.JPG
Może ktoś spotkał się z takim problemem i jest w stanie wyjaśnić jak go się optymalnie pozbyć ?
f5 ? może ktoś jednak coś będzie wiedział na ten temat ? jeżeli wyłączę dodatek to błedów nie ma, lecz chciałbym reklamy i chciałbym zostać przy włączonym ! Jeżeli można pozbyć się błędów to jaki plik hltm edytować ? coś zmienić ?
<?php
/**
* @version $Id: plgContentMultiAds.php 1.5
* @copyright Joe Guo
* @license GNU/GPLv2,
* @author Joe Guo - http://www.eboga.org
*/
defined('_JEXEC') or die('Restricted access');
jimport('joomla.plugin.plugin');
jimport('joomla.environment.browser');
class plgContentMultiads extends JPlugin {
function onContentPrepare($context, &$article, &$params, $limitstart) {
if ((JRequest :: getVar('view')) != 'article') {
return true;
}
if ($this->ignore($article->id, $article->catid)) {
return true;
}
if (!$this->showAdsForAuthor($article)) {
return true;
}
if (!$this->showAdsForTemplates()) {
return true;
}
$topAds = $this->param('Content_top_ads');
$align = $this->param('align');
$divStart = "<div style='";
if ($align == 1) {
$divStart.="float:left;text-align:left;";
} else if ($align == 0) {
$divStart.="float:right;text-align:right;";
} else if ($align == 2) {
$divStart.="float:center;text-align:center;";
} else {
//no align
}
$margin = $this->param('margin', '1');
$divStart.=" margin:" . $margin . "px auto;'>";
$divEnd = "</div>";
$adsenseSection = $this->param('adsense_section');
if ($adsenseSection) {
$article->text = "\n<!-- google_ad_section_start -->\n" . $article->text . "\n<!-- google_ad_section_end -->\n";
}
if ($topAds) {
$article->text = $divStart . $topAds . $divEnd . $article->text;
}
$bottomAds = $this->param('Content_bottom_ads');
if ($bottomAds) {
$article->text.='<br/>' . $bottomAds;
}
return true;
}
function showAdsForAuthor(&$article) {
$createdBy = $article->created_by;
$authors = $this->param('Only_Authors');
if (isset($authors) && $authors) {
$authorsArray = explode(',', $authors);
if (!empty($authorsArray) && !in_array($createdBy, $authorsArray, false)) {
return false;
}
}
return true;
}
function showAdsForTemplates() {
$app = & JFactory::getApplication();
$template = $app->getTemplate();
$template = strtolower($template);
$templates = $this->param('Only_templates');
if (!isset($templates) || !trim($templates)) {
return true;
}
$templates = strtolower($templates);
$templatesArray = explode(',', $templates);
if (in_array($template, $templatesArray)) {
return true;
}
return false;
}
function onContentBeforeDisplay($context, &$article, &$params, $limitstart) {
if ($this->ignore($article->id, $article->catid)) {
return '';
}
if (!$this->showAdsForTemplates()) {
return '';
}
$ads = $this->showContent('Before_content_ads', true);
if ($ads) {
if ($this->showAdsForAuthor($article)) {
return $ads;
}
}
return '';
}
public function onContentAfterTitle($context, &$article, &$params, $limitstart)
{
if ($this->ignore($article->id, $article->catid)) {
return '';
}
if (!$this->showAdsForTemplates()) {
return '';
}
$ads = $this->showContent('After_title_ads', true);
if ($ads) {
if ($this->showAdsForAuthor($article)) {
return $ads;
}
}
return '';
}
function onContentAfterDisplay($context, &$article, &$params, $limitstart) {
if ($this->ignore($article->id, $article->catid)) {
return '';
}
if (!$this->showAdsForTemplates()) {
return '';
}
$ads = $this->showContent('After_content_ads', true);
if ($ads) {
if ($this->showAdsForAuthor($article)) {
return $ads;
}
}
return '';
}
function showContent($paramName, $isCount) {
if (!$this->isFrontPage() && !$this->isBlogView()) {
return $this->param($paramName);
} else {
$frontPageCount = JRequest :: getVar('frontPageAdsCount');
if (!isset($frontPageCount)) {
$frontPageCount = 0;
}
if ($isCount) {
$frontPageCount++;
JRequest :: setVar('frontPageAdsCount', $frontPageCount);
}
$adCount = (int) $this->param('Front_page_ads_count');
if ($frontPageCount <= $adCount) {
if ($this->isFrontPage() && $frontPageCount <= 1) {
return $this->param($paramName);
} else {
return $this->param($paramName);
}
}
}
}
function isFrontPage() {
if ((JRequest :: getVar('view')) == 'featured') {
return true;
} else {
return false;
}
}
function isBlogView() {
if ((JRequest :: getVar('layout')) == 'blog') {
return true;
} else {
return false;
}
}
function param($name, $default='') {
return $this->params->get($name,$default);
}
function exclude($paramName, $value) {
$excludeArticlesIds = $this->param($paramName);
$excludeArticlesIdsArray = explode(',', $excludeArticlesIds);
if (empty($excludeArticlesIdsArray)) {
return 0;
}
if (!$value) {
return 0;
}
if (in_array($value, $excludeArticlesIdsArray, false)) {
return 1;
}
return 0;
}
function ignore($id, $catId) {
$onlyGuest = $this->param('ONLY_GUEST');
if ($onlyGuest) {
$user = & JFactory::getUser();
$aid = $user->get('aid', 0);
if ($aid > 0) {
return true;
}
}
$ip = $this->getClientIp();
$ignore = $this->exclude('Block_IPs', $ip);
if ($ignore) {
return $ignore;
}
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$browser = &JBrowser::getInstance($userAgent);
$agent = $browser->getBrowser();
if (!$agent) {
$agent = $browser->getAgentString();
}
$ignore = $this->exclude('Block_User_Agent', $agent);
if ($ignore) {
return $ignore;
}
$ignore = $this->exclude('Exclude_Article_Ids', $id);
if ($ignore) {
return $ignore;
}
$ignore = $this->exclude('Exclude_Category_Ids', $catId);
if ($ignore) {
return $ignore;
}
return $ignore;
}
function getClientIp() {
global $_SERVER;
if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
$realip = $_SERVER["HTTP_X_FORWARDED_FOR"];
} elseif (isset($_SERVER["HTTP_CLIENT_IP"])) {
$realip = $_SERVER["HTTP_CLIENT_IP"];
} else {
$realip = $_SERVER["REMOTE_ADDR"];
}
return $realip;
}
}
?>
Aktualizowałeś stronę do nowszej wersji? Sprawdź czy plugin masz aktualny i do odpowiedniej wersji (zawsze możesz go przeinstalować)?
owszem posiadam wersję Joomla! 2.5.1, co do dodatku zaraz zobaczę, czy zmini się wynik po ponownej instalacji...
---------- Post dodany o 18:33 ---------- Poprzedni post był o 18:29 ----------
niby jest dostępna wersja dla 2.5
http://extensions.joomla.org/extensions/ads-a-affiliates/affiliate-systems/affiliate-advertising/4995
ale po wejściu w download ukazuję się do 1.7
palyga007
06-02-2012, 20:38
To nie są błędy tylko ostrzeżenia to po pierwsze.
Po drugie wyłącz w ustawieniach serwera wyświetlanie błędów i ostrzeżeń i komunikaty znikną.
seba.adm
06-02-2012, 21:33
Witam.
Jest problem z dodatkiem Multi Ads - wiem bo sam to przerabiałem. Wyłączenie dodatku oczywiście rozwiązuje problem. Optymalne rozwiązanie: @bePFRo skorzystaj z tego dodatku >>ContentAds (http://extensions.joomla.org/extensions/ads-a-affiliates/affiliate-systems/google-ads/16027) - opcje do użycia takie same jak w MultiAds.
seba.adm (http://forum.joomla.pl/member.php?16613-seba-adm) dziękuję za pomoc ;)
vBulletin® v4.2.5, Prawa przedruku © 2024 vBulletin Solutions, Inc. Wszystkie prawa zastrzeżone.
Tłumaczenie: Polskie Centrum Joomla!