</div>
                        </div>
                    </div>
                </div>
                <div class="box-footer">
                    <div class="row">
                        <div class="form-group">
                            <div class="col-xs-12">
                                <label>Template Code: </label>

                                <div id="editor2">
                                    <script>
                                        initSample();
                                    </script>
                                    <?php 
echo readUrl();
?>
</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<script type="text/javascript">
    $.fn.editable.defaults.mode = 'inline';
    $('#title , #code').editable({
        pk: '<?php 
Example #2
0
<?php

/*
Jappix - An open social platform
This is the Jappix geolocation script
-------------------------------------------------
License: AGPL
Author: Valérian Saliou
*/
// PHP base
define('JAPPIX_BASE', '..');
// Get the needed files
require_once './functions.php';
require_once './read-main.php';
require_once './read-hosts.php';
// Prepare application
enableErrorSink();
hideErrors();
compressThis();
// Not allowed for a special node
if (isStatic() || isUpload()) {
    exit;
}
// If valid data was sent
if (isset($_GET['latitude']) && !empty($_GET['latitude']) && (isset($_GET['longitude']) && !empty($_GET['longitude'])) && (isset($_GET['language']) && !empty($_GET['language']))) {
    // Set a XML header
    header('Content-Type: text/xml; charset=utf-8');
    // Get the XML content
    $xml = readUrl('http://maps.googleapis.com/maps/api/geocode/xml?latlng=' . urlencode($_GET['latitude']) . ',' . urlencode($_GET['longitude']) . '&language=' . urlencode($_GET['language']) . '&sensor=true');
    exit($xml);
}
Example #3
0
compressThis();
// Not allowed for a special node
if (isStatic() || isUpload()) {
    exit;
}
// Set a JSON header
header('Content-Type: application/json');
// If valid data was sent
if (isset($_GET['username']) && !empty($_GET['username'])) {
    // Read remote IP (secures passwords that are passed there)
    $remote_ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null;
    // Generate cache values
    $cache_hash = md5($_GET['username'] . '@' . $remote_ip);
    $cache_path = JAPPIX_BASE . '/tmp/jingle/' . $cache_hash . '.cache';
    $cache_life = $remote_ip ? 3600 : 0;
    // Cache missing or obsolete?
    $filemtime = @filemtime($cache_path);
    if (!$filemtime or time() - $filemtime >= $cache_life) {
        // Note: we use a Google API there, so fallback TURNs will be using Google's TURN server through an encrypted channel
        //       we know this won't satisfy everyone, but this is the best compromise we could find for the end-user
        //       if you are concerned about privacy, rather setup your TURN and add it to Jappix hosts configuration
        // Get the JSON content
        $json = readUrl('https://computeengineondemand.appspot.com/turn?username='******'username']));
        if ($json && strpos($json, 'uris') !== false) {
            file_put_contents($cache_path, $json);
        }
    } else {
        $json = file_get_contents($cache_path);
    }
    exit($json);
}
Example #4
0
$rs = mysql_query($sql, $dbc->db);
if (!$rs) {
    die("DB ERROR");
}
while ($obj = mysql_fetch_object($rs)) {
    $id = $obj->id;
    $celular = $obj->celular;
    $qrImgName = $id . ".jpg";
    $downloadOk = getFtpFiles(FTP_PATH . "/{$qrImgName}");
    if ($downloadOk === TRUE) {
        // leer qr
        $qrRead = readQRCode($qrImgName);
        // parse result
        if (qrFound($qrRead) === TRUE) {
            $qrFound = TRUE;
            $urlPush = readUrl($qrRead);
            // valido url
            if (isValidUrl($urlPush) === TRUE) {
                // send sms push
                $msgPush = "Ir a";
                $push = new pushAntel($dbc->db, SMS_SC, $celular, $msgPush);
                $sent = $push->enviarPush($urlPush, $msgPush);
            } else {
                // send sms
                $msgSms = ERROR_MSG_BADURL;
                $sent = enviarSMS($celular, $msgSms);
            }
            // actualizo enviados
            if ($sent === TRUE) {
                $enviado = "OK";
            } else {
Example #5
0
function newUpdates($force)
{
    // No need to check if developer mode
    if (isDeveloper()) {
        return false;
    }
    $cache_path = JAPPIX_BASE . '/tmp/cache/version.xml';
    // No cache, obsolete one or refresh forced
    if (!file_exists($cache_path) || file_exists($cache_path) && time() - filemtime($cache_path) >= 86400 || $force) {
        // Get the content
        $last_version = readUrl('https://jappix.org/xml/version.xml');
        // Write the content
        file_put_contents($cache_path, $last_version, LOCK_EX);
    } else {
        // Read from cache
        $last_version = file_get_contents($cache_path);
    }
    // Parse the XML
    $xml = @simplexml_load_string($last_version);
    // No data?
    if ($xml === FALSE) {
        return false;
    }
    // Get the version numbers
    $current_version = getVersion();
    $last_version = $xml->id;
    // Check if we have the latest version
    $current_version = versionNumber($current_version);
    $last_version = versionNumber($last_version);
    if ($current_version < $last_version) {
        return true;
    }
    return false;
}
Example #6
0
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(readUrl('http://api.jamendo.com/get2/name+id+duration+url/track/xml/?searchquery=' . urlencode($searchquery) . '&order=searchweight_desc'));
    }
    // Local music search
    $xml = '<data>';
    $searchquery = strtolower($searchquery);
    // Escape the regex special characters
    $searchquery = escapeRegex($searchquery);
    // Search in the directory
    $repertory = '../store/music/';
    $scan = scandir($repertory);
    foreach ($scan as $current) {
        // This file match our query!
        if (is_file($repertory . $current) && $current && preg_match('/(^|\\s|\\[)(' . $searchquery . ')(.+)?(\\.(og(g|a)|mp3|wav))$/i', strtolower($current))) {
            // Get the basic informations
            $title = preg_replace('/^(.+)(\\.)(og(g|a)|mp3|wav)$/i', '$1', $current);
            $url = $location . 'store/music/' . $current;