MCE Remote with XBMC (Windows)

Hello again,

well i'm struggling for several months now with this mce remote and xbmc but today i found a very awesome site taking care of this topic. You can get a predefined keyboard.xml there. The downloaded xml file combined with the xbmc plugin for mceremotes where you can edit this file with a specific editor resolved all my problems with this remote. Finally i can use it like i want.

So here's a summary what you need to customize your keypresses:

  • keyboard.xml (please check the site for more infos)
  • mceremote add-on (install it from the add-on page in xbmc, after installation it can be found under "programs")

I hope this helps someone.

Howto open, read and write a file in PHP

Hello world,

this is a very basic operation which i do almost every day and of course you can do it in different ways like always in programming. It's however not for absolute beginners. You need to have some basic knowledge about variables, functions etc. Please visit php.net for these basics, their online documenttation is one of the best of all languages i've worked with.

here is an example how you could do it:

<?php

# OPEN A FILE IN READ ONLY AND PUT RESULT INTO A FILE HANDLER ($FH)
$fh = fopen("/tmp/openme.txt", "r");

Possibiliy 1:

# READ CONTENT AS ONE BIG TEXT STRING FROM FILE HANDLER
$content = file_get_contents($fh);

Possibility 2:

# READ FILE AS AN ARRAY (EVERY LINE GOES TO ONE ARRAY ENTRY)
$content = file($fh);

# IF READ AS AN ARRAY YOU NEED FIRST TO CONVERT THE
# ARRAY INTO A STRING BEFORE SAVING
$content = implode("", $content);

# CREATE A NEW FILE OR OPEN FILE IN WRITE MODE AND GIVE IT
# A NEW FILE HANDLER ($FH_NEW)
$fh_new = fopen("/tmp/saveme.txt", "w");

# NOW STORE THE CONTENT IN THERE
fwrite($content, $fh_new);

# AND DO NOT FORGET TO CLOSE THE FILE AFTERWARDS TO MAKE YOUR FILE PERMANENT
fclose($fh_new);

?>

So, that's it. Hope this helped some of you people out there.