Jump to content

Ninjakreborn

Members
  • Posts

    3,922
  • Joined

  • Last visited

Everything posted by Ninjakreborn

  1. Is there a way to force a referrer of HTTPS for force future pages as HTTPS? So if the referrer had an http at the beginning then it does nothing. However, if the referrer started with https then every new pages that load will force SSL? So if you are at the site in SSL on index.php. If you click on a link that goes to about us and your IN SSL then it'll load up aboutus.php and notice that the referrer was https. So it'll force aboutus.php as an https request also. If it notices that it was standard http referrer the it leaves it as is. Is that possible with PHP or Htaccess?
  2. No the lack of time currently is coming from me looking for freelance projects. I currently have a small work load. Which means small income. So I was digging up more freelance work. The round of projects I hope to start because of that will keep me busy a few weeks. After that I would have the time to work on something. Perhaps I will PM you (radar) about it in about 2 weeks and maybe we can team up on something. Also that 50-60 hours per week are during personal times. I have about 16 hours Saturday and Sunday to relax or game or whatever. That's 32 hours already. I have about 5 hours per night (25 hours). So a total of about 60 hours almost. If I start on personal projects, I generally start taking up personal time for those.
  3. Well I use to like ActiveCollab but they headed into the opposite direction. Mostly just adding clients, projects, tasks, and time hours with a timer. Then being able to invoice them (optional). We could also team up on one if you wanted. It's definitely worth the idea.
  4. I play on average of about 50-60 hours per week when I am not working. I prefer them all. I make sure the first thing I get is all systems and whatever games I want. Right after bills comes games. If I "had" to pick a favorite it would be the 360. There are a great deal of games for that system. But every other system is good as well. Anything on old systems now (nintendo, super nintendo, sega, or any other old system) you can use an emulator/rom setup for them on your PC. I have all the old systems but don't normally use them because I can play them on my computer.
  5. I could build one but I have a very severe lack of time (lot's of different things) and trying to take on more paying work. I am trying to find perhaps even open source, then I could modify it. That would work well.
  6. I am looking for a very good (preferably free if possible, but I don't mind if it costs money if it's really good) application that will do a few things. I am wanting a system that has a collection of freelancer based tools. The main thing would be time tracking (with a timer) as well as managing clients, projects, and tasks. I would prefer something with invoicing. The closest thing I have found to what I was wanting was at http://www.timetask.com but they have too many limitations for the cheaper accounts. Anyone know of anything good?
  7. Actually whatever the code was before didn't work for some reason. So I went ahead and defaulted to stripping the comma's from the string. I will try out your patterns as well. I am trying to learn more about this Regex, but some of these patterns are really advanced. I have been trying to work with them a lot lately to get better with them. Thanks also for the explanation, it helped me understand what you were doing with it. Thanks again.
  8. One solution is to get the contents of the page like I am doing and then replace all ',' with '' instead. But that is a little resource intensive if there is a simpler way to take that into account for regex.
  9. I had some questions a few days ago that Wildteen helped me with. It was working great but I ran into a few issues, and I am trying to figure out how to make this work. Basically the code is: <?php preg_match_all("~\bInlinks\b \(([[:digit:]]+)\)~", $url, $num_backlinks); ?> So in this situation it's suppose to get numbers. The + apparently allows it to get multiple digit numbers. The only situation I have found this does not work in is in the thousands or some such. It adds a "comma" to the number and I am not sure how to screen that out. I was thinking of wildcard but it could be at the 10's or thousands..like 1,200 or 12,000 or even 120,000 or perhaps more. So the comma could be in different places. Is there something that I can replace [[:digit]]+ with that will take into account commas?
  10. Oh ok. I got it adjusted and now it's even working with the Inlinks part as well. Thanks again, I appreciate it.
  11. OK I appreciate that. I made some notes about the delimiters and other things you said. I tried it and it wasn't working, so I cut it out into a test case and it still wasn't working then reduced the pattern a little to try and make it more specific and it still wasn't working. Here is the current pattern and test case <?php $temp = preg_match_all("~\(([[:digit:]+])\)~", 'test whatever (1234) whatever test', $test); echo '<pre>'; print_r($test); echo '</pre>'; ?> I basically want to grab the numbers between (). So in this ist should just be start delimiter and then escape the ( and then inside that grab all the digits and then unescape the other ) and close delimeter. Any advice is appreciated. This test case returns an empty array. I will expand upon it myself to make sure the Inlinks is in front of it after I get the test case working but there must be something I am doing wrong here. Thanks again.
  12. <?php $temp = preg_match_all("\bInlinks\b \(([:digit:])\)", $url, $test); ?> OK I can't get this to work. I want to take a look at a giant string and return 1 instance of this "Inlinks (123)" The 123 could be replaced by whatever number of how many results. I am having a strange error like Warning: preg_match_all() [function.preg-match-all]: Delimiter must not be alphanumeric or backslash in /users1/functions.php on line 51 I tried the above regular expression also without the \b's around the text because I thought you could directly match using a word or something. So when the Regex finds the words Inlinks followed by a set of numbers in parenthesis I want to grab those numbers. My logic flow for this was match the word Inlinks followed by () (which is why I escaped the first set) then get any numeric characters inside that. But instead I get this error. Any advice would be apreciated.
  13. Very much so, thank you very much. Oh and Wildteen, I have not seen you in forever. It's not to see you around here again. Hope things are doing well for you. Thanks again for the help. I am really trying to jump into this Regex stuff, finally starting to write some of my own. After all this time I finally find out it's very helpful with some of the stuff I have had to do. Thanks again.
  14. <?php $url = file_get_contents('http://search.yahoo.com/search;_ylt=A0geu5jCGDhIk6gAr6pXNyoA?p=link:' . $domain); $preg = preg_match_all("=<span class\=\"url\">(.*)</span>=siU", $url, $results); ?> This simply goes and get's everything from a string where <span class="url">whatever</span> it grabs everything in the span tags. This works great..but why is it doubling the array? It returns $results as $array[0] and $array[1] with 0 and 1 both having a duplicate..so all of 0 has the text I want but the same text is in 1..why did it create it that way? More trying to figure this out so I can understand Regular Expressions better.
  15. Just for your information this is what I ended up putting together. Based off what I had (that was already working for JPG and PNG files, I have taken stuff from the resource you pointed to and it started working. Below is the final function I am using to resize that seems to work across the board for all image types. <?php function resize($width,$height) { // Setup new image $new_image = imagecreatetruecolor($width, $height); if( $this->image_type == IMAGETYPE_JPEG ) { } elseif( $this->image_type == IMAGETYPE_GIF) { $trnprt_indx = imagecolortransparent($this->image); // If we have a specific transparent color if ($trnprt_indx >= 0) { // Get the original image's transparent color's RGB values $trnprt_color = imagecolorsforindex($this->image, $trnprt_indx); // Allocate the same color in the new image resource $trnprt_indx = imagecolorallocate($new_image, $trnprt_color['red'], $trnprt_color['green'], $trnprt_color['blue']); // Completely fill the background of the new image with allocated color. imagefill($new_image, 0, 0, $trnprt_indx); // Set the background color for new image to transparent imagecolortransparent($new_image, $trnprt_indx); } } elseif( $this->image_type == IMAGETYPE_PNG ) { // These parameters are required for handling PNG files. imagealphablending($new_image, false); imagesavealpha($new_image,true); $transparent = imagecolorallocatealpha($new_image, 255, 255, 255, 127); imagefilledrectangle($new_image, 0, 0, $width, $height, $transparent); } // Resize image imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight()); $this->image = $new_image; } ?>
  16. Perfect. That led me to a function that I was able to cut up and use to fix my issue. Thanks, I didn't think I would ever get that working. I really appreciate that.
  17. <?php function resize($width,$height) { // Setup new image $new_image = imagecreatetruecolor($width, $height); if( $this->image_type == IMAGETYPE_JPEG ) { } elseif( $this->image_type == IMAGETYPE_GIF ) { imagealphablending($new_image, false); imagesavealpha($new_image,true); $transparent = imagecolorallocatealpha($new_image, 255, 255, 255, 127); imagefilledrectangle($new_image, 0, 0, $width, $height, $transparent); imagecolortransparent ( $new_image, $transparent); } elseif( $this->image_type == IMAGETYPE_PNG ) { // These parameters are required for handling PNG files. imagealphablending($new_image, false); imagesavealpha($new_image,true); $transparent = imagecolorallocatealpha($new_image, 255, 255, 255, 127); imagefilledrectangle($new_image, 0, 0, $width, $height, $transparent); } // Resize image imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight()); $this->image = $new_image; } ?> The stuff for the PNG and JPG work perfectly...but the GIF is not working. I tried the same thing that I am doing for PNG files and it's not working. Any advice on how to resize a GIF file and have it show up correctly..the full sized image works fine...but not when it's resized...
  18. It sounds like something wrong with how you put the database table together. A standard AutoInc field should start at one by default (unless you set it otherwise via SQL). Also if you are passing an "id" to the field then it will use that ID instead of an auto-inc number. Some SQL you ran on it probably screwed it up. Delete the database and all the tables, recreate them and retry. If that is not an option then create a new database/table and try it there. If it works then it's related to some SQL you ran on it that messed it up.
  19. <?php if ($_POST['submit'] == ''Add comment") { } ?> Also your Xhtml and PHP is malformed. Run the Xhtml through a validator. That might explain why it's being ignored instead of passing the variables. Proper form is important.
  20. I noticed on PHP.net there were a great deal of Pear files. These seem to be third party PHP classes that let you do things other systems won't. IS there ever a need for me to gather all of these together and package them into classes...or are some of them not really needed...I have never had to use them before and have only worked with a few classes that required them.
  21. OK here is the issue. I am trying to setup some Amazon S3 usage. I have it going really well currently (I mean I can do anything with photo's) but I am having trouble getting raw code for videos to stream. I am basically doing this... <?php function test($filename = 'niceday.wmv') { $filename = basename($filename); $file_extension = strtolower(substr(strrchr($filename,"."),1)); switch($file_extension) { case "mp3": $ctype="audio/mpeg"; break; case "wav": $ctype="audio/x-wav"; break; case "mpeg": case "mpg": case "mpe": $ctype="video/mpeg"; break; case "mov": $ctype="video/quicktime"; break; case "avi": $ctype="video/x-msvideo"; break; case "wmv": $ctype="video/wmv"; break; } //Use the switch-generated Content-Type header("Content-Type: $ctype"); echo $this->s3_get_file('niceday.wmv', 'theendlesstribute_tributevideos'); } ?> This is in codeignitor. Right now this tries to stream me a text file with the raw video source code. I am trying this on a WMV file. I am basically needing this function to get a video from S3 and then using the code generate a file internally that can be called..say I have a video player...I want to have it setup and call this test function and have it work properly... does that make any sense? What is the best way to go about doing this?
  22. Nevermind, of course you can. Was wondering while fighting with the Amazon S3 system. Finally figured it was just a filename issue. Thanks.
  23. Is there a way to get file contents (file_get_contents()) without having to fully upload the file? Meaning of having to do move_uploaded_file is there a way to get it directly after it's been loaded up without moving it to the server first?
  24. And the situation has been resolved. Use the above stuff I described when outputting an image..for PNG files this'll allow it to work properly..then if you need to do a resizing just do this and it all should fall into place... <?php function resize($width,$height) { // Setup new image $new_image = imagecreatetruecolor($width, $height); // These parameters are required for handling PNG files. imagealphablending($new_image, false); imagesavealpha($new_image,true); $transparent = imagecolorallocatealpha($new_image, 255, 255, 255, 127); imagefilledrectangle($new_image, 0, 0, $width, $height, $transparent); // Resize image imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight()); $this->image = $new_image; } ?> Seems I have resolved all issues. As a bonus the above code works for Jpg files as well.so I didn't have to do special conditions to check what filetype it was before doing this..so it seems this works for all images as well as fixes PNG issues. I haven't done any testing on GIF files so unsure how all that will work..but since this works for the JPG as well as fixes all issues with PNG files then it should support GIF files. This class I am using I got off the internet but I have heavily modified it so now that these issues are fixed I think I am going to carry it around with me now and start adding in debugging support and everything else. Thanks for the help, the only reason I was able to resolve it quicker was because of you pointing me in the right direction and giving me that link. Thanks again.
  25. I am still having issues with Resizing though..same thing. When it's a natural image it works, but when I need to resize it screws up. Now that I am past the basic issue I am working to debug the issue related to the resizing. In general the output issue was because certain PNG files have different information that others...some are 8, and some are 24..I think different ones (depending on how the backgrounds are done in them) cause some issues with the basic function and require a little more processing (as we figured out while working through it). I will let you know what works for the resizing once I get it sorted out.
×
×
  • 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.