Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include ("config.php");
- $link = mysql_connect ($dbhost,$dbuser,$dbpasswd) or die ('Erreur : '.mysql_error() );
- mysql_select_db($dbname) or die ('Erreur :'.mysql_error());
- $select = "SELECT topic_title,topic_id,topic_poster,forum_id,topic_last_poster_name,topic_last_post_time FROM phpbb_topics where forum_id !='37' ORDER BY topic_last_post_time DESC limit 3";
- $result = mysql_query($select,$link) or die ('Erreur : '.mysql_error() );
- while($row = mysql_fetch_array($result))
- {
- $topic_id = $row['topic_id'];
- $titre = $row['topic_title'];
- $posteur = $row['topic_last_poster_name'];
- ########## Début format URL ##########
- $annonce= $titre;
- $annonce = preg_replace("`\[.*\]`U","",$annonce);
- $annonce = preg_replace('`&(amp;)?#?[a-z0-9]+;`i','-',$annonce);
- $annonce = htmlentities($annonce, ENT_COMPAT, 'UTF-8');
- $annonce = preg_replace( "`&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i","\\1", $annonce );
- $annonce = preg_replace( array("`[^a-z0-9]`i","`[-]+`") , "-", $annonce);
- $annonce = ( $annonce == "" ) ? $type : strtolower(trim($annonce, '-'));
- ########## Fin format URL ##########
- $titre_lien= (strlen($titre) > 32) ? substr($titre, 0,29).'...' : $titre;
- echo '<a href="/forum/viewtopic.php?t='.$topic_id.'" target="_blank">'.ucfirst(strtolower($titre_lien)).'</a> - par '.$posteur.'<br>';
- }
- mysql_free_result($result);
- mysql_close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement