بسم الله الرحمن الرحيم...
نظراً لأن الـ 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"> </p>
<p style="margin-top: 0; margin-bottom: 0"> </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"> </p>
<p style="margin-top: 0; margin-bottom: 0"> </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"> </p>
<p style="margin-top: 0; margin-bottom: 0"> </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"> </p>
<p style="margin-top: 0; margin-bottom: 0"> </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