السلام عليكم
لدي هاك في موقعي يقوم باحضار اخر المواضيع
قمت بتحويل موقعي الى الاجاكس
ولكن عند تحويلي لوصلات هذا الهاك (كي يتوالم مع الموقع) لو تعمل
واعتقد ان المشكله بسبب ان استدعاء هذا الهاك بالجافا بواسطه هذا الكود
<SCRIPT language=javascript src="http://mysite.com/news/remote_headlines.php"></SCRIPT>
اما كود الهاك هذا هو
<?PHP
//----------------------
// CONFIGURATION
//----------------------
$template = "{date}: [link]{title}[/link]<br>"; //: you can use {date}, {title}, {author} and
$date_format = "d M Y"; //: for help on date format go here:
http://www.php.net/manual/en/function.date.php
$local_news_page = "http://yoursite.com/my_news.php"; //: URL to page where you include your news eg.
http://mysite.com/index.php
$remote_target = "_blank"; //: _blank = open in new window; _top = open in same window;
//----------------------
// END CONFIGURATION
//----------------------
if(!$PHP_SELF){
if($HTTP_POST_VARS) {extract($HTTP_POST_VARS, EXTR_PREFIX_SAME, "post_");}
if($HTTP_GET_VARS) {extract($HTTP_GET_VARS, EXTR_PREFIX_SAME, "get_");}
if($HTTP_COOKIE_VARS) {extract($HTTP_COOKIE_VARS, EXTR_PREFIX_SAME, "cookie_");}
if($HTTP_ENV_VARS) {extract($HTTP_ENV_VARS, EXTR_PREFIX_SAME, "env_");}
}
if($PHP_SELF == ""){ $PHP_SELF = $HTTP_SERVER_VARS[PHP_SELF]; }
$all_news = file("./data/news.txt");
$i = 0;
echo"<!-----\n";
echo"//News powered by News: http://mini-5pider.com\n";
foreach($all_news as $single_news){
$news_arr = explode("|", $single_news);
if($category != "" and $category != $news_arr[6]){ continue; }
$output = $template;
$output = str_replace("{title}", "$news_arr[2]", $output);
$output = str_replace("[link]", "<a href='$local_news_page?subaction=showfull&id=$news_arr[0]&archive=' target='$remote_target'>", $output);
$output = str_replace("[/link]", "</a>", $output);
$output = str_replace("{author}", "$news_arr[1]", $output);
$output = str_replace("{date}", date($date_format ,"$news_arr[0]"), $output);
echo"document.write(\"$output\");\n";
$i++;
if($number != "" and $i == $number){ break; }
}
echo"//----->\n";
?>
طبعا التعديل رايح يكون بالسطر الخاص بالوصله الي هو
$output = str_replace("[link]", "<a href='$local_news_page?subaction=showfull&id=$news_arr[0]&archive=' target='$remote_target'>", $output);
وبتحديد اكثر
<a href='$local_news_page?subaction=showfull&id=$news_arr[0]&archive=' target='$remote_target'>
حيث عند ادخال الاجاكس الى هنا يصبح هكذا
<a href=javascript
:; onclick=\"include('$local_news_page?subaction=showfull&id=$news_arr[0]&archive=','contentarea')\">
اتمنى اكون نجحت بتوضيح المشكله
اعتقد ان الحل تعديل الهاك لتغيير وطريقه الاستعداء
اتمنى اجد المساعده
تحياتي للجميع