Jump to content

webster

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by webster

  1. Thanks , Solves by installing the forum on directory not on sub-domain in host. It seems the server have problem in sub-domains dns settings. Regards,
  2. Hello, When I select and copy an image from a web-page into the bb rich-text editor, the image doesn't appear, I checked the source Imge Sorce <img style="max-width: 600px; cursor: pointer;" onclick="window.open(this.src)" src="images/smilies/smile.png" border="0" alt="" title="" class="inlineimg" /> I found it is saved in the post like. http://mydomain.com/images/smilies/smile.png[/code] This image is not in my website. Can you please modify this code to make the image bb code be like: http://somewebsite.com/images/smilies/smile.png[/code] else if (g == "img") { if (isWebKit) { f = f.replace(/<img(.*?)src="(.*?)">/gi, "[img=http://$2]"); } else { f.match(/<img(.*?)src="(.*?)"(.*?)>/gi); var s = RegExp.$2; s = s.replace("./", ""); if (s.toLowerCase().substr(0, 7) != "http://") { var t = document.URL; t = t.replace("http://", ""); var u = t.split("/"); var v = "http://"; for (var d = 0; d < u.length; d++) { if (d < u.length - 1) { v += u[d] + "/"; } } f = f.replace(/\<img(.*?)src="(.*?)"(.*?)>/gi, "[img=http://" + v + s + "]"); } else { f = f.replace(/<img(.*?)src="(.*?)"(.*?)>/gi, "[img=http://$2]"); } } Regards,
  3. Thanks for reply, You mean DNS issue in my internet connection or that domains DNS !! It is working with a friend, I tried diffrenet RSS links, same thing do I need to ask the ISP for proxy settings if there!!! Regards,
  4. Hello, I'm using pbb forum http://xemix.pl/ When I tried to get topics using rss feeds module, I got this error. Fatal error: Uncaught exception 'Exception' with message 'Erroe occured while loading url by cURL. Couldn't resolve host 'pbboard.com'' in /home/a5402323/public_html/includes/FeedParser.php:226 Stack trace: #0 /home/a5402323/public_html/includes/FeedParser.php(157): FeedParser->getUrlContent() #1 /home/a5402323/public_html/modules/admin/feeder.module.php(218): FeedParser->parse('http://absba.or...') #2 /home/a5402323/public_html/modules/admin/feeder.module.php(49): PowerBBFeederMOD->_AddFeedStart() #3 /home/a5402323/public_html/admin.php(89): PowerBBFeederMOD->run() #4 {main} thrown in /home/a5402323/public_html/includes/FeedParser.php on line 226 the host said thet Hello,cURL is installed by default here Many Thanks,Helpdesk Staff any help !!!!
  5. I found it here: http://www.php.net/manual/en/function.urldecode.php mkaganer at gmail dot com 04-Dec-2007 02:58 B.H. I had troubles converting Unicode-encoded data in $_GET (like this: %u05D8%u05D1%u05E2) which is generated by JavaScript's escape() function to UTF8 for server-side processing. Finally, i've found a simple solution (only 3 lines of code) that does it (at least in my configuration): <?php function utf8_urldecode($str) { $str = preg_replace("/%u([0-9a-f]{3,4})/i","&#x\\1;",urldecode($str)); return html_entity_decode($str,null,'UTF-8');; } ?> note that documentation for html_entity_decode() states that "Support for multi-byte character sets was added at PHP 5.0.0" so this might not work for PHP 4
  6. I don't advice to remove that unicode mark unless you need to and it is necessary to add <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> between <head></head>
  7. Hello, header(); ... header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file. <html> <?php /* This will give an error. Note the output * above, which is before the header() call */ header('Location: http://www.example.com/'); ?> or <?php /* This will give an error. Note the output * above, which is before the header() call */ header('Location: http://www.example.com/'); ?> or <?php /* This will give an error. Note the output * above, which is before the header() call */ header('Location: http://www.example.com/'); ?> If you uploaded your php file with above codes you will get a warning: Warning: Cannot modify header information - headers already sent by ... Those are shown errors but what about hidden characters like  that been written using editors if you saved the file with character encoding utf-8. only a none unicode compatible editor (cute html v2.6-2001) will show that marker at the start of the unicode file. There is an edit program (Editpad lite - free from http://www.editpadpro.com/editpadlite.html) has an option to write that marker or not. Click on Options > Configure file types > Encoding Hope that was useful!, I found this trick, is it known to you ??? Regards, M.Shair [attachment deleted by admin]
  8. How to use ajax with none english letters like (ċ,á,ä,è,ص,ל,מ,ע,...) I have two pages "test.htm" with the ajax request jscript. When I write english letters, I got them ok. But when I write none english letters I got ? ? I modified the line url=url+"?q="+str to be url=url+"?q="+escape(str) Now I got like this "c%u010B" how can i deal with these characters while date stored in none english letters. Is it clear !!! I tried to use urldecode(); and urlencode() ... is there somthing else ??? test.htm <html><head> <title>ajax test</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript"> var xmlHttp function showResult(str){ if (str.length==0) { document.getElementById("livesearch"). innerHTML=""; document.getElementById("livesearch"). style.border="0px"; return } xmlHttp=GetXmlHttpObject() if (xmlHttp==null){ alert ("Browser does not support HTTP Request") return } var url="test.php" url=url+"?q="+escape(str) url=url+"&sid="+Math.random() xmlHttp.onreadystatechange=stateChanged xmlHttp.open("GET",url,true) xmlHttp.send(null) } function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("livesearch").innerHTML=xmlHttp.responseText; document.getElementById("livesearch"). style.border="1px solid #A5ACB2"; } } function GetXmlHttpObject(){ var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try {xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} } return xmlHttp;} </script> </head> <body> <form> <div class="div1">Live Search</div> <div class="div2"> <input type="text" id="txt1" size="18" onkeyup="showResult(this.value)"> <div id="livesearch"></div> </div></form> </body> </html> test.php <?php print $q=$_GET["q"]; ?> Regards
  9. Thank you for those great MODs; it works . I tested it also with ajax xmlHttp request by sending $start and $end. .. var url="getcd.php?s="+s+"&e="+e+"&sid="+Math.random(); .. but what do recommend for less server load "direct xml" in php or using "ajax", I think the first method is good for indexing page text. Thanks again. Reagards, M.Shair
  10. Hello, Any one can help me to modify this code to display only selected range of records instead all records. I want to make this code display records from 10 to 20 <?php $doc = new DOMDocument(); $doc->load( 'books.xml' ); $books = $doc->getElementsByTagName( "book" ); foreach( $books as $book ) { $authors = $book->getElementsByTagName( "author" ); $author = $authors->item(0)->nodeValue; $publishers = $book->getElementsByTagName( "publisher" ); $publisher = $publishers->item(0)->nodeValue; $titles = $book->getElementsByTagName( "title" ); $title = $titles->item(0)->nodeValue; echo "$title - $author - $publisher\n"; } ?> --------------------- I modified this code using break; <?php $xml = new SimpleXMLElement( ' <C> <J><N>1n</N><K>ships</K></J> <J><N>2n</N><K>fisch</K></J> <J><N>3n</N><K>wine</K></J> <J><N>4n</N><K>wine1</K></J> <J><N>5n</N><K>wine2</K></J> <J><N>6n</N><K>wine3</K></J> <J><N>7n</N><K>wine4</K></J> </C>'); $vals = array(); RecurseXML($xml,$vals); foreach($vals as $key=>$value) print $value; function RecurseXML($xml,&$vals,$parent="") { $childs=0; $child_count=-1; # Not realy needed. $arr=array(); foreach ($xml->children() as $key=>$value) { if(in_array($key,$arr)){$child_count++;} else {$child_count=4;} $arr[]=$key; $k=($parent == "") ? "$key.$child_count" : "$parent.$key.$child_count"; $childs=RecurseXML($value,$vals,$k); if($childs==0){$vals[$k]=(string)$value;} if($child_count=="5"){break;} //display only first three records but how to display from 2 to 5 } return $childs; } ?> ----------------- In javascript I can use this code (ie > 5 only) x=xmldat.recordset; for (i=2;i<=5;i++){ x.absoluteposition=i; block2.innerHTM=block2.innerHTM+x('K') } </script> page should contain form named as form1 and textarea named text and a button to call the function. This example is not i'm asking for but to explain what i'm asking help for (xml in php and renge of records). Please try on the 1st php code; it is bettter for me. Regards, M.Shair
×
×
  • 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.