Link to home
Start Free TrialLog in
Avatar of Johandrex
Johandrex

asked on

PHP Current link code

Hello, If a user were on this link http://minecraftcommunity.org/servers/2 and pressed on a link I would like him to go to "http://minecraftcommunity.org/servers/2&order_by=online_players" so I wonder how I would change the code below to add "/servers/(nr)


						<li><a href="<?php echo $this->pagination->link . $order_by_link . '&order_by=online_players' ?>"><?php echo $language['misc']['order_by_players']; ?></a></li>

Open in new window

Avatar of Gary
Gary
Flag of Ireland image

If they are staying on the same page then all you need is

<li><a href="?order_by=online_players"><?php echo $language['misc']['order_by_players']; ?></a></li>

Open in new window

Avatar of Johandrex
Johandrex

ASKER

It works but the page number is getting removed
Do you mean the number /2 in the url?
It shouldn't remove anything and just append the querystring onto the url.
When you hover the link what do you see?

Are you using routing? It's possible your routing is removing it
The url becomes "http://minecraftcommunity.org/?order_by=online_players"
routing? is that the .htaccess
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
can try this:
<li><a href="<?php echo '/servers/' . $this->pagination->cur_page . '&order_by=online_players'; ?>"><?php echo $language['misc']['order_by_players']; ?></a></li>

Open in new window

I need to get this code
<?php 

if(isset($_GET['page']) && (($_GET['page'] == 'category' && $category_exists) || $_GET['page'] == 'servers')) {
	include 'widgets/servers_filter.php';
}?>

Open in new window


into this code
<?php
initiate_html_columns();

echo '<hr><h3><b><center>' . $language['headers']['premium_servers'] . '</h3></b></center><hr>';

/* Initiate the servers list class */
$servers = new Servers;

/* Make it so it will display only the active and the servers which are not private */
$servers->additional_where("AND `private` = '0' AND `active` = '1' AND `highlight` = '1'");

/* Remove pagination */
$servers->remove_pagination();

/* Try and display the server list */
$servers->display();

/* Display any notification if there are any ( no servers ) */
display_notifications();

/*FILTER*/
$servers->filters_display();
/* NON SPONSORED SERVERS DOWN BELOW! */
$servers = new Servers;
$servers->additional_where("AND `private` = '0' AND `active` = '1' AND `highlight` = '0'");
$servers->display();
display_notifications();
$servers->display_pagination('servers');
?>

Open in new window

before the "$servers->display();" but whenever I do the website isn't showing up.
Is your first question solved? Why are you asking a totally different question here?
This is how it'll get fixed