Jump to content

sopranolv

Members
  • Posts

    18
  • Joined

  • Last visited

Everything posted by sopranolv

  1. I dont know how to modify the addMarker() function
  2. Someone can help me make map script with multiply icons from sql by type or icon. I have this And I wont something as this MYSQL CREATE TABLE `poi_example` ( `id` int(11) NOT NULL, `name` text NOT NULL, `desc` text NOT NULL, `lat` text NOT NULL, `lon` text NOT NULL, `expiry` varchar(15) NOT NULL, `type` varchar(100) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `poi_example` -- INSERT INTO `poi_example` (`id`, `name`, `desc`, `lat`, `lon`, `expiry`, `type`) VALUES (2, '93 Feet East', '150 Brick Lane, London E1 6RU<br/>7 Dec 2010 : Jenny & Johnny<br/>', '51.521710', '-0.071737', '2016/07/28', 'green'), PHP <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Google Maps</title> <style type="text/css"> body { font: normal 10pt Helvetica, Arial; } #map { width: 950px; height: 900px; border: 0px; padding: 0px; } </style> <script src="http://maps.google.com/maps/api/js?key=xxxxxxxxxxxxxxxxxxxxxxxxxx&sensor=false" type="text/javascript"></script> <script type="text/javascript"> //Sample code written by August Li var icon = new google.maps.MarkerImage("http://maps.google.com/mapfiles/ms/micons/blue.png", new google.maps.Size(32, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 32)); var center = null; var map = null; var currentPopup; var bounds = new google.maps.LatLngBounds(); function addMarker(lat, lng, info) { var pt = new google.maps.LatLng(lat, lng); bounds.extend(pt); var marker = new google.maps.Marker({ position: pt, icon: icon, map: map }); var popup = new google.maps.InfoWindow({ content: info, maxWidth: 300 }); google.maps.event.addListener(marker, "click", function() { if (currentPopup != null) { currentPopup.close(); currentPopup = null; } popup.open(map, marker); currentPopup = popup; }); google.maps.event.addListener(popup, "closeclick", function() { map.panTo(center); currentPopup = null; }); } function initMap() { map = new google.maps.Map(document.getElementById("map"), { center: new google.maps.LatLng(0, 0), zoom: 14, mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: true, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR }, navigationControl: true, navigationControlOptions: { style: google.maps.NavigationControlStyle.ZOOM_PAN } }); <?php $query = mysql_query("SELECT * FROM poi_example")or die(mysql_error()); while($row = mysql_fetch_array($query)) { $name = $row['name']; $lat = $row['lat']; $lon = $row['lon']; $desc = $row['desc']; echo("addMarker($lat, $lon, '<b>$name</b><br />$desc');\n"); } ?> center = bounds.getCenter(); map.fitBounds(bounds); } </script> </head> <body onload="initMap()" style="margin:0px; border:0px; padding:0px;"> <div id="map"></div> </body> </html>
  3. I can't figure out how to make this script (twitch(dot)tv) to show only online/live channels not all... Here is Javascript (function () { 'use strict'; angular .module('twitch', []) .controller('TwitchCtrl', TwitchCtrl); function TwitchCtrl($http, $scope) { $scope.streams=[]; var apiEndPoint = 'https://api.twitch.tv/kraken/streams/'; var streamers = ['Chizijs','tornis', 'elveeftw', 'piecits', 'lobosjr', 'fattypillow']; var apiSuccess = function(response, streamer){ console.log(response); var stream = response.data; stream.Name = streamer; var offline = stream.stream === null if(offline){ stream.stream = {game: 'offlines', channel:{ 'logo': '' }}; $scope.streams.push(stream); } else{ $scope.streams.unshift(stream); } console.log(stream); }; var apiError = function(response, streamer){ console.log(response); if(response.status === 422){ var stream = response.data; stream.Name = streamer; stream.stream = {game: 'Account Closed', channel:{ 'logo': ''}}; console.log(stream); $scope.streams.push(stream); } }; var setupSuccess = function(streamer){ return function(response){ return apiSuccess(response, streamer); }; }; var setupError = function(streamer){ return function(response){ return apiError(response, streamer); }; }; for(var i = 0; i < streamers.length; i++){ var onSuccess = setupSuccess(streamers[i]); var onError = setupError(streamers[i]); $http({url: apiEndPoint + streamers[i], method:'GET'}) .then(onSuccess, onError); } } })();
  4. can help me with this youtube playlist stream script it doesn't work here is yt.zip i wont something as this
  5. i have this code <img src="http://maps.googleapis.com/maps/api/staticmap?center=jelgava&zoom=12&scale=1&size=400x100&maptype=terrain&sensor=false&format=png32&visual_refresh=true" class="gm" alt="Google Map of jelgava"> can remove all words from the map? i need somethink as this please help ...
  6. here is code http://jsfiddle.net/dp9w6wbe/
  7. how make default noavatar if male no avatar show default picture noavatar-male.jpg and if female noavatar-female.jpg here is my code $row['avatar'] = $row['avatar'] == "default" ? site_url. "/style/images/avatar.png":site_url.$row['avatar']; $sizes = array(25, 46, 75, 100); foreach($sizes as $size) { if($row['avatar'] != site_url."/style/images/avatar.png") { $row['avatar_'.$size.'x'.$size] = str_replace("_$row[id]", "_$row[id]_".$size."x".$size, $row['avatar']); $row['avatar_'.$size.'x'.$size] = $row['avatar_'.$size.'x'.$size] . "?".filemtime($_SERVER['DOCUMENT_ROOT'].str_replace(site_url, '', $row['avatar_'.$size.'x'.$size])); } } if($row['avatar'] == site_url."/style/images/avatar.png") { foreach($sizes as $size) { $row['avatar_'.$size.'x'.$size] = $row['avatar']; } } else { $row['avatar'] .= "?".filemtime($_SERVER['DOCUMENT_ROOT'].str_replace(site_url, '', $row['avatar'])); }
  8. this working to select range and import in db and problem is that the don't show in slider range from mysql db need this <?=$user['sage']?> and <?=$user['sageto']?> to show here values: [ 2, 4 ], js $(function() { $( "#slider-range" ).slider({ range: true, min: 1, max: 100, values: [ 2, 4 ], slide: function( event, ui ) { $( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] ); $( "input#bed_min").val(ui.values[ 0 ]); $( "input#bed_max").val(ui.values[ 1 ]); } }); $( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) + " - $" + $( "#slider-range" ).slider( "values", 1 ) ); }); php <p> <label for="amount">Price range:</label> <input type="text" id="amount" style="border: 0; color: #f6931f; font-weight: bold;" /> </p> <div style="width:400px;" id="slider-range"></div> min: <input id="bed_min" type="text" value="<?=$user['sage']?>" name="sage"><br> max: <input id="bed_max" type="text" value="<?=$user['sageto']?>" name="sageto">
  9. yes i think it is problem becouse i try image from google upload That's ok and when i try upload image taken by my samsung,it rotated how fix it someone know?
  10. sorry function createThumb($sourcefile, $target_file, $new_w, $new_h) { $root = $_SERVER['DOCUMENT_ROOT']."/"; $source_path = $sourcefile; // // Add file validation code here // list( $source_width, $source_height, $source_type ) = getimagesize( $source_path ); switch ( $source_type ) { case IMAGETYPE_GIF: $source_gdim = imagecreatefromgif( $source_path ); $ext = ".gif"; $fija = "imagegif"; break; case IMAGETYPE_JPEG: $source_gdim = imagecreatefromjpeg( $source_path ); $ext = ".jpg"; $fija = "imagejpeg"; break; case IMAGETYPE_PNG: $source_gdim = imagecreatefrompng( $source_path ); $ext = ".png"; $fija = "imagepng"; break; } $source_aspect_ratio = $source_width / $source_height; $desired_aspect_ratio = $new_w / $new_h; if ( $source_aspect_ratio > $desired_aspect_ratio ) { // // Triggered when source image is wider // $temp_height = $new_h; $temp_width = ( int ) ( $new_h * $source_aspect_ratio ); } else { // // Triggered otherwise (i.e. source image is similar or taller) // $temp_width = $new_w; $temp_height = ( int ) ( $new_w / $source_aspect_ratio ); } // // Resize the image into a temporary GD image // $temp_gdim = imagecreatetruecolor( $temp_width, $temp_height ); imagealphablending($temp_gdim, false); imagesavealpha($temp_gdim,true); $transparent = imagecolorallocatealpha($temp_gdim, 255, 255, 255, 127); imagefilledrectangle($temp_gdim, 0, 0, $temp_width,$temp_height, $transparent); imagecopyresampled( $temp_gdim, $source_gdim, 0, 0, 0, 0, $temp_width, $temp_height, $source_width, $source_height ); // // Copy cropped region from temporary image into the desired GD image // $x0 = ( $temp_width - $new_w ) / 2; $y0 = ( $temp_height - $new_h ) / 2; $desired_gdim = imagecreatetruecolor( $new_w, $new_h ); imagealphablending($desired_gdim, false); imagesavealpha($desired_gdim,true); $transparent = imagecolorallocatealpha($desired_gdim, 255, 255, 255, 127); imagefilledrectangle($desired_gdim, 0, 0, $new_w,$new_h, $transparent); imagecopy( $desired_gdim, $temp_gdim, 0, 0, $x0, $y0, $new_w, $new_h ); // // Render the image // Alternatively, you can save the image in file-system or database // if($fija($desired_gdim, $root.$target_file.$ext)) { imagedestroy($desired_gdim ); imagedestroy($temp_gdim); } return $ext;
  11. yes its thumbnail images function userInfo($user = '0') { if(is_numeric($user)) { $user = $user == 0 ? (int)$_COOKIE['user_id']:$user; $query = mysql_query("SELECT * FROM users WHERE id = $user"); } else { $user = quote_smart($user); $query = mysql_query("SELECT * FROM users WHERE username = $user"); } $row = mysql_fetch_array($query); if((int)$row['id'] > 0) { $posts = get_post_count_author($row['id']); mysql_query("UPDATE users SET posts = $posts WHERE id = $row[id]"); $row['posts'] = $posts; } $row['mgroup'] = (int)$row['mgroup']; $row['avatar'] = $row['avatar'] == "default" ? site_url. "/style/images/avatar.png":site_url.$row['avatar']; $sizes = array(25, 46, 75, 100); foreach($sizes as $size) { if($row['avatar'] != site_url."/style/images/avatar.png") { $row['avatar_'.$size.'x'.$size] = str_replace("_$row[id]", "_$row[id]_".$size."x".$size, $row['avatar']); $row['avatar_'.$size.'x'.$size] = $row['avatar_'.$size.'x'.$size] . "?".filemtime($_SERVER['DOCUMENT_ROOT'].str_replace(site_url, '', $row['avatar_'.$size.'x'.$size])); } } if($row['avatar'] == site_url."/style/images/avatar.png") { foreach($sizes as $size) { $row['avatar_'.$size.'x'.$size] = $row['avatar']; } } else { $row['avatar'] .= "?".filemtime($_SERVER['DOCUMENT_ROOT'].str_replace(site_url, '', $row['avatar'])); } return $row; }
  12. ok thx work's fine and i have one more problem when I upload image turned 90 degrees why?
  13. in script i have this $target_path2 = $_SERVER['DOCUMENT_ROOT']."/uploads/"; $aname1 = basename( $_FILES['avatar']['name']); $anameExt = substr($aname1, 100); switch($anameExt) { case '.png': $papl = ".png"; break; case '.gif': $papl = ".gif"; break; default: $papl = ".jpg"; break; } $failaName = time().$papl; $target_path = $target_path2 . $failaName; move_uploaded_file($_FILES['avatar']['tmp_name'], $target_path); $ext = createThumb($target_path, "uploads/avatars/avatar_$user[id]", 550, 950); $pictureURL = "/uploads/pictures/".$faila_nosaukums; $sizes = array(25, 46, 75, 100); foreach($sizes as $size) { createThumb($target_path, "uploads/avatars/avatar_$user[id]_".$size."x".$size, $size, $size); //chmod($_SERVER['DOCUMENT_ROOT']."/uploads/avatars/avatar_$user[id]_".$size."x".$size.$ext, 0777); //echo $_SERVER['DOCUMENT_ROOT']."/uploads/avatars/avatar_$user[id]_".$size."x".$size.$ext; } unlink($target_path); $avatar=quote_smart("/uploads/avatars/avatar_".$user[id].$ext); } in functions.php i have this $row['avatar'] = $row['avatar'] == "default" ? site_url. "/style/images/avatar.png":site_url.$row['avatar']; $sizes = array(25, 46, 75, 100); foreach($sizes as $size) { if($row['avatar'] != site_url."/style/images/avatar.png") { $row['avatar_'.$size.'x'.$size] = str_replace("_$row[id]", "_$row[id]_".$size."x".$size, $row['avatar']); $row['avatar_'.$size.'x'.$size] = $row['avatar_'.$size.'x'.$size] . "?".filemtime($_SERVER['DOCUMENT_ROOT'].str_replace(site_url, '', $row['avatar_'.$size.'x'.$size])); } } if($row['avatar'] == site_url."/style/images/avatar.png") { foreach($sizes as $size) { $row['avatar_'.$size.'x'.$size] = $row['avatar']; } } else { $row['avatar'] .= "?".filemtime($_SERVER['DOCUMENT_ROOT'].str_replace(site_url, '', $row['avatar'])); } return $row; } how make this script to upload orginal size image not only the thumbs ?
  14. How to get all users with same city <?php function quote_smart($value) { $value = htmlspecialchars($value); if (get_magic_quotes_gpc()) { $value = stripslashes($value); } $value = "'" . mysql_real_escape_string($value) . "'"; return $value; } $pilseta = quote_smart($_GET['city']); $select_u = mysql_query("SELECT * FROM `users` WHERE `city` = $pilseta"); while($u = mysql_fetch_array($select_u)){ echo $u['username'];?> <? } ?> this script works x.php?city=new-york or other city. but i need to show users from the same city from which I am in my profile have city jelgava and I want to make this script show another users with same city get logged in users id by cookies
  15. i have javascript with second form dont import select data in db but first form work's fine
  16. Hello I have one problem,don't work select with this work's fine <select name="age" > <option value="18">18</option> <option value="19">19</option> </select> I have problem with this,how make to to function this code <div class='selectBox'> <span class='selected'></span> <span class='selectArrow'>▼</span> <div class="selectOptions" > <span class="selectOption" value="Option 1">Option 1</span> <span class="selectOption" value="Option 2">Option 2</span> <span class="selectOption" value="Option 3">Option 3</span> </div> </div> I hope that in the right section
  17. Hello,can anyone help me create members search script? here is image example here is 'users 'table `id` int(11) NOT NULL auto_increment, `age` varchar(200) collate utf8_unicode_ci NOT NULL, `city` varchar(200) collate utf8_unicode_ci NOT NULL, `username` varchar(30) collate utf8_unicode_ci NOT NULL, `password` varchar(150) collate utf8_unicode_ci NOT NULL, `salt` varchar(10) collate utf8_unicode_ci NOT NULL, `mgroup` int(3) NOT NULL, `email` varchar(100) collate utf8_unicode_ci NOT NULL, `ip` varchar(15) collate utf8_unicode_ci NOT NULL, `posts` int(11) NOT NULL, `date_joined` varchar(25) collate utf8_unicode_ci NOT NULL, `logged_in` int(1) NOT NULL default '0', `last_action_time` int(25) NOT NULL, `signature` text collate utf8_unicode_ci NOT NULL, `avatar` varchar(300) collate utf8_unicode_ci NOT NULL default 'default', `what_is_doing` varchar(30) collate utf8_unicode_ci NOT NULL, `what_is_doing_id` varchar(100) collate utf8_unicode_ci NOT NULL, `name` varchar(200) collate utf8_unicode_ci NOT NULL, `website` varchar(200) collate utf8_unicode_ci NOT NULL, `title` varchar(150) collate utf8_unicode_ci NOT NULL, `rank_pips` int(11) NOT NULL, `friends` tinytext collate utf8_unicode_ci NOT NULL, `blocks` tinytext collate utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; 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.