هاست لینوکس

آخرین بسته‌ی MyBB: نسخه‌ی 1.8.27 MyBB منتشر شد


امتیاز موضوع:
  • 2 رأی - میانگین امتیازات: 4.5
  • 1
  • 2
  • 3
  • 4
  • 5
آموزش کامل قرار دادن آخرین ارسالهای mybb در وردپرس
#31
کدهای فایل last.php خودم رو در اختیار شما میزارم تا ازش الگو برداری کنید .

کد php:
<?php
//web alfa
// http://www.85ohm.ir
// ver 1.0

echo '
<html xmlns="http://www.w3.org/1999/xhtml" dir="rtl" lang="fa-IR">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="http://download.85ohm.ir/wp-content/themes/WSDFantezy/last/FB.css" rel="stylesheet" type="text/css" media="screen">
<div id="MTForumBlock">
<table id="webalfa-lastpost">
        <tr class="MTForumfirst">
            <td class="MTForumtitle">عنوان</td>
            <td class="MTForumanswer">پاسخ</td>
            <td class="MTForumview">بازديد</td>
            <td class="MTForumlast">توسط</td>
</tr>'
;
            
## CUSTOMIZE SETTINGS FOR YOUR SITE ##
$db_host "******"// Change this if your MySQL database host is different.
$db_name "******"// Change this to the name of your database.
$db_user "******"// Change this to your database username.
$db_pw "*****"// Change this to your database password.
$db_pre "mybb_"// Tables prefix
$forum_url "http://www.85ohm.ir/"// Change this to reflect to your forum's URL.
$limit "20"// Number of posts displayed.
$txtlimit "100"// This is the character limit.

#######################################
// Connecting to your database
mysql_connect($db_host$db_user$db_pw );
mysql_select_db($db_name);

mysql_query("SET NAMES utf8");
$thread_sql mysql_query("SELECT tid,subject,lastposter,replies,views FROM ".$db_pre."threads order by lastpost DESC LIMIT $limit");

while(
$thread_get=mysql_fetch_array($thread_sql))
{
$replycount $thread_get['replies'];
$views $thread_get['views'];
$threadid $thread_get['tid'];
$poster $thread_get['lastposter'];
$title $thread_get['subject'];
if(
strlen($title) > ($txtlimit-4)){
$title substr($title,0,$txtlimit).'...';
}

echo 
"
        <tr>
            <td class=\"MTForumrowtitle\"><a href=\""
.$forum_url."thread-$threadid-lastpost.html\"><img src=\"last/FBarrow.gif\" border=\"0\"> $title</a></td>
            <td class=\"MTForumanswer\">
$replycount</td>
            <td class=\"MTForumview\">
$views</td>
            <td class=\"MTForumlast\">
$poster</td>
        </tr>"
;
        

}

echo 
"        </tr>
    </table>
</div>

"
;

?>

تنها چیزی که به ذهنم میرسه این خطشه :
کد php:
<link href="http://download.85ohm.ir/wp-content/themes/WSDFantezy/last/FB.css" rel="stylesheet" type="text/css" media="screen"
آدرس این قسمت رو دقیقا به همین صورت بهش بده یعنی با لینک کامل .....
اگه بازم درست نشد احتمالا مربوط به قالب میشه . با یه قالب دیگه هم امتحان کن ...
پاسخ
 سپاس شده توسطghanari (۱۳۹۰/۶/۳، ۲۰:۱۰:۳۳ عصر) ، samal (۱۳۹۱/۳/۱۲، ۱۶:۳۰:۵۸ عصر)
#32
ok شد ممنون
پاسخ
#33
با سلام
دوست عزیز من تمامی این انجمن رو مشاهده کردم ولی نتونستم مشکلم رو حل کنم

اگه میشه به این سایت یه نگاه بنداز:
www.anzalichi.ir
مطالب ارسالی بهش اضافه میشه اما وقتی کلیک میکنم روش این پیغام میاد :
فایرفاکس نمی‌تواند کارگزار «from.anzalichi.irshowthread.php» را بیابد.

در ضمن حاشیه هاش هم نشون داده نمیشه
تمامی این مراحلی که بحث شد رو هم دنبال کردم اما نتیجه نداد
لطفا راهنماییم کنید
پاسخ
#34
خب توی آدرسها یه دونه / کم داره ، برای همین این اتفاق میفته . http://from.anzalichi.ir/showthread.php/?tid=5
مشخصا همه مراحل رو به درستی انجام ندادید . ضمنا قالب بندیش هم نمیاد . برای اصلاح قالب بندی به ارسال 31 همین تاپیک مراجعه کنید.
برای اون مورد هم یه بار دیگه فایل php رو چک کنید .
پاسخ
 سپاس شده توسطscarce (۱۳۹۰/۵/۲۱، ۰۰:۵۹:۳۶ صبح)
#35
دوست عزیز منظور شما از اینکه یه دونه کم میاد یعنی چی؟

خوب بخش 31 رو هم نگاه کردم ولی مشکل حل نشد
در ضمن همه مراحل رو دستی انجام دادم.
پاسخ
 سپاس شده توسطghanari (۱۳۹۰/۶/۳، ۲۰:۱۰:۵۱ عصر)
#36
ببین یعنی آدرستهات به جای اینکه اینطوری باشه :
کد:
http://from.anzalichi.ir/showthread.php/?tid=5
اینطوریه :
کد:
http://from.anzalichi.irshowthread.php/?tid=5
خب تا حالا افراد زیادی بدون مشکل از این آموزش استفاده کردند .
در صورت تمایل دسترسی را پیام خصوصی کنید تا بررسی کنم . و یا اینکه فایل php اسکریپت رو برای من ارسال کنید ...
پاسخ
 سپاس شده توسطghanari (۱۳۹۰/۶/۳، ۲۰:۱۱:۱۶ عصر)
#37
دوست عزیز این کد رو به صورت کامل کپی کردم ولی مشخصات دیتابیس رو وارد نکردم(از لحاض امنیتی )


<?php
//web alfa
// ver 1.0

echo '
<html xmlns="http://www.w3.org/1999/xhtml" dir="rtl" lang="fa-IR">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="http://www.anzalichi.ir/wp-content/themes/wp-venos/last/FB.css" rel="stylesheet" type="text/css" media="screen">
<div id="MTForumBlock">
<table id="webalfa-lastpost">
<tr class="MTForumfirst">
<td class="MTForumtitle">عنوان</td>
<td class="MTForumanswer">پاسخ</td>
<td class="MTForumview">بازديد</td>
<td class="MTForumlast">توسط</td>
</tr>';

## CUSTOMIZE SETTINGS FOR YOUR SITE ##
$db_host = "localhost"; // Change this if your MySQL database host is different.
$db_name = "***********"; // Change this to the name of your database.
$db_user = "*********"; // Change this to your database username.
$db_pw = "**********"; // Change this to your database password.
$db_pre = "mybb_"; // Tables prefix
$forum_url = "http://from.anzalichi.ir"; // Change this to reflect to your forum's URL.
$limit = "20"; // Number of posts displayed.
$txtlimit = "100"; // This is the character limit.

#######################################
// Connecting to your database
mysql_connect($db_host, $db_user, $db_pw );
mysql_select_db($db_name);

mysql_query("SET NAMES utf8");
$thread_sql = mysql_query("SELECT tid,subject,lastposter,replies,views FROM ".$db_pre."threads order by lastpost DESC LIMIT $limit");

while($thread_get=mysql_fetch_array($thread_sql))
{
$replycount = $thread_get['replies'];
$views = $thread_get['views'];
$threadid = $thread_get['tid'];
$poster = $thread_get['lastposter'];
$title = $thread_get['subject'];
if(strlen($title) > ($txtlimit-4)){
$title = substr($title,0,$txtlimit).'...';
}

echo "
<tr>
<td class=\"MTForumrowtitle\"><a href=\"".$forum_url."showthread.php?tid=$threadid\"><img src=\"FBarrow.gif\" border=\"0\"> $title</a></td>
<td class=\"MTForumanswer\">$replycount</td>
<td class=\"MTForumview\">$views</td>
<td class=\"MTForumlast\">$poster</td>
</tr>";


}

echo " </tr>
</table>
</div>

";

?>
پاسخ
#38
اول این تغییر رو بدین :
کد:
// Tables prefix
$forum_url = "http://from.anzalichi.ir"; // Change this to reflect to your forum's URL.

به :

کد:
// Tables prefix
$forum_url = "http://from.anzalichi.ir/"; // Change this to reflect to your forum's URL.

و اگه جواب نداد ، این تغییر رو اعمال کنید :

کد:
<td class=\"MTForumrowtitle\"><a href=\"".$forum_url."showthread.php?tid=$threadid\"><img src=\"FBarrow.gif\" border=\"0\"> $title</a></td>

به :

کد:
<td class=\"MTForumrowtitle\"><a href=\"".$forum_url./"showthread.php?tid=$threadid\"><img src=\"FBarrow.gif\" border=\"0\"> $title</a></td>

ضمنا من بررسی کردم آدرس فایل css رو اشتباه دادین ، همچین فایلی با این آدرس روی سرور شما نیست :
کد:
http://www.anzalichi.ir/wp-content/themes/wp-venos/last/FB.css
آدرس رو اصلاح کنید
پاسخ
 سپاس شده توسطs2s2x (۱۳۹۰/۱۰/۱، ۱۲:۴۳:۵۸ عصر)
#39
دوست عزیز مشکل حل شد.
کد دومی که نوشته بودید رو جایگزین اولی کردم.
فایل css رو هم اشتباه آپلود کرده بودم و دوباره آدرسش رو تغییر دادم.
بابت همه همکاریهاتون ممنونم اما فقط یه مشکل دیگه وجود داره و اون اینه که اگه تعداد ارسالها از مقداری که مشخص کردیم مثلا من 14 ارسال در صفحه اول رو مشخص کردم، اگه تعداد ارسال ها بیشتر از 14 تا بشه دیگه صفحه بعدی وجود نداره که کاربران بتونن بقیه ارسالها رو ببینن. اگه میشه دررباره این موضوع هم یه تحقیقی انجام بدین.خیلی متشکرم.
آدرس سایتی که فروم داخلش نصب شده:www.anzalichi.ir
پاسخ
#40
میشه این روش رو به صورت تصویری برای سیستم [تصویر:  wp-fa-logo.png] هم بگید اخه این وبلاگ هم زیرمجموعه وردپرس هستش
پاسخ


موضوع‌های مشابه…
موضوع نویسنده پاسخ بازدید آخرین ارسال
  آموزش قرار دادن بنر کنار هم Pars 62 67,888 ۱۳۹۳/۱۲/۱۹، ۱۲:۰۷:۳۱ عصر
آخرین ارسال: firstboy000
Thumbs Up آموزش قرار دادن تبلیغات در کنار هدر Amin Yaghubi 10 10,389 ۱۳۹۳/۷/۱۶، ۱۸:۱۵:۰۶ عصر
آخرین ارسال: firstboy000
  آموزش جامع قرار دادن دکمه بانک برای ادیتور Ckeditor salehkhan 3 3,616 ۱۳۹۳/۳/۱، ۱۲:۲۹:۳۰ عصر
آخرین ارسال: amir1
Thumbs Up آموزش قرار دادن آمار آلکسا در فوتر Amin Yaghubi 4 3,694 ۱۳۹۳/۱/۲۱، ۲۰:۴۶:۱۰ عصر
آخرین ارسال: avacs
Music {آموزش} قرار دادن "موزیک من" در پروفایل (اختصاصی PnuForums) Webmaster 70 53,053 ۱۳۹۲/۱۲/۱۴، ۰۹:۲۸:۱۰ صبح
آخرین ارسال: ahmad65
Wink [برای 1.6] آموزش قرار دادن پلیر (موزیک) در پست بیت AR@KST@R 15 16,290 ۱۳۹۲/۸/۱۹، ۰۱:۴۳:۲۱ صبح
آخرین ارسال: Pars
  آموزش قرار دادن ورود سریع h0mayun 14 12,935 ۱۳۹۱/۳/۱۲، ۰۱:۳۰:۲۳ صبح
آخرین ارسال: mhy

پرش به انجمن:


کاربرانِ درحال بازدید از این موضوع: 1 مهمان