pusatdata

Joomla - Modif List Category ada Introtext dan Thumbnail

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