Chciałem wyciągnąć z bazy forum dane ostatnich tematów i umieścić je na stronie głównej wordpressa, służy do tego odpowiedni mod. Wszystko działa tylko są krzaki.
W bazie wordpress mam takie ustawienia:
<?php ?>
W bazie forum są takie same dane. Jednak w plikach forum i strony charsety ustawione są na
<?php ?>
Źródło pliku conf z moda:
<?php /* Plugin Name: PhpBB Son Basliklar (PhpBB Last Topics) Description: Phpbb forumdaki son basliklari listeler (List last phpbb forum topics on your wordpress). Version: 1.0 Author: dmRy <hakan@dmry.net> Author URI: http://www.dmry.net/ */ DEFINE("VERITABANI_HOST","localhost"); DEFINE("VERITABANI","xxxxxxxxxxx"); DEFINE("VERITABANI_KULLANICI","xxxxx"); DEFINE("VERITABANI_SIFRE","xxxxxxxxx"); DEFINE("PHPBB_TABLO_PREFIX","xxxxxx_"); /* Dil - Languages */ DEFINE("PHPBB_MESAJ_IKONU","Mesaj ikonu"); DEFINE("PHPBB_SON_GONDEREN","Son Gönderenţ:"); function PhpBBSonMesaj($limit=10) { $baglan = new wpdb(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 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 .= "<li><a href=\"".SITE_URL."/viewtopic.php?t=".$baslik->topic_id."#".$baslik->topic_last_post_id."\" title=\"".$baslik->topic_title."\"><b>".$baslik->topic_title."</b></li>"; $count = $count + 1; } $wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST); } ?>
Prosze o radę jak mogę to poprawnie wyświetlić. Dzięki