تغطية مباشرة لأحداث منتدى الإعلام الجديد المقام بمدينة أبوظبي
هل تقترح تمديد مسابقة سوالف كاست؟

 

العودة   سوالف سوفت > قسم تطوير وبرمجة المواقع للمتقدمين > PHP
المدوّنات البحث مشاركات اليوم اجعل كافة المشاركات مقروءة

رد  
 
LinkBack أدوات الموضوع
عضو جديد
تاريخ التسجيل: Jan 2008-
#1 (permalink)  
مطلوب دالة الروابط الاعشوائيه


السلام عليكم

مطلوب دالة تظهر الروابط المواقع عشوائيه الموجودة في دليل المواقع وتتغير مع كل تحديث

واريد كيف طريقة تركيبها في دليل مواقع نواحي الجديد



وهذا الملف الذي اريد عمل فيه كود المواقع العشوائية :



كود PHP:
<?php
include("config.php");
include(
"function.php");
include(
"templates/template.php");

$id intval($_GET["id"]);
clean_value($id);

$Sql mysql_query("select * from dlil_site where id='$id'");
$Row mysql_fetch_array($Sql);
if (!
$Row)
{
error();
exit;
}

$Row['title'] = stripslashes($Row['title']);
$Row['title'] = htmlspecialchars($Row['title']);

$Row['url'] = stripslashes($Row['url']);
$Row['url'] = htmlspecialchars($Row['url']);

$t $Row['url'];
$t str_replace("http://","",$t);
$t str_replace("http://www.","",$t);
$t str_replace("http://www","",$t);
$t str_replace("www.","",$t);
$t str_replace("www","",$t);

$Row['metadescription'] = stripslashes($Row['metadescription']);
$Row['metadescription'] = htmlspecialchars($Row['metadescription']);

$Row['metakeywords'] = stripslashes($Row['metakeywords']);
$Row['metakeywords'] = htmlspecialchars($Row['metakeywords']);

$Row['country'] = stripslashes($Row['country']);
$Row['country'] = htmlspecialchars($Row['country']);

$Row['yourname'] = stripslashes($Row['yourname']);
$Row['yourname'] = htmlspecialchars($Row['yourname']);

$Row['yourmail'] = stripslashes($Row['yourmail']);
$Row['yourmail'] = htmlspecialchars($Row['yourmail']);

$d date("j/n/Y",$Row['date']);

if(
$Row['metadescription'] == ""){
$meta1 $t;
}else{
$meta1 $Row['metadescription'];
}

if(
$Row['metakeywords'] == ""){
$meta2 $t;
}else{
$meta2 $Row['metakeywords'];
}

if(
$Row['metadescription'] == $Row['title']){
$meta1 $t;
}else{
$meta1 $Row['metadescription'];
}

if(
$Row['metakeywords'] == $Row['title']){
$meta2 $t;
}else{
$meta2 $Row['metakeywords'];
}

$img "<a href='".$Row['url']."' title='".$Row['url']."'><img src='http://open.thumbshots.org/image.pxf?url=".$Row['url']."' border='0' vspace='0' hspace='0'>";

$p "» ".$Row['title']."<div dir='ltr' align='right'><a target='_blank' class='aa' href='site.php?siteid=".$Row['id']."'>".$Row['url']."</a></div>".$f."";

$sql2 = @mysql_query("update dlil_site set vis=vis+1 where id='$id'") or die ("Query failed4");

$Sqlx mysql_query("select * from dlil_catgory where id='".$Row['cat']."'");
$Rowx mysql_fetch_array($Sqlx);
$Rowx['title'] = stripslashes($Rowx['title']);
$Rowx['title'] = htmlspecialchars($Rowx['title']);

if(
$htmlorphp==1){
$sxx "section-".$Rowx['id'].".html";
}else{
$sxx "section.php?id=".$Rowx['id']."";
}

tpl_header($Row['title']);

echo 
"<div align='center'>
<center>
<table border='0' style='border-collapse: collapse' width='99%' id='AutoNumber10' cellpadding='2'>
<tr>
<td width='100%' valign='top'>"
;

echo 
"<div align='center'>
  <center>
<table class='xtable' width='98%' id='AutoNumber1555'>

<tr>
<td width='100%' colspan='5' class='xtr' align='center'>معلومات الموقع "
.$Row['title']."</td>
</tr>

<tr>
<td width='20%' class='xtr'>» عنوان الموقع</td>
<td width='80%' class='xtd'><a target='_blank' class='aa' href='"
.$Row['url']."'>".$Row['url']."</a></td>
</tr>

<tr>
<td width='20%' class='xtr'>» زيارات الموقع</td>
<td width='80%' class='xtd'>"
.$Row['vis']."</td>
</tr>

<tr>
<td width='20%' class='xtr'>» وصف الموقع 1</td>
<td width='80%' class='xtd'>"
.$Row['metadescription']."</td>
</tr>

<tr>
<td width='20%' class='xtr'>» وصف الموقع 2</td>
<td width='80%' class='xtd'>"
.$Row['metakeywords']."</td>
</tr>

<tr>
<td width='20%' class='xtr'>» تقييم الموقع</td>
<td width='80%' class='xtd'>
<form name='vbform' method='POST' action='rate.php' style='margin-top: 0; margin-bottom: 0'>
<input type='hidden' name='id' value='$id'>
التقييم "
.$Row['rate']." الأصوات ".$Row['count']." شخص <select size='1' name='rate'>
  <option value='1' selected>1</option>
  <option value='2'>2</option>
  <option value='3'>3</option>
  <option value='4'>4</option>
  <option value='5'>5</option>
  <option value='6'>6</option>
  <option value='7'>7</option>
  <option value='8'>8</option>
  <option value='9'>9</option>
  <option value='10'>10</option>

</select> <input type='submit' value=' تقييم ' name='B1'>
</form>
</td>
</tr>

<tr>
<td width='20%' class='xtr'>» الموقع في جوجل</td>
<td width='80%' class='xtd'><a target='_blank' href='http://www.google.com/search?q=site:"
.$Row['url']."'>الصفحات</a> - <a target='_blank' href='http://www.google.com/search?q=link:".$Row['url']."'>الروابط</a> - <a target='_blank' href='http://www.google.com/search?q=cache:".$Row['url']."'>الكاش</a></td>
</tr>

<tr>
<td width='20%' class='xtr'>» صورة الموقع</td>
<td width='80%' class='xtd'>$img</td>
</tr>

<tr>
<td width='20%' class='xtr'>» القسم الخاص بالموقع</td>
<td width='80%' class='xtd'><a class='aa' href='$sxx'>"
.$Rowx['title']."</a></td>
</tr>

</table>
  </center>
</div>"
;

echo 
"</td></tr></table></center></div>";

tpl_footer();
?>






خالد الشمالي غير متواجد حالياً   قديم 22-06-2008, 12:59 AM
رد مع اقتباس
عضو نشيط
تاريخ التسجيل: May 2008-
#2 (permalink)  

جرب هذا وقولي إذا نفع (ماجربته) :
كود PHP:
$query mysql_query("SELECT * FROM dalil_site WHERE id IN (SELECT id FROM dalil_site)");
$link mysql_fetch_array($query);
$rand rand(0count($site_list)-1);
echo 
"<a href=\"" $link['site_link'] . "\">" $link['site_name'] . "</a>; 
أو شوف هالكود ممكن يفيدك :
كود PHP:
$site_list = array(
array(
"سوالف سوفت""http://www.swalif.net"),
array(
"Google""http://www.google.com"),
array(
"W3C""http://www.w3.org"),
);

$rand rand(0count($site_list)-1);
echo 
"<a href=\"" $site_list[$rand][1] . "\">" $site_list[$rand][0] . "</a>; 






Foxhound متواجد حالياً   قديم 22-06-2008, 01:31 AM
رد مع اقتباس
رد


 

أدوات الموضوع

تعليمات المشاركة
لا تستطيع كتابة مواضيع
لا تستطيع كتابة ردود
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

كود [IMG] متاحة
كود HTML معطلة
Trackbacks are متاحة
Pingbacks are متاحة
Refbacks are متاحة


المواضيع المتشابهه
الموضوع كاتب الموضوع المنتدى مشاركات آخر مشاركة
[Product] منع روية الروابط للزوار او الاعضاء غير مستخدمي تول بار اليكسا ابن السودان الهاكات والإضافات 18 28-09-2007 06:47 AM
مطلوب دالة لعمل مجلد تلقائي owner PHP 7 15-02-2007 02:35 PM
مطلوب دالة لكشف الروابط التي لاتعمل أبو فيصل PHP 11 14-01-2007 02:24 PM
مطلوب كود جالب اخبار kw20 تطوير الويب 1 14-12-2004 07:57 PM
مطلوب سكريبت جالب اخبار الجزيرة نت لمجلةphp nuke محب php nuke تطوير الويب 0 13-11-2001 10:48 PM


الساعة الآن: 11:20 AM بتوقيت المملكة العربية السعودية