Author Topic: [SOLVED] Remove "Start, Prev, Next, End" text in Page Navigation  (Read 11419 times)

lipes

  • Full Member
  • ***
  • Posts: 720
Re: Remove "Start, Prev, Next, End" text in Page Navigation
« Reply #15 on: December 15, 2010, 21:49:42 pm »
yep.. I tryed "Content - Page Navigation Titles" but I still have the main "Content - Page Navigation" from Joomla
VM V. online: J2.5.14 | VM 2.0.20a | SQL 5.1.70 | PHP 5.3.25

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10365
  • VirtueMart Version: 3+
Re: Remove "Start, Prev, Next, End" text in Page Navigation
« Reply #16 on: December 15, 2010, 21:51:07 pm »
this is NEXT

            <th class="pagenav_next">
               <a href="'. $row->next .'">'
                  . JText::_( 'Next' ) . $pnSpace . JText::_( '&gt' ) .'</a>
            </th>

THEN:

previous

            <th class="pagenav_prev">
               <a href="'. $row->prev .'">'
                  . JText::_( '&lt' ) . $pnSpace . JText::_( 'Prev' ) . '</a>
            </th>








what did you do to the code above to try and change it? It did nothing?
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

lipes

  • Full Member
  • ***
  • Posts: 720
Re: Remove "Start, Prev, Next, End" text in Page Navigation
« Reply #17 on: December 15, 2010, 22:24:08 pm »
pagenavigation.php file in /plugins/content/

Code: [Select]
<?php
/**
* @version $Id: pagenavigation.php 14401 2010-01-26 14:10:00Z louis $
* @package Joomla
* @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// no direct access
defined'_JEXEC' ) or die( 'Restricted access' );

$mainframe->registerEvent'onBeforeDisplayContent''plgContentNavigation' );

function 
plgContentNavigation( &$row, &$params$page=)
{
$view JRequest::getCmd('view');

// Get Plugin info
$plugin =& JPluginHelper::getPlugin('content''pagenavigation');

if ($params->get('show_item_navigation') && ($view == 'article'))
{

$html  '';
$db  = & JFactory::getDBO();
$user = & JFactory::getUser();
$nullDate $db->getNullDate();

$date =& JFactory::getDate();
$config  = & JFactory::getConfig();
$now  $date->toMySQL();

$uid  $row->id;
$option  'com_content';
$canPublish $user->authorize('com_content''publish''content''all');

// the following is needed as different menu items types utilise a different param to control ordering
// for Blogs the `orderby_sec` param is the order controlling param
// for Table and List views it is the `orderby` param
$params_list $params->toArray();
if (array_key_exists('orderby_sec'$params_list)) {
$order_method $params->get('orderby_sec''');
} else {
$order_method $params->get('orderby''');
}
// additional check for invalid sort ordering
if ( $order_method == 'front' ) {
$order_method '';
}

// Determine sort order
switch ($order_method)
{
case 'date' :
$orderby 'a.created';
break;

case 'rdate' :
$orderby 'a.created DESC';
break;

case 'alpha' :
$orderby 'a.title';
break;

case 'ralpha' :
$orderby 'a.title DESC';
break;

case 'hits' :
$orderby 'a.hits';
break;

case 'rhits' :
$orderby 'a.hits DESC';
break;

case 'order' :
$orderby 'a.ordering';
break;

case 'author' :
$orderby 'a.created_by_alias, u.name';
break;

case 'rauthor' :
$orderby 'a.created_by_alias DESC, u.name DESC';
break;

case 'front' :
$orderby 'f.ordering';
break;

default :
$orderby 'a.ordering';
break;
}

$xwhere ' AND ( a.state = 1 OR a.state = -1 )' .
' AND ( publish_up = '.$db->Quote($nullDate).' OR publish_up <= '.$db->Quote($now).' )' .
' AND ( publish_down = '.$db->Quote($nullDate).' OR publish_down >= '.$db->Quote($now).' )';

// array of articles in same category correctly ordered
$query 'SELECT a.id,'
' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,'
' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug'
' FROM #__content AS a'
' LEFT JOIN #__categories AS cc ON cc.id = a.catid'
' WHERE a.catid = ' . (int) $row->catid
' AND a.state = '. (int) $row->state
. ($canPublish '' ' AND a.access <= ' .(int) $user->get('aid'0))
$xwhere
' ORDER BY '$orderby;
$db->setQuery($query);
$list $db->loadObjectList('id');

// this check needed if incorrect Itemid is given resulting in an incorrect result
if ( !is_array($list) ) {
$list = array();
}

reset($list);

// location of current content item in array list
$location array_search($uidarray_keys($list));

$rows array_values($list);

$row->prev null;
$row->next null;

if ($location ->= 0 {
// the previous content item cannot be in the array position -1
$row->prev $rows[$location -1];
}

if (($location +1) < count($rows)) {
// the next content item cannot be in an array position greater than the number of array postions
$row->next $rows[$location +1];
}

$pnSpace "";
if (JText::_('&lt') || JText::_('&gt')) {
$pnSpace " ";
}

if ($row->prev) {
$row->prev JRoute::_(ContentHelperRoute::getArticleRoute($row->prev->slug$row->prev->catslug));
} else {
$row->prev '';
}

if ($row->next) {
$row->next JRoute::_(ContentHelperRoute::getArticleRoute($row->next->slug$row->next->catslug));
} else {
$row->next '';
}


// output
if ($row->prev || $row->next)
{
$html '
<table align="center" class="pagenav">
<tr>'
;
if ($row->prev)
{
$html .= ''
;
}

if ($row->prev && $row->next)
{
$html .= '
<td width="50">
&nbsp;
</td>'
;
}

if ($row->next)
{
$html .= ''
;
}
$html .= '
</tr>
</table>'
;

// Get the plugin parameters
$pluginParams = new JParameter$plugin->params );
$position   = $pluginParams->get('position'1);

if ($position) {
// display after content
$row->text .= $html;
} else {
// display before content
$row->text $html $row->text;
}
}
}

return ;
}


and pagination.php in /templates/lmpm/html/

Code: [Select]
<?php
/**
 * @version $Id: pagination.php 14401 2010-01-26 14:10:00Z louis $
 * @package Joomla
 * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
 * @license GNU/GPL, see LICENSE.php
 * Joomla! is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

/**
 * This is a file to add template specific chrome to pagination rendering.
 *
 * pagination_list_footer
 *  Input variable $list is an array with offsets:
 *  $list[limit] : int
 *  $list[limitstart] : int
 *  $list[total] : int
 *  $list[limitfield] : string
 *  $list[pagescounter] : string
 *  $list[pageslinks] : string
 *
 * pagination_list_render
 *  Input variable $list is an array with offsets:
 *  $list[all]
 *  [data] : string
 *  [active] : boolean
 *  $list[start]
 *  [data] : string
 *  [active] : boolean
 *  $list[previous]
 *  [data] : string
 *  [active] : boolean
 *  $list[next]
 *  [data] : string
 *  [active] : boolean
 *  $list[end]
 *  [data] : string
 *  [active] : boolean
 *  $list[pages]
 *  [{PAGE}][data] : string
 *  [{PAGE}][active] : boolean
 *
 * pagination_item_active
 *  Input variable $item is an object with fields:
 *  $item->base : integer
 *  $item->link : string
 *  $item->text : string
 *
 * pagination_item_inactive
 *  Input variable $item is an object with fields:
 *  $item->base : integer
 *  $item->link : string
 *  $item->text : string
 *
 * This gives template designers ultimate control over how pagination is rendered.
 *
 * NOTE: If you override pagination_item_active OR pagination_item_inactive you MUST override them both
 */

function pagination_list_footer($list)
{
$html "<div class=\"list-footer\">\n";

$html .= "\n<div class=\"limit\">".JText::_('Display Num').$list['limitfield']."</div>";
$html .= $list['pageslinks'];
$html .= "\n<div class=\"counter\">".$list['pagescounter']."</div>";

$html .= "\n<input type=\"hidden\" name=\"limitstart\" value=\"".$list['limitstart']."\" />";
$html .= "\n</div>";

return $html;
}

function 
pagination_list_render($list)
{
// Initialize variables
$html "<span class=\"pagination\">";
$html .= '<span>&laquo;</span>'.$list['start']['data'];
$html .= $list['previous']['data'];

foreach( $list['pages'] as $page )
{
if($page['data']['active']) {
$html .= '<strong>';
}

$html .= $page['data'];

if($page['data']['active']) {
$html .= '</strong>';
}
}

$html .= $list['next']['data'];
$html .= $list['end']['data'];
$html .= '<span>&raquo;</span>';

$html .= "</span>";
return $html;
}

function 
pagination_item_active(&$item) {
return "<a href=\"".$item->link."\" title=\"".$item->text."\">".$item->text."</a>";
}

function 
pagination_item_inactive(&$item) {
return "<span>".$item->text."</span>";
}
?>
VM V. online: J2.5.14 | VM 2.0.20a | SQL 5.1.70 | PHP 5.3.25

lipes

  • Full Member
  • ***
  • Posts: 720
Re: [SOLVED] Remove "Start, Prev, Next, End" text in Page Navigation
« Reply #18 on: December 16, 2010, 01:39:22 am »
Ufff.... FINALY FOUND THE SOLUTION!!
had nothing to do with the Joomla files but only with Virtuemart files....

go to:
/administrator/components/com_virtuemart/classes/pageNavigation.class.php

and then change:

Code: [Select]
 /**
   * @return string The html links for pages, eg, previous, next, 1 2 3 ... x
   */
  function getPagesLinks($link='') {
    global $VM_LANG;
    
    $displayed_pages = 10;
    $total_pages = ceil( $this->total / $this->limit );
    $this_page = ceil( ($this->limitstart+1) / $this->limit );
    $start_loop = (floor(($this_page-1)/$displayed_pages))*$displayed_pages+1;
    if ($start_loop + $displayed_pages - 1 < $total_pages) {
      $stop_loop = $start_loop + $displayed_pages - 1;
    } else {
      $stop_loop = $total_pages;
    }
    $html = '<ul class="pagination">';
    if ($this_page > 1) {
      $page = ($this_page - 2) * $this->limit;
      if( $link != '') {
        $html .= "\n<li><a href=\"".vmRoute($link.'&limit='.$this->limit.'&limitstart=0')."\" class=\"pagenav\" title=\"".$VM_LANG->_('PN_START')."\">&laquo;&laquo;</a></li>";
        $html .= "\n<li><a href=\"".vmRoute($link.'&limit='.$this->limit.'&limitstart='.$page)."\" class=\"pagenav\" title=\"".$VM_LANG->_('PN_PREVIOUS')."\">&laquo; </a></li>";
      } else {
        $html .= "\n<li><a href=\"#beg\" class=\"pagenav\" title=\"".$VM_LANG->_('PN_START')."\" onclick=\"javascript: document.adminForm.limitstart.value=0; document.adminForm.submit();return false;\">&laquo;&laquo; </a></li>";
        $html .= "\n<li><a href=\"#prev\" class=\"pagenav\" title=\"".$VM_LANG->_('PN_PREVIOUS')."\" onclick=\"javascript: document.adminForm.limitstart.value=$page; document.adminForm.submit();return false;\">&laquo; </a></li>";
      }
    } else {
      $html .= "\n<li><span class=\"pagenav\">&laquo;&laquo; </span></li>";
      $html .= "\n<li><span class=\"pagenav\">&laquo; </span></li>";
    }

    for ($i=$start_loop; $i <= $stop_loop; $i++) {
      $page = ($i - 1) * $this->limit;
      if ($i == $this_page) {
        $html .= "\n<li><span class=\"pagenav\"> $i </span></li>";
      } else {
        if( $link != '') {
          $html .= "\n<li><a href=\"".vmRoute($link.'&limit='.$this->limit.'&limitstart='.$page)."\" class=\"pagenav\"><strong>$i</strong></a></li>";
        } else {
          $html .= "\n<li><a href=\"#$i\" class=\"pagenav\" onclick=\"javascript: document.adminForm.limitstart.value=$page; document.adminForm.submit();return false;\"><strong>$i</strong></a></li>";
        }
      }
    }

    if ($this_page < $total_pages) {
      $page = $this_page * $this->limit;
      $end_page = ($total_pages-1) * $this->limit;
      if( $link != '') {
        $html .= "\n<li><a href=\"".vmRoute($link.'&limit='.$this->limit.'&limitstart='.$page)."\" class=\"pagenav\" title=\"".$VM_LANG->_('PN_NEXT')."\">  &raquo;</a></li>";
        $html .= "\n<li><a href=\"".vmRoute($link.'&limit='.$this->limit.'&limitstart='.$end_page)."\" class=\"pagenav\" title=\"".$VM_LANG->_('PN_END')."\"> &raquo;&raquo;</a></li>";
      } else {
        $html .= "\n<li><a href=\"#next\" class=\"pagenav\" title=\"".$VM_LANG->_('PN_NEXT')."\" onclick=\"javascript: document.adminForm.limitstart.value=$page; document.adminForm.submit();return false;\"> &raquo;</a></li>";
        $html .= "\n<li><a href=\"#end\" class=\"pagenav\" title=\"".$VM_LANG->_('PN_END')."\" onclick=\"javascript: document.adminForm.limitstart.value=$end_page; document.adminForm.submit();return false;\"> &raquo;&raquo;</a></li>";
      }
    } else {
      $html .= "\n<li><span class=\"pagenav\"> &raquo;</span></li>";
      $html .= "\n<li><span class=\"pagenav\"> &raquo;&raquo;</span></li>";
    }
    $html .= "\n</ul>";
    return $html;
  }

  function getListFooter() {
    $html = '<table class="adminlist">';
    if( $this->total > $this->limit || $this->limitstart > 0) {

      $html .= '<tr><th colspan="3">';

      $html .= $this->getPagesLinks();
      $html .= '</th></tr>';
    }
    $html .= '<tr><td nowrap="nowrap" width="48%" align="right">'.$GLOBALS['VM_LANG']->_('PN_DISPLAY_NR').'</td>';
    $html .= '<td>' .$this->getLimitBox() . '</td>';
    $html .= '<td nowrap="nowrap" width="48%" align="left">' . $this->getPagesCounter() . '</td>';
    $html .= '</tr></table>';
   return $html;
  }

this option must be on admin VM backend by default to users choose (on/off)

it works like a charm!
VM V. online: J2.5.14 | VM 2.0.20a | SQL 5.1.70 | PHP 5.3.25

royster13

  • Beginner
  • *
  • Posts: 3
Re: [SOLVED] Remove "Start, Prev, Next, End" text in Page Navigation
« Reply #19 on: January 05, 2011, 01:10:44 am »
What did you change?...

elmar

  • Beginner
  • *
  • Posts: 1
Re: [SOLVED] Remove "Start, Prev, Next, End" text in Page Navigation
« Reply #20 on: March 29, 2011, 16:55:08 pm »
I changed pageNavigation.class so now it looks like: «« « 1 2 » »»
perfect but is it possible to remove the  «« « 1 2 » »» in Page Navigation from the top of the page,
but leave it at the bottom of that page?