Ticket #1930: patch-mythweb-sort-subchannel

File patch-mythweb-sort-subchannel, 870 bytes (added by p-mtv@…, 15 years ago)

patch for mythweb includes/channels.php to sort on atsc subchannel numbers

Line 
1--- channels.php.orig   2006-06-08 00:47:17.000000000 -0700
2+++ channels.php        2006-06-08 00:38:51.000000000 -0700
3@@ -33,8 +33,13 @@
4         $sql .= ' channel.visible=1';
5     // Sort.
6         $sql .= ' ORDER BY '
7-                .(sortby_channum ? '' : 'channel.callsign, ')
8-                .'(channel.channum + 0), channel.chanid';
9+// gpz 060608
10+//                .(sortby_channum ? '' : 'channel.callsign, ')
11+//                .'(channel.channum + 0), channel.chanid';
12+                .(sortby_channum ?
13+                       '(channel.channum + 0), (SUBSTRING(channel.channum,INSTR(REPLACE(REPLACE(channel.channum,\'.\',\'-\'),\'_\',\'-\'),\'-\')+1)+0), channel.callsign,' :
14+                       'channel.callsign,  (channel.channum + 0),')
15+                .' channel.chanid';
16     // Query
17         $result = mysql_query($sql)
18             or trigger_error('SQL Error: '.mysql_error(), FATAL);