Новости Joomla

Как тестировать Joomla PHP-разработчику? Компонент Patch tester.

👩‍💻 Как тестировать Joomla PHP-разработчику? Компонент Patch tester.Joomla - open source PHP-фреймворк с готовой админкой. Его основная разработка ведётся на GitHub. Для того, чтобы международному сообществу разработчиков было удобнее тестировать Pull Requests был создан компонент Patch Tester, который позволяет "накатить" на текущую установку Joomla именно те изменения, которые необходимо протестировать. На стороне инфраструктуры Joomla для каждого PR собираются готовые пакеты, в которых находится ядро + предложенные изменения. В каждом PR обычно находятся инструкции по тестированию: куда зайти, что нажать, ожидаемый результат. Тестировщики могут предположить дополнительные сценарии, исходя из своего опыта и найти баги, о которых сообщить разработчику. Или не найти, и тогда улучшение или исправление ошибки быстрее войдёт в ядро Joomla. Напомню, что для того, чтобы PR вошёл в ядро Joomla нужны минимум 2 положительных теста от 2 участников сообщества, кроме автора. Видео на YouTubeВидео на VK ВидеоВидео на RuTubeКомпонент на GitHub https://github.com/joomla-extensions/patchtester@joomlafeed#joomla #php #webdev #community

Вышел релиз Revo PageBuilder Toolkit for YOOtheme Pro 1.6

Вышел релиз Revo PageBuilder Toolkit for YOOtheme Pro 1.6.2PageBuilder Toolkit - это специализированный плагин для конструктора страниц Yootheme Pro, содержит набор различных утилит для ускорения процесса работы и отладки макета, множественные улучшения в интерфейсе, включая поддержку dark mode, подсказки, быстрая смена разрешения в окне просмотра и много чего еще.v.1.6.2 Что нового?- Индикатор статусов: теперь не просто показывает состояние запросов, но и делает автоматические попытки их отправки при кратковременных сбоях в сети, а если это не помогло, то переводит конструктор в ручной режим, что позволяет сохранит макет и настройки темы прежде чем вы потеряете все, что было сделано с момента последнего сохранения- Подсветка ошибок в макете: плагин анализирует код страницы и может автоматически подсвечивать data атрибуты с кучей мусора, которые попадают в код страницы при копипасте из Figma в TinyMCE (пригодится для старых макетов, в текущей работе плагин сам очищает код мусора). Также есть подсветка семантических ошибок сборки - дубли h1 тега на странице и вложенных друг в друга заголовков.- Улучшена поддержка будущего релиза Yootheme Pro 5 и редактора CodeMirror 6Плагин для русскоязычных пользователей доступен в каталоге расширений SovMart и распространяется за символическую плату (100р). Разработчики Joomla расширений и партнеры автора могут получить плагин бесплатно.Для работы плагина необходим конструктор страниц Yootheme Pro.Разработчик плагина - участник нашего сообщества Александр Судьбинов (@alexrevo), член официальной группы поддержки Yootheme Pro. Страница расширенияОписание на сайте автора@joomlafeed#joomla #yootheme

0 Пользователей и 1 Гость просматривают эту тему.
  • 10 Ответов
  • 2002 Просмотров
*

Sony

  • Осваиваюсь на форуме
  • 17
  • 0 / 0
Господа, проблема в следущем:
Следуя инструкции на сайте я произвел интеграцию JComments в AdsManager - все работает как надо, под каждым объявлением лента комментариев.
Однако, хотелось бы, чтобы при просмотре списка объявлений, было видно количество комментариев к каждому объявлению (например, в скобках), чтобы легко можно было отслеживать появление новых комментариев.
Никто не подскажет, как это сделать?
*

Sony

  • Осваиваюсь на форуме
  • 17
  • 0 / 0
На официальном сайте есть это:
Цитировать
global $mainframe; 
$comments = $mainframe->getCfg('absolute_path'). '/components/com_jcomments/jcomments.php'; 
$jcomments_installed = false; 
if (file_exists($comments)) {   
require_once($comments);   
$jcomments_installed = true;  }
а куда этот код вставлять подскажите, на форуме я ненашел... ^-^
*

Sony

  • Осваиваюсь на форуме
  • 17
  • 0 / 0
Делюсь еще одним поиском  smart предлогает вставить два кода
http://joomlaforum.ru/index.php?topic=69421.0
дальше тема не была раскрыта, народ подскажите пожалуйста, как сделать?
*

Sony

  • Осваиваюсь на форуме
  • 17
  • 0 / 0
Примерно, где то здесь components\com_adsmanager\views\list\tmpl\default.php должен стоять этот код
                           
<?php
 global $mainframe;
  $comments = $mainframe->getCfg('absolute_path'). '/components/com_jcomments/jcomments.php';
  if (file_exists($comments)) {
    require_once($comments);
    $count = JComments::getCommentsCount($id, 'com_mycomp');
    echo $count ? ('Комментарии ('. $count . ')') : 'No comments';
  }
?>

вставлял я его между 192 и 193 сточкой
вот мой пример получаеться что выходит текст но нету какое количество комментариев
Код: code://<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;
 
?>
<div class="adsmanager_pathway">
<?php
$pathway ="";
$nb = count($this->pathlist);
for ($i = $nb - 1 ; $i >0;$i--)
{
$pathway .= '<a href="'.$this->pathlist[$i
->link.'">'.$this->pathlist[$i]->text.'</a>';
$pathway .= ' <img src="'.$this->baseurl.'/components/com_adsmanager/images/arrow.png" alt="arrow" /> ';
}
$pathway .= '<a href="'.$this->pathlist[0]->link.'">'.$this->pathlist[0]->text.'</a>';
echo $pathway;
?>
</div>
<h1 class="contentheading">
<?php
echo '<img  class="imgheading" src="'.$this->list_img.'" alt="'.$this->list_img.'" />';
echo $this->list_name;
if ($this->conf->show_rss == 1)
{
$linkrss = JRoute::_("index.php?option=com_adsmanager&view=list&format=feed&catid=".$this->catid);
echo '<a href="'.$linkrss.'" target="_blank"><img align="right" class="imgheading" src="'.$this->baseurl.'/components/com_adsmanager/images/rss.png" alt="rss" /></a>';
}
?>
</h1>
<div class="adsmanager_subcats">
<?php foreach($this->subcats as $key => $subcat) {
$subcat->link = JRoute::_('index.php?option=com_adsmanager&view=list&catid='.$subcat->id."&Itemid=".$this->Itemid);
if ($key != 0)
echo ' | ';
echo '<a href="'.$subcat->link.'">'.$subcat->name.'</a>';
}
?>
</div>
<div class="adsmanager_description">
<?php echo $this->list_description; ?>
</div>
<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">
<?php if ($this->catid != 0) {?>
<form action="<?php echo JRoute::_('index.php?option=com_adsmanager&view=list&catid='.$this->catid.'&Itemid='.$this->Itemid)?>" method="get">
<?php $urloptions = "&catid=".$this->catid; ?>
<?php } ?>
<?php if ($this->userid != 0) {?>
<form action="<?php echo JRoute::_('index.php?option=com_adsmanager&view=list&user='.$this->userid.'&Itemid='.$this->Itemid)?>" method="get">
<?php $urloptions = "&user=".$this->userid; ?>
<?php } ?>
<div align="left">
<input name="tsearch" id="tsearch" maxlength="20" alt="search" class="inputbox" type="text" size="20" value="<?php echo $this->tsearch;?>"  onblur="if(this.value=='') this.value='';" onfocus="if(this.value=='<?php echo $this->tsearch;?>') this.value='';" />
</div>
<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>
</form>
<?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=list".$urloptions."&order=&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=list".$urloptions."&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 == 1) { ?>
<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'); ?></th>
 <?php
   foreach($this->columns as $col)
 {
echo "<th>".JTEXT::_($col->name)."</th>";
 }
 ?>
 <th><?php echo JTEXT::_('ADSMANAGER_DATE'); ?></th>
</tr>
<?php
foreach($this->contents as $content)
{
$linkTarget = JRoute::_( "index.php?option=com_adsmanager&task=display&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/fotki/".$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/fotki/".$content->id.$ext_name."_t.jpg' alt='".htmlspecialchars(stripslashes($content->content_headline),ENT_QUOTES)."' /></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>
                     <?php
                    global $mainframe;
                    $comments = $mainframe->getCfg('absolute_path'). '/components/com_jcomments/jcomments.php';
                    if (file_exists($comments)) {
                    require_once($comments);
                    $count = JComments::getCommentsCount($id, 'com_mycomp');
                    echo $count ? ('Комментарии ('. $count . ')') : 'No comments';
                                                }
                    ?> <h2>
<?php echo '<a href="'.$linkTarget.'">'.stripslashes($content->ad_headline).'</a>'; ?>
<span class="adsmanager_cat"><?php echo "(".$content->parent." / ".$content->cat.")"; ?></span>
</h2>
<?php
$content->ad_text = str_replace ('<br />'," ",stripslashes($content->ad_text));
$af_text = 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&Itemid=$this->Itemid&task=write&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&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">';
if (isset($this->fColumns[$col->id]))
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 align='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 align='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&view=list&user=".$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)&&($update_possible == 1)) {
?>
<div>
<?php
$target = JROUTE::_("index.php?option=com_adsmanager&Itemid=$this->Itemid&task=write&adid=$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&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/fotki/".$content->id.$ext_name."_t.jpg";
$piclink = $this->baseurl."/images/com_adsmanager/fotki/".$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/fotki/".$content->id.$ext_name."_t.jpg' alt='".htmlspecialchars(stripslashes($content->ad_headline),ENT_QUOTES)."' /></a>";
break;
case 'lightbox':
echo "<a href='".$piclink."' rel='lightbox[roadtrip".$content->id."]'><img src='".$this->baseurl."/images/com_adsmanager/fotki/".$content->id.$ext_name."_t.jpg' alt='".htmlspecialchars(stripslashes($content->ad_headline),ENT_QUOTES)."' /></a>";
break;
case 'lytebox':
echo "<a href='".$piclink."' rel='lytebox[roadtrip".$content->id."]'><img src='".$this->baseurl."/images/com_adsmanager/fotki/".$content->id.$ext_name."_t.jpg' alt='".htmlspecialchars(stripslashes($content->ad_headline),ENT_QUOTES)."' /></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/fotki/".$content->id.$ext_name."_t.jpg' alt='".htmlspecialchars(stripslashes($content->ad_headline),ENT_QUOTES)."' /></a>";
break;
case 'default':
default:
echo "<a href='".$piclink."' target='_blank'><img src='".$this->baseurl."/images/com_adsmanager/fotki/".$content->id.$ext_name."_t.jpg' alt='".htmlspecialchars(stripslashes($content->ad_headline),ENT_QUOTES)."' /></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 } ?>
<?php echo $this->pagination->getListFooter(); ?>
</form>
<?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;
 
?>
<div class="adsmanager_pathway">
<?php
$pathway ="";
$nb = count($this->pathlist);
for ($i = $nb - 1 ; $i >0;$i--)
{
$pathway .= '<a href="'.$this->pathlist[$i]->link.'">'.$this->pathlist[$i]->text.'</a>';
$pathway .= ' <img src="'.$this->baseurl.'/components/com_adsmanager/images/arrow.png" alt="arrow" /> ';
}
$pathway .= '<a href="'.$this->pathlist[0]->link.'">'.$this->pathlist[0]->text.'</a>';
echo $pathway;
?>
</div>
<h1 class="contentheading">
<?php
echo '<img  class="imgheading" src="'.$this->list_img.'" alt="'.$this->list_img.'" />';
echo $this->list_name;
if ($this->conf->show_rss == 1)
{
$linkrss = JRoute::_("index.php?option=com_adsmanager&view=list&format=feed&catid=".$this->catid);
echo '<a href="'.$linkrss.'" target="_blank"><img align="right" class="imgheading" src="'.$this->baseurl.'/components/com_adsmanager/images/rss.png" alt="rss" /></a>';
}
?>
</h1>
<div class="adsmanager_subcats">
<?php foreach($this->subcats as $key => $subcat) {
$subcat->link = JRoute::_('index.php?option=com_adsmanager&view=list&catid='.$subcat->id."&Itemid=".$this->Itemid);
if ($key != 0)
echo ' | ';
echo '<a href="'.$subcat->link.'">'.$subcat->name.'</a>';
}
?>
</div>
<div class="adsmanager_description">
<?php echo $this->list_description; ?>
</div>
<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">
<?php if ($this->catid != 0) {?>
<form action="<?php echo JRoute::_('index.php?option=com_adsmanager&view=list&catid='.$this->catid.'&Itemid='.$this->Itemid)?>" method="get">
<?php $urloptions = "&catid=".$this->catid; ?>
<?php } ?>
<?php if ($this->userid != 0) {?>
<form action="<?php echo JRoute::_('index.php?option=com_adsmanager&view=list&user='.$this->userid.'&Itemid='.$this->Itemid)?>" method="get">
<?php $urloptions = "&user=".$this->userid; ?>
<?php } ?>
<div align="left">
<input name="tsearch" id="tsearch" maxlength="20" alt="search" class="inputbox" type="text" size="20" value="<?php echo $this->tsearch;?>"  onblur="if(this.value=='') this.value='';" onfocus="if(this.value=='<?php echo $this->tsearch;?>') this.value='';" />
</div>
<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>
</form>
<?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=list".$urloptions."&order=&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=list".$urloptions."&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 == 1) { ?>
<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'); ?></th>
 <?php
   foreach($this->columns as $col)
 {
echo "<th>".JTEXT::_($col->name)."</th>";
 }
 ?>
 <th><?php echo JTEXT::_('ADSMANAGER_DATE'); ?></th>
</tr>
<?php
foreach($this->contents as $content)
{
$linkTarget = JRoute::_( "index.php?option=com_adsmanager&task=display&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/fotki/".$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/fotki/".$content->id.$ext_name."_t.jpg' alt='".htmlspecialchars(stripslashes($content->content_headline),ENT_QUOTES)."' /></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>
<?php
                    global $mainframe;
                    $comments = $mainframe->getCfg('absolute_path'). '/components/com_jcomments/jcomments.php';
                    if (file_exists($comments)) {
                    require_once($comments);
                    $count = JComments::getCommentsCount($id, 'com_mycomp');
                    echo $count ? ('Комментарии ('. $count . ')') : 'No comments';
                                                }
                    ?>
<h2>
<?php echo '<a href="'.$linkTarget.'">'.stripslashes($content->ad_headline).'</a>'; ?>
<span class="adsmanager_cat"><?php echo "(".$content->parent." / ".$content->cat.")"; ?></span>
</h2>
<?php
$content->ad_text = str_replace ('<br />'," ",stripslashes($content->ad_text));
$af_text = 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&Itemid=$this->Itemid&task=write&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&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">';
if (isset($this->fColumns[$col->id]))
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 align='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 align='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&view=list&user=".$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)&&($update_possible == 1)) {
?>
<div>
<?php
$target = JROUTE::_("index.php?option=com_adsmanager&Itemid=$this->Itemid&task=write&adid=$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&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/fotki/".$content->id.$ext_name."_t.jpg";
$piclink = $this->baseurl."/images/com_adsmanager/fotki/".$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/fotki/".$content->id.$ext_name."_t.jpg' alt='".htmlspecialchars(stripslashes($content->ad_headline),ENT_QUOTES)."' /></a>";
break;
case 'lightbox':
echo "<a href='".$piclink."' rel='lightbox[roadtrip".$content->id."]'><img src='".$this->baseurl."/images/com_adsmanager/fotki/".$content->id.$ext_name."_t.jpg' alt='".htmlspecialchars(stripslashes($content->ad_headline),ENT_QUOTES)."' /></a>";
break;
case 'lytebox':
echo "<a href='".$piclink."' rel='lytebox[roadtrip".$content->id."]'><img src='".$this->baseurl."/images/com_adsmanager/fotki/".$content->id.$ext_name."_t.jpg' alt='".htmlspecialchars(stripslashes($content->ad_headline),ENT_QUOTES)."' /></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/fotki/".$content->id.$ext_name."_t.jpg' alt='".htmlspecialchars(stripslashes($content->ad_headline),ENT_QUOTES)."' /></a>";
break;
case 'default':
default:
echo "<a href='".$piclink."' target='_blank'><img src='".$this->baseurl."/images/com_adsmanager/fotki/".$content->id.$ext_name."_t.jpg' alt='".htmlspecialchars(stripslashes($content->ad_headline),ENT_QUOTES)."' /></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 } ?>
<?php echo $this->pagination->getListFooter(); ?>
</form>
<?php
}
« Последнее редактирование: 14.11.2011, 17:23:10 от Sony »
*

Alex89

  • Давно я тут
  • 555
  • 198 / 1
  • Joomlaman :)
попробуйте использовать такой код
Код
<?php
  $comments = JPATH_BASE.'/components/com_jcomments/jcomments.php';
  if (file_exists($comments)) {
    require_once($comments);
    $count = JComments::getCommentsCount($content->id, 'com_adsmanager');
    echo $count ? ('Комментариев ('. $count . ')') : 'Без комментариев';
  }
?>

Вроде должно работать, нет возможности проверить к сожалению! Скажите помогло или нет :)
« Последнее редактирование: 13.11.2011, 18:55:05 от Alex89 »
Увеличить посещаемость сайта помогут здесь - http://tinyurl.com/kpaprwy
Если помог, ткните "крестик" в репу!
*

Sony

  • Осваиваюсь на форуме
  • 17
  • 0 / 0
Alex89 Спасибо помогло!
находим
Код
<?php echo sprintf(JTEXT::_('ADSMANAGER_VIEWS'),$content->views); ?>
и после него вставляем
Код
<?php
                    $comments = JPATH_BASE.'/components/com_jcomments/jcomments.php';
                    if (file_exists($comments)) {
                    require_once($comments);
                    $count = JComments::getCommentsCount($content->id, 'com_adsmanager');
                    echo $count ? ('/ Comments ('. $count . ')') : '/ No Comments';
                    }
                    ?>

у меня получилось после 256 строчке
единственое осталось переделать (Comments) на русские буквы иначе выводиться пустые квадратики, может подскажешь?
*

Alex89

  • Давно я тут
  • 555
  • 198 / 1
  • Joomlaman :)
Цитировать
может подскажешь?
файл должен быть в кодировке UTF8 без BOM, тогда и квадратиков никаких не будет
Увеличить посещаемость сайта помогут здесь - http://tinyurl.com/kpaprwy
Если помог, ткните "крестик" в репу!
*

Sony

  • Осваиваюсь на форуме
  • 17
  • 0 / 0
а поподробнее  про эту кодировку, я что то слышал о ней но так и не понял, где её искать...
нашел только кодировку utf8_bin нажал применить ко всем, применил перезагрузил и все равно квадратики

у меня AdminTools стоит через него можно?
« Последнее редактирование: 14.11.2011, 18:24:45 от Sony »
*

Alex89

  • Давно я тут
  • 555
  • 198 / 1
  • Joomlaman :)
открываете файл, в который вставляли код (default.php) с помощью текстового редактора Notepad ++.
Нажимаете в меню Кодировки->Преобразовать в UTF-8 без BOM, сохраняете. Всё!
Увеличить посещаемость сайта помогут здесь - http://tinyurl.com/kpaprwy
Если помог, ткните "крестик" в репу!
*

Sony

  • Осваиваюсь на форуме
  • 17
  • 0 / 0
Все получилось!
*

marozz1k

  • Захожу иногда
  • 316
  • 8 / 0
для 2.5 можете сказать куда пихать?)
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Вывести количество картинок в обьявлении

Автор Sabotage

Ответов: 4
Просмотров: 1110
Последний ответ 15.10.2017, 13:47:30
от Sabotage
Общее количество объявлений

Автор Diman1980

Ответов: 2
Просмотров: 1463
Последний ответ 03.05.2016, 01:01:02
от yury181
Количество объявлений в субкатегории

Автор voras

Ответов: 1
Просмотров: 1208
Последний ответ 20.02.2016, 00:44:18
от yury181
Как сделать рассылку комментариев владельцам объявлений?

Автор gertruda

Ответов: 6
Просмотров: 1172
Последний ответ 19.02.2016, 12:02:26
от gertruda
Количество объявлений в подкатегориях

Автор voras

Ответов: 1
Просмотров: 841
Последний ответ 28.11.2015, 19:05:12
от voras