Jump to content

dmaxey

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Everything posted by dmaxey

  1. Eureka. got it showing correctly. i replaced, <p style="margin-bottom:0px;">'. $item->description . '</p> with. <p style="margin-bottom:0px;">'.iconv ( 'UTF-8', 'ISO-8859-1', $item->description ). '</p> So to my untrained eye it looks like I have converted the feed back to the ISO original. The quotation marks show as 66 99 so pleased. Thank you all for the helpful advice and Happy New Year to you all. From a 63 year old php newbie.
  2. The coding on the rss feed is <?xml version="1.0" encoding="ISO-8859-1" ?> I have no control over that. My page that shows the feed has <meta http-equiv="content-type" content="text/html; charset=utf-8" /> My xml feeds read <?xml version="1.0" encoding="UTF-8"?> The problematic part is the double quotes which look like the traditional 66 99 Hope they put a new feed on soon and then everything will be ok. Only happens occassionaly Regards
  3. Just seen your previous post. went to the feed as in the define('STORE_XML_RSS_FILE' , htmlentities('http://www.computerweekly.com/feed/0ac94b78-3177-43d3-936c-ae5e60aaa69d/CW360/The-latest-IT-News-headlines.xml')); Browser shows this With cloud computing, as with data breaches, it is a question of “when” not “if”, so what can information security professionals do practically to manage security compliance in the cloud? source shows this. <description><![CDATA[With cloud computing, as with data breaches, it is a question of “when” not “if”, so what can information security professionals do practically to manage security compliance in the cloud?]]></description> Kindest regards
  4. Tried for several hours and tried many different inserts but the best I get by $output .= ' <td style="border:none;"><h3 > <img src="images/headers/rss.png" width="68" height="67" alt="rss logo " style="float:left;"/>'. $item->title.'</h3> <p style="margin-bottom:0px;">'. htmlentities( $item->description). '</p> <p><span style="font-size:8px;">'. $item->pubDate.'</span></p> </td> '; // checks the loop. If it's >= 2 (indicating that it's looped 3 times)... if ($i >= 0){ // start new row $output .= "</tr>"; // reset loop $i = 0; } // if not, add one to the loop else $i++; break; } // finishes table $output .= '</table>'; return htmlentities($output); Shows all the table parts and more rubbish. I am echoing all the table so understand this what I dont understand is where I should do the echo of htmlentities() This problem occurs very rarely so I understand I must put up with it. Very irritating. Thanks again for your help. Happy New Year to you and yours.
  5. Doing nothing this is shown, With cloud computing, as with data breaches, it is a question of âwhenâ not âifâ, so what can information security professionals do practically to manage security compliance in the cloud? When I put <p style="margin-bottom:0px;"> '.htmlentities($item->description ).'</p> I get With cloud computing, as with data breaches, it is a question of âÂ�Â�whenâÂ�Â� not âÂ�Â�ifâÂ�Â�, so what can information security professionals do practically to manage security compliance in the cloud? So where do I put the echo htmlentities() Bed now will try again tomorrow. Thanks again
  6. Following your advice I got inserts working but have struggled with rss feeds. so here is the code to print the rss. <?php define('STORE_XML_RSS_FILE' , htmlentities('http://www.computerweekly.com/feed/0ac94b78-3177-43d3-936c-ae5e60aaa69d/CW360/The-latest-IT-News-headlines.xml')); require_once(($_SERVER['DOCUMENT_ROOT'] .'/functions/templates.php')); /** Functions **/ function get_xml_rss() {return new SimpleXMLelement(file_get_contents(STORE_XML_RSS_FILE));} ?> <?php function render_products_from_RSS() { if ($xml = simplexml_load_file(STORE_XML_RSS_FILE)) { $output = "<table><tr>"; // sets loop to 0 $i = 0; // starts looping through products foreach ($xml->channel->item as $item) { $output .= ' <td style="border:none;"><h3 > <img src="images/headers/rss.png" width="68" height="67" alt="rss logo " style="float:left;"/>'. $item->title.'</h3> <p style="margin-bottom:0px;"> '. $item->description.'</p> <p><span style="font-size:8px;">'. $item->pubDate.'</span></p> </td> '; // checks the loop. If it's >= 2 (indicating that it's looped 3 times)... if ($i >= 0){ // start new row $output .= "</tr>"; // reset loop $i = 0; } // if not, add one to the loop else $i++; break; } // finishes table $output .= '</table>'; return $output; } else $output .= 'News cannot be displayed at this time.'; } ?> and finally <?php echo render_products_from_RSS();?> [/code Kindest regards
  7. I will try and use the advice you have already given to try to sort out the inserts and rss feeds. If I fail I will post the code of only one problem. Kindest regards David
  8. Thank you ever so much. That works exactly as you expected it would. So is the Rss feed an impossible conundrum or would you allow me to post the code, in the forum's . . . BBCode tags. For your perusal. Once again many thanks and kindest regards.
  9. Right, forget the rss feeds. Just help me with a short bit of code . Above the head I have the following code which sets the setlocale. <?php require_once 'functions/functions.php'; ini_set('display_errors', 'Off'); ini_set('display_startup_errors', 'Off'); error_reporting(0); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <?php date_default_timezone_set('Europe/paris'); setlocale(LC_ALL, array('fr.UTF-8','fr_FR@euro','fr_FR','french')); ?> <head> Then in the body I have <?php $french= strftime("%A %d %B %Y - %H:%M",time()); echo $french; ?> which shows as jeudi 29 d�cembre 2011 - 19:36 I would like it to show as jeudi 29 décembre 2011 - 19:36 I am sure all this was in the first post however just the one question now so hope this simplifies the subject. Will you be able to advise? Kindest regards
  10. Thank you for bearing with me. I am not sure I can explain in any other way but here goes. strftime is something I have no control over, so should it be inserted in a formula to be changed by htmlentities? If so like what? The rss feeds are processed through xml, thus function render_products_from_RSS() { if ($xml = simplexml_load_file(STORE_XML_RSS_FILE)) { $output = "<table><tr>"; // sets loop to 0 $i = 0; // starts looping through products foreach ($xml->channel->item as $item) { $output .= ' <td style="border:none;"><h3 > <img src="images/headers/rss.png" width="68" height="67" alt="rss logo " style="float:left;"/>'. $item->title.'</h3> <p style="margin-bottom:0px;"> '. $item->description.'</p> <p><span style="font-size:8px;">'. $item->pubDate.'</span></p> </td> '; // checks the loop. If it's >= 2 (indicating that it's looped 3 times)... if ($i >= 0){ // start new row $output .= "</tr>"; // reset loop $i = 0; } // if not, add one to the loop else $i++; break; } // finishes table $output .= '</table>'; return $output; } else $output .= 'News cannot be displayed at this time.'; } ?> Should the htmlentities go here? Please advise in a manner I may understand. Kindest regards and thanks for the help so far.
  11. I hope you mis-understood me or I am lost. When I write an insert I correctly code to show acute and grave accents and anything else for that matter. That shows perfectly. The problem arises with <?php $french= strftime("%A %d %B %Y - %H:%M",time()); echo $french; ?> Showing jeudi 29 d�cembre 2011 - 08:59 I have perused the link you gave but cannot see where I would implement it. I have no control over what php sends from <?php date_default_timezone_set('Europe/paris'); setlocale(LC_ALL, array('fr.UTF-8','fr_FR@euro','fr_FR','french')); ?> The rss feeds are feeds from other people and once again I have no control over their feed. Is there a way of using htmlentities to show the feeds correctly. once I receive them. I just need pointing in the right direction and dont mind messing but I would appreciate a valid pointer.
  12. If one inserts acute letters, grave letters, ampersands and accented letters in xhtml they show perfectly on the page. However if one uses insert or rss feed they show as � or a square. How does one make them show correctly.
  13. Finally found a way to do this. My wamp server is obviously windows but my web host is Linux. So this goes before the head <?php date_default_timezone_set('Europe/madrid'); setlocale(LC_ALL, array('es.UTF-8','es_ES@euro','es_ES','spanish')); ?> and this goes in the body <?php $spanish= strftime("%A %d %B %Y - %H:%M",time()); echo $spanish; ?> Just change country identifiers for different ones.
  14. Right I have <?php setlocale(LC_Time, 'nld_nld'); $dutch= strftime("%A %d %B %Y - %H:%M",time()); echo $dutch; ?> which shows woensdag 28 december 2011 - 15:36 on my wamp server. When I put it online it shows Wednesday 28 December 2011 - 15:50 Where, exactly, am I going wrong
  15. Thanks for your reply. I have been there before and struggled to understand. I have tried this but just shows jS \of F Y H:i:s. instead of Woensdag 28 december 2011 13:49:28. <?php /* Set locale to Dutch */ setlocale(LC_ALL, 'nl_NL'); echo strftime("l jS \of F Y H:i:s."); ?> Will you give me further advice?
  16. I have a time and date using the code echo date("l jS \of F Y H:i:s."); Now I need to show this in several different languages, including French German and Dutch I have tried setlocale(); and echo strftime The date shows but still in English. Any idea how to show the day date and time in Php for the languages suggested.
×
×
  • 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.