[mythtv-users] can't change keybindings in mythtv 0.16

Tim Fenn fenn at stanford.edu
Sat Jan 29 22:31:59 EST 2005


On Wed, Jan 19, 2005 at 11:12:02PM -0800, Tim Fenn wrote:
> 
> In short, I can't seem to change the keybindings in mythtv via mythweb
> (FC3, ATrpms mythtv-0.16-82.2.rhfc3.at) - they always reset to the
> default settings.  Has anyone found a solution/workaround to this?
> 

I've actually had the time to take a look at this, and right off I
should say this is my first dive into SQL, so chances are my solution
is a total hackjob that won't work for anyone else.

That disclaimer aside, I've attached a diff of what I changed in the
settings_keys.php in order to get it to work properly.  In short, it
required fixing the hostname as returned from SQL queries (so the
hostname was something like "foo.bar.com" instead of "foo_bar_com").

Hope its helpful.

Regards,
Tim

-- 
Morals?  I eat communism and $h!t America, brother.  --Seanbaby
-------------- next part --------------
--- settings_keys.php.orig	2004-08-09 21:15:32.000000000 -0700
+++ settings_keys.php	2005-01-29 19:23:44.211039757 -0800
@@ -21,6 +21,7 @@
             if (preg_match('/^jump:([\\w_\/]+):(\\w+)$/', $key, $matches)) {
                 list($match, $dest, $host) = $matches;
                 $dest = str_replace("_", " ", $dest);
+		$host = str_replace("_", ".", $host);
                 $usehost = $host;
                 $query = 'UPDATE jumppoints SET keylist='.escape($_POST[$key]).' WHERE destination='.escape($dest).' AND hostname='.escape($host).';';
                 $result = mysql_query($query)
@@ -28,6 +29,7 @@
             }
             elseif (preg_match('/^key:([\\w_\/]+):(\\w+):(\\w+)$/', $key, $matches)) {
                 list($match, $context, $action, $host) = $matches;
+		$host = str_replace("_", ".", $host);
                 $usehost = $host;
                 $context = str_replace("_", " ", $context);
                 $query = 'UPDATE keybindings SET keylist='.escape($_POST[$key]).' WHERE context='.escape($context).' AND action='.escape($action).' AND hostname='.escape($host).';';


More information about the mythtv-users mailing list