
المشاركة الأصلية كتبت بواسطة orok
هل بالإمكان التعديل عليه ليصبح آخر المشاركات
حاولت التعديل قدر المستطاع وخرجت بالتالي:
كود PHP:
SELECT post.postid, thread.title, thread.replycount, thread.postusername, thread.postuserid, thread.lastposter, thread.views, forum.forumid, forum.inlastthread
FROM forum
INNER JOIN thread ON forum.forumid = thread.forumid
INNER JOIN post ON post.threadid = thread.threadid
WHERE forum.inlastthread <>0
ORDER BY `post`.`postid` DESC
عند تطبيقها في الـ sql تظهر النتائج لآخر المشاركات صحيحة
لكن عندما ادمجها مع كود الباهوت لا تعطيني نتائج آخر المشاركات صحيحة بل وتوجد اخطاء عند الضغط على الرابط غالبا بسبب حذف thread.threadid، مثال:
كود PHP:
/////شريط أخر الموضوعات الاصدارة 2.0 by illogicalx for vBulletin 3.0.3 edit by albahoot for 3.5.x
if ($vbulletin->options['lastthreadactive'])
{
$getthreads= $db->query(" SELECT
" . TABLE_PREFIX . "post.postid,
" . TABLE_PREFIX . "thread.title,
" . TABLE_PREFIX . "thread.replycount,
" . TABLE_PREFIX . "thread.postusername,
" . TABLE_PREFIX . "thread.postuserid,
" . TABLE_PREFIX . "thread.lastposter,
" . TABLE_PREFIX . "thread.views,
" . TABLE_PREFIX . "forum.forumid,
" . TABLE_PREFIX . "forum.inlastthread
FROM
" . TABLE_PREFIX . "forum
INNER JOIN " . TABLE_PREFIX . "thread ON (" . TABLE_PREFIX . "forum.forumid = " . TABLE_PREFIX . "thread.forumid)
INNER JOIN " . TABLE_PREFIX . "post ON (" . TABLE_PREFIX . "post.postid = " . TABLE_PREFIX . "thread.threadid)
WHERE
(" . TABLE_PREFIX . "forum.inlastthread <> 0)
ORDER BY
" . TABLE_PREFIX . "post.postid DESC
LIMIT " . iif(!$vbulletin->options['lastthread_limit'], ' 1', $vbulletin->options[lastthread_limit] ) . "
");
if ($db->num_rows($getthreads))
{
$headdodo="
<!-- شريط أخر الموضوعات الاصدارة 2.0 by illogicalx for vBulletin 3.0.3 edit by albahoot for 3.5.x -->
<style type=\"text/css\">
.billcontent{
width: " . iif(!$vboptions['lastthread_width'], '100%', $vboptions[lastthread_width] ) . ";
height: " . iif(!$vboptions['lastthread_height'], 'auto', $vboptions[lastthread_height] ) . ";
}
</style>
<script type=\"text/javascript\">
var billboardeffects=[\"GradientWipe(GradientSize=1.0 Duration=0.7)\", \"Inset\", \"Iris\", \"Pixelate(MaxSquare=5 enabled=false)\", \"RadialWipe\", \"RandomBars\", \"Slide(slideStyle='push')\", \"Spiral\", \"Stretch\", \"Strips\", \"Wheel\", \"ZigZag\"]
var tickspeed=" . iif(!$vboptions['lastthread_speed'], '2000', $vboptions[lastthread_speed] ) . " //ticker speed in miliseconds (2000=2 seconds)
var effectduration=1000 //Transitional effect duration in miliseconds
var hidecontent_from_legacy=0 //Should content be hidden in legacy browsers- IE4/NS4 (0=no, 1=yes).
var filterid=Math.floor(Math.random()*billboardeffects.length)
document.write('<style type=\"text/css\">\\n')
if (document.getElementById)
document.write('.billcontent{display:none;\\n'+'filter:progid:DXImageTransform.Microsoft.'+billboardeffects[filterid]+'}\\n')
else if (hidecontent_from_legacy)
document.write('#contentwrapper{display:none;}')
document.write('</style>\\n')
var selectedDiv=0
var totalDivs=0
function contractboard(){
var inc=0
while (document.getElementById(\"billboard\"+inc)){
document.getElementById(\"billboard\"+inc).style.display=\"none\"
inc++
}
}
function expandboard(){
var selectedDivObj=document.getElementById(\"billboard\"+selectedDiv)
contractboard()
if (selectedDivObj.filters){
if (billboardeffects.length>1){
filterid=Math.floor(Math.random()*billboardeffects.length)
selectedDivObj.style.filter=\"progid:DXImageTransform.Microsoft.\"+billboardeffects[filterid]
}
selectedDivObj.filters[0].duration=effectduration/1000
selectedDivObj.filters[0].Apply()
}
selectedDivObj.style.display=\"block\"
if (selectedDivObj.filters)
selectedDivObj.filters[0].Play()
selectedDiv=(selectedDiv<totalDivs-1)? selectedDiv+1 : 0
setTimeout(\"expandboard()\",tickspeed)
}
function startbill(){
while (document.getElementById(\"billboard\"+totalDivs)!=null)
totalDivs++
if (document.getElementById(\"billboard0\").filters)
tickspeed+=effectduration
expandboard()
}
if (window.addEventListener)
window.addEventListener(\"load\", startbill, false)
else if (window.attachEvent)
window.attachEvent(\"onload\", startbill)
else if (document.getElementById)
window.onload=startbill
</script>
<!-- شريط أخر الموضوعات الاصدارة 2.0 by illogicalx for vBulletin 3.0.3 edit by albahoot for 3.5.x -->
";
if ($vbulletin->options['lastthread_movedir'] == "up" or $vbulletin->options['lastthread_movedir'] == "down" or $vbulletin->options['lastthread_movedir'] == "left" or $vbulletin->options['lastthread_movedir'] == "right" )
{
$headdodo="";
$lastthreadshower =" <div class=\"lastthread\"><marquee dir=\"rtl\" direction=\"" . $vbulletin->options['lastthread_movedir'] . "\" onmouseover='this.scrollAmount=2' onmouseout='this.scrollAmount=5' width=\"" . iif(!$$vbulletin->options['lastthread_width'], '100%', $vbulletin->options[lastthread_width] ) . "\" height=\"" . iif(!$vbulletin->options['lastthread_height'], 'auto', $vbulletin->options[lastthread_height] ) . "\" scrolldelay=\"" . iif(!$vbulletin->options['lastthread_speed'], '2000', $vbulletin->options[lastthread_speed] ) . "\" > <div align=\"center\">";
while ($threads = $db->fetch_array($getthreads))
{
$alt_title= $threads[title];
if($vbulletin->options[lastthread_maxchar] > 0 and strlen($threads['title']) > $vbulletin->options[lastthread_maxchar])
{
$threads[title] = substr($threads[title], 0, $vbulletin->options[lastthread_maxchar]) . " ... ";
}
eval('$lastthreadshower .= "' . fetch_template('lastthreadshower') . '";');
}
$lastthreadshower .="</div></marquee></div>";
}
else
{
$lastthreadshower ="
<div class='lastthread'>";
$co = 0 ;
while ($threads = $db->fetch_array($getthreads))
{
$alt_title= $threads[title];
$lastthreadshower .= "<div id=\"billboard" . $co . "\" class=\"billcontent\"> <div align=\"center\"> ";
if( $vbulletin->options[lastthread_maxchar] > 0 and strlen($threads['title']) > $vbulletin->options[lastthread_maxchar])
{
$threads[title] = substr($threads[title], 0, $vbulletin->options[lastthread_maxchar]) . " ... ";
}
eval('$lastthreadshower .= "' . fetch_template('lastthreadshower') . '";');
$lastthreadshower .= "</div></div>";
$co++ ;
}
$lastthreadshower .="</div>";
}
}
}
/////شريط أخر الموضوعات الاصدارة 2.0by illogicalx for vBulletin 3.0.3 edit by albahoot for 3.5.x
ترى ما الحل بارك الله فيكم..
أطيب التحيات.