[ ????? ] ????? ?? ??? ???? ????? ??????? ??? ??????? ?? DB
مرسل: الأربعاء فبراير 08, 2012 3:26 am
??? ???? ??????? ??????
?????? ??? ?????? ??? ???????? ????? ????? ???? ????? ??????? ??? ???????? ?? ????? ???????? ??? ????? ?????? ????? ??????? ? ???????? ???? ???? phpBB3
??? ????? ???? ???? ??????? ?????? ??????? ?? ???? ???? ???? ??????? ?????? ??????? ???? ??? 10 ???????? ?? ??????? ??? ?????? ??????? ?????? ????? ????? ?????? ?? ?????? ?????..
??? ???? ???? ???? ??????? phpbb ???? phpbb_news ????? ??? news_id news_title news_text news_user news_date ??? ?? ??????

? ?????? ??????

????? ? header ??? ????
???? ???? ?? ?????? ??????? ??? ?? ??? ?? ?? ????? ??? ???????? ???????? ?? ??????? ????? ???????


??????? ?????? ???????? ???? ??????? ???????? ?????? ????? class dbal ????? ????????
?????? ????? ????? ?? ??? ??? ?????????

????? ????? ????????
??? ?????? ?????? ?????? ?? ??? ?????? ???? phpbb_news

?????? ???????? ?? ????? ???????? ??????
?????? ???????? ?? ??? ???????? ?? ??????
???? ?????? ??? ????? ??? ??????? ?? ??? ???????? ???.
????? ?? ???? ?? ????? ???? ??? ??????.
??????? ??? ???? ????? ? ??????? ?????? ???? =)[/size]
?????? ??? ?????? ??? ???????? ????? ????? ???? ????? ??????? ??? ???????? ?? ????? ???????? ??? ????? ?????? ????? ??????? ? ???????? ???? ???? phpBB3
??? ????? ???? ???? ??????? ?????? ??????? ?? ???? ???? ???? ??????? ?????? ??????? ???? ??? 10 ???????? ?? ??????? ??? ?????? ??????? ?????? ????? ????? ?????? ?? ?????? ?????..
??? ???? ???? ???? ??????? phpbb ???? phpbb_news ????? ??? news_id news_title news_text news_user news_date ??? ?? ??????

? ?????? ??????

????? ? header ??? ????
كود: تحديد الكل
<meta http-equiv="content-type" content="text/html" charset="windows-1256">


??????? ?????? ???????? ???? ??????? ???????? ?????? ????? class dbal ????? ????????
كود: تحديد الكل
$db->sql_query
$db->sql_fetchrow

????? ????? ????????
كود: تحديد الكل
<?php
/*** phpBB3 - Last Active Topics System ***/
//Show last x topics
define('TOPICS_LIMIT',10);
// Create arrays
$topics = array();
// Get forums that current user has read rights to.
$forums = array_unique(array_keys($auth->acl_getf('f_read', true)));
// Get active topics.
$sql="SELECT *
FROM " . TOPICS_TABLE . "
WHERE topic_approved = '1' AND " . $db->sql_in_set('forum_id', $forums) . "
ORDER BY topic_last_post_time DESC";
$result = $db->sql_query_limit($sql,TOPICS_LIMIT);
while ($r = $db->sql_fetchrow($result))
{
$topics[] = $r;
}
$db->sql_freeresult($result);
?>

?????? ???????? ?? ????? ???????? ??????
كود: تحديد الكل
$user = $user->data['username'];
$title= htmlentities($_POST['news_title'], ENT_QUOTES);
$title= htmlspecialchars($title);
$text=htmlentities($_POST['news_text'], ENT_QUOTES);
$text= htmlspecialchars($text);
$news_date = date("Y/m/d")." ".date('H:m:s');
$random_id= rand(1111111,9999999);
$sql = "insert into phpbb_news VALUES('$random_id','$title','$text','$user','$news_date')";
$db->sql_query($sql);
$db->sql_freeresult($result);
كود: تحديد الكل
$result = $db->sql_query("select * from phpbb_news");
while ($row = $db->sql_fetchrow($result))
{
$news_id = $row['news_id'];
$news_user = $row['news_user'];
$news_title =htmlspecialchars_decode(html_entity_decode($row['news_title']));
$news_date = $row['news_date'];
}
????? ?? ???? ?? ????? ???? ??? ??????.
??????? ??? ???? ????? ? ??????? ?????? ???? =)[/size]