| |
| |
|
|
|
|
| |
|
| |
|
| :: |
| Auteur |
Message |
sat010
Inscrit le: 18 Avr 2007 Messages: 20
|
Posté le: Mer Mai 21, 2008 6:51 am Sujet du message: dernier sujets sur un blog |
|
|
bonjour a tous
possedant un phpbb3 avec les mod suivant :
mod Rewrite phpBB3 SEO Avancé V 0.4.2
Zéro Duplicate phpBB3 SEO V 0.4.2
comment faire apparaitre sur un blog les derniers sujets du forum rewrité ?
existe il des script?
merci d'avance
bonne journée  |
|
|
| Revenir en haut de page |
|
 |
|
 |
dcz Administrateur - Site Admin

Inscrit le: 28 Avr 2006 Messages: 14279
|
|
| Revenir en haut de page |
|
 |
sat010
Inscrit le: 18 Avr 2007 Messages: 20
|
Posté le: Sam Mai 31, 2008 3:31 pm Sujet du message: Re: dernier sujets sur un blog |
|
|
| dcz a écrit: | Par contre, quand on aura des beaux flux RSS pour phpBB3, cela simplifiera les choses
++ |
salut
tu mettones pour les rss
merci pour ta réponses ça fait x temps que je cherche , bon je suis tomber sur un script qui a l'air de fonctionner sans vos mods (mod Rewrite phpBB3 SEO Avancé V 0.4.2 et Zéro Duplicate phpBB3 SEO V 0.4.2 )
je cherche a integrer la date et le membre qui a poster et si possible compatible avec les mod seo(mod Rewrite phpBB3 SEO Avancé V 0.4.2
Zéro Duplicate phpBB3 SEO V 0.4.2 )
si vous pourriez m'aider la dessus
ci dessous le script
merci d'avance
| Code: | <?php
function phpbb_recent_posts(){
// Set up the basic database constants. Edit these to match your configuration.
define ("PHPBB_HOSTNAME", "localhost");
define ("PHPBB_LOGIN", "*****");
define ("PHPBB_PASSWORD", "****");
define ("PHPBB_DATABASE", "****");
define ("PHPBB_BASE_URL", "******");
define ("PHPBB_TABLE_PREFIX", "phpbb_");
// Set the max posts you want returned.
$max_posts = 5;
// You probably won't have to modify anything below this line.
// Connect to the server, select the database. We create a new database connection here so as to not clobber the existing WP connection if the
//phpbb3 username, password, and server are the same as the WP connection.
if ( !($dbh = mysql_connect( PHPBB_HOSTNAME, PHPBB_LOGIN, PHPBB_PASSWORD, TRUE ))){
die ( "Cannot connect to server" );
} else {
// Now we select the database.
if ( !(mysql_select_db(PHPBB_DATABASE, $dbh ))){
die ( "Can not select database" );
}//end if
}//end if
// Build the query.
$query = 'SELECT DISTINCT p.topic_id, p.forum_id, p.post_subject FROM '.PHPBB_DATABASE.'.'.PHPBB_TABLE_PREFIX.'posts p ORDER BY p.post_time DESC LIMIT '.$max_posts;
$result = mysql_query($query);
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}//end if
// Begin the unordered list tag.
echo "<ul>\n";
// Runs the fetch from the statement handle, echoes out the results in the form of a link.
while ($row = mysql_fetch_assoc($result)) {
$topic_id = $row['topic_id'];
$forum_id = $row['forum_id'];
$post_subject = $row['post_subject'];
// Builds the link then echoes.
$link = PHPBB_BASE_URL."/viewtopic.php?f=${forum_id}&t=${topic_id}";
echo "<li><a href=\"${link}\">$post_subject</a></li>\n";
}//end while
// Close up the unordered list.
echo "</ul>\n";
// Cleans up.
mysql_free_result($result);
mysql_close();
return(0);
}
?> |
cordialement
sat010  |
|
|
| Revenir en haut de page |
|
 |
|
| Navigation |
Autres sujets de discussion |
|
|
|
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |