Praat mee over van alles en nog wat!
Forumregels
Dit forum is voor alle zinnige gesprekken buiten phpBB om. Discussies en gesprekken over interessante onderwerpen.
Een nieuw onderwerp moet..:
- uiteraard voldoen aan de algemene voorwaarden
- niet passen in de gewone supportfora
- interessante zijn voor het overgrote deel van onze gebruikers
- een neutrale of positieve ondertoon hebben
- anders zijn dan bestaande onderwerpen
-
angelotus
- Berichten: 7
- Lid geworden op: 29 mei 2007, 09:49
Bericht
door angelotus » 05 jun 2007, 10:36
- 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
-
Alexander
- Berichten: 348
- Lid geworden op: 20 mar 2007, 20:59
- Locatie: Warmenhuizen
Bericht
door Alexander » 05 jun 2007, 21:57
- 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

-
angelotus
- Berichten: 7
- Lid geworden op: 29 mei 2007, 09:49
Bericht
door angelotus » 06 jun 2007, 07:57
Ik heb 'm gewijzigd, maar zie nog geen resultaat.

-
Salomon
- Berichten: 3878
- Lid geworden op: 14 feb 2006, 16:15
Bericht
door Salomon » 07 jun 2007, 15:08
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...
-
angelotus
- Berichten: 7
- Lid geworden op: 29 mei 2007, 09:49
Bericht
door angelotus » 07 jun 2007, 15:40
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!?!?

-
Stef
- Berichten: 9080
- Lid geworden op: 04 jun 2003, 20:47
Bericht
door Stef » 09 jun 2007, 11:41
Is niet je host, waarschijnlijk gewoon "localhost".
-
angelotus
- Berichten: 7
- Lid geworden op: 29 mei 2007, 09:49
Bericht
door angelotus » 11 jun 2007, 08:39
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...

-
Stef
- Berichten: 9080
- Lid geworden op: 04 jun 2003, 20:47
Bericht
door Stef » 11 jun 2007, 10:01
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());
-
angelotus
- Berichten: 7
- Lid geworden op: 29 mei 2007, 09:49
Bericht
door angelotus » 11 jun 2007, 10:16
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!