Jump to content

sasori

Members
  • Posts

    332
  • Joined

  • Last visited

Everything posted by sasori

  1. Hi, I'm about to implement a chat messaging feature which will be used by both web and mobile platform. I only code in PHP....in some messaging clients or just chatbox from websites, you can see the other person status as "is typing..." this indicates that the application can detect whether the other party is actually doing something in the chatbox right? my question now is, is there a way to implement this by just using php?, without using nodejs , websockets or what not.
  2. can someone please help me understand the concept how to implement the "Domand Driven Design" strategy in PHP ? ok let's say for example I have a user and a user got multiple addresses. so the user got e.g class User { public $userId; public $name; public $age; public function setUserId($userId) { $this->userId = $userId; } public function getUserId() { return $this->userId; } public function setName($name) { $this->name = $name; } public function getName() { return $this->name; } public function setAge($age) { $this->age = $age; } public function getAge() { return $this->age; } } Then Address got e.g class Address { public $addressId; public $country; public $city; public $zip; public function setAddressId($addressId) { $this->addressId = $addressId; } public function getAddressId() { return $this->addressId; } public function setCountry($country) { $this->country = $country; } public function getCountry() { return $this->country; } public function setCity($city) { $this->city = $city; } public function getCity() { return $this->city; } public function setZip($zip) { $this->zip = $zip; } public function getZip() { return $this->zip; } } So how to apply the concept of the Domain Driven Design here ?
  3. Hi, I'm trying to develop a web app to get the number of facebook likes, and number of facebook comments on a particular facebook page post content by just inputting the facebook page id via url or to whatever input form that i'm gonna create. My question now is, 1) do we always need to have user access token ? or page access token is enough already and we can save it in some php config file? because while I was playing with the graph explorer, and I logged out the fb page from another browser, the graph explorer insisted that I need a user access token, any inputs is much appreciated, as this is my first time to mingle with facebook apis
  4. But it's not actually a bot..the concept of the proposed experiment, was , enable the user to login in within that platform, and choose the shops that he/she like to have his/her ad posted by just filling up a form and one click of a submit button. But still I find it hard. I've already tried cURLing in one of the target sites and since it has no api available I failed already. ))
  5. ok I'll tell the real score why I came up with this question..it's because one of my colleague asked me to experiment and create a platform that can do cross posting to other shopping sites, so that sellers can use it and ease the pain of opening tabs of different sites and posting again and again...
  6. That's the exact thing I want to achieve from my first post, I only used ebay as an example. Because my real target website that is similar to ebay, has no open API end point at all. And yes, the target website has a form, but, one needs to login before being able to post anything, can you give me a sample snippet on how to do it via cURL ?..I know how to use curl, but I just wanna see how others will do it
  7. Hi, Is it possible to cross post some data to a target site even if the target has not open API end point? let's say for example the ebay.com website. They have an API for developers to use and I think it's easy to post some data/ads to their site because of this maybe by just using CURL of php.. but what if my real target website doesn't have open API?, is it possible to do that in PHP?. can someone give me a short snippet how to do that if possible?,
  8. Hi, the scenario was like this, I was looking at an item in e.g groupon website. then I opened a new tab on my browser and logged-in to my facebook account, then I saw the particular item that I viewed from groupon is now being suggested/advertised on the facebook newsfeed, any ideas how this thing works?, I'm sure there's a technical explanation how it works, I just don't have any idea how it works... because I'm thinking of implementing that same feature in the web app that I am working on right now using PHP. so that if anyone viewed an item from my app, they'll see it too on their facebook newsfeeds useful replies are much appreciated. thanks in advance.
  9. the thing that has caused the issue is the white space in the image name...to fix the issue.. the sencha front-end code is now encoding the url being passed to me
  10. it's a jpeg image...how come other jpegs are being read without problems at all? here are the two images, the baby apparel is ok, but the knitted hat is causing that error I mentioned in this thread.. i'm not sure if this forum modified those files that i just attached in this reply
  11. it's not a script..i have a alot of random images in my local storage that i usually use for testing ... here's the part of the code $fext = pathinfo($url, PATHINFO_EXTENSION); $tmp_name = date('His') . rand() . "." . $fext; $filename = $path .'/'. $tmp_name; $cont = @file_get_contents($url); $op = @fopen($filename, 'w+'); @fwrite($op, $cont); @fclose($op); chmod($filename, 0777); $orientation = 999; $exif = null; if (strtolower($fext) == 'jpg' || strtolower($fext) == 'jpeg') { try { $exif = @exif_read_data($filename); } catch (Exception $e) { Yii::log($e->getMessage()); }; if (!empty($exif) && !empty($exif['Orientation'])) { $orientation = $exif['Orientation']; } $img = imagecreatefromjpeg($filename);
  12. Hi, before posting this problem, I already tried googling and tried those possible solutions that could help but still failed. I am having a problem with that PHP function imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error: based from what i found in google, some say, use ini_set("gd.jpeg_ignore_warning", 1); failed. some say, use init_set("memory_limit", -1) still failed I am sure that I am passing .jpg image, how come i keep on getting that error ? any suggestions of what to do?
  13. Hi, I just want to ask for some suggestions of open source web and mobile web ready cms kits that I can use for free? coz it takes time to build mobile web version of a website from scratch, that's why I am looking for a cms kits that is capable for web and web mobile Thanks in advance for all of your suggestions .....please take note..am looking for a "FREE" one not trial versions
  14. with regards to the issue, there's another thing, even if the response is "200" , if you check in firebug...you will see that there's "pink" colored bar in the timeline., does that mean incomplete upload? ..because the typical color of the "200" ok response is blue in firebug , right?
  15. 2 Problems Hi, 1 ) has anyone ever used the plupload ?, my problem right now is, when i triy uploading .gif files with big dimensions, it doesn't get through. but with jpeg,jpg it does work here's the current configuration of my plupload 'options' => array( 'runtimes' => 'gears,html5,flash,silverlight,browserplus', 'url' => $this->createUrl('upload'), "max_file_size" => '10mb', 'chunk_size' => '1mb', 'unique_names' => true, 'resize' => array('width' => 900, 'height' => 900, 'quality' => 90), 'filters' => array( array("title" => "Image files", "extensions" => "jpg,gif,png,jpeg") ), 2) how to throw an error to the user that the upload has failed ? , like e.g while uploading the internet connection has failed. and I wanna tell them that they need to re-upload the file? I added this in the array 'Error' => 'js:function(up,file){ alert("File was not uploaded properly"); }',
  16. Hi, is there such way/method/strategy to detect if the downloading of a file is finished?..my problem is like this. Scenario: when click the report generator button, a loading wheel icon appears because it takes a while to generate the spreadsheet...and now, when the download has finished and the spreadsheet was saved in the client's machine, the loading wheel icon is still there spinning.. the only way that I think of to remove that spinning wheel is by detecting if the downloading is finished and then hide the spinning wheel ..so how ?
  17. Hi, I am using php to generate report into a spreadsheet, basically, it goes like this. i have keyword links in the website..every click to that link was agreed to be a pageview. I can get the data and output it to the spreadsheet "accurately"..but my problem now is, the GA Analytics shows less pageview count with those keywords links, what's the best approach to solve this ?.any reply with code snippets is very much appreciated...thanks
  18. nevermind , it got solved by just using header("Location: to my chosen directory"); exit; But i don't know why or how no matter what pattern I used in the .htaccess, all the stuff that was typed after the slash of the main domain, shows "url not found in server", maybe it's with the framework........moving on, atleast it got solved now without using .htaccess, thanks for the time though... Off Topic: by the way,I suggest you read the manga version of the naruto, it's more advance than the cartoon series www.mangastream.com
  19. it says, page not redirecting properly...your suggested code , didn't worked at all, any other ideas how to solve this thing ? OFF TOPIC : here http://narutobase.net/Naruto-Shippuden-Episodes.html if you know the episode number , you can just browse youtube every weekend.
  20. here's the structure of the app htdocs somefiles myfolder /image /js index.html style.css protected /models /controllers /blahblabha index.php .htaccess what i want to happen is any stuff that I type after my domain name, should get redirected to the /myfolder like e.g www.mydomain.com -> www.mydomain.com/myfolder (with or without www) www.mydomain.com/blahblahbalh -> www.mydomain.com/myfolder (with or without www) dev.mydomain.com/omghowtodothis -> www.mydomain.com/myfolder (with or without www) http://www.mydomain.com/help-me-please-/how-to-do-this -> www.mydomain.com/myfolder(with or without www) so how to do that in .htaccess ? at first i tried this RewriteEngine On RewriteCond %{HTTP_HOST} ^(http://www.)?mydomain.com$ RewriteCond %{REQUEST_URI} ^/(.*)+$ RewriteRule (.*) http://dev.mydomain.com/$1 [R=301,L] RewriteRule ^$ /myfolder [L,R=301] but it wasn't able to cater for the stuffs that i typed after the main domain URL such as in my example above
  21. ok, I guess it has something to do with that solr function thingy or that highlighting function that adds the <em> thing to the keyword which was inputted to the search box , that produces these item search result listing view I cannot post the full dump of the code, I am using a framework, and it will take more post to explain each of things that is being called just to display that item listings view... but anyway, those two regex you've posted were awesome.... I'll mark this thread as solved, at some point .thanks alot
  22. thanks for these , it somehow has helped ease the pain.. now my problem is, some of the item description got wiped out totally
  23. yes and no.. example: the string appears like this The quick brown fox jumps over the lazy dog near the bank of the river Listed via Carousell - http://thecarousell.com I want to remove the Listed via Carousell - http://thecarousell.com of that string,, so that i can display only this The quick brown fox jumps over the lazy dog near the bank of the river but as I mentioned from the start of the thread, there are six types of them that I want to remove Listed via Carousell - http://carousell.co, Listed via Carousell - http://thecarousell.com Listed via Carousell - http://thecarousell.com/iphone Listed via <em>Carousell</em> - http://carousell.co Listed via <em>Carousell</em> - http://thecarousell.com Listed via <em>Carousell</em> - http://thecarousell.com/iphone every item description that I was trying to tell may contain any of those strings above, how to filter those 6 types in a single regex ? here's a screen shot of my problem
  24. can you also add the url? ..actually it's not a hyperlink when it gets displayed, it's a plain text in front end Note: that regex you posted will delete all the strings including the other text in the item's description right? ( i just tried it ) ... i only wanted to delete the particular exact strings that I mentioned those 6 types of strings that I mentioned is part of a string , like ., e.g The quick brown fox jumps over the lazy dog near the bank of the river Listed via Carousell - http://carousell.co or The quick brown fox jumps over the lazy dog near the bank of the river Listed via Carousell - http://thecarousell.com I only want a regex to remove these Listed via Carousell - http://carousell.co, Listed via Carousell - http://thecarousell.com Listed via Carousell - http://thecarousell.com/iphone Listed via <em>Carousell</em> - http://carousell.co Listed via <em>Carousell</em> - http://thecarousell.com Listed via <em>Carousell</em> - http://thecarousell.com/iphone because they are part of a text/string
  25. I only used $dirtyString variable when I posted the thread, to represent the item string that contains any of those strings that I mentioned that I should hide. yes it's happening in front-end , it will print the string...but the thing is, there is <em> tag when the string Carousell was search via the search box I tried to play with regex $str = "Listed via Carousell - http://carousell.co<br/> Listed via Carousell - http://thecarousell.com<br/> Listed via Carousell - http://thecarousell.com/iphone<br/> Listed via <em>Carousell</em> - http://carousell.co<br/> Listed via <em>Carousell</em> - http://thecarousell.com<br/> Listed via <em>Carousell</em> - http://thecarousell.com/iphone<br/>"; echo $str; echo "<br/><br/>"; $str = preg_replace("/Listed via <.*?>Carousell/","",$str); echo $str; the output went like this Listed via Carousell - http://carousell.co Listed via Carousell - http://thecarousell.com Listed via Carousell - http://thecarousell.com/iphone Listed via Carousell - http://carousell.co Listed via Carousell - http://thecarousell.com Listed via Carousell - http://thecarousell.com/iphone Listed via Carousell - http://carousell.co Listed via Carousell - http://thecarousell.com Listed via Carousell - http://thecarousell.com/iphone - http://carousell.co - http://thecarousell.com - http://thecarousell.com/iphone you see the first 3 didn't get detected at all.. what more if I want to totally hide all those 6 types of strings
×
×
  • 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.