MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Main Features (talk, share your ideas, get support) » Watch / Listen Media » MyTV - Engine 0.2 » Tips and Tricks


Tips and Tricks Post your Tips and Tricks in here.

Reply
 
Thread Tools Display Modes
Old 2004-06-13, 19:41   #1 (permalink)
Anonymous
Guest
 
Posts: n/a


Default How to add Channel numbers to tvdatabase4 via a PHP page...

I got tired of adding my Channel numbers everytime I did a clean install of MediaPortal so I came up with this script.

Your channel name format must be Numer Name (5 WTTG), because this script splits the name @ the space and takes the first array.

Install Apache and PHP5 (with SQLite support) on your MediaPortal PC. Copy and past this code into a new php page. Access the page via a web browser.

Code:
<?php

$db = sqlite_open("c:\Program Files\Team MediaPortal\MediaPortal\database\TVDatabasev4.db") or
die("failed to open the database");

$res = sqlite_query($db,
	   "SELECT idChannel, strChannel
	    FROM Channel
	    WHERE iChannelNr = 0
	    OR iChannelNr = 'Array'");

if (!$res) {
// This should happen :)
echo "All channels have numbers assigned";
} else {
while ($row = sqlite_fetch_array($res)) {

$idChan =  $row[idChannel];
$Channel = $row[strChannel];

$ChanNum = explode(" ",$Channel);

$res2 = sqlite_query($db,
	   "UPDATE Channel
	    SET iChannelNr = '$ChanNum[0]'
	    WHERE idChannel = $idChan");
echo "$Channel done.";
}
}
?>
  Reply With Quote
Reply

Bookmarks

Tags
add, channel, numbers, page, php, tvdatabase4

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
KNC 1 DVB-C / cannot tune channels lutz General Support 15 2006-10-01 12:04
Technotrend DVB-S no LNB switch Erbsenkopp General Support 0 2006-08-03 10:04
Technotrend Budget 1500 CI no LNB switch Erbsenkopp General Support 0 2006-08-03 09:46
Tuning-problem - FireDTV - Stockholm-Nacka alek01 Installation, configuration support 2 2006-07-11 00:06
Xmltv set big hassle for a newb Anonymous Tips and Tricks 38 2004-12-18 21:09


All times are GMT +1. The time now is 18:42.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress
Advertisement System V2.6 By   Branden