Current Path : /proc/self/root/home/sudancam/.trash/quran/ |
Current File : //proc/self/root/home/sudancam/.trash/quran/xml-create.php |
<?php include("includes/function.php"); function createfile($filename,$content){ if (!$handle = fopen($filename, 'w')) { $text = '<div class="alert">لايمكن فتح الملف ('.$filename.') .. يحتاج ترخيص 777</div>'; //exit; } if (fwrite($handle, $content) === FALSE) { $text = '<div class="alert">لايمكن الكتابة بداخل الملف ('.$filename.') .. يحتاج ترخيص 777</div>'; //exit; } $text = '<div class="alert">تم إنشاء ملف خريطة الموقع بنجاح<br /><a href="'.$filename.'">'.$filename.'</a></div>'; fclose($handle); return $text; } function create_xml($site,$htmlorphp){ global $qn; $code = '<?xml version="1.0" encoding="utf-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> <url> <loc>'.$site.'</loc> </url>'."\n"; for($i=1; $i<=114; ++$i){ if($htmlorphp==1){ $links = 'sora-'.$i.'.html'; }else{ $links = 'index.php?sora='.$i.''; } $code .= '<url> <loc>'.$site.'/'.$links.'</loc> </url>'."\n"; } for($i=1; $i<=5; ++$i){ if($htmlorphp==1){ $links = 'tafseer-'.$i.'.html'; }else{ $links = 'tafseer.php?type='.$i.''; } $code .= '<url> <loc>'.$site.'/'.$links.'</loc> </url>'."\n"; } for($i=1; $i<=5; ++$i){ for($i2=1; $i2<=114; ++$i2){ if($htmlorphp==1){ $links = 'tafseer-'.$i2.'-'.$i.'.html'; }else{ $links = 'tafseer.php?sora='.$i2.'&type='.$i.''; } $code .= '<url> <loc>'.$site.'/'.$links.'</loc> </url>'."\n"; } } for($i=1; $i<=5; ++$i){ for($i2=1; $i2<=114; ++$i2){ for($i3=1; $i3<=$qn[$i2]; ++$i3){ if($htmlorphp==1){ $links = 't-'.$i2.'-'.$i.'-'.$i3.'.html'; }else{ $links = 'tafseer.php?sora='.$i2.'&type='.$i.'&aya='.$i3.''; } $code .= '<url> <loc>'.$site.'/'.$links.'</loc> </url>'."\n"; } } } for($i=1; $i<=41; ++$i){ if($htmlorphp==1){ $links = 'language-'.$i.'.html'; }else{ $links = 'translate.php?l='.$i.''; } $code .= '<url> <loc>'.$site.'/'.$links.'</loc> </url>'."\n"; } for($i=1; $i<=41; ++$i){ for($i2=1; $i2<=114; ++$i2){ if($htmlorphp==1){ $links = 'translate-'.$i2.'-'.$i.'.html'; }else{ $links = 'translate.php?sora='.$i2.'&l='.$i.''; } $code .= '<url> <loc>'.$site.'/'.$links.'</loc> </url>'."\n"; } } $code .= '</urlset>'; return createfile("sitemap.xml",$code); } $form = '<div class="xmlcreate"> <h2>انشاء ملف خريطة الموقع sitemap.xml</h2> <form name="FormName" action="" method="post"> <input name="action" type="hidden" value="create_sitemap" /> اكتب رابط الموقع بدون علامة السلاش بالأخير مثلا<br />http://www.nwahy.com/holyquran<br /><input type="text" name="site" class="input1" /><br /><br /> تفعيل خاصية تحويل الروابط الى html<br /><select size="1" name="rewriterule"> <option value="1" selected="selected">نعم</option> <option value="0">لا</option> </select><br /> <input type="submit" value=" إبدأ في إنشاء الملف " class="input2" /> </form></div>'; if(file_exists("sitemap.xml")){ $MSG = '<div class="alert">ملف خريطة الموقع موجود بموقعك<br /><a href="sitemap.xml">من هنا</a><br />إن كنت تريد انشاء ملف جديد فقط غيّر تسمية الملف أو قم بحذفه حتى تتمكن من إنشاء ملف جديد لخريطة الموقع</div>'; }else{ if(isset($_POST['action']) AND $_POST['action'] == "create_sitemap"){ $rewriterule = intval($_POST['rewriterule']); $site = htmlspecialchars($_POST['site']); if (function_exists('filter_var')) { if (filter_var($site, FILTER_VALIDATE_URL)) { $MSG = create_xml($site,$rewriterule); }else{ $MSG = '<div class="alert">الرابط غير صحيح !</div>'; } }else{ if($site == ""){ $MSG = '<div class="alert">لا تترك خانة رابط الموقع فارغه</div>'; }else{ $MSG = create_xml($site,$rewriterule); } } }else{ $MSG = $form; } } $titletag = 'إنشاء ملف sitemap'; $Template->TemplateType = 1; $Template->description = $m1; $Template->keywords = $m2; $Template->title = $titletag; $content = $Template->tpl_content("<a href='".$siteurl."'>".$sitename."</a> » ".$titletag."",$MSG); $menu = $Template->tpl_menu_ar($Q_W[23],language_ul()); $menu .= $Template->tpl_menu_ar($Q_W[21],$function_sora_menu); $menu .= $Template->tpl_menu_ar($Q_W[22],tafseer_ul($type)); if($addthis_allow==1){ $menu .= $Template->tpl_menu_ar($Q_W[24],addthis($addthis_style)); } echo $Template->Template_view($content,$menu); ?>