مرجع پارسی MyBB

نسخه‌ی کامل: آموزش کامل قرار دادن آخرین ارسالهای mybb در وردپرس
شما درحال مشاهده‌ی نسخه‌ی متنی این صفحه می‌باشید. مشاهده‌ی نسخه‌ی کامل با قالب‌بندی مناسب.
صفحه‌ها: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

zohair

کدهای فایل 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"
آدرس این قسمت رو دقیقا به همین صورت بهش بده یعنی با لینک کامل .....
اگه بازم درست نشد احتمالا مربوط به قالب میشه . با یه قالب دیگه هم امتحان کن ...
ok شد ممنون
با سلام
دوست عزیز من تمامی این انجمن رو مشاهده کردم ولی نتونستم مشکلم رو حل کنم

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

در ضمن حاشیه هاش هم نشون داده نمیشه
تمامی این مراحلی که بحث شد رو هم دنبال کردم اما نتیجه نداد
لطفا راهنماییم کنید

zohair

خب توی آدرسها یه دونه / کم داره ، برای همین این اتفاق میفته . http://from.anzalichi.ir/showthread.php/?tid=5
مشخصا همه مراحل رو به درستی انجام ندادید . ضمنا قالب بندیش هم نمیاد . برای اصلاح قالب بندی به ارسال 31 همین تاپیک مراجعه کنید.
برای اون مورد هم یه بار دیگه فایل php رو چک کنید .
دوست عزیز منظور شما از اینکه یه دونه کم میاد یعنی چی؟

خوب بخش 31 رو هم نگاه کردم ولی مشکل حل نشد
در ضمن همه مراحل رو دستی انجام دادم.

zohair

ببین یعنی آدرستهات به جای اینکه اینطوری باشه :
کد:
http://from.anzalichi.ir/showthread.php/?tid=5
اینطوریه :
کد:
http://from.anzalichi.irshowthread.php/?tid=5
خب تا حالا افراد زیادی بدون مشکل از این آموزش استفاده کردند .
در صورت تمایل دسترسی را پیام خصوصی کنید تا بررسی کنم . و یا اینکه فایل php اسکریپت رو برای من ارسال کنید ...
دوست عزیز این کد رو به صورت کامل کپی کردم ولی مشخصات دیتابیس رو وارد نکردم(از لحاض امنیتی )


<?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>

";

?>

zohair

اول این تغییر رو بدین :
کد:
// 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
آدرس رو اصلاح کنید
دوست عزیز مشکل حل شد.
کد دومی که نوشته بودید رو جایگزین اولی کردم.
فایل css رو هم اشتباه آپلود کرده بودم و دوباره آدرسش رو تغییر دادم.
بابت همه همکاریهاتون ممنونم اما فقط یه مشکل دیگه وجود داره و اون اینه که اگه تعداد ارسالها از مقداری که مشخص کردیم مثلا من 14 ارسال در صفحه اول رو مشخص کردم، اگه تعداد ارسال ها بیشتر از 14 تا بشه دیگه صفحه بعدی وجود نداره که کاربران بتونن بقیه ارسالها رو ببینن. اگه میشه دررباره این موضوع هم یه تحقیقی انجام بدین.خیلی متشکرم.
آدرس سایتی که فروم داخلش نصب شده:www.anzalichi.ir
میشه این روش رو به صورت تصویری برای سیستم [تصویر:  wp-fa-logo.png] هم بگید اخه این وبلاگ هم زیرمجموعه وردپرس هستش
صفحه‌ها: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17