Paging in Last Views Tab

9 years 9 months ago #245615 by Mx150
Paging in Last Views Tab was created by Mx150
Hi all,

i added paging in the Last views tab, but it was in the old version. Works nice with cb 1.0 but cannot get the code to work again on version 1.2

Can someone help me to add Paging to the new Version of Last Views Tab?
My Code for the old plugin was:
$database->setQuery( $sql ); 
	    $muh = $database->loadObjectList();
	    $total      = count($muh); 
	    //define pagination parameters
		$limit = JRequest::getVar('limit', 5);
		$limitstart = JRequest::getVar('limitstart', 0);
		jimport( 'joomla.html.pagination' ); 
	    $pageNav = new JPagination($total, $limitstart, $limit);
	    
		$sql = 
				"SELECT " 
			.		"\n v.viewer_id, "
			.		"lastview, "
			.		"\n v.viewscount, c.avatar, c.avatarapproved, c.banned, u.username, u.name "
			.	"\n FROM "
			.		"\n `#__comprofiler_views` v, `#__comprofiler` c, `#__users` u "
			.	"\n WHERE "
			.		"\n v.profile_id = " . $database->getEscaped($user->id)
			.		"\n AND c.id=v.viewer_id "
			.		"\n AND u.id=c.id "
			.		"\n AND c.id NOT IN (" . $database->getEscaped($LVexclusionlist) . ") "
			.	"\n ORDER BY "
			.		"\n v.lastview DESC ";
			//.	"\n LIMIT " . $database->getEscaped($listlimit);		
		$database->setQuery($sql, $limitstart, $limit);
		$lastviews = $database->loadObjectList();
		$viewercount=$total;

		if($tab->description != null) {
			$return .=
					"<div class=\"tab_Description\">"
				.		unHtmlspecialchars(getLangDefinition($tab->description))
				.	"</div>";
		}

		$return = 
			"<table cellpadding=\"0\" cellspacing=\"1\" border=\"0\" width=\"100%\" align=\"center\" style='border: 1px solid #a10000;' >";
		
		$colspan = 0;

Please Log in to join the conversation.

9 years 9 months ago #245664 by Mx150
Replied by Mx150 on topic Paging in Last Views Tab
Can anyone help? krileon maybe?

Iam from germany .. so sorry for my bad english..

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.177 seconds

Facebook Twitter LinkedIn