Ejemplo n.º 1
0
function act_log($link, $action, $activity)
{
    global $session;
    /**
     * 
     */
    //----------------------------[ read parameters from url ]
    if (isset($_GET['uid'])) {
        $uid = $_GET['uid'];
    } else {
        $uid = '';
    }
    //if (isset($_GET['source'])) $source=$_GET['source']; else $source='unknown';
    //	if (isset($_GET['application'])) $source=$_GET['application'];
    //$activity="act_log:0.106;loc:cpd".$activity;
    // try to read userID from $session
    $ra = "";
    if (isset($session)) {
        $ui = $session->userinfo;
        $ra = $_SERVER['REMOTE_ADDR'];
        $uid = $ra;
        if (isset($ui["username"])) {
            $uid = $ui["username"];
        }
    }
    if (isset($activity)) {
        $act = $activity;
    } else {
        $act = '';
    }
    $act = $activity;
    $act = set_attribute($act, 'remote_addr', $_SERVER['REMOTE_ADDR']);
    $tmp = "Schneider-login_name";
    if (isset($_COOKIE[$tmp])) {
        $tmpa = $_COOKIE[$tmp];
        if (is_string($tmpa)) {
            $act = set_attribute($act, $tmp, $tmpa);
        }
    }
    if ($uid == '') {
        $uid = $_SERVER['REMOTE_ADDR'];
    }
    if ($uid == '') {
        $uid = 'unknown';
    }
    $p = "";
    if (isset($_SERVER['QUERY_STRING'])) {
        $p = libMysqlEscape($_SERVER['QUERY_STRING']);
    }
    $geo = "";
    // if (isset($_COOKIE["SECTRYCODE"])) {$geo=set_attribute($geo,"SECTRYCODE",$_COOKIE["SECTRYCODE"]);}
    $client_id = "";
    if (isset($_COOKIE["help_client_uuid"])) {
        $client_id = $_COOKIE["help_client_uuid"];
    }
    $source = 'concepts';
    $geo = set_attribute($geo, 'country', geoCountryFromIP($link, act_log_getClientIP()));
    //$query="insert into `data_rpt`.`act_log` (`source`) values ('".$source."');";
    //$result = mysqli_query($link,$query);
    $apiKey = get_attribute($activity, "apikey");
    if (isset($_GET['apiKey'])) {
        $apiKey = $_GET['apiKey'];
    }
    //$query="insert into `data_rpt`.`act_log` (`source`,`uid`,`action`,`activity`,`query_string`,`remote_addr`) values ('".$source."','".$uid."','".$action."','".$act."','".$p."','".$ra."');";
    $query = "insert into `data_rpt`.`act_log` (`source`,`uid`,`action`,`activity`,`query_string`,`remote_addr`,`getClientIP`,`api_key`,`clientGeoData`,`prod_id`,`client_id`) values ('" . $source . "','" . $uid . "','" . $action . "','" . $act . "','" . $p . "','" . $ra . "','" . act_log_getClientIP() . "','" . $apiKey . "','" . $geo . "','" . strtoupper(get_attribute($activity, "prod_id")) . "','" . $client_id . "');";
    $result = mysqli_query($link, $query);
    //echo $query;
    return 0;
}
Ejemplo n.º 2
0
function set_limit_value(&$a, $v, $o = true)
{
    set_attribute('Meta-Interval-Value', $a, $v, $o);
}
Ejemplo n.º 3
0
 /**
  * Removes the given CSS class(es) from the element
  *
  * @param string|array $attributes Array of attributes or HTML attribute string
  * @param string|array $class Class name, multiple class names separated by
  *                            whitespace, array of class names
  *
  * @return string A string containing result attributes
  */
 function remove_class($attributes, $class)
 {
     $attributes = prepare_attributes($attributes);
     if (!is_array($class)) {
         $class = preg_split('/\\s+/', $class, null, PREG_SPLIT_NO_EMPTY);
     }
     $curClass = array_diff(preg_split('/\\s+/', get_attribute($attributes, 'class'), null, PREG_SPLIT_NO_EMPTY), $class);
     if (0 == count($curClass)) {
         return remove_attribute($attributes, 'class');
     }
     return set_attribute($attributes, 'class', implode(' ', $curClass));
 }
Ejemplo n.º 4
0
         // Check to see if the track we've returned is a wishlist track, and update its info
         if ($uri && $album) {
             check_wishlist_doodads($ttids);
         }
     }
 }
 if (count($ttids) > 0) {
     foreach ($ttids as $ttid) {
         foreach ($attributes as $pair) {
             $dbg = $pair["value"];
             if (is_array($pair["value"])) {
                 $dbg = implode($pair["value"], ", ");
             }
             debuglog("Setting " . $pair["attribute"] . " to " . $dbg . " on TTindex " . $ttid, "USERRATING", 6);
             $result = true;
             $r = set_attribute($ttid, $pair["attribute"], $pair["value"]);
             if ($r == false) {
                 debuglog("FAILED Setting " . $pair["attribute"] . " to " . $dbg, "USERRATING", 2);
                 $result = false;
             }
         }
         if ($result && $uri) {
             send_list_updates($artist_created, $album_created, $ttid, false);
             $returninfo['metadata'] = get_all_data($ttid);
         }
         $artist_created = false;
         $album_created = false;
     }
     update_track_stats();
     $returninfo['stats'] = alistheader(get_stat('ArtistCount'), get_stat('AlbumCount'), get_stat('TrackCount'), format_time(get_stat('TotalTime')));
     print json_encode($returninfo);