Jump to content

Minklet

Members
  • Posts

    88
  • Joined

  • Last visited

    Never

Everything posted by Minklet

  1. I'm trying to tidy up my code by getting to grips with OOP. I know that this isnt really OOP, but I want to put a cache system into a function. The bit in comments is basically the bit that I want to put into a function. As you can see its fairly rudimentary but basically I dont know how to get what 'include' produces into the output buffer because, of course, its not actually outputting anything. I thought something like fopen() but its all PHP scripts in the include so taht wont work Anyway, this is what I have: $cachefile = 'cache/cache_blogphotofeed.html'; $include = 'feeds/blogphoto_feed.php'; $table = 'our_photos'; if (file_exists($cachefile)) { if (is_outdated($cachefile, $table, $dbc)) { // This bit ob_start(); include($include); $fp = fopen($cachefile, 'w'); fwrite($fp, ob_get_contents()); fclose($fp); // close the file ob_end_flush();[/b] // To this bit } else { include($cachefile); } } else { ob_start(); include($include); $fp = fopen($cachefile, 'w'); fwrite($fp, ob_get_contents()); fclose($fp); // close the file ob_end_flush(); } The function is_outdated simply checks if the database table has been modified more recently than the cache file Any suggestions at all?
  2. Actually I said thankyou to those that tried to help, that included you. I also did post the solution. You appear to have missed out the first two sentences in my post.
  3. Strangely, despite adding it in the scripts, adding UTF-8 to htmlentities and changing the mysql charset did the trick. Thanks to the people who tried to help No thanks to the people who didn't (not one of you knew of a decent resource or even a place to find a freelancer?), I cant remember the last time I got some decent help on this forum. Sarcastic posting of the manual is usually the best I get, regardless of the question. Dev Shed helped me within an hour and 1 post, so kudos to them
  4. Still cant get this to work. Surely someone can point me to something to help me out? I refuse to believe that this issue is unfixable. These characters are handled fine by countless other sites, surely there is an answer. Like I said I can pay someone something (not much I'm a student). I might do a larry david and pay for just a response.
  5. Sadly didn't make a difference. One of the characters is an ampersand and is outputted as & How can there be a problem outputting this? Surely this is a clue? I'm actually willing to pay someone to help me now, so if anyone can come up with a reasonable offer to help me, give me a shout. PLEASE!
  6. Does anyone have ANY information about sanitizing (or whatever the term would be) text copied from websites into a text box? Because this could be worth an attempt to sort it out maybe. Seriously, no one can help me here?
  7. Sorry to keep bumping this but I really need to get this sorted and the stupid modify rules for posts on here mean i cant just add information to posts. It seems copying and pasting from other blogs, facebook and other sites into the text inputs for my site results in something that causes it to render them incorrectly For instance, this tracklist copied into the tracklisting field is fine http://forum.breakbeat.co.uk/tm.aspx?m=1972135876&mpage=1&key=shiverman But this one is not http://nottingham.subverb.net/blog/saltwater/ Despite being EXACTLY THE SAME I cant not allow my users to copy and paste from the main sites that they use and even the site that they are on! What is going on, can someone PLEASE help me here? There has to be something that I am doing wrong, either on the inputs or outputs - but I CANT FIND OUT WHAT
  8. Is there anything that might be going on at the server that I should ask about? But then, wordpress is working managing to display it absolutely fine. RSS validation is throwing this: Your feed appears to be encoded as "utf-8", but your server is reporting "US-ASCII" and 'utf8' codec can't decode byte 0x96 in position 3657: unexpected code byte (maybe a high-bit character?) The character in question is just a dash, that is actually being displayed fine when rendered as content. F*cksake.
  9. This is still not working and it is even breaking RSS feed. Does anyone have ANY information or ideas where I can get some? This is actually driving me insane
  10. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> Tried charset=iso-8859-1 and it managed to display the ••• characters correctly, but still not correct on the ones I posted above
  11. It's running from the same server and it's the same database
  12. P.s. this is the series of characters that are throwing up a question mark ∷∷∷∷∷∷ and these ○○○ and they aren't in the UTF-8 table, so does that mean I should be using a different encoding? Which wouldn't make sense because that is what the wordpress pages are using.
  13. I've just tried copying the contents of the field directly from phpadmin into my text editor and it pasted the dodgy characters as question marks, so this is even before it gets to browser there is a problem, does this mean anything? The database is in utf8_general_ci Apparently that's just my text editor, as copying and pasting into a text field on another website displays the characters correctly. I'm getting seriously annoyed by this now.
  14. Thanks for checking. I tried this <?php function _convert($content) { if(!mb_check_encoding($content, 'UTF-8') OR !($content === mb_convert_encoding(mb_convert_encoding($content, 'UTF-32', 'UTF-8' ), 'UTF-8', 'UTF-32'))) { $content = mb_convert_encoding($content, 'UTF-8'); if (mb_check_encoding($content, 'UTF-8')) { // log('Converted to UTF-8'); } else { // log('Could not converted to UTF-8'); } } return $content; } ?> With no result. What I don't understand is that wordpress manages to display the exact same database results. The offending content is copied directly from facebook, which I HAVE to be able to do, there is no way I can ask clients to retype everything - why would they? This is really irritating. I would go through the wordpress functions, but I really don't know where it would be and it's very doubtful that it would be easily decipherable
  15. I realise that it seems to be frowned upon to actually help people on this forum, but I genuinely cant find how to fix this. I've tried everything I can think of and had no joy, I've been looking all weekend. This is quite important and I can't see why wordpress can manage it with the same charset encoding, yet I can't in regular php. Can someone give me a hand please?
  16. I don't know to rectify this tho. There are very little results in google for this error, none of which I can get any useful information from Ive tried utf8_decode and encode with no results
  17. I have also tried SET NAMES utf8 and it then prints the string with the question mark in the diamond symbol
  18. Hi, I am geting questions marks in place of some characters. However, this only happens on my own queries and echo statements, the same database read by wordpress handles them fine. Can anyone tell me why? I have added UTF-8 headers and meta tags, the database is in UTF-8 encoding. I just can't figure out why wordpress can manage it and my php cant. I have tried htmlentities with no luck the offending page: http://subverb.net the wordpress blog echoing out the exact same title from the same database http://nottingham.subverb.net/blog/sounddhism/ Thankyou
  19. Oh dear, I'll get onto that then Thanks for the advice
  20. What browser are you using? I thought I had sorted that. Yeah, I'm getting a lot of negative responses about the yellow, I've emailed my designer about it. What exactly do you mean by lining the containers? You mean horizontally? Thanks
  21. Soon to be launched, would appreciate people pointing out anything I might have missed or my friends are being too 'friendish' to point out looks rubbish http://nottingham.subverb.net/index.php
  22. If this helps this: <object height="81" width="100%"> <param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F758467%3Fsecret_token%3Ds-f6d9b&secret_url=false"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F758467%3Fsecret_token%3Ds-f6d9b&secret_url=false" type="application/x-shockwave-flash" width="100%"></embed> </object> <span><a href="http://soundcloud.com/generalpie/june-09-chilled-soulful-dubstep-and-garage-mix">June 09 Chilled/Soulful Dubstep and Garage Mix</a> by <a href="http://soundcloud.com/generalpie">GeneralPie</a></span> matches with this: ~^<object height="(\d{2,3})" width="(\d{2,3})%">\s*' . '<param name="movie" value="(http://player\.soundcloud\.com/player\.swf\?url=http%3A%2F%2Fapi.soundcloud\.com%2F[\w-%]+&secret_url=(?:false|true))">\s*</param>\s*' . '<param name="allowscriptaccess" value="always">\s*</param>\s*' . '<embed allowscriptaccess="always" height="\1" src="\3" type="application/x-shockwave-flash" width="\2%">\s*</embed>\s*' . '</object> <span><a href="(.*?)">(.*?)</a>(.*?)<a href="(.*?)">(.*?)</a></span>$~
×
×
  • 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.