النتائج 1 إلى 2 من 2

الموضوع: للمحولين من الـ vb إلى MySBB :: عرض كامل المرفقات

  1. #1
    عضو سوبر نشيط
    تاريخ التسجيل
    Jun 2003
    المشاركات
    601

    للمحولين من الـ vb إلى MySBB :: عرض كامل المرفقات



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

    نظراً لأن الـ vb تسمح بتعدد المرفقات في الموضوع او الرد الواحد ... و MySBB لا تدعم تعدد المرفقات في النسخة الحالية...
    فقمت فيما يلي بشرح التعديل المطلوب لعرض جميع مرفقات الرد او الموضوع..

    ---------------------
    افتح ملف show.php

    ابحث عن :
    كود:
                 $getattach_query = $DB->sql_query("SELECT * FROM MySBB_attach WHERE subject_id='" . $id . "' AND reply<>'1'");
                 $getattach_row   = $DB->sql_fetch_array($getattach_query);
    قم بإستبداله بـ:
    كود:
                 $getattach_query = $DB->sql_query("SELECT * FROM MySBB_attach WHERE subject_id='" . $id . "' AND reply<>'1'");

    قم بالبحث عن:
    كود:
                 $Smarty->assign('getattach_num',$getattach_num);
                 $Smarty->assign_by_ref('getpoll_row',$getpoll_row);
                 $Smarty->assign_by_ref('getattach_row',$getattach_row);
    واستبدله بـ:
    كود:
                 while ($getattach_row2 = $DB->sql_fetch_array($getattach_query)){
                          $getattach_row[] = $getattach_row2;
                          $Smarty->assign('getattach_row',$getattach_row);
                 }
                 $Smarty->assign('getattach_num',$getattach_num);
                 $Smarty->assign_by_ref('getpoll_row',$getpoll_row);

    ابحث عن:
    كود:
                                    $getattach_query = $DB->sql_query("SELECT * FROM MySBB_attach WHERE subject_id='" . $reply_row['id'] . "' AND reply='1'");
                                    $getattach_row   = $DB->sql_fetch_array($getattach_query);
                                    $getattach_num   = $DB->sql_num_rows($getattach_query);
    قم بإستبداله بـ:
    كود:
                                    $getattach_query = $DB->sql_query("SELECT * FROM MySBB_attach WHERE subject_id='" . $reply_row['id'] . "' AND reply='1'");
                                    $getattach_num   = $DB->sql_num_rows($getattach_query);
                                    while ($getattach_row2 = $DB->sql_fetch_array($getattach_query)){
                                    $getattach_row[] = $getattach_row2;
                                    $Smarty->assign('getattach_row',$getattach_row);
                                    }
    احفظ الملف...

    افتح قالب show_topic.tpl

    ابحث عن:
    كود:
    {if $getattach_num gt 0}
    <p style="margin-top: 0; margin-bottom: 0">&nbsp;</p>
    <p style="margin-top: 0; margin-bottom: 0">&nbsp;</p>
    <div align="center">
      <center>
      <table border="1" cellpadding="3" cellspacing="1" style="{$border_style}" id="tab1" width="40%" id="AutoNumber1">
        <tr>
          <td id="tab" class="thead" width="100%" colspan="2" align="center"><p class="main"><font class="spical">ملف مرفق</font></td>
        </tr>
        <tr>
          <td id="tab" class="row1" width="50%" align="center">اسم الملف</td>
          <td id="tab" class="row1" width="50%" align="center">{$getattach_row.filename|escape:"html"}</td>
        </tr>
        <tr>
          <td id="tab" class="row1" width="50%" align="center">حجم الملف</td>
          <td id="tab" class="row1" width="50%" align="center">{$getattach_row.filesize} بايت</td>
        </tr>
        <tr>
          <td id="tab" class="row1" width="50%" align="center">مرات التحميل</td>
          <td id="tab" class="row1" width="50%" align="center">{$getattach_row.visitor}</td>
        </tr>
        <tr>
          <td id="tab" class="row1" width="100%" colspan="2" align="center"><a target="_blank" href="attach.php?download=1&id={$getattach_row.id}">تحميل</a></td>
        </tr>
      </table>
      </center>
    </div>
    {/if}
    استبدله بـ:
    كود:
    {if $getattach_num gt 0}
    <p style="margin-top: 0; margin-bottom: 0">&nbsp;</p>
    <p style="margin-top: 0; margin-bottom: 0">&nbsp;</p>
    <div align="center">
      <center>
      <table border="1" cellpadding="3" cellspacing="1" style="{$border_style}" id="tab1" width="50%" id="AutoNumber1">
        <tr>
          <td id="tab" class="thead" width="100%" colspan="3" align="center"><font class="spical">ملف مرفق</font></td>
        </tr>
        <tr>
          <td id="tab" class="row1" width="34%" align="center">اسم الملف</td>
          <td id="tab" class="row1" width="33%" align="center">حجم الملف</td>
          <td id="tab" class="row1" width="33%" align="center">مرات التحميل</td>
        </tr>
    {section name=idx loop=$getattach_row}
        <tr>
          <td id="tab" class="row1" width="34%" align="center"><a target="_blank" href="attach.php?download=1&id={$getattach_row[idx].id}">{$getattach_row[idx].filename|escape:"html"}</a></td>
          <td id="tab" class="row1" width="33%" align="center">{$getattach_row[idx].filesize} بايت</td>
          <td id="tab" class="row1" width="33%" align="center">{$getattach_row[idx].visitor}</td>
        </tr>
    {/section}
      </table>
      </center>
    </div>
    {/if}
    احفظ القالب...

    افتح القالب smart-reply_part2.tpl
    ابحث عن:
    كود:
    {if $getattach_num gt 0}
    
    <p style="margin-top: 0; margin-bottom: 0">&nbsp;</p>
    <p style="margin-top: 0; margin-bottom: 0">&nbsp;</p>
    
    {if $show_image eq "1"}
    <fieldset dir="rtl" style="width: 0">
      <legend>العضو أرفق الصورة</legend>
      <p align="right">
      {if $width eq "400" or $height eq "400"}<a title="الصوة مصغرة ، إضغط هنا لتكبيرها" target="_blank" href="attach.php?download=1&id={$getattach_row.id}"><img border="0" src="{$getattach_row.filepath|escape:"html"}" {if $width eq "400"} width="400" {/if} {if $height eq "400"} height="400" {/if}></a>
      {else}<img border="0" src="{$getattach_row.filepath|escape:"html"}" {if $width eq "400"} width="400" {/if} {if $height eq "400"} height="400" {/if}>{/if}
    </fieldset>
    
    {else}
    
    <div align="center">
      <center>
      <table border="1" cellpadding="3" cellspacing="1" style="{$border_style}" id="tab1" width="40%">
        <tr>
          <td id="tab" class="thead" width="100%" colspan="2" align="center"> ملف مرفق</td>
        </tr>
        <tr>
          <td id="tab" class="row1" width="50%" align="center">اسم الملف</td>
          <td id="tab" class="row1" width="50%" align="center">{$getattach_row.filename|escape:"html"}</td>
        </tr>
        <tr>
          <td id="tab" class="row1" width="50%" align="center">حجم الملف</td>
          <td id="tab" class="row1" width="50%" align="center">{$getattach_row.filesize} بايت</td>
        </tr>
        <tr>
          <td id="tab" class="row1" width="50%" align="center">مرات التحميل</td>
          <td id="tab" class="row1" width="50%" align="center">{$getattach_row.visitor}</td>
        </tr>
        <tr>
          <td id="tab" class="row1" width="100%" colspan="2" align="center"><a target="_blank" href="attach.php?download=1&id={$getattach_row.id}">تحميل</a></td>
        </tr>
      </table>
      </center>
    </div>
    {/if}
    {/if}
    استبدله بـ:
    كود:
    {if $getattach_num gt 0}
    <p style="margin-top: 0; margin-bottom: 0">&nbsp;</p>
    <p style="margin-top: 0; margin-bottom: 0">&nbsp;</p>
    <div align="center">
      <center>
      <table border="1" cellpadding="3" cellspacing="1" style="{$border_style}" id="tab1" width="50%" id="AutoNumber1">
        <tr>
          <td id="tab" class="thead" width="100%" colspan="3" align="center"><font class="spical">ملف مرفق</font></td>
        </tr>
        <tr>
          <td id="tab" class="row1" width="34%" align="center">اسم الملف</td>
          <td id="tab" class="row1" width="33%" align="center">حجم الملف</td>
          <td id="tab" class="row1" width="33%" align="center">مرات التحميل</td>
        </tr>
    {section name=idx loop=$getattach_row}
        <tr>
          <td id="tab" class="row1" width="34%" align="center"><a target="_blank" href="attach.php?download=1&id={$getattach_row[idx].id}">{$getattach_row[idx].filename|escape:"html"}</a></td>
          <td id="tab" class="row1" width="33%" align="center">{$getattach_row[idx].filesize} بايت</td>
          <td id="tab" class="row1" width="33%" align="center">{$getattach_row[idx].visitor}</td>
        </tr>
    {/section}
      </table>
      </center>
    </div>
    {/if}
    احفظ القالب ...

    انتهى

    --------------------
    المصدر: http://www.mysmartbb.com/forums/show.php?main=1&id=1055
    الشرح بملف txt : http://www.mysmartbb.com/forums/atta...nload=1&id=287







  2. #2
    عضو نشيط جدا
    تاريخ التسجيل
    Nov 2005
    المشاركات
    367


    بارك الله فيك





    __________________
    أكاديمية ريبير

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

    http://www.reepair.net/vb





ضوابط المشاركة

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

أضف موقعك هنا| اخبار السيارات | حراج | شقق للايجار في الكويت | بيوت للبيع في الكويت | دليل الكويت العقاري | مقروء | شركة كشف تسربات المياه | شركة عزل اسطح بالرياض | عزل فوم بالرياض| عزل اسطح بالرياض | كشف تسربات المياة بالرياض | شركة عزل اسطح بالرياض