Pagina 1 van 1
PHPBB 3 Laatste posts in Wordpress
Geplaatst: 05 jun 2007, 10:36
door angelotus
- Wat is het probleem?
Ik ontvang geen uitvoer in dit script. De laatste topics moeten weergegeven worden in mijn Wordpress blog, maar er gebeurt niets, ook geen foutmelding.
Wanneer ontstond het probleem?
Meteen
Adres van je forum: http://forums.metalvalley.nl
adres van Wordpress installatie is http://www.metalvalley.nl
Modifications op je forum:
Op dit moment geen
Huidige stijl:
Eigen stijl (modificatie van subsilver
phpBB versie: 3.0.x
Waar is je forum gehost:
Eigen installatie
Heb je onlangs iets verandert aan je forum?
Nope
Dit is het script van de wordpress plugin die de laatste posts uit dezelfde database moet halen:
Ik heb geprobeerd antwoord te krijgen bij de bouwer van dit script, maar krijg daar 0 respons vandaar mijn vraag hier.
Dit is het bewuste script:
Code: Selecteer alles
<?php
/*
Plugin Name: WP-Phpbb Last Topics
Plugin URI: http://www.4mj.it/wordpress-phpbb-last-topics-plugin/
Description: Display the most recent topics of your phpBB forum.
Version: 1.1
Author: Peppe Argento
Author URI: http://www.4mj.it
****************************
Sorry for my english!
To exclude a category of the forum, like private forum, add AND forum_id !='2', whith the id you want exclude.
You can set the number of post to display in DESC LIMIT 0,10, where 10 is the number.
For example if you wanna exlude (id 2 e 11) write
$phpbbq = "SELECT * FROM ".$table_prefix."topics WHERE forum_id !='2' AND forum_id !='11' ORDER BY topic_last_post_id DESC LIMIT 0,10";
****************************
*/
function wpphpbb_topics() {
//set forum path, forum host
$forum_path = "/public/sites/forums.metalvalley.nl";
$host = "http://forums.metalvalley.nl";
include("".$forum_path."/config.php");
$connection = mysql_connect($dbhost, $dbuser, $dbpasswd);
$s_db = mysql_select_db($dbname, $connection);
$phpbbq = "SELECT * FROM ".$table_prefix."topics ORDER BY topic_last_post_id DESC LIMIT 0,10";
$results = mysql_query($phpbbq, $connection);
while ($resultsow = mysql_fetch_array($results)) {
$topic_tit = $resultsow[topic_title];
// You can wrap long words below, where 60 is the lenght.
$topics_title = substr($topic_tit, 0, 48);
echo "<li><a href=\"$host"."/viewtopic.php?t=$resultsow[topic_id]\">$topics_title...</a></li>";
}
}
?>
Hopelijk kunnen jullie mij helpen!
Verplaatst naar AO, heeft niks vandoen met de phpBB software, maar met Wordpress.
- Stef
Re: PHPBB 3 Laatste posts in Wordpress
Geplaatst: 05 jun 2007, 21:38
door BetaDevil
Dit script is voor phpBB2.
Re: PHPBB 3 Laatste posts in Wordpress
Geplaatst: 05 jun 2007, 21:57
door Alexander
- Spoiler: bekijk
Code: Selecteer alles
<?php
/*
Plugin Name: WP-Phpbb Last Topics
Plugin URI: http://www.4mj.it/wordpress-phpbb-last-topics-plugin/
Description: Display the most recent topics of your phpBB forum.
Version: 1.1
Author: Peppe Argento
Author URI: http://www.4mj.it
****************************
Sorry for my english!
To exclude a category of the forum, like private forum, add AND forum_id !='2', whith the id you want exclude.
You can set the number of post to display in DESC LIMIT 0,10, where 10 is the number.
For example if you wanna exlude (id 2 e 11) write
$phpbbq = "SELECT * FROM ".$table_prefix."topics WHERE forum_id !='2' AND forum_id !='11' ORDER BY topic_last_post_id DESC LIMIT 0,10";
****************************
*/
function wpphpbb_topics() {
//set forum path, forum host
$forum_path = "http://forums.metalvalley.nl";
$host = "http://forums.metalvalley.nl";
include("".$forum_path."/config.php");
// De connectie zit al in config.php ;)
$query = mysql_query("SELECT * FROM ".$table_prefix."topics ORDER BY topic_last_post_id DESC LIMIT 0,10") or die ("Kon geen contact krijgen met de db <br>" . mysql_error());
while ($resultsow = mysql_fetch_array($query)) {
$topic_tit = $resultsow[topic_title];
// You can wrap long words below, where 60 is the lenght.
$topics_title = substr($topic_tit, 0, 48);
print '<li><a href="'.$host.'/viewtopic.php?t=$resultsow[topic_id]">'.$topics_title.'</a></li>';
}
}
?>
Deze moet beter zijn, er zaten wat fouten hier en daar

Re: PHPBB 3 Laatste posts in Wordpress
Geplaatst: 06 jun 2007, 07:57
door angelotus
Ik heb 'm gewijzigd, maar zie nog geen resultaat.

Re: PHPBB 3 Laatste posts in Wordpress
Geplaatst: 07 jun 2007, 09:52
door angelotus
Iemand een idee?
Re: PHPBB 3 Laatste posts in Wordpress
Geplaatst: 07 jun 2007, 15:08
door Salomon
Alexander schreef:- Spoiler: bekijk
Code: Selecteer alles
<?php
/*
Plugin Name: WP-Phpbb Last Topics
Plugin URI: http://www.4mj.it/wordpress-phpbb-last-topics-plugin/
Description: Display the most recent topics of your phpBB forum.
Version: 1.1
Author: Peppe Argento
Author URI: http://www.4mj.it
****************************
Sorry for my english!
To exclude a category of the forum, like private forum, add AND forum_id !='2', whith the id you want exclude.
You can set the number of post to display in DESC LIMIT 0,10, where 10 is the number.
For example if you wanna exlude (id 2 e 11) write
$phpbbq = "SELECT * FROM ".$table_prefix."topics WHERE forum_id !='2' AND forum_id !='11' ORDER BY topic_last_post_id DESC LIMIT 0,10";
****************************
*/
function wpphpbb_topics() {
//set forum path, forum host
$forum_path = "http://forums.metalvalley.nl";
$host = "http://forums.metalvalley.nl";
include("".$forum_path."/config.php");
// De connectie zit al in config.php ;)
$query = mysql_query("SELECT * FROM ".$table_prefix."topics ORDER BY topic_last_post_id DESC LIMIT 0,10") or die ("Kon geen contact krijgen met de db <br>" . mysql_error());
while ($resultsow = mysql_fetch_array($query)) {
$topic_tit = $resultsow[topic_title];
// You can wrap long words below, where 60 is the lenght.
$topics_title = substr($topic_tit, 0, 48);
print '<li><a href="'.$host.'/viewtopic.php?t=$resultsow[topic_id]">'.$topics_title.'</a></li>';
}
}
?>
Deze moet beter zijn, er zaten wat fouten hier en daar

Ehm alexander, de connectie zit helemaal niet standaard in config.php... Daar staan alleen de gegevens...
Re: PHPBB 3 Laatste posts in Wordpress
Geplaatst: 07 jun 2007, 15:40
door angelotus
Salomon schreef:Alexander schreef:- Spoiler: bekijk
Code: Selecteer alles
<?php
/*
Plugin Name: WP-Phpbb Last Topics
Plugin URI: http://www.4mj.it/wordpress-phpbb-last-topics-plugin/
Description: Display the most recent topics of your phpBB forum.
Version: 1.1
Author: Peppe Argento
Author URI: http://www.4mj.it
****************************
Sorry for my english!
To exclude a category of the forum, like private forum, add AND forum_id !='2', whith the id you want exclude.
You can set the number of post to display in DESC LIMIT 0,10, where 10 is the number.
For example if you wanna exlude (id 2 e 11) write
$phpbbq = "SELECT * FROM ".$table_prefix."topics WHERE forum_id !='2' AND forum_id !='11' ORDER BY topic_last_post_id DESC LIMIT 0,10";
****************************
*/
function wpphpbb_topics() {
//set forum path, forum host
$forum_path = "http://forums.metalvalley.nl";
$host = "http://forums.metalvalley.nl";
include("".$forum_path."/config.php");
// De connectie zit al in config.php ;)
$query = mysql_query("SELECT * FROM ".$table_prefix."topics ORDER BY topic_last_post_id DESC LIMIT 0,10") or die ("Kon geen contact krijgen met de db <br>" . mysql_error());
while ($resultsow = mysql_fetch_array($query)) {
$topic_tit = $resultsow[topic_title];
// You can wrap long words below, where 60 is the lenght.
$topics_title = substr($topic_tit, 0, 48);
print '<li><a href="'.$host.'/viewtopic.php?t=$resultsow[topic_id]">'.$topics_title.'</a></li>';
}
}
?>
Deze moet beter zijn, er zaten wat fouten hier en daar

Ehm alexander, de connectie zit helemaal niet standaard in config.php... Daar staan alleen de gegevens...
Ik heb zelf ook nog even geknutseld, maar ik kom er helaas niet uit. Ik hoop dat hier iemand mij toch nog verder kan helpen!?!?

Re: PHPBB 3 Laatste posts in Wordpress
Geplaatst: 09 jun 2007, 11:41
door Stef
Is niet je host, waarschijnlijk gewoon "localhost".
Re: PHPBB 3 Laatste posts in Wordpress
Geplaatst: 11 jun 2007, 08:39
door angelotus
Ik kom er niet meer uit. Ik heb alles geprobeerd (ook gewijzigd in localhost, lijkt me overigens raar, omdat deze al in config wordt opgeroepen)...krijg het niet aan de praat...

Re: PHPBB 3 Laatste posts in Wordpress
Geplaatst: 11 jun 2007, 10:01
door Stef
angelotus schreef:Ik kom er niet meer uit. Ik heb alles geprobeerd (ook gewijzigd in localhost, lijkt me overigens raar, omdat deze al in config wordt opgeroepen)...
mmz true, heel die var wordt niet gebruikt!
Maak van dit eens:
Eens dit:
Code: Selecteer alles
$results = mysql_query($phpbbq, $connection) or die (mysql_error());
Re: PHPBB 3 Laatste posts in Wordpress
Geplaatst: 11 jun 2007, 10:16
door angelotus
Ok, uitgaande dat connectie nog gemaakt moet worden en dus de eerste code de juiste is. De host goed is ingevult, zou deze code het moeten doen:
Code: Selecteer alles
[spoiler]<?php
/*
Plugin Name: WP-Phpbb Last Topics
Plugin URI: http://www.4mj.it/wordpress-phpbb-last-topics-plugin/
Description: Display the most recent topics of your phpBB forum.
Version: 1.1
Author: Peppe Argento
Author URI: http://www.4mj.it
****************************
Sorry for my english!
To exclude a category of the forum, like private forum, add AND forum_id !='2', whith the id you want exclude.
You can set the number of post to display in DESC LIMIT 0,10, where 10 is the number.
For example if you wanna exlude (id 2 e 11) write
$phpbbq = "SELECT * FROM ".$table_prefix."topics WHERE forum_id !='2' AND forum_id !='11' ORDER BY topic_last_post_id DESC LIMIT 0,10";
****************************
*/
function wpphpbb_topics() {
//set forum path, forum host
$forum_path = "/public/sites/forums.metalvalley.nl";
$host = "localhost";
include("".$forum_path."/config.php");
$connection = mysql_connect($dbhost, $dbuser, $dbpasswd);
$s_db = mysql_select_db($dbname, $connection);
$phpbbq = "SELECT * FROM ".$table_prefix."topics ORDER BY topic_last_post_id DESC LIMIT 0,10";
$results = mysql_query($phpbbq, $connection) or die (mysql_error());
while ($resultsow = mysql_fetch_array($results)) {
$topic_tit = $resultsow[topic_title];
// You can wrap long words below, where 60 is the lenght.
$topics_title = substr($topic_tit, 0, 48);
echo "<li><a href=\"$host"."/viewtopic.php?t=$resultsow[topic_id]\">$topics_title...</a></li>";
}
}
?>[/spoiler]
Maar helaas werkt ie nog steeds niet....
Volgens het voorbeeld moet ik als path de http:// nemen en als host dus local host!