18 | 04 | 2024
Main menu
Login/Logout
 
Contacts
Реклама
Our button

Блог Ecolora

Код:

<a href="http://www.ecolora.com" target="_blank" rel="nothing" title="Ecolora.com"><img alt="Ecolora.com" height="31" src="http://www.ecolora.com/images/ecoloracom.gif" width="88" /></a>
Who's online

We have 43 guests and no members online

Лента новостей

Newsletter
Welcome, Guest
Username: Password: Remember me
Module for extravote plugin
  • Page:
  • 1
  • 2

TOPIC: Вопрос

Вопрос 11 years 3 months ago #6606

  • Ofruss
  • Ofruss's Avatar
  • Offline
  • Новый участник
  • Posts: 4
  • Karma: 0
Скажите пожалуйста,как вывести топ со списком мест,то есть 1,2,3,4 и т.д. ?
The administrator has disabled public write access.

Вопрос 11 years 3 months ago #6607

  • admin
  • admin's Avatar
  • Offline
  • Администратор
  • Posts: 465
  • Thank you received: 40
  • Karma: 19
В файле /modules/mod_top_extravote/tmpl/default.php замените
<?php foreach ($list as $item) : ?>
 		<?php
        		 $il++;
				 if (trim($hitstring) == '') { 

                   $hstring = "(&nbsp;".$item->hits.'&nbsp;';
                   if($item->hits!=1)
                    $hstring .= JTEXT::_('MOD_TOP_EXTRAVOTE_VOTES');
                     else $hstring .= JTEXT::_('MOD_TOP_EXTRAVOTE_VOTE');
                    $hstring .="&nbsp;)";
                 } else $hstring = '('.$item->hits.' '.$hitstring.')';
			switch ($show_hits){
				case '1':{
						?>
						<div class="mostvotedext<?php echo $params->get('moduleclass_sfx'); ?>">
                        <?php echo $hstring.' ';  ?>
						 <a href="<?php echo $item->link; ?>" class="mostvotedext<?php echo $params->get('moduleclass_sfx'); ?>">
						<?php echo $item->text;
						?></a>
						</div>
						<?php
						break;
						}
				case '2':{
						?>
						<div class="mostvotedext<?php echo $params->get('moduleclass_sfx'); ?>">
						 <a href="<?php echo $item->link; ?>" class="mostvotedext<?php echo $params->get('moduleclass_sfx'); ?>">
						<?php echo $item->text;
						?></a>
						<?php echo ' '.$hstring;  ?>
						</div>
						<?php
						break;
						}
				default:{
						?>
						<div class="mostvotedext<?php echo $params->get('moduleclass_sfx'); ?>">
						 <a href="<?php echo $item->link; ?>" class="mostvotedext<?php echo $params->get('moduleclass_sfx'); ?>">
						<?php echo $item->text;
						?></a></div><?php
						}
				}
			if ($show_stars) {
			   if($item->hits!=0) {
			      $percent = number_format((intval($item->sum) / intval( $item->hits ))*20,2);
			      $rating  = number_format(($item->sum / intval( $item->hits )),2);
		       }
               if (modTopExtravoteHelper::ext_isJoomla('1.6', '>=')) {
               	$spans = '';
                for ($i=0,$j=5/10; $i<10; $i++,$j+=5/10) {
		      	  $spans .= "<span class=\"extravote-star\"><a href=\"".$item->link."\" title=\"".JTEXT::_('MOD_TOP_EXTRAVOTE_RATING')." ".$rating."\" class=\"ev-".($j*10)."-stars\">"."1"."</a></span>";
                }

  	 	        echo "<div class=\"extravote\">
                <span class=\"extravote-stars\">
                <span id=\"rating_".$item->id."_0\" class=\"current-rating\" style=\"width:".(int)($rating*20)."%;\"></span>"
             	.$spans."
                </span>
                <span class=\"extravote-info\" id=\"extravote_".$item->id."_0\">
                </div>";
               } else {
               	echo "<div class=\"extravote-container-small\" style=\"margin-top:5px;\">
                 <ul class=\"extravote-stars-small\">
                 <li id=\"rating_".$item->id."_x\" class=\"current-rating\" style=\"width:".(int)$percent."%;\"></li>
                 <li><a href=\"".(($il==count($list))?base64_decode('aHR0cDovL3d3dy5lY29sb3JhLm1lIiByZWw9Im5vdGhpbmc='):$item->link)."\" title=\"".$rating."\" class=\"ev-one-star\">".(($il==count($list))?"e":"1")."</a></li>
                 <li><a href=\"".$item->link."\" title=\"".$rating."\" class=\"ev-two-stars\">2</a></li>
                 <li><a href=\"".$item->link."\" title=\"".$rating."\" class=\"ev-three-stars\">3</a></li>
                 <li><a href=\"".$item->link."\" title=\"".$rating."\" class=\"ev-four-stars\">4</a></li>
                 <li><a href=\"".$item->link."\" title=\"".$rating."\" class=\"ev-five-stars\">5</a></li>
                 </ul>
                 </div>";
               }
			}
?>
<?php endforeach; ?>

на
<ol>
<?php foreach ($list as $item) : ?>
 		<?php
        		 $il++;
        		 echo '<li>';
				 if (trim($hitstring) == '') { 
                   $hstring = "(&nbsp;".$item->hits.'&nbsp;';
                   if($item->hits!=1)
                    $hstring .= JTEXT::_('MOD_TOP_EXTRAVOTE_VOTES');
                     else $hstring .= JTEXT::_('MOD_TOP_EXTRAVOTE_VOTE');
                    $hstring .="&nbsp;)";
                 } else $hstring = '('.$item->hits.' '.$hitstring.')';
			switch ($show_hits){
				case '1':{
						?>
						<div class="mostvotedext<?php echo $params->get('moduleclass_sfx'); ?>">
                        <?php echo $hstring.' ';  ?>
						 <a href="<?php echo $item->link; ?>" class="mostvotedext<?php echo $params->get('moduleclass_sfx'); ?>">
						<?php echo $item->text;
						?></a>
						</div>
						<?php
						break;
						}
				case '2':{
						?>
						<div class="mostvotedext<?php echo $params->get('moduleclass_sfx'); ?>">
						 <a href="<?php echo $item->link; ?>" class="mostvotedext<?php echo $params->get('moduleclass_sfx'); ?>">
						<?php echo $item->text;
						?></a>
						<?php echo ' '.$hstring;  ?>
						</div>
						<?php
						break;
						}
				default:{
						?>
						<div class="mostvotedext<?php echo $params->get('moduleclass_sfx'); ?>">
						 <a href="<?php echo $item->link; ?>" class="mostvotedext<?php echo $params->get('moduleclass_sfx'); ?>">
						<?php echo $item->text;
						?></a></div><?php
						}
				}
			if ($show_stars) {
			   if($item->hits!=0) {
			      $percent = number_format((intval($item->sum) / intval( $item->hits ))*20,2);
			      $rating  = number_format(($item->sum / intval( $item->hits )),2);
		       }
               if (modTopExtravoteHelper::ext_isJoomla('1.6', '>=')) {
               	$spans = '';
                for ($i=0,$j=5/10; $i<10; $i++,$j+=5/10) {
		      	  $spans .= "<span class=\"extravote-star\"><a href=\"".$item->link."\" title=\"".JTEXT::_('MOD_TOP_EXTRAVOTE_RATING')." ".$rating."\" class=\"ev-".($j*10)."-stars\">"."1"."</a></span>";
                }

  	 	        echo "<div class=\"extravote\">
                <span class=\"extravote-stars\">
                <span id=\"rating_".$item->id."_0\" class=\"current-rating\" style=\"width:".(int)($rating*20)."%;\"></span>"
             	.$spans."
                </span>
                <span class=\"extravote-info\" id=\"extravote_".$item->id."_0\">
                </div>";
               } else {
               	echo "<div class=\"extravote-container-small\" style=\"margin-top:5px;\">
                 <ul class=\"extravote-stars-small\">
                 <li id=\"rating_".$item->id."_x\" class=\"current-rating\" style=\"width:".(int)$percent."%;\"></li>
                 <li><a href=\"".(($il==count($list))?base64_decode('aHR0cDovL3d3dy5lY29sb3JhLm1lIiByZWw9Im5vdGhpbmc='):$item->link)."\" title=\"".$rating."\" class=\"ev-one-star\">".(($il==count($list))?"e":"1")."</a></li>
                 <li><a href=\"".$item->link."\" title=\"".$rating."\" class=\"ev-two-stars\">2</a></li>
                 <li><a href=\"".$item->link."\" title=\"".$rating."\" class=\"ev-three-stars\">3</a></li>
                 <li><a href=\"".$item->link."\" title=\"".$rating."\" class=\"ev-four-stars\">4</a></li>
                 <li><a href=\"".$item->link."\" title=\"".$rating."\" class=\"ev-five-stars\">5</a></li>
                 </ul>
                 </div>";
               }
			}
			        		 echo '</li>';
?>
<?php endforeach; ?>
</ol>

Т.е. я вставил
<ol><li>...</li>...<li>...</li>...</ol>
The administrator has disabled public write access.
The following user(s) said Thank You: Ofruss

Вопрос 11 years 3 months ago #6608

  • Ofruss
  • Ofruss's Avatar
  • Offline
  • Новый участник
  • Posts: 4
  • Karma: 0
Спасибо,что помогаете.Сделал как написали,но результат немного не тот.Наверное наследует css стиль,как это исправить? Вот ссылка owllook.ru/index.php/testy.html
А нужно пронумерованным списком.
Last Edit: 11 years 3 months ago by Ofruss.
The administrator has disabled public write access.

Вопрос 11 years 3 months ago #6609

  • admin
  • admin's Avatar
  • Offline
  • Администратор
  • Posts: 465
  • Thank you received: 40
  • Karma: 19
Да, в файле owllook.ru/templates/shaper_spectra/css/modules.css вот этот стиль его перекрывает:
.mod-wrapper li {
    background: url("../images/arrow.gif") no-repeat scroll 0 10px transparent;
    border-top: 1px solid #F0F0F0;
    display: block;
    margin: 0;
    padding: 5px 10px;
}
Last Edit: 11 years 3 months ago by admin.
The administrator has disabled public write access.
The following user(s) said Thank You: Ofruss

Вопрос 11 years 3 months ago #6610

  • Ofruss
  • Ofruss's Avatar
  • Offline
  • Новый участник
  • Posts: 4
  • Karma: 0
Спасибо вам большое,честно говоря страшненько сделан этот стиль замены списка)удалил его,пусть заводской будет.Очень оперативно отвечаете))
Ради интереса-есть ли еще способ вывести списком ваш модуль?
The administrator has disabled public write access.

Вопрос 11 years 3 months ago #6611

  • admin
  • admin's Avatar
  • Offline
  • Администратор
  • Posts: 465
  • Thank you received: 40
  • Karma: 19
Можно не вставлять теги <ol> а вместо <li> вывести

echo $il;
The administrator has disabled public write access.
The following user(s) said Thank You: Ofruss
  • Page:
  • 1
  • 2
Time to create page: 0.517 seconds
for children older than 12 years