diff options
author | Erik Dubbelboer <erik@dubbelboer.com> | 2015-03-22 20:25:53 +0300 |
---|---|---|
committer | Erik Dubbelboer <erik@dubbelboer.com> | 2015-03-22 20:35:34 +0300 |
commit | f419e7fb95652b0c429e01d50c32586733face1b (patch) | |
tree | 2b8ea983dc6d90e06fc4c2dd7d255020b707cf22 | |
parent | 5c91646ca2729385de984962f52de70788a452cb (diff) |
Fix #35 and possibly #52v1.2.0
-rw-r--r-- | composer.json | 4 | ||||
-rw-r--r-- | composer.lock | 44 | ||||
-rw-r--r-- | delete.php | 4 | ||||
-rw-r--r-- | edit.php | 2 | ||||
-rw-r--r-- | import.php | 2 | ||||
-rw-r--r-- | includes/common.inc.php | 21 | ||||
-rw-r--r-- | includes/config.sample.inc.php | 13 | ||||
-rw-r--r-- | index.php | 54 | ||||
-rw-r--r-- | info.php | 2 | ||||
-rw-r--r-- | js/index.js | 13 | ||||
-rw-r--r-- | rename.php | 2 | ||||
-rw-r--r-- | view.php | 34 |
12 files changed, 125 insertions, 70 deletions
diff --git a/composer.json b/composer.json index dd19d92..d51d3cc 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "erik-dubbelboer/php-redis-admin", "description": "Simple web interface to manage Redis databases.", - "version": "1.1.2", + "version": "1.2.0", "license": "CC-BY-ND", "homepage": "https://github.com/ErikDubbelboer/phpRedisAdmin", "authors": [ @@ -13,7 +13,7 @@ } ], "require": { - "predis/predis": "0.8.*" + "predis/predis": "1.0.1" }, "minimum-stability": "stable", "target-dir": "ErikDubbelboer/phpRedisAdmin" diff --git a/composer.lock b/composer.lock index 55ba3ee..99da8b2 100644 --- a/composer.lock +++ b/composer.lock @@ -1,35 +1,39 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" + "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" ], - "hash": "81de6835a02ee54ae5d87ce2b395ba6e", + "hash": "e0695856c109266b2eabff6d53d879c0", "packages": [ { "name": "predis/predis", - "version": "v0.8.3", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/nrk/predis.git", - "reference": "v0.8.3" + "reference": "7a170b3d8123c556597b4fbdb88631f99de180c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nrk/predis/zipball/v0.8.3", - "reference": "v0.8.3", + "url": "https://api.github.com/repos/nrk/predis/zipball/7a170b3d8123c556597b4fbdb88631f99de180c2", + "reference": "7a170b3d8123c556597b4fbdb88631f99de180c2", "shasum": "" }, "require": { "php": ">=5.3.2" }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, "suggest": { "ext-curl": "Allows access to Webdis when paired with phpiredis", "ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol" }, "type": "library", "autoload": { - "psr-0": { - "Predis": "lib/" + "psr-4": { + "Predis\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -50,23 +54,15 @@ "predis", "redis" ], - "time": "2013-02-18 14:03:45" + "time": "2015-01-02 12:51:34" } ], - "packages-dev": [ - - ], - "aliases": [ - - ], + "packages-dev": [], + "aliases": [], "minimum-stability": "stable", - "stability-flags": [ - - ], - "platform": [ - - ], - "platform-dev": [ - - ] + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] } @@ -46,7 +46,7 @@ if (isset($_GET['key'])) { } - die('?view&s='.$server['id'].'&key='.urlencode($_GET['key'])); + die('?view&s='.$server['id'].'&d='.$server['db'].'&key='.urlencode($_GET['key'])); } @@ -57,7 +57,7 @@ if (isset($_GET['tree'])) { $redis->del($key); } - die('?view&s='.$server['id']); + die('?view&s='.$server['id'].'&d='.$server['db']); } ?> @@ -86,7 +86,7 @@ if (isset($_POST['type'], $_POST['key'], $_POST['value'])) { ?> <script> - top.location.href = top.location.pathname+'?view&s=<?php echo $server['id']?>&key=<?php echo urlencode($_POST['key'])?>'; + top.location.href = top.location.pathname+'?view&s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&key=<?php echo urlencode($_POST['key'])?>'; </script> <?php @@ -73,7 +73,7 @@ if (isset($_POST['commands'])) { ?> <script> - top.location.href = top.location.pathname+'?overview&s=<?php echo $server['id']?>'; + top.location.href = top.location.pathname+'?overview&s=<?php echo $server['id']?>&d=<?php echo $server['db']?>'; </script> <?php diff --git a/includes/common.inc.php b/includes/common.inc.php index d5f2305..0d45753 100644 --- a/includes/common.inc.php +++ b/includes/common.inc.php @@ -40,8 +40,6 @@ if (isset($config['login'])) { } - - if (isset($login['servers'])) { $i = current($login['servers']); } else { @@ -53,8 +51,8 @@ if (isset($_GET['s']) && is_numeric($_GET['s']) && ($_GET['s'] < count($config[' $i = $_GET['s']; } -$server = $config['servers'][$i]; -$server['id'] = $i; +$server = $config['servers'][$i]; +$server['id'] = $i; $server['charset'] = isset($server['charset']) && $server['charset'] ? $server['charset'] : false; @@ -75,9 +73,14 @@ if (isset($login, $login['servers'])) { if (!isset($server['db'])) { - $server['db'] = 0; + if (isset($_GET['d']) && is_numeric($_GET['d'])) { + $server['db'] = $_GET['d']; + } else { + $server['db'] = 0; + } } + if (!isset($server['filter'])) { $server['filter'] = '*'; } @@ -94,6 +97,14 @@ if (!isset($server['seperator'])) { $server['seperator'] = $config['seperator']; } +if (!isset($server['keys'])) { + $server['keys'] = $config['keys']; +} + +if (!isset($server['scansize'])) { + $server['scansize'] = $config['scansize']; +} + // Setup a connection to Redis. $redis = !$server['port'] ? new Predis\Client($server['host']) : new Predis\Client('tcp://'.$server['host'].':'.$server['port']); try { diff --git a/includes/config.sample.inc.php b/includes/config.sample.inc.php index b132bed..9455e67 100644 --- a/includes/config.sample.inc.php +++ b/includes/config.sample.inc.php @@ -24,9 +24,11 @@ $config = array( 'port' => 6379, 'db' => 1, // Optional database number, see http://redis.io/commands/select 'filter' => 'something:*', // Show only parts of database for speed or security reasons. - 'seperator' => '/', // Use a different seperator on this database. + 'seperator' => '/', // Use a different seperator on this database (default uses config default). 'flush' => false, // Set to true to enable the flushdb button for this instance. 'charset' => 'cp1251', // Keys and values are stored in redis using this encoding (default utf-8). + 'keys' => false, // Use the old KEYS command instead of SCAN to fetch all keys for this server (default uses config default). + 'scansize' => 1000 // How many entries to fetch using each SCAN command for this server (default uses config default). ),*/ ), @@ -55,7 +57,14 @@ $config = array( // You can ignore settings below this point. 'maxkeylen' => 100, - 'count_elements_page' => 100 + 'count_elements_page' => 100, + + + // Use the old KEYS command instead of SCAN to fetch all keys. + 'keys' => false, + + // How many entries to fetch using each SCAN command. + 'scansize' => 1000 ); ?> @@ -4,7 +4,23 @@ require_once 'includes/common.inc.php'; if($redis) { - $keys = $redis->keys($server['filter']); + if (!empty($server['keys'])) { + $keys = $redis->keys($server['filter']); + } else { + $next = 0; + $keys = array(); + + while (true) { + $r = $redis->scan($next, 'MATCH', $server['filter'], 'COUNT', $server['scansize']); + + $next = $r[0]; + $keys = array_merge($keys, $r[1]); + + if ($next == 0) { + break; + } + } + } sort($keys); @@ -83,7 +99,7 @@ if($redis) { ?> <li<?php echo empty($class) ? '' : ' class="'.implode(' ', $class).'"'?>> - <a href="?view&s=<?php echo $server['id']?>&key=<?php echo urlencode($fullkey)?>"><?php echo format_html($name)?><?php if ($len !== false) { ?><span class="info">(<?php echo $len?>)</span><?php } ?></a> + <a href="?view&s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&key=<?php echo urlencode($fullkey)?>"><?php echo format_html($name)?><?php if ($len !== false) { ?><span class="info">(<?php echo $len?>)</span><?php } ?></a> </li> <?php } @@ -93,7 +109,7 @@ if($redis) { ?> <li class="folder<?php echo ($fullkey === '') ? '' : ' collapsed'?><?php echo $islast ? ' last' : ''?>"> <div class="icon"><?php echo format_html($name)?> <span class="info">(<?php echo count($item)?>)</span> - <?php if ($fullkey !== '') { ?><a href="delete.php?s=<?php echo $server['id']?>&tree=<?php echo urlencode($fullkey)?>:" class="deltree"><img src="images/delete.png" width="10" height="10" title="Delete tree" alt="[X]"></a><?php } ?> + <?php if ($fullkey !== '') { ?><a href="delete.php?s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&tree=<?php echo urlencode($fullkey)?>:" class="deltree"><img src="images/delete.png" width="10" height="10" title="Delete tree" alt="[X]"></a><?php } ?> </div><ul> <?php @@ -144,7 +160,7 @@ require 'includes/header.inc.php'; ?> <div id="sidebar"> -<h1 class="logo"><a href="?overview&s=<?php echo $server['id']?>">phpRedisAdmin</a></h1> +<h1 class="logo"><a href="?overview&s=<?php echo $server['id']?>&d=<?php echo $server['db']?>">phpRedisAdmin</a></h1> <p> <select id="server"> @@ -152,24 +168,35 @@ require 'includes/header.inc.php'; <option value="<?php echo $i?>" <?php echo ($server['id'] == $i) ? 'selected="selected"' : ''?>><?php echo isset($srv['name']) ? format_html($srv['name']) : $srv['host'].':'.$srv['port']?></option> <?php } ?> </select> -</p> -<?php if($redis): ?> +<?php if($redis) { ?> + +<?php +$databases = $redis->config('GET', 'databases'); +$databases = $databases['databases']; +if ($databases > 1) { ?> + <select id="database"> + <?php for ($d = 0; $d < $databases; ++$d) { ?> + <option value="<?php echo $d?>" <?php echo ($server['db'] == $d) ? 'selected="selected"' : ''?>>database <?php echo $d?></option> + <?php } ?> + </select> +<?php } ?> +</p> <p> <?php if (isset($login)) { ?> <a href="logout.php"><img src="images/logout.png" width="16" height="16" title="Logout" alt="[L]"></a> <?php } ?> -<a href="?info&s=<?php echo $server['id']?>"><img src="images/info.png" width="16" height="16" title="Info" alt="[I]"></a> -<a href="?export&s=<?php echo $server['id']?>"><img src="images/export.png" width="16" height="16" title="Export" alt="[E]"></a> -<a href="?import&s=<?php echo $server['id']?>"><img src="images/import.png" width="16" height="16" title="Import" alt="[I]"></a> +<a href="?info&s=<?php echo $server['id']?>&d=<?php echo $server['db']?>"><img src="images/info.png" width="16" height="16" title="Info" alt="[I]"></a> +<a href="?export&s=<?php echo $server['id']?>&d=<?php echo $server['db']?>"><img src="images/export.png" width="16" height="16" title="Export" alt="[E]"></a> +<a href="?import&s=<?php echo $server['id']?>&d=<?php echo $server['db']?>"><img src="images/import.png" width="16" height="16" title="Import" alt="[I]"></a> <?php if (isset($server['flush']) && $server['flush']) { ?> -<a href="?flush&s=<?php echo $server['id']?>" id="flush"><img src="images/flush.png" width="16" height="16" title="Flush" alt="[F]"></a> +<a href="?flush&s=<?php echo $server['id']?>&d=<?php echo $server['db']?>" id="flush"><img src="images/flush.png" width="16" height="16" title="Flush" alt="[F]"></a> <?php } ?> </p> <p> -<a href="?edit&s=<?php echo $server['id']?>" class="add">Add another key</a> +<a href="?edit&s=<?php echo $server['id']?>&d=<?php echo $server['db']?>" class="add">Add another key</a> </p> <p> @@ -187,9 +214,10 @@ require 'includes/header.inc.php'; </ul> </div><!-- #keys --> -<?php else: ?> +<?php } else { ?> +</p> <div style="color:red">Can't connect to this server</div> -<?php endif; ?> +<?php } ?> <div id="frame"> <iframe src="<?php echo format_html($iframe)?>" id="iframe" frameborder="0" scrolling="0"></iframe> @@ -31,7 +31,7 @@ require 'includes/header.inc.php'; <?php if (method_exists($redis, 'resetStat')) { ?> <p> -<a href="?reset&s=<?php echo $server['id']?>" class="reset">Reset usage statistics</a> +<a href="?reset&s=<?php echo $server['id']?>&d=<?php echo $server['db']?>" class="reset">Reset usage statistics</a> </p> <?php } ?> diff --git a/js/index.js b/js/index.js index 545add0..1fbb755 100644 --- a/js/index.js +++ b/js/index.js @@ -49,6 +49,17 @@ $(function() { }); + $('#database').change(function(e) { + if (location.href.indexOf('?') == -1) { + location.href = location.href+'?d='+e.target.value; + } else if (location.href.indexOf('&d=') == -1) { + location.href = location.href+'&d='+e.target.value; + } else { + location.href = location.href.replace(/d=[0-9]*/, 'd='+e.target.value); + } + }); + + $('li.current').parents('li.folder').removeClass('collapsed'); $('li.folder').click(function(e) { @@ -71,7 +82,7 @@ $(function() { $('#btn_server_filter').click(function() { var filter = $('#server_filter').val(); - location.href = top.location.pathname + '?overview&s=' + $('#server').val() + '&filter=' + filter; + location.href = top.location.pathname + '?overview&s=' + $('#server').val() + '&d=' + ($('#database').val() || '') + '&filter=' + filter; }); $('#server_filter').keydown(function(e){ @@ -18,7 +18,7 @@ if (isset($_POST['old'], $_POST['key'])) { ?> <script> - top.location.href = top.location.pathname+'?view&s=<?php echo $server['id']?>&key=<?php echo urlencode($_POST['key'])?>'; + top.location.href = top.location.pathname+'?view&s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&key=<?php echo urlencode($_POST['key'])?>'; </script> <?php @@ -32,9 +32,9 @@ $page_num_request = $page_num_request === 0 ? 1 : $page_num_request; ?> <h2><?php echo format_html($_GET['key'])?> <?php if ($exists) { ?> - <a href="rename.php?s=<?php echo $server['id']?>&key=<?php echo urlencode($_GET['key'])?>"><img src="images/edit.png" width="16" height="16" title="Rename" alt="[R]"></a> - <a href="delete.php?s=<?php echo $server['id']?>&key=<?php echo urlencode($_GET['key'])?>" class="delkey"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a> - <a href="export.php?s=<?php echo $server['id']?>&key=<?php echo urlencode($_GET['key'])?>"><img src="images/export.png" width="16" height="16" title="Export" alt="[E]"></a> + <a href="rename.php?s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&key=<?php echo urlencode($_GET['key'])?>"><img src="images/edit.png" width="16" height="16" title="Rename" alt="[R]"></a> + <a href="delete.php?s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&key=<?php echo urlencode($_GET['key'])?>" class="delkey"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a> + <a href="export.php?s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&key=<?php echo urlencode($_GET['key'])?>"><img src="images/export.png" width="16" height="16" title="Export" alt="[E]"></a> <?php } ?> </h2> <?php @@ -95,7 +95,7 @@ if (isset($values) && ($count_elements_page !== false)) { <tr><td><div>Type:</div></td><td><div><?php echo format_html($type)?></div></td></tr> -<tr><td><div><abbr title="Time To Live">TTL</abbr>:</div></td><td><div><?php echo ($ttl == -1) ? 'does not expire' : $ttl?> <a href="ttl.php?s=<?php echo $server['id']?>&key=<?php echo urlencode($_GET['key'])?>&ttl=<?php echo $ttl?>"><img src="images/edit.png" width="16" height="16" title="Edit TTL" alt="[E]" class="imgbut"></a></div></td></tr> +<tr><td><div><abbr title="Time To Live">TTL</abbr>:</div></td><td><div><?php echo ($ttl == -1) ? 'does not expire' : $ttl?> <a href="ttl.php?s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&key=<?php echo urlencode($_GET['key'])?>&ttl=<?php echo $ttl?>"><img src="images/edit.png" width="16" height="16" title="Edit TTL" alt="[E]" class="imgbut"></a></div></td></tr> <?php if (!is_null($encoding)) { ?> <tr><td><div>Encoding:</div></td><td><div><?php echo format_html($encoding)?></div></td></tr> @@ -173,9 +173,9 @@ if ($type == 'string') { ?> <table> <tr><td><div><?php echo nl2br(format_html($value))?></div></td><td><div> - <a href="edit.php?s=<?php echo $server['id']?>&type=string&key=<?php echo urlencode($_GET['key'])?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a> + <a href="edit.php?s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&type=string&key=<?php echo urlencode($_GET['key'])?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a> </div></td><td><div> - <a href="delete.php?s=<?php echo $server['id']?>&type=string&key=<?php echo urlencode($_GET['key'])?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a> + <a href="delete.php?s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&type=string&key=<?php echo urlencode($_GET['key'])?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a> </div></td></tr> </table> @@ -191,9 +191,9 @@ else if ($type == 'hash') { ?> <?php foreach ($values as $hkey => $value) { ?> <tr <?php echo $alt ? 'class="alt"' : ''?>><td><div><?php echo format_html($hkey)?></div></td><td><div><?php echo nl2br(format_html($value))?></div></td><td><div> - <a href="edit.php?s=<?php echo $server['id']?>&type=hash&key=<?php echo urlencode($_GET['key'])?>&hkey=<?php echo urlencode($hkey)?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a> + <a href="edit.php?s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&type=hash&key=<?php echo urlencode($_GET['key'])?>&hkey=<?php echo urlencode($hkey)?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a> </div></td><td><div> - <a href="delete.php?s=<?php echo $server['id']?>&type=hash&key=<?php echo urlencode($_GET['key'])?>&hkey=<?php echo urlencode($hkey)?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a> + <a href="delete.php?s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&type=hash&key=<?php echo urlencode($_GET['key'])?>&hkey=<?php echo urlencode($hkey)?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a> </div></td></tr> <?php $alt = !$alt; } ?> @@ -219,9 +219,9 @@ else if ($type == 'list') { ?> $value = $redis->lIndex($_GET['key'], $i); ?> <tr <?php echo $alt ? 'class="alt"' : ''?>><td><div><?php echo $i?></div></td><td><div><?php echo nl2br(format_html($value))?></div></td><td><div> - <a href="edit.php?s=<?php echo $server['id']?>&type=list&key=<?php echo urlencode($_GET['key'])?>&index=<?php echo $i?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a> + <a href="edit.php?s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&type=list&key=<?php echo urlencode($_GET['key'])?>&index=<?php echo $i?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a> </div></td><td><div> - <a href="delete.php?s=<?php echo $server['id']?>&type=list&key=<?php echo urlencode($_GET['key'])?>&index=<?php echo $i?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a> + <a href="delete.php?s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&type=list&key=<?php echo urlencode($_GET['key'])?>&index=<?php echo $i?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a> </div></td></tr> <?php $alt = !$alt; } ?> @@ -237,12 +237,12 @@ else if ($type == 'set') { <tr><th><div>Value</div></th><th><div> </div></th><th><div> </div></th></tr> <?php foreach ($values as $value) { - $display_value = $redis->exists($value) ? '<a href="view.php?s='.$server['id'].'&key='.urlencode($value).'">'.nl2br(format_html($value)).'</a>' : nl2br(format_html($value)); + $display_value = $redis->exists($value) ? '<a href="view.php?s='.$server['id'].'&d='.$server['db'].'&key='.urlencode($value).'">'.nl2br(format_html($value)).'</a>' : nl2br(format_html($value)); ?> <tr <?php echo $alt ? 'class="alt"' : ''?>><td><div><?php echo $display_value ?></div></td><td><div> - <a href="edit.php?s=<?php echo $server['id']?>&type=set&key=<?php echo urlencode($_GET['key'])?>&value=<?php echo urlencode($value)?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a> + <a href="edit.php?s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&type=set&key=<?php echo urlencode($_GET['key'])?>&value=<?php echo urlencode($value)?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a> </div></td><td><div> - <a href="delete.php?s=<?php echo $server['id']?>&type=set&key=<?php echo urlencode($_GET['key'])?>&value=<?php echo urlencode($value)?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a> + <a href="delete.php?s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&type=set&key=<?php echo urlencode($_GET['key'])?>&value=<?php echo urlencode($value)?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a> </div></td></tr> <?php $alt = !$alt; } ?> @@ -258,11 +258,11 @@ else if ($type == 'zset') { ?> <?php foreach ($values as $value) { $score = $redis->zScore($_GET['key'], $value); - $display_value = $redis->exists($value) ? '<a href="view.php?s='.$server['id'].'&key='.urlencode($value).'">'.nl2br(format_html($value)).'</a>' : nl2br(format_html($value)); + $display_value = $redis->exists($value) ? '<a href="view.php?s='.$server['id'].'&d='.$server['db'].'&key='.urlencode($value).'">'.nl2br(format_html($value)).'</a>' : nl2br(format_html($value)); ?> <tr <?php echo $alt ? 'class="alt"' : ''?>><td><div><?php echo $score?></div></td><td><div><?php echo $display_value ?></div></td><td><div> - <a href="edit.php?s=<?php echo $server['id']?>&type=zset&key=<?php echo urlencode($_GET['key'])?>&score=<?php echo $score?>&value=<?php echo urlencode($value)?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a> - <a href="delete.php?s=<?php echo $server['id']?>&type=zset&key=<?php echo urlencode($_GET['key'])?>&value=<?php echo urlencode($value)?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a> + <a href="edit.php?s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&type=zset&key=<?php echo urlencode($_GET['key'])?>&score=<?php echo $score?>&value=<?php echo urlencode($value)?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a> + <a href="delete.php?s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&type=zset&key=<?php echo urlencode($_GET['key'])?>&value=<?php echo urlencode($value)?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a> </div></td></tr> <?php $alt = !$alt; } ?> @@ -272,7 +272,7 @@ if ($type != 'string') { ?> </table> <p> - <a href="edit.php?s=<?php echo $server['id']?>&type=<?php echo $type?>&key=<?php echo urlencode($_GET['key'])?>" class="add">Add another value</a> + <a href="edit.php?s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&type=<?php echo $type?>&key=<?php echo urlencode($_GET['key'])?>" class="add">Add another value</a> </p> <?php } |