PDA

Zobacz pełną wersję : problem z AdsManager



fred8585
31-12-2011, 09:50
witam serdecznie po zapoznaniu się z AdsManager, nastąpił problem z wyszukiwaniem przedmiotów chodzi o pasek z prawej strony http://korepetycjekrakow.edu.pl. Wpiszując polski ukazują sie wyniki wyszukiwania lecz w tabeli w polu "Warunek" wyświetlany jest błąd
Warning: Invalid argument supplied for foreach() in /home/fred8585/public_html/korepetycjekrakow.edu.pl/components/com_adsmanager/views/result/tmpl/default.php on line 182. Czy kupienie pełnego pakietu powinno rozwiązać problem ?
a o to plik php

<script language="javascript" type="text/javascript">
function tableOrdering( order, dir, task )
{
var form = document.adminForm;

form.filter_order.value = order;
form.filter_order_Dir.value = dir;
document.adminForm.submit( task );
}
</script>
<?php
$conf= $this->conf;
?>
<h1 class="contentheading">
<?php
echo '<img class="imgheading" src="'.$this->list_img.'" alt="'.$this->list_img.'" />';
echo $this->list_name;
?>
</h1>
<script language="JavaScript" type="text/JavaScript">
<!--
function jumpmenu(target,obj){
eval(target+".location='"+obj.options[obj.selectedIndex].value+"'");
obj.options[obj.selectedIndex].innerHTML="<?php echo JText::_('ADSMANAGER_WAIT');?>";
}
//-->
</script>
<div class="adsmanager_search_box">
<div class="adsmanager_inner_box">
<div align="left">
<a href="<?php echo JRoute::_("index.php?option=com_adsmanager&view=search&catid=".$this->catid."&Itemid=".$this->Itemid);?>"><?php echo JText::_('ADSMANAGER_ADVANCED_SEARCH'); ?></a>
</div>
<?php if (isset($this->orders)) { ?>
<?php echo JText::_('ADSMANAGER_ORDER_BY_TEXT'); ?>
<select name="order" size="1" onchange="jumpmenu('parent',this)">
<option value="<?php echo JRoute::_("index.php?option=com_adsmanager&view=result&Itemid=".$this->Itemid);?>" <?php if ($this->order == "0") { echo "selected='selected'"; } ?>><?php echo JText::_('ADSMANAGER_DATE'); ?></option>
<?php foreach($this->orders as $o)
{
?>
<option value="<?php echo JRoute::_("index.php?option=com_adsmanager&view=result&order=".$o->fieldid."&Itemid=".$this->Itemid);?>" <?php if ($this->order == $o->fieldid) { echo "selected='selected'"; } ?>><?php echo JText::_($o->title); ?></option>
<?php
}
?>
</select>
<?php } ?>
</div>
</div>
<?php $this->general->showGeneralLink() ?>
<?php
if ($this->pagination->total == 0 )
{
echo JText::_('ADSMANAGER_NOENTRIES');
}
else
{
echo $this->pagination->total;
?>
<?php echo $this->pagination->getResultsCounter() ?>
<br/><br/>
<form name="adminForm" id="adminForm" method="post" action="<?php echo $this->requestURL; ?>" >
<input type="hidden" id="mode" name="mode" value="<?= $this->mode?>"/>
<?php if ($this->conf->display_expand == 2) { ?>
<script type="text/javascript">
function changeMode(mode)
{
element = document.getElementById("mode");
element.value = mode;
form = document.getElementById("adminForm");
form.submit();
}
</script>
<div class="adsmanager_subtitle">
<?php
/* Display SubTitle */
echo '<a href="javascript:changeMode(0)">'.JText::_('ADSMANAGER_MODE_TEXT')." ".JText::_('ADSMANAGER_SHORT_TEXT').'</a>';
echo " / ";
echo '<a href="javascript:changeMode(1)">'.JText::_('ADSMANAGER_EXPAND_TEXT').'</a>';
?>
</div>
<?php } ?>
<?php if ($this->mode != 1) { ?>
<table class="adsmanager_table">
<tr>
<th><?php echo JText::_('ADSMANAGER_CONTENT'); ?>
<?php /*<a href="<?php echo JRoute::_("index.php?option=com_adsmanager&view=result&order=5&orderdir=ASC&Itemid=".$this->Itemid);?>"><img src="<?php echo $this->baseurl ?>administrator/images/sort_asc.png" alt="+" /></a>
<a href="<?php echo JRoute::_("index.php?option=com_adsmanager&view=result&order=5&orderdir=DESC&Itemid=".$this->Itemid);?>"><img src="<?php echo $this->baseurl ?>administrator/images/sort_desc.png" alt="-" /></a>
*/?></th>
<?php
foreach($this->columns as $col)
{
echo "<th>".JText::_($col->name);
/*$order = @$this->fColumns[$col->id][0]->fieldid;
?>
<a href="<?php echo JRoute::_("index.php?option=com_adsmanager&view=result&order=$order&orderdir=ASC&Itemid=".$this->Itemid);?>"><img src="<?php echo $this->baseurl ?>administrator/images/sort_asc.png" alt="+" /></a>
<a href="<?php echo JRoute::_("index.php?option=com_adsmanager&view=result&order=$order&orderdir=DESC&Itemid=".$this->Itemid);?>"><img src="<?php echo $this->baseurl ?>administrator/images/sort_desc.png" alt="-" /></a>
*/?>
<?php echo "</th>";
}
?>
<th><?php echo JText::_('ADSMANAGER_DATE'); ?>
<?php /*<a href="<?php echo JRoute::_("index.php?option=com_adsmanager&view=result&order=&orderdir=ASC&Itemid=".$this->Itemid);?>"><img src="<?php echo $this->baseurl ?>administrator/images/sort_asc.png" alt="+" /></a>
<a href="<?php echo JRoute::_("index.php?option=com_adsmanager&view=result&order=&orderdir=DESC&Itemid=".$this->Itemid);?>"><img src="<?php echo $this->baseurl ?>administrator/images/sort_desc.png" alt="-" /></a>
*/?>
</th>
</tr>
<?php
foreach($this->contents as $content)
{
$linkTarget = JRoute::_( "index.php?option=com_adsmanager&view=details&id=".$content->id."&catid=".$content->catid."&Itemid=".$this->Itemid);
if (function_exists('getContentClass'))
$classcontent = getContentClass($content);
else
$classcontent = "adsmanager_table_description";
?>
<tr class="<?php echo $classcontent;?>">
<td>
<?php
$ok = 0;$i=1;
$nbimages = $conf->nb_images;
if (function_exists("getMaxPaidSystemImages"))
{
$nbimages += getMaxPaidSystemImages();
}
while(!$ok)
{
if ($i < $nbimages + 1)
{
$ext_name = chr(ord('a')+$i-1);
$pic = JPATH_BASE."/images/com_adsmanager/ads/".$content->id.$ext_name."_t.jpg";
if (file_exists( $pic))
{
echo "<a href='".$linkTarget."'><img class='adimage' name='adimage".$content->id."' src='".$this->baseurl."images/com_adsmanager/ads/".$content->id.$ext_name."_t.jpg' alt='".htmlspecialchars($content->ad_headline)."' /></a>";
$ok = 1;
}
}
else if ($nbimages != 0)
{
if ((JText::_('ADSMANAGER_NOPIC') != "")&&(file_exists(JPATH_BASE."/components/com_adsmanager/images/".JText::_('ADSMANAGER_NOPIC'))))
echo "<a href='".$linkTarget."'><img class='adimage' src='".$this->baseurl."components/com_adsmanager/images/".JText::_('ADSMANAGER_NOPIC')."' alt='nopic' /></a>";
else
echo "<a href='".$linkTarget."'><img class='adimage' src='".$this->baseurl."components/com_adsmanager/images/nopic.gif' alt='nopic' /></a>";
$ok = 1;
}
else
{
$ok = 1;
}
$i++;
}
?>
<div>
<h2>
<?php echo '<a href="'.$linkTarget.'">'.$content->ad_headline.'</a>'; ?>
<span class="adsmanager_cat"><?php echo "(".$content->parent." / ".$content->cat.")"; ?></span>
</h2>
<?php
$content->ad_text = str_replace ('<br />'," ",$content->ad_text);
$af_text = JString::substr($content->ad_text, 0, 100)."...";
echo $af_text;
?>
</div>

<?php
if (($this->userid == $content->userid)&&($content->userid != 0)) {
?>
<div>
<?php
$target = JRoute::_("index.php?option=com_adsmanager&task=write&catid=".$content->catid."&id=$content->id"."&Itemid=".$this->Itemid);
echo "<a href='".$target."'>".JText::_('ADSMANAGER_CONTENT_EDIT')."</a>";
echo "&nbsp;";
$target = JRoute::_("index.php?option=com_adsmanager&task=delete&catid=".$content->catid."&id=$content->id"."&Itemid=".$this->Itemid);
echo "<a href='".$target."'>".JText::_('ADSMANAGER_CONTENT_DELETE')."</a>";
?>
</div>
<?php
}
?>
</td>
<?php
foreach($this->columns as $col) {
echo '<td class="center">';
foreach($this->fColumns[$col->id] as $field)
{
echo $this->field->showFieldValue($content,$field);
}
echo "</td>";
}
?>
<td class="center">
<?php
$iconflag = false;
if (($conf->show_new == true)&&($this->isNewcontent($content->date_created,$conf->nbdays_new))) {
echo "<div class='center'><img align='center' src='".$this->baseurl."components/com_adsmanager/images/new.gif' /> ";
$iconflag = true;
}
if (($conf->show_hot == true)&&($content->views >= $conf->nbhits)) {
if ($iconflag == false)
echo "<div class='center'>";
echo "<img align='center' src='".$this->baseurl."components/com_adsmanager/images/hot.gif' />";
$iconflag = true;
}
if ($iconflag == true)
echo "</div>";
echo $this->reorderDate($content->date_created);
?>
<br />
<?php
if ($content->userid != 0)
{
echo JText::_('ADSMANAGER_FROM')." ";

if ($conf->comprofiler == 2)
{
$target = JRoute::_("index.php?option=com_comprofiler&task=userProfile&tab=adsmanagerTab&user=".$content->userid."&Itemid=".$this->Itemid);
}
else
{
$target = JRoute::_("index.php?option=com_adsmanager&task=show_user&userid=".$content->userid."&Itemid=".$this->Itemid);
}

echo "<a href='".$target."'>".$content->user."</a><br/>";
}
?>
<?php echo sprintf(JText::_('ADSMANAGER_VIEWS'),$content->views); ?>
</td>
</tr>
<?php
}
?>
</table>
<?php } else { ?>
<?php foreach($this->contents as $content)
{
$this->loadScriptImage($this->conf->image_display);
?>
<br/>
<div class="adsmanager_ads" align="left">
<div class="adsmanager_top_ads">
<h2 class="adsmanager_ads_title">
<?php if (@$this->positions[0]->title) {$strtitle = JText::_($this->positions[0]->title);} ?>
<?php echo "<b>".@$strtitle."</b>";
if (isset($this->fDisplay[1]))
{
foreach($this->fDisplay[1] as $field)
{
echo $this->field->showFieldValue($content,$field);
}
} ?>
</h2>
<div>
<?php
if ($content->userid != 0)
{
echo JText::_('ADSMANAGER_SHOW_OTHERS');
if ($this->conf->comprofiler == 2)
{
$target = JROUTE::_("index.php?option=com_comprofiler&task=userProfile&tab=AdsManagerTab&user=".$content->userid."&Itemid=".$this->Itemid);
}
else
{
$target = JROUTE::_("index.php?option=com_adsmanager&view=list&user=".$content->userid."&Itemid=".$this->Itemid);
}
echo "<a href='$target'><b>".$content->user."</b></a>";

if ($this->userid == $content->userid) {
?>
<div>
<?php
$target = JROUTE::_("index.php?option=com_adsmanager&Itemid=$this->Itemid&task=write&catid=".$content->catid."&id=$content->id"."&Itemid=".$this->Itemid);
echo "<a href='".$target."'>".JText::_('ADSMANAGER_CONTENT_EDIT')."</a>";
echo "&nbsp;";
$target = JROUTE::_("index.php?option=com_adsmanager&Itemid=$this->Itemid&task=delete&catid=".$content->catid."&id=$content->id"."&Itemid=".$this->Itemid);
echo "<a href='".$target."'>".JText::_('ADSMANAGER_CONTENT_DELETE')."</a>";
?>
</div>
<?php
}
}
?>
</div>
<div class="adsmanager_ads_kindof">
<?php if (@$this->positions[1]->title) {$strtitle = JText::_($this->positions[1]->title);} ?>
<?php echo "<b>".@$strtitle."</b>";
if (isset($this->fDisplay[2]))
{
foreach($this->fDisplay[2] as $field)
{
echo $this->field->showFieldValue($content,$field);
}
}
?>
</div>
</div>
<div class="adsmanager_ads_main">
<div class="adsmanager_ads_body">
<div class="adsmanager_ads_desc">
<?php if (@$this->positions[2]->title) {$strtitle = JText::_($this->positions[2]->title);} ?>
<?php echo "<b>".@$strtitle."</b>";
if (isset($this->fDisplay[3]))
{
foreach($this->fDisplay[3] as $field)
{
echo $this->field->showFieldValue($content,$field);
}
} ?>
</div>
<div class="adsmanager_ads_desc">
<?php if (@$this->positions[5]->title) {$strtitle = JText::_($this->positions[5]->title);} ?>
<?php echo "<b>".@$strtitle."</b>";
if (isset($this->fDisplay[6]))
{
foreach($this->fDisplay[6] as $field)
{
echo $this->field->showFieldValue($content,$field);
}
} ?>
</div>
<div class="adsmanager_ads_price">
<?php if (@$this->positions[3]->title) {$strtitle = JText::_($this->positions[3]->title); } ?>
<?php echo "<b>".@$strtitle."</b>";
if (isset($this->fDisplay[4]))
{
foreach($this->fDisplay[4] as $field)
{
echo $this->field->showFieldValue($content,$field);
}
}?>
</div>
<div class="adsmanager_ads_contact">
<?php if (@$this->positions[4]->title) {$strtitle = JText::_($this->positions[4]->title);} ?>
<?php echo "<b>".@$strtitle."</b>";
if (($this->userid != 0)||($conf->show_contact == 0)) {
if (isset($this->fDisplay[5]))
{
foreach($this->fDisplay[5] as $field)
{
echo $this->field->showFieldValue($content,$field);
}
}
if (($content->userid != 0)&&($this->conf->allow_contact_by_pms == 1))
{
$pmsText= sprintf(JText::_('ADSMANAGER_PMS_FORM'),$content->user);
$pmsForm = JROUTE::_("index.php?option=com_uddeim&task=new&recip=".$content->userid);
echo '&nbsp;<a href="'.$pmsForm.'">'.$pmsText.'</a><br />';
}
}
else
{
echo JText::_('ADSMANAGER_CONTACT_NOT_LOGGED');
}
?>
</div>
</div>
<div class="adsmanager_ads_image">
<?php
$image_found =0;
$nbimages = $this->conf->nb_images;
if (function_exists("getMaxPaidSystemImages"))
{
$nbimages += getMaxPaidSystemImages();
}
for($i=1;$i < $nbimages + 1;$i++)
{
$ext_name = chr(ord('a')+$i-1);
$pic = JPATH_BASE."/images/com_adsmanager/ads/".$content->id.$ext_name."_t.jpg";
$piclink = $this->baseurl."images/com_adsmanager/ads/".$content->id.$ext_name.".jpg";
if (file_exists($pic))
{
switch($this->conf->image_display)
{
case 'popup':
echo "<a href=\"javascript:popup('$piclink');\"><img src='".$this->baseurl."images/com_adsmanager/ads/".$content->id.$ext_name."_t.jpg' alt='".htmlspecialchars($content->ad_headline)."' /></a>";
break;
case 'lightbox':
case 'lytebox':
echo "<a href='".$piclink."' rel='lytebox[roadtrip".$content->id."]'><img src='".$this->baseurl."images/com_adsmanager/ads/".$content->id.$ext_name."_t.jpg' alt='".htmlspecialchars($content->ad_headline)."' /></a>";
break;
case 'highslide':
echo "<a id='thumb".$content->id."' class='highslide' onclick='return hs.expand (this)' href='".$piclink."'><img src='".$this->baseurl."/images/com_adsmanager/ads/".$content->id.$ext_name."_t.jpg' alt='".htmlspecialchars($content->ad_headline)."' /></a>";
break;
case 'default':
default:
echo "<a href='".$piclink."' target='_blank'><img src='".$this->baseurl."images/com_adsmanager/ads/".$content->id.$ext_name."_t.jpg' alt='".htmlspecialchars($content->ad_headline)."' /></a>";
break;
}
$image_found = 1;
}
}
if (($image_found == 0)&&($conf->nb_images > 0))
{
if ((JText::_('ADSMANAGER_NOPIC') != "")&&(file_exists(JPATH_BASE."/components/com_adsmanager/images/".JText::_('ADSMANAGER_NOPIC'))))
echo '<img align="center" src="'.$this->baseurl.'components/com_adsmanager/images/'.JText::_('ADSMANAGER_NOPIC').'" alt="nopic" /></a>';
else
echo '<img align="center" src="'.$this->baseurl.'components/com_adsmanager/images/nopic.gif" alt="nopic" />';
}
?>
</div>
<div class="adsmanager_spacer"></div>
</div>
</div>
<?php } ?>
<?php } ?>
<div class="pagelinks"><?php echo $this->pagination->getPagesLinks(); ?></div>
</form>
<?php
} $this->general->endTemplate();

palyga007
31-12-2011, 12:33
Czy kupienie pełnego pakietu powinno rozwiązać problem

Raczej nie. Problem wynika, z faktu, że wywołane zapytanie zwraca pusty wynik.
Czy Joomla i Adsmanager są w najnowszych stabilnych dostępnych wersjach?
Czy wprowadzałeś jakieś modyfikacje w kodzie ?
Próbowałeś przeinstalować komponent?

fred8585
31-12-2011, 19:31
przeinstalowanie nie pomogło, problem to jest bo szukanie to jest numer 1

palyga007
01-01-2012, 12:23
Wyłącz wyświetlanie błędów i ostrzeżeń w php.ini lub .htaccess

fred8585
01-01-2012, 22:27
Wyłącz wyświetlanie błędów i ostrzeżeń w php.ini lub .htaccess
a jak to zrobić? z httacces miałem do czynienia tylko 1 raz jak musiałem php 5.2 załączyć natomiast php.ini to nie wiem nawet gdzie on jest

a o to moj plik httacess

##
# @version $Id: htaccess.txt 21064 2011-04-03 22:12:19Z dextercowley $
# @package Joomla
# @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##


################################################## ###
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations. It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file. If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's. If they work,
# it has been set by your server administrator and you do not need it set here.
#
################################################## ###

## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

#
# mod_rewrite in use

RewriteEngine On

########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
## Deny access to extension xml files (uncomment out to activate)
#<Files ~ "\.xml$">
#Order allow,deny
#Deny from all
#Satisfy all
#</Files>
## End of deny access to extension xml files
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode data within the URL
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a ********** tag in URL
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
########## End - Rewrite rules to block out some common exploits


########## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
########## End - Custom redirects


# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root)

# RewriteBase /


########## Begin - Joomla! core SEF Section
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the request is for root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} (/[^.]*|\.(php|html?|feed|pdf|raw))$ [NC]
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
########## End - Joomla! core SEF Section
AddHandler application/x-httpd-php5 .php

palyga007
02-01-2012, 08:58
Problem poruszany wielokrotnie zarówno na forum jak i w ogólnie pojętej sieci.
Także nie rozumiem z czym masz problem?

fred8585
02-01-2012, 14:18
Problem poruszany wielokrotnie zarówno na forum jak i w ogólnie pojętej sieci.
Także nie rozumiem z czym masz problem?


# supress php errors
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_value docref_root 0
php_value docref_ext 0
dopisałem i nic :(


# PHP error handling for production servers
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_flag log_errors on
php_flag ignore_repeated_errors off
php_flag ignore_repeated_source off
php_flag report_memleaks on
php_flag track_errors on
php_value docref_root 0
php_value docref_ext 0
php_value error_log /home/path/public_html/domain/PHP_errors.log
# [see footnote 3] # php_value error_reporting 999999999
php_value error_reporting -1
php_value log_errors_max_len 0

<Files PHP_errors.log>
Order allow,deny
Deny from all
Satisfy All
</Files>

palyga007
02-01-2012, 14:20
być może na Twoim hostingu wymagane jest objęcie tych wpisów w specjalny znacznik.
Tak jest chyba na nazwa.pl ale zabij nie powiem czy na 100%

Gdzie masz hosting?

fred8585
02-01-2012, 14:38
może trzeba odczekać po zmianach ?

---------- Post dodany o 14:32 ---------- Poprzedni post był o 14:26 ----------

wysłałem zapytanie do firmy

---------- Post dodany o 14:38 ---------- Poprzedni post był o 14:32 ----------

webd.pl