الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

( طلب مساعدة في شريط عرض المواضيع )

مغلق
بدأه Mohammed Dehya في 26 أكتوبر 2005 · 3 رد · 493 مشاهدة · في منتدى تطوير المواقع بـ PHP
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

بسم الله الرحمن الرحيم

أخواني هذا الكود الذي يقوم بعرض أخر مواضيع المنتدى بشكل افقي

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" -->
<html dir="rtl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<meta http-equiv="Content-Style-Type" content="text/css">

<link rel="top" href="index.php" title="" />
<link rel="search" href="search.php" title="" />
<link rel="help" href="faq.php" title="" />
<link rel="author" href="memberlist.php" title="" />

<title>آخر 10 مواضيع</title>

<style type="text/css">
<!--
/* Specifiy background images for selected styles
   This can't be done within the external style sheet as NS4 sees image paths relative to
   the page which called the style sheet (i.e. this page in the root phpBB directory)
   whereas all other browsers see image paths relative to the style sheet. Stupid NS again!
*/
TH 	 { background-image: url(templates/subSilver/images/cellpic3.gif) }
TD.cat  { background-image: url(templates/subSilver/images/cellpic1.gif) }
TD.rowpic	{ background-image: url(templates/subSilver/images/cellpic2.jpg); background-repeat: repeat-y }
TD.catHead,TD.catSides,TD.catLeft,TD.catRight,TD.catBottom { background-image: url(templates/subSilver/images/cellpic1.gif) }


/* Import the fancy styles for IE only (NS4.x doesn't use the @import function) */
@import url("templates/SubSilver/formIE.css");
-->
</style>
<script language="Javascript" type="text/javascript">
<!--
	if ( 0 )
	{
  window.open('privmsg.php?mode=newpm', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
	}
//-->
</script>
</head>
<body bgcolor="#EAE8CF" text="#3F702E" alink="#DD6900" link="#3F702E" vlink="#66A650" leftMargin=0 topMargin=0>
<?
/*
برمجة الأخ سكراتشي
secra4@hotmail.com
 */
PRINTF("<html dir=rtl>");
$LIMIT=10; //عدد المواضيع في الشريط  
$exforum= array(); //array(1,5,7) تضع رقم المنتدى الذي لاتريد ظهور مواضيعه مثل منتدى المشرفين أو المنتديات الخاصة وتفصل بينهم بفاصله و,    
define('IN_PHPBB', true);
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

    $fut="";
  IF(count($exforum)):
   	 $fut="where ";
   	 FOR ($Q=0;$Q<=count($exforum)-1;$Q++){
      if ($Q== count($exforum)-1):
     	 $fut.="forum_id <> '".$exforum[$Q]."' ";
      
      ELSE:
          $fut.="forum_id <> '".$exforum[$Q]."' and ";
      ENDIF;
   	 }
ENDIF;
    PRINTF("<marquee direction=\"right\" dir=rtl scrolldelay=\"170\">");

	$QUERY = "SELECT * FROM phpbb_topics ".$fut."  ORDER BY topic_time  DESC limit $LIMIT"; 
 	 $result = mysql_query($QUERY); 
 	 $topics=mysql_num_rows($result); 



   	 
 while($myrow= mysql_fetch_array($result)) {
IF($myrow["topic_status"]==0):
 PRINTF(" <a target='_blank' href='viewtopic.php?t=%s'><font face=\"Tahoma\" size=\"2\"><b>%s</b></font>\n\n</a>   .::.   ",
  $myrow["topic_id"], $myrow["topic_title"]);
ENDIF;
}
 	 
 PRINTF( "</marquee>");
?> 
</html>

كل المطلوب هو التعديل على الكود

لأنه يعرض عناوين المواضيع كاملة مهما كان عنوان الموضوع طويل

والمطلوب هو أن يعرض مثلا 27 حرف فقط كحد أقصى لعنوان الموضوع

مثال :

هذا عنوان موضوع مثلا :

( طلب مساعدة في شريط عرض المواضيع )

يتم تحجيمه ل 27 حرف فقط وهيكون بالشكل ده :

( طلب مساعدة في شريط عرض...

أعتقد ان هذا الكود هو المطلوب ولكن بحاجه إلى تعديل :unsure:

if (strlen($topic_title)>27) { 
         $topic_title = substr($topic_title,0,24) . '...'; 
      }

ياريت أحد الأخوان يستطيع تعديل الكود

لأني احاول فيه منذ شهر :(

تحياتــــي للجميع :rolleyes:

#2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" -->
<html dir="rtl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<meta http-equiv="Content-Style-Type" content="text/css">

<link rel="top" href="index.php" title="" />
<link rel="search" href="search.php" title="" />
<link rel="help" href="faq.php" title="" />
<link rel="author" href="memberlist.php" title="" />

<title>آخر 10 مواضيع</title>

<style type="text/css">
<!--
/* Specifiy background images for selected styles
  This can't be done within the external style sheet as NS4 sees image paths relative to
  the page which called the style sheet (i.e. this page in the root phpBB directory)
  whereas all other browsers see image paths relative to the style sheet. Stupid NS again!
*/
TH   { background-image: url(templates/subSilver/images/cellpic3.gif) }
TD.cat  { background-image: url(templates/subSilver/images/cellpic1.gif) }
TD.rowpic { background-image: url(templates/subSilver/images/cellpic2.jpg); background-repeat: repeat-y }
TD.catHead,TD.catSides,TD.catLeft,TD.catRight,TD.catBottom { background-image: url(templates/subSilver/images/cellpic1.gif) }


/* Import the fancy styles for IE only (NS4.x doesn't use the @import function) */
@import url("templates/SubSilver/formIE.css");
-->
</style>
<script language="Javascript" type="text/javascript">
<!--
if ( 0 )
{
 window.open('privmsg.php?mode=newpm', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
}
//-->
</script>
</head>
<body bgcolor="#EAE8CF" text="#3F702E" alink="#DD6900" link="#3F702E" vlink="#66A650" leftMargin=0 topMargin=0>
<?
/*
برمجة الأخ سكراتشي
secra4@hotmail.com
*/
PRINTF("<html dir=rtl>");
$LIMIT=10; //عدد المواضيع في الشريط  
$exforum= array(); //array(1,5,7) تضع رقم المنتدى الذي لاتريد ظهور مواضيعه مثل منتدى المشرفين أو المنتديات الخاصة وتفصل بينهم بفاصله و,    
define('IN_PHPBB', true);
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

   $fut="";
 IF(count($exforum)):
    $fut="where ";
    FOR ($Q=0;$Q<=count($exforum)-1;$Q++){
     if ($Q== count($exforum)-1):
      $fut.="forum_id <> '".$exforum[$Q]."' ";
     
     ELSE:
         $fut.="forum_id <> '".$exforum[$Q]."' and ";
     ENDIF;
    }
ENDIF;
   PRINTF("<marquee direction=\"right\" dir=rtl scrolldelay=\"170\">");

$QUERY = "SELECT * FROM phpbb_topics ".$fut."  ORDER BY topic_time  DESC limit $LIMIT"; 
  $result = mysql_query($QUERY); 
  $topics=mysql_num_rows($result); 



    
while($myrow= mysql_fetch_array($result)) {
if (strlen($myrow["topic_title"])>27) { 
        $topic_title = substr($myrow["topic_title"],0,24) . '...'; 
     }
else
{
$topic_title = $myrow["topic_title"];
}

IF($myrow["topic_status"]==0):
PRINTF(" <a target='_blank' href='viewtopic.php?t=%s'><font face=\"Tahoma\" size=\"2\"><b>%s</b></font>\n\n</a>   .::.   ",
 $myrow["topic_id"], $topic_title);
ENDIF;
}
  
PRINTF( "</marquee>");
?> 
</html>

Let's google help you Before ask

--------------------------

My Blog : www.phplover.net

#3

اسف الكود غير مرتب لانني لم اعرف لحد الان كيف ارتب كود ضمن منتدانا

Let's google help you Before ask

--------------------------

My Blog : www.phplover.net

#4

شكراُ لك أخي mostafasawan

والله أنت حليت لي مشكلة كبيرة

جزاك الله خير وجعلة في ميزان حسناتك

تقبل تحياتـــــي :rolleyes:

هذا الموضوع مغلق.

مواضيع مشابهة