Jump to content

vaskovasilev

Members
  • Posts

    34
  • Joined

  • Last visited

  • Days Won

    1

vaskovasilev last won the day on August 12 2017

vaskovasilev had the most liked content!

About vaskovasilev

  • Birthday 09/23/1984

Contact Methods

  • Website URL
    http://vasilev.link

Profile Information

  • Gender
    Male
  • Location
    Germany

vaskovasilev's Achievements

Member

Member (2/5)

1

Reputation

1

Community Answers

  1. hello, i am trying to find working example for posting to a company page in Linkedin. i found some articles on stackoverflow .. but nothing: https://stackoverflow.com/questions/21788482/linkedin-company-share-api?rq=1 after authenticating, nothing is happening. i asked Linkedin also, but they didnt hepled me. can you please help me.. function posttopage($method, $resource, $body = '') { //$params = array('visbility' => array('code' => 'anyone'),'comment' => "php test post",'content' => array('submitted-url' => 'webcv', 'title' => 'Test Share with Content' , 'description' => 'content description' , 'submitted-image­url' => 'http://domain/logo.png'),'oauth2_access_token' => $_SESSION['access_token'],'format' => 'json'); //$params = array('visibility' => array('code' => 'anyone'),'comment' => "php test post", 'share-target-reach' => array('share-targets' => array('share-target' => array('code' => 'geos' , 'tvalues' => array('tvalue'=> 'test body for posting'))))); //print_r($params); //echo "<br><br>".json_encode($params); $strShare = <<<XML <share> <visibility> <code>anyone</code> </visibility> <comment>comment share!</comment> <content> <submitted-­url>http://www.domain</submitted-­url> <title>test share from php</title> <description>description</description> <submitted‐image-­url>http://www.domain/logo.png</submitted-­image-­url> </content> <share-target-reach> <share-targets> <share-target> <code>geos</code> <tvalues> <tvalue>IT</tvalue> </tvalues> </share-target> </share-targets> </share-target-reach> </share> XML; //$params = http_build_query($params); //$data_len = strlen ($params); //$url = 'https://api.linkedin.com' . $resource .'?'. $params ; $url = 'https://api.linkedin.com' . $resource ; //$context = stream_context_create( //array('http' => //array('method' => $method, //) //) //); //$response = file_get_contents($url, false, $context,$data_len); //return json_decode($response); //echo $url; $objCurl = curl_init(); curl_setopt($objCurl, CURLOPT_URL, "https://api.linkedin.com/v1/companies/id/shares?format=xml"); curl_setopt($objCurl, CURLOPT_HEADER, 1); //curl_setopt($objCurl, CURLOPT_POST, 1); curl_setopt($objCurl, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($objCurl, CURLOPT_POSTFIELDS, $strShare); //curl_setopt($objCurl, CURLOPT_HTTPHEADER, array( //'Content-Type: application/json', //'Connection: Keep-Alive' //)); curl_setopt($objCurl, CURLOPT_HTTPHEADER, array( 'Content-Type: application/xml', 'Connection: Keep-Alive' )); curl_setopt($objCurl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($objCurl); curl_close($objCurl); echo $response; }
  2. this is good but how to check if Sathurday is working or not, and Monday is rest or not from the arrays?
  3. hello, i am printing the days with php: $i = 0; $date = 0; while ($i < 3) { $nexttime = strtotime("+$date days", strtotime("thursday")); if(date("D", $nexttime) == "Sat") { echo "saturday...skipping one day...<br />\n"; $date++; } else { echo "it's ".date("D", $nexttime)."<br />\n"; $i++; } $date++; } i am trying to check if the day is working or not, for this purpuse i have one table with two rows - arrays for working and rest days: ["11.02","03.06"...] this is the final result but .. something is wrong because today is working day but it was not printed: if((date("D",$nexttime)=="Sat" || (date("D",$nexttime)=="Sun") && !in_array(date("d.m",$nexttime),$workingdaysarray) ){$date++; ...
  4. there are many sites that take the coordinates without google, but they are very close to google coordinates. i tried some api but .. they are not so close. i ask this - is there a tool, web service, php, database that will give me the closest coordinates that give me google. in this case there wont be confirmation.
  5. so.. there is no way to take the coordinates without confirmation ?
  6. hello, i want to get the exact coordinates of IP address - latitude, longitude. i am using google geocode but it needs to confirm that you want to share the information. after that i tried other methods - ipinfodb.. and others api but they didnt give me the same coordinates as google. is there any way ?
  7. jazzman1, i wanted to create a way to save different information about different cities in one field, because when there are many users in one table, and if there are many information about cities for each user .. the rows will be much more. So in this way you have the whole information in one field:) Maybe there is and another way, but i dont know it.
  8. AbraCadaver thanks! i read that if i want to delete some array, i have to use unset($json->Sofia) for example.
  9. hello, i have on row in database with this: {"Sofia":["26","42.696693","23.302080"],"Lovetch":["13","43.140461","24.718996"]} to read the data, i use : .. $datasortarray=$row_info['seats_id']; $datasortarray=json_decode($datasortarray); foreach ($datasortarray as $key=>$row){ echo $key ; } first is the name of the city, every city has an array with data - number seats, latitude, longitude Can you please tell me how to add/delete other data to this array? if i have these input fields: <input name="city" type="text"> -> city name <input name="numbers" type="text"> -> for first number.. <input name="latitude" type="text"> -> for second number <input name="longitude" type="text"> -> for third number
  10. i rewrite the code based on jquery gmap and everything is ok.
  11. hello, i am using google scripts for finding the location base ot search city or street.. everything is working if i am searching from the same index by input tag with some id.. the button is executing some javascript. i am trying to make the search by giving parameter from other index - with $_GET['location']. after that i put one rule - if($_GET[location]){ echo "<script type javascript.. function()." but nothing happens. in the function i put one alert after the if(thislocation), to see if the parameter is givven to the function ant id is, but the location didnt appear. can you help me to understand what i am missing. function submitQuery(thislocation) { if(thislocation){var query=thislocation} else { var query = document.getElementById("location").value; } if (/\s*^\-?\d+(\.\d+)?\s*\,\s*\-?\d+(\.\d+)?\s*$/.test(query)) { var latlng = parseLatLng(query); if (latlng == null) { document.getElementById("location").value = ""; } else { geocode({ 'latLng': latlng }); } } else { geocode({ 'address': query }); } } function geocode(request) { resetMap(); var hash = ''; if (request.latLng) { hash = 'q=' + request.latLng.toUrlValue(6); } else { hash = 'q=' + request.address; } hashFragment = '#' + escape(hash); window.location.hash = escape(hash); geocoder.geocode(request, showResults); } function parseLatLng(value) { value.replace('/\s//g'); var coords = value.split(','); var lat = parseFloat(coords[0]); var lng = parseFloat(coords[1]); if (isNaN(lat) || isNaN(lng)) { return null; } else { return new google.maps.LatLng(lat, lng); } } <input type="text" id="location" style="width:93%; height:30px; font-size:15px;" class="logbut" placeholder="<?php echo $lang['mapinfo'];?>" > </td> <td align="right" style="min-width:46px; vertical-align:middle"> <input type="button" value="<?php echo $lang['search'];?>" class="newclassbutton" onclick="submitQuery()"/> <?php if($_GET['location']){?><script type="text/javascript">submitQuery('<?php echo $_GET['location'];?>')</script><?php } ?>
  12. hello , i have one database for users with coorinates - lat , longitude . i want to make something like - get nearest clients when you are accessing the site . i put geocode i the site , so when someone opens it , it give the coordinates . but how to get the nearest clients from the database , in distance 1 km for example . i search reverse geocoding , but i see it takes data from the site of google .. not from my database .
  13. Hello to all , i have some problems with mod_rewrite rules and i aks for help . i have working code that redirects domain.com/username/servicesid to domain.com/index.php?page=Profile&user=username&services_id=servicesid i want to make subdomain rewrite .. username.domain.com/servicesid to the same url domain.com/index.php?page=Profile&user=username&services_id=servicesid here is my code : RewriteRule ^([^/]+)/([a-z\d]{32})/(\d{4}-\d{2}-\d{2})$ index.php?page=Profile&user=$1&services_id=$2&date=$3 [L] RewriteRule ^([^/]+)/([a-z\d]{32})$ index.php?page=Profile&user=$1&services_id=$2 [L] RewriteCond %{REQUEST_FILENAME} !-f this is for rewriting only the subdomain : RewriteCond %{HTTP_HOST} !www.domain.com$ [NC] RewriteCond %{HTTP_HOST} ^(www.)?([^/]+).domain.com [NC] RewriteRule (.*) index.php?page=Profile&user=%2 [NC,QSA] can you please help me to make the code working . also when i open username.domain.com , i cannot open the css , js .. images files .
  14. hello , i use this maps api to visualise markers with coordinates from database : http://code.google.com/intl/bg/apis/maps/articles/phpsqlsearch.html i want to create a marker clusterer : http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/docs/examples.html but cannot understand how to write the code for my example - php/mysql . can you please help me .
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.