Пример #1
0
                    $include_app = 'mobile';
                }
            }
        }
    }
}
// Special stuffs for Jappix apps?
if ($include_app == 'desktop' || $include_app == 'mobile') {
    // Redirects the user to HTTPS if forced
    if (!useHttps() && httpsForce()) {
        // Apply some special headers
        header('Status: 301 Moved Permanently', true, 301);
        header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
        // Kill the script!
        exit('HTTP/1.1 301 Moved Permanently');
    }
    // Is it a static node?
    if (isStatic()) {
        $include_app = 'static';
    }
    // Is it an upload node?
    if (isUpload()) {
        $include_app = 'upload';
    }
    // Save this visit (for the stats)
    if (hasStatistics()) {
        writeVisit();
    }
}
// Include it!
include './server/' . $include_app . '.php';
-------------------------------------------------
License: AGPL
Author: Valérian Saliou
Last revision: 27/05/11
*/
// PHP base
define('JAPPIX_BASE', '..');
// Get the needed files
require_once './functions.php';
require_once './read-main.php';
require_once './read-hosts.php';
// Optimize the page rendering
hideErrors();
compressThis();
// Not allowed for a special node
if (isStatic() || isUpload()) {
    exit;
}
// If valid data was sent
if (isset($_GET['searchquery']) && !empty($_GET['searchquery']) && (isset($_GET['location']) && !empty($_GET['location']))) {
    // Set a XML header
    header('Content-Type: text/xml; charset=utf-8');
    // Get the values
    $searchquery = $_GET['searchquery'];
    $location = $_GET['location'];
    // Jamendo search?
    if ($location == 'jamendo') {
        exit(file_get_contents('http://api.jamendo.com/get2/name+id+duration+url/track/xml/?searchquery=' . urlencode($searchquery) . '&order=searchweight_desc'));
    }
    // Local music search
    $xml = '<data>';