biow0lf / evedev-kb

Automatically exported from code.google.com/p/evedev-kb
1 stars 0 forks source link

When "Show Kills Only" is selected for summary table, links are wrong. #197

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Go to Admin->options select "Show Kills Only" for summary tables.
2. Go to main page, mouse over summary table links, notice they have bad links.

What is the expected output? What do you see instead?
expect <url>/home.php?a={whatev}
see <url>/{whatev}

What version of the board are you using? e.g. 3.2.3 or 4.0 revision
4b53033f8a1b.
4.1

What version of PHP and MySQL does the board run on?
Any

Please provide any additional information below.

Talked with paul about this in IRC, this is just a reminder.

--- 
/var/www/vhosts/rotekapelle.com/kb/evedev-kb/common/includes/class.killsummaryta
blepublic.php       2011-12-27 19:01:25.000000000 +0000
+++ class.killsummarytablepublic.php    2011-12-27 19:27:45.000000000 +0000
@@ -115,25 +115,35 @@
             $this->getkills();
             $entry = &$this->entry;
         }
-
                // Don't count noobships.
                $num = count($entry) - 1;
                $summary = array();
                $count = 0;
+
+               $args = edkURI::parseURI();
+               if (edkURI::getArg('scl_id')) {
+                       foreach ($args as $key => $value) {
+                               if($value[0] == 'scl_id') {
+                                       unset($args[$key]);
+                                       break;
+                               }
+                       }
+               }
+               $qrystring = edkURI::build($args);
+               $clearfilter = $qrystring;
+               if(strpos($qrystring, '?') === false) {
+                       $qrystring .= "?";
+               } else {
+                       $qrystring .= "&amp;";
+               }
+
                foreach ($entry as $k => $v)
                {
                        if($v['id'] == 3) continue;
                        $v['break'] = 0;
                        if($_GET['scl_id'] && $_GET['scl_id'] == $v['id']) $v['hl'] = 1;
                        else $v['hl'] = 0;
-                       $qrystring = preg_replace("/&scl_id=([0-9]?[0-9])/", 
"", $_SERVER['QUERY_STRING']);
-                       $qrystring = preg_replace("/&page=([0-9]?[0-9])/", "", 
$qrystring);
-                       $qrystring = preg_replace("/&/", "&amp;", $qrystring);
-                       if ($this->view)
-                       {
-                               $qrystring .= '&view='.$this->view;
-                       }
-                       $v['url'] = $querystring;
+                       $v['qry'] = $qrystring;
                        $v['kisk'] = round($v['kills_isk']/1000000, 2);
                        $v['name'] = $k;

@@ -159,11 +169,8 @@
                        $smarty->assign('kcount', $this->tkcount);
                }

-               if (!empty($_GET['scl_id']))
-               {
-                       $qrystring = preg_replace("/&scl_id=([0-9]?[0-9])/", 
"", '?'.$_SERVER['QUERY_STRING']);
-                       $qrystring = preg_replace("/&/", "&amp;", $qrystring);
-                       $smarty->assign('clearfilter',$qrystring);
+               if (edkURI::getArg('scl_id')){
+                       $smarty->assign('clearfilter',$clearfilter);
                }

                $html .= $smarty->fetch(get_tpl('summarytable'));

Original issue reported on code.google.com by jjl...@gmail.com on 27 Dec 2011 at 7:31

GoogleCodeExporter commented 9 years ago
Note the diff above just patches the newer syntax from 
class.killsummarytable.php into class.killsummarytablepublic.php.

Original comment by jjl...@gmail.com on 27 Dec 2011 at 7:31

GoogleCodeExporter commented 9 years ago
This issue was closed by revision daf7f2b9969c.

Original comment by kovellia on 22 Jan 2012 at 2:25