نمایش 5ارسال آخر به انجمن در یک صفحه سفید؟؟؟؟؟؟

nistelrooy

Member
سلام خدمت تمام دوستان
من یک فایل php می خواهم که در این صفحه فقط 5 ارسال آخر به انجمن را نشان بدهد

ممنون می شم کمک کنید
 

nistelrooy

Member
سلام

کسی نیست واسه من یک فایل php بسازه که 5 ارسال آخر انجمن PHPBB3 را نشان بده؟

ممنون می شم اگه یکی این لطف رو کنه
 

S4DEGH

Well-Known Member
دوست عزیز کمی صبر داشته باشی بد نیست !

اینم کدش :
کد:
<?php
$connection = mysql_connect(localhost,"your_login","your password") or die("Service temporairly unavailable");
$db = mysql_select_db("your_db_name",$connection) or die("Service temporairly unavailable");
$sql = "select * from phpbb_topics order by topic_last_post_time desc limit 0,10";
$result = mysql_query($sql) or die("Service temporairly unavailable");
for($x=1;$x<=10;$x++){
	$row = mysql_fetch_array($result);
	echo "<a href = \"http://www.yourforumdomain.com/viewtopic.php?f=$row[forum_id]&t=$row[topic_id]\" target = \"_blank\">$row[topic_title]</a><br>";
}
?>
 

nistelrooy

Member
واقعاً ممنون
من واقها عجله داشم و کارم گیره این قضیه بود
بازهم سپاس
 

nistelrooy

Member
سلام دوست عزیز
اینکه کار نمی کنه:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'your_login'@'localhost' (using password: YES) in /home/rmadridf/domains/rmadridfc.com/public_html/portada_fa/forum/last.php on line 2
Service temporairly unavailable

من می خوام 10 ارسال آخر لینکاش نمایش داده بشه؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟
؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟
 

S4DEGH

Well-Known Member
عزیز من شما باید تو بخش هایی که عنوان شده اطلاعاتت رو وارد کنی .. این هارو که من نباید بگم که !
Access denied for user 'your_login'@'localhost' (using password: YES)

جایی که زده your_login مال یوزر دیتابیسه .. your password پسورد دیتابیس .. your_db_name نام دیتابیس .. yourforumdomain.com آدرس انجمن !


یکم توجه بد نیست ..
 

nistelrooy

Member
مشکلی که قبلاً داشتم بازهم تکرار شد:

من قبلاً با روش دیگری این کار رو کردم ولی جواب نداد
حالا هم باز
??????? ??? ?????
??? ???? ?? ?????? ???? : ????? ???? ??? ?? ????
???????? ? ????????? ? ?????? ? ?????? ???????
????? ??? ???????? ?????
????? ??? ???????? ?????
???? ?? ??? ??? ?? ??? ???????? ????? ???? ????? ?? ????????
10 ?????? ???? ????? ???? ??????
]????? ??? ?? ???? ?? ????? ?? ??????? ??
?????? ??????? ??????? ??????? ????? ?? ??????? ??
??? ??? ????????

اینارو نمایش می ده
مثل گذشه
یعنی به جایی تیتر ؟؟؟؟؟؟؟؟؟؟؟؟؟ می زاره
چرا؟
 

S4DEGH

Well-Known Member
کد درست هست و تست کردم مشکلي نداره . از طرفي چيزي هم نيست يه اتصال و نمايشه .. اونکه ؟؟؟؟؟ ميزنه بنظرم از کدينگ ديتابيست هست .. آدرس انجمنت چيه ؟
 

nistelrooy

Member
آقا کسی نیست کمک کنه؟
دیتابیس من utf-8 هست
و فکر کنیم به همین دلیل تیتر آخرین ارسال ها به صورت علامت سوال نمایش داده می شود

لطفاً کمک کنید
 

nistelrooy

Member
سلام دوس عزیز
ممنون از لینکی که دادی
ولی نشد
من فایل php می خوام که 10ارسال آخر انجمن phpbb را نمایش بده
و با توجه به اینکه دیتابیس من utf-8 هست
همواره مشکل وجود داره
خواستم لطف کنید و کمک کنید
ممنون
 

nistelrooy

Member
آقا من کماکاً این مشکل بزرگ را دارم
باید چه کنم؟

کسی نیست کمک کنه؟:cry::oops:
ثواب داره هاااااااااااااااااااااااااااااااااااااااااااااااااااااااااااااااااااا:rose:
 

BetaMaster

Member
PHP:
<?php 
$output = ' 
<!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;> 
<html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; dir=&quot;ltr&quot; lang=&quot;nl&quot; xml:lang=&quot;nl&quot;> 
<head> 

    <meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=UTF-8&quot; /> 
    <meta http-equiv=&quot;content-language&quot; content=&quot;nl&quot; /> 
    <meta http-equiv=&quot;content-style-type&quot; content=&quot;text/css&quot; /> 
    <meta http-equiv=&quot;imagetoolbar&quot; content=&quot;no&quot; /> 
    <meta name=&quot;resource-type&quot; content=&quot;document&quot; /> 
    <meta name=&quot;distribution&quot; content=&quot;global&quot; /> 

    <meta name=&quot;copyright&quot; content=&quot;www.phpBB.Maghsad.com&quot; /> 

    <title>phpBB.Maghsad.com News script 1.0.1</title> 
</head> 

<body> 

<div id=&quot;inhoud&quot;> 

    <h1>News from forum</h1> 
'; 
//-- Start the phpBB session AND include the nessacary files 
define( 'IN_PHPBB', true ); 
$phpbb_root_path = './../phpBB3/'; // change in your own root path. 
$phpEx = substr(strrchr(__FILE__, '.'), 1); 
include($phpbb_root_path . 'common.' . $phpEx); 
include($phpbb_root_path . 'includes/functions_display.' . $phpEx); 
include($phpbb_root_path . 'includes/bbcode.' . $phpEx); 

$user->session_begin(); 
$auth->acl( $user->data ); 
$user->setup(); 

//-- Fetch the data from the specified fora 
$bbcode = new bbcode(); 
$news_fora_id = array( '2' ); // Change in the fora id's you need 
$query = &quot; 
    SELECT p.topic_id, p.forum_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, 
        u.user_id, u.user_email, u.username, u.user_posts, u.user_rank, u.user_colour, u.user_allow_viewonline, u.user_allow_viewemail, 
            ( 
                SELECT COUNT( post_id ) 
                FROM &quot; . POSTS_TABLE . &quot; 
                    WHERE topic_id = p.topic_id 
            ) AS aantal_posts 
    FROM &quot; . POSTS_TABLE . &quot; AS p, &quot; . USERS_TABLE . &quot; AS u 
        WHERE &quot; . $db->sql_in_set( 'p.forum_id', $news_fora_id ) . &quot; 
            AND u.user_id = p.poster_id 
    GROUP BY topic_id 
    ORDER BY topic_id DESC 
&quot;; 
//die('<pre>' . $query ); 
$result = $db->sql_query( $query ); 
while( $row = $db->sql_fetchrow($result) ) 
{ 
    // Parse the message and subject 
    $message = censor_text($row['post_text']); 

    // Second parse bbcode here 
    if ($row['bbcode_bitfield']) 
    { 
        $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']); 
    } 

    $message = bbcode_nl2br($message); 
    $message = smiley_text($message); 
     
    // Send data to output var 
    $output .= &quot;<h2><a href=&quot;&quot; . $phpbb_root_path . &quot;viewtopic.php?f={$row['forum_id']}&amp;t={$row['topic_id']}&quot; title=&quot;&quot;  . censor_text($row['post_subject']) . &quot;&quot;>&quot;.censor_text($row['post_subject']).&quot;</a></h2>n&quot;; 
    $output .= &quot;<p style=&quot; padding-bottom: 3em; &quot;>nt&quot;; 
    $output .= $message; 
    $output .= &quot;nt<span style=&quot;widht: 50%; float: left; border-top: 1px solid #00008b;\&quot;>Posted by:  <span style=\&quot; color: #&quot; . $row['user_colour'] . &quot;;\&quot;>&quot; . $row['username'] . &quot;</span></span>&quot;; 
    $output .= &quot;nt<span style=&quot;widht: 50%; float: right; border-top: 1px solid #00008b;\&quot;>On: &quot; . date( $user->data['user_dateformat'], $row['post_time'] ) . &quot;</span>\n&quot;; 
    $output .= &quot;</p>nn&quot;; 
} 

$output .= ' 
</div> 

</body> 
</html>'; 

// print the output 
print( $output ); 
?>

لينك صحيح بود.. 3 روش آموزش داده شده كه روش سوم مد نظر من بود .
 
آخرین ویرایش:

nistelrooy

Member
سلام
دوس عزیز من
change in your own root path.
// Change in the fora id's you need

را عوض کردم و پیغام
Parse error: syntax error, unexpected ';', expecting T_PAAMAYIM_NEKUDOTAYIM in C:\wamp\www\phpBB3\last.php on line 40
را می ده
می شه راهنمایی بیشتر بفرمایید؟

ممنون می شم
 

جدیدترین ارسال ها

بالا