woolyg
Members-
Posts
254 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
woolyg's Achievements
Advanced Member (4/5)
0
Reputation
-
Hi all, I need to take a PNG image, and superimpose a triangle shape into it, and make everything *outside* the triangle to be resampled as transparent, so it appears like the once-rectangular image is now a triangle (but it's still a rectangle with a non-transparent triangle within it). I've been searching all over, but the GD library seems to only work on rectangle/square images... has anyone seen any resources on how to do this? All the best, WoolyG
-
Thanks rythemton!
-
Hi Daj, I'm currently writing a similar app for a client, and have gotten a certain distance - I can save single attachments locally as well as the email details, but if there is more than one attachment, I run into problems. I'd be interested in working with you to see if you've managed to attain what you need to do, maybe my code thus far might help you out also..? Drop me a PM and I'll send you my email address. All the best, WoolyG
-
Hi all, Does anyone know how to extract attachments from an email that has more than one attachment associated with it? Getting the overall attachment data works fine using <?php $attachment_data = imap_fetchbody($inbox,$email_number,2); ?> ..but breaking up that data into its component attachments is eluding me, and I can't find anything on the PHP doco that enabled me to do it. All info appreciated, WoolyG
-
Hi all, Here's the code I'm using, after opening an IMAP stream to an inbox. The code previous to this opens the inbox, grabs the emails and iterates through them. This bit is checking an individual mail for attachments. <?php $structure = imap_fetchstructure($mbox, $email_number); $parts = $structure->parts; $fpos=2; for($i = 1; $i < count($parts); $i++) { $message["pid"][$i] = ($i); $part = $parts[$i]; if($part->disposition == 'ATTACHMENT') { // Save the attachment locally to the server // Find the file extension // Save the attachment to DB code here $fpos+=1; } } ?> When I run the script, I get a load of the following reply: Notice: Undefined property: stdClass::$parts in /var/www/html/site/public_html/cron/cron_email_import.php on line XXX Would this mean that there are no actual attachments in the email being processed? Has anyone ever dealt with this function before? All input appreciated. WoolyG
-
Hi all, Has anybody here had any experience controlling relays through a webserver (specifically PHP)? I'm looking at a potentially cool project, and functionality would be greatly added if I could control relays.. Possibly a left-field question, but any resources would be appreciated! WoolyG
-
Great - done. Thanks Fenway.
-
Hi all, I have a little MySQL question I hope I can get some input on. I'm designing a DB, and one of the tables' fields is going to comprise of a non-unique 10-digit integer. This tabel has the possibility to be huge (millions of rows), and the integer will be one of a couple of fields of the table that will be placed in the WHERE part of a SQL query, exactly matching the string in the field. My question is - assuming the table already has a primary key index, should I use an INT data type for this field, or a VARCHAR data type with a FULLTEXT index for more efficient searching? The number will always be 10 characters - either 10 characters or a zero (0). What would be the best data type to use here? Thanks, WoolyG
-
Sorry, I should have specified. msg_data_array is an array built out of a long string (messages_list), split and delimited by two colons. Just above the for() loop, is this code: var msg_data_array = messages_list.split('::'); Any ideas?
-
Here's my javascript: for(i=0;i<=20;i++) { // msg_data_array is a string with 20 items in it, all delimited by 2 hashes - ## var msgtext = msg_data_array[i].split('##'); } The script returns msgtext just fine, but I'm getting an error in firebug: msg_data_array is undefined .. Can anybody shed any light on this? All info appreciated. Thanks WoolyG
-
getimagesize() "No such file or directory" - but the image is there!
woolyg replied to woolyg's topic in PHP Coding Help
I've solved it - the end uer was placing a tab prior to the img ref. Thanks! -
getimagesize() "No such file or directory" - but the image is there!
woolyg replied to woolyg's topic in PHP Coding Help
Hi voip03 1. I've ensure the path exists. 2. I'm calling the image half way down a page from a function, so this will cause issues won't it? -
Hi all, I'm iterating 4 images out in a loop. All 4 images exist (definitely), and using an earlier script, have been resized to a width of 200px, so they are not large. I'm finding that if I use the following code: $image_info = getimagesize($filename); $type = $image_info['mime']; echo $type; .. some of the images come up with no mime type. Is this normal? As a (possible) result of / link to having no mime type assigned to it, I'm getting: [function.getimagesize]: failed to open stream: No such file or directory .. but I am positive the image exists. Viewing the image info in a browser gives "image/jpeg", so I'm a bit weirded out as to how the script queries the image for a mime type, and it returns nothing. Has anybody else seen this, can anyone help? All the best, WoolyG
-
why my div content is not refreshing by ajax in ie
woolyg replied to phpmady's topic in Javascript Help
Hi phpmady, You use the word "refresh", which could indicate that you need to use setInterval rather than setTimeout? Please see http://www.phpfreaks.com/forums/index.php?topic=327711.0, which I managed to work out for my own regularly-updating div issue... If you add a unique identifier in the URI of the data.php call (like a current timestamp, generated by javascript , something like that) then the recurring call will not be cached as it has a unique value in the URI being called. Just a thought. WoolyG -
OK, having delved a bit deeper, it was because IE was caching the ajax call. Once I changed: function update_user_credit_left_div($user_id){ // FUNCTION 48 ajax_refresh('<?php echo base_url(); ?>assets/ajax/ajax.update_user_credit_left_div.inc.php?uid=<?php echo $user_id; ?>', 'user_credit_left'); } // FUNCTION 48 to: function update_user_credit_left_div($user_id){ // FUNCTION 48 ajax_refresh('<?php echo base_url(); ?>assets/ajax/ajax.update_user_credit_left_div.inc.php?uid=<?php echo $user_id; ?>&t=' + (new Date()).getTime(), 'user_credit_left'); } // FUNCTION 48 .. the div began updating every 10 seconds as expected! Solved. Hopefully this can help someone else out some time. WoolyG