Advertisement
pusatdata

Joomla 1.5 List Category Ada Thumbnail + Deskripsi

Nov 20th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.38 KB | None | 0 0
  1. components/com_content/views/category/tmpl/default_items.php
  2.  
  3. =================
  4.  
  5. <?php // no direct access
  6. defined('_JEXEC') or die('Restricted access'); ?>
  7. <script language="javascript" type="text/javascript">
  8.  
  9. function tableOrdering( order, dir, task )
  10. {
  11. var form = document.adminForm;
  12.  
  13. form.filter_order.value = order;
  14. form.filter_order_Dir.value = dir;
  15. document.adminForm.submit( task );
  16. }
  17. </script>
  18. <form action="<?php echo $this->action; ?>" method="post" name="adminForm">
  19. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  20. <?php if ($this->params->get('filter') || $this->params->get('show_pagination_limit')) : ?>
  21. <tr>
  22. <td colspan="5">
  23. <table>
  24. <tr>
  25. <?php if ($this->params->get('filter')) : ?>
  26. <td align="left" width="60%" nowrap="nowrap">
  27. <?php echo JText::_($this->params->get('filter_type') . ' Filter').'&nbsp;'; ?>
  28. <input type="text" name="filter" value="<?php echo $this->escape($this->lists['filter']);?>" class="inputbox" onchange="document.adminForm.submit();" />
  29. </td>
  30. <?php endif; ?>
  31. <?php if ($this->params->get('show_pagination_limit')) : ?>
  32. <td align="right" width="40%" nowrap="nowrap">
  33. <?php
  34. echo '&nbsp;&nbsp;&nbsp;'.JText::_('Display Num').'&nbsp;';
  35. echo $this->pagination->getLimitBox();
  36. ?>
  37. </td>
  38. <?php endif; ?>
  39. </tr>
  40. </table>
  41. </td>
  42. </tr>
  43. <?php endif; ?>
  44. <?php if ($this->params->get('show_headings')) : ?>
  45. <tr>
  46. <td class="sectiontableheader<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" align="right" width="5%">
  47. <?php echo JText::_('Num'); ?>
  48. </td>
  49. <?php if ($this->params->get('show_title')) : ?>
  50. <td class="sectiontableheader<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" >
  51. <?php echo JHTML::_('grid.sort', 'Item Title', 'a.title', $this->lists['order_Dir'], $this->lists['order'] ); ?>
  52. </td>
  53. <?php endif; ?>
  54. <?php if ($this->params->get('show_date')) : ?>
  55. <td class="sectiontableheader<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" width="25%">
  56. <?php echo JHTML::_('grid.sort', 'Date', 'a.created', $this->lists['order_Dir'], $this->lists['order'] ); ?>
  57. </td>
  58. <?php endif; ?>
  59. <?php if ($this->params->get('show_author')) : ?>
  60. <td class="sectiontableheader<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" width="20%">
  61. <?php echo JHTML::_('grid.sort', 'Author', 'author', $this->lists['order_Dir'], $this->lists['order'] ); ?>
  62. </td>
  63. <?php endif; ?>
  64. <?php if ($this->params->get('show_hits')) : ?>
  65. <td align="center" class="sectiontableheader<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" width="5%" nowrap="nowrap">
  66. <?php echo JHTML::_('grid.sort', 'Hits', 'a.hits', $this->lists['order_Dir'], $this->lists['order'] ); ?>
  67. </td>
  68. <?php endif; ?>
  69. </tr>
  70. <?php endif; ?>
  71. <?php foreach ($this->items as $item) : ?>
  72. <tr class="sectiontableentry<?php echo ($item->odd +1 ) . $this->escape($this->params->get('pageclass_sfx')); ?>" >
  73. <td align="right">
  74. <?php echo $this->pagination->getRowOffset( $item->count ); ?>
  75. </td>
  76. <?php if ($this->params->get('show_title')) : ?>
  77. <?php if ($item->access <= $this->user->get('aid', 0)) : ?>
  78. <td>
  79. <a href="<?php echo $item->link; ?>">
  80.  
  81.  
  82.  
  83. <?php
  84. $text = $item->introtext;
  85. if(preg_match('/<\s*img[^>]+>/Ui', $text, $matches)){
  86. $image=$matches[0];
  87. $text = str_replace($image,'',$text);
  88. }
  89. if ($matches) {
  90. $image = str_replace('img src="','img align=left width=100px style=padding-right:10px; src="/',$image);
  91. $image = str_replace("caption","", $image);
  92. echo '' . $image . '';
  93. }
  94. ?>
  95.  
  96.  
  97.  
  98.  
  99.  
  100. <?php echo $this->escape($item->title); ?></a>
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107. <?php
  108. $text = $item->introtext;
  109. $text = preg_replace('@<div[^>]*class=(["\'])mosimage_caption\\1[^>]*>[^>]*</div>@', '', $text );
  110. $preserv = "";
  111. $text = strip_tags($text, /* exclude */ $preserv );
  112. $text = preg_replace("@<script[^>]*?>.*?</script>@si","",$text);
  113. $text = preg_replace('/{.+?}/','',$text);
  114. $text = preg_replace('/(( )|(&nbsp;))+/',' ',$text);
  115. $text = preg_replace('/&quot;/',' ',$text);
  116. $text = str_replace(array("\r\n", "\n", "\r"), "", $text);
  117. $text = str_replace("caption","", $text);
  118. $shorttext = substr($text,0,200);
  119. echo $shorttext;
  120. ?>
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133. <?php $this->item = $item; echo JHTML::_('icon.edit', $item, $this->params, $this->access) ?>
  134. </td>
  135. <?php else : ?>
  136. <td>
  137. <?php
  138. echo $this->escape($item->title).' : ';
  139. $link = JRoute::_('index.php?option=com_user&view=login');
  140. $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid), false);
  141. $fullURL = new JURI($link);
  142. $fullURL->setVar('return', base64_encode($returnURL));
  143. $link = $fullURL->toString();
  144. ?>
  145. <a href="<?php echo $link; ?>">
  146. <?php echo JText::_( 'Register to read more...' ); ?></a>
  147. </td>
  148. <?php endif; ?>
  149. <?php endif; ?>
  150. <?php if ($this->params->get('show_date')) : ?>
  151. <td>
  152. <?php echo $item->created; ?>
  153. </td>
  154. <?php endif; ?>
  155. <?php if ($this->params->get('show_author')) : ?>
  156. <td >
  157. <?php echo $this->escape($item->created_by_alias) ? $this->escape($item->created_by_alias) : $this->escape($item->author); ?>
  158. </td>
  159. <?php endif; ?>
  160. <?php if ($this->params->get('show_hits')) : ?>
  161. <td align="center">
  162. <?php echo $this->escape($item->hits) ? $this->escape($item->hits) : '-'; ?>
  163. </td>
  164. <?php endif; ?>
  165. </tr>
  166. <?php endforeach; ?>
  167. <?php if ($this->params->get('show_pagination')) : ?>
  168. <tr>
  169. <td colspan="5">&nbsp;</td>
  170. </tr>
  171. <tr>
  172. <td align="center" colspan="4" class="sectiontablefooter<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
  173. <?php echo $this->pagination->getPagesLinks(); ?>
  174. </td>
  175. </tr>
  176. <tr>
  177. <td colspan="5" align="right">
  178. <?php echo $this->pagination->getPagesCounter(); ?>
  179. </td>
  180. </tr>
  181. <?php endif; ?>
  182. </table>
  183.  
  184. <input type="hidden" name="id" value="<?php echo $this->category->id; ?>" />
  185. <input type="hidden" name="sectionid" value="<?php echo $this->category->sectionid; ?>" />
  186. <input type="hidden" name="task" value="<?php echo $this->lists['task']; ?>" />
  187. <input type="hidden" name="filter_order" value="" />
  188. <input type="hidden" name="filter_order_Dir" value="" />
  189. <input type="hidden" name="limitstart" value="0" />
  190. <input type="hidden" name="viewcache" value="0" />
  191. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement