Solved

PHP Current link code

Posted on 2014-12-22
9
107 Views
Last Modified: 2014-12-23
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

0
Comment
Question by:johandrex
  • 4
  • 3
  • 2
9 Comments
 
LVL 58

Expert Comment

by:Gary
Comment Utility
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

0
 

Author Comment

by:johandrex
Comment Utility
It works but the page number is getting removed
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
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
0
 

Author Comment

by:johandrex
Comment Utility
The url becomes "http://minecraftcommunity.org/?order_by=online_players"
routing? is that the .htaccess
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
Comment Utility
See my amended comment above.
0
 
LVL 9

Expert Comment

by:Brian Tao
Comment Utility
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

0
 

Author Comment

by:johandrex
Comment Utility
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.
0
 
LVL 9

Expert Comment

by:Brian Tao
Comment Utility
Is your first question solved? Why are you asking a totally different question here?
0
 

Author Comment

by:johandrex
Comment Utility
This is how it'll get fixed
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now