forumum forum.ornek.com da kurulu, bense ornek.com a girince bir bölümde siteye gelenler forumdaki son mesajları da (Son 5 mesajı) anasayfamdan görebilsinler.Bunun için bir blogda hazırlanmış modu kullandım ama hata aldım.Bu konuda biri bana yardımcı olabilirse ben de anasayfamı canlandırmış olurum.
Bulduğum kod:[syntax="php"]<?php
DEFINE("SITE_URL","http://");
DEFINE("VERITABANI_HOST","localhost");
DEFINE("VERITABANI","");
DEFINE("VERITABANI_KULLANICI","");
DEFINE("VERITABANI_SIFRE","");
DEFINE("PHPBB_TABLO_PREFIX","_");
/* Dil - Languages */
DEFINE("PHPBB_MESAJ_IKONU","Mesaj ikonu");
DEFINE("PHPBB_SON_GONDEREN","Son Gönderen:");
DEFINE("PHPBB_KONU","Konu:");
DEFINE("PHPBB_TARIH","Tarih:");
function PhpBBSonMesaj($limit=10) {
$baglan = new db(VERITABANI_KULLANICI,VERITABANI_SIFRE,VERITABANI,VERITABANI_HOST);
$count = 1;
$SQL = "SELECT t.topic_id, t.topic_last_post_id, t.topic_title, f.forum_name, f.forum_id FROM ".PHPBB_TABLO_PREFIX."topics t, ".PHPBB_TABLO_PREFIX."forums f where t.forum_id=f.forum_id and f.auth_view=0 ORDER BY t.topic_last_post_id DESC LIMIT $limit";
$basliklar = $baglan->get_results($SQL);
foreach ($basliklar as $baslik) {
$SQL2 = "SELECT topic_id, poster_id, FROM_UNIXTIME(post_time,'%b %d, %Y Saat: %T') as post_time FROM ".PHPBB_TABLO_PREFIX."posts where post_id='".$baslik->topic_last_post_id."'";
$mesajlar = $baglan->get_row($SQL2);
$SQL3 = "SELECT username, user_id FROM ".PHPBB_TABLO_PREFIX."users where user_id='".$mesajlar->poster_id."'";
$kullanici = $baglan->get_row($SQL3);
$content .= "<img src=\"".SITE_URL."/templates/subSilver/images/icon_minipost.gif\" alt=\"".PHPBB_MESAJ_IKONU."\" border=\"0\"><a href=\"".SITE_URL."/viewtopic.php?t=".$baslik->topic_id."#".$baslik->topic_last_post_id."\" title=\"".$baslik->topic_title."\"><b>".$baslik->topic_title."</b></a><br><font color=\"#666666\"><i>".PHPBB_SON_GONDEREN." <A HREF=\"".SITE_URL."/profile.php?mode=viewprofile&u=".$kullanici->user_id."\" title=\"".$kullanici->username."\">".$kullanici->username."</a> ".PHPBB_KONU." <a href=\"".SITE_URL."/viewforum.php?f=".$baslik->forum_id."\" title=\"".$baslik->forum_name."\">".$baslik->forum_name."</a> ".PHPBB_TARIH." ".$mesajlar->post_time."</i></font><br><br>";
$count = $count + 1;
}
echo $content;
$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
}
?>[/syntax]
bunu aynen anasayfama koydum ve şu kodu yazdım <?php PhpBBSonMesaj(5); ?>
ama şu hatayı aldım, Fatal error: Cannot instantiate non-existent class: wpdb in /home/ornek/public_html/deneme.php on line 118
Yardımcı olursanız çok teşekkür ederim