Example #1
0
     if ($get_realname == null) {
         echo '<span class="from"><a href="profile.php?id=' . $get_userID . '" class="user-name">@' . $get_username . '</a> ';
     } else {
         echo '<span class="from"><a href="profile.php?id=' . $get_userID . '" class="user-name">' . $get_realname . '</a> ';
     }
     if ($get_title !== null) {
         echo '<span class="forum-title"><em>' . $get_title . '</em></span></span> ';
     }
     echo '<span class="time muted"><small>' . timeAgo($get_sTime) . '</small></span>';
     if ($_SESSION['current_userID'] !== $get_userID) {
         echo '<span class="pull-right">';
         echo '<button class="btn btn-mini tip-top" id="rtshoutm-' . $get_shoutID . '" onClick="rtshoutm(\'' . $get_shoutID . '\',\'' . $get_username . '\');" title="Reshout"><i class="icon-share"></i> RT</button> ';
         echo '<button class="btn btn-mini" id="mention-' . $get_shoutID . '" onClick="insertNickname(\'' . $get_username . '\');"><i class="icon-circle"></i> Mention</button>';
         echo '</span>';
     }
     echo '<span class="text" id="msg-' . $get_shoutID . '">' . stripslashes(rtrim(clickable(bbCode($get_shoutMsg)))) . '</span>';
     echo '</span></li>';
 }
 if ($count_shout_more == 20) {
     echo '<div style="margin-top:10px;padding:10px;text-align:center;" id="more-' . $get_shoutID . '" class="morebox"><a href="#" id="' . $get_shoutID . '" class="btn btn-small btn-inverse more"><i class="icon-arrow-down icon-white"></i> Load more...</a></div>';
 } else {
     echo '<div style="margin-top:10px;padding:10px;text-align:center;">End of Messages</div>';
 }
 echo '
 <script>
 $(document).ready(function () { // START DOCUMENT.READY
 
 $(".link-tip, .tip-top").tooltip();
 $(".more").click(function(e){
 e.preventDefault();
 var ID = $(this).attr("id");
Example #2
0
/**
 * Parse post content into readable data, or return default text
 * @global array
 * @param string $text data to be parsed
 * @param boolean $bbcode show bbcode or not?
 * @return mixed
 */
function parse($text, $bbcode = true)
{
    global $config;
    // Do they allow bbcode or does this post allow bbcode?
    if ($config['bbcode'] && $bbcode) {
        $start = array('/\\[url=("|\'|)(.*?)\\1\\]/i', '/\\[url\\]/i', '/\\[\\/url\\]/i', '/\\[img\\]\\s*(.*?)\\s*\\[\\/img\\]/is', '/\\[colou?r=("|\'|)(.*?)\\1\\](.*?)\\[\\/colou?r\\]/is', '/\\[quote=(&quot;|"|\'|)(.*?)\\1\\]\\s */i', '/\\[qoute=(&quot;|"|\'|)(.*?)\\1\\]\\s */i', '/\\[quote\\]\\s */i', '/\\[qoute\\]\\s */i', '/\\s*\\[\\/quote\\]\\s */i', '/\\s*\\[\\/qoute\\]/i', '/\\[code\\][\\r\\n]*(.*?)\\[\\/code\\]/is');
        $end = array('[url=$2]', '[url]', '[/url]', '[img]$1[/img]', '[color=$2]$3[/color]', '[quote=$1$2$1]', '[quote=$1$2$1]', '[quote]', '[quote]', '[/quote]' . "\n", '[/quote]' . "\n", '[code]$1[/code]' . "\n");
        // Replace the non needed characters.
        $text = preg_replace($start, $end, $text);
        // Html close tags edited to work for bbcode
        $text = closetags($text);
        // Lets make sure the code doesn't get obscured
        if (strpos($text, '[code]') !== false && strpos($text, '[/code]') !== false) {
            list($inside, $outside) = split_text($text, '[code]', '[/code]');
            $outside = array_map('ltrim', $outside);
            $text = implode('<">', $outside);
        }
        // Quoting
        if (strpos($text, 'quote') !== false) {
            $text = str_replace('[quote]', '<blockquote><div class="quotebox"><div>', $text);
            $text = preg_replace('/\\[quote=(&quot;|"|\'|)(.*)\\1\\]/seU', '"<blockquote><div class=\\"quotebox\\"><h4>".str_replace(array(\'[\', \'\\"\'), array(\'&#91;\', \'"\'), \'$2\')." wrote:</h4><div class=\\"text\\">"', $text);
            $text = preg_replace('/\\[\\/quote\\](\\s *)?/i', '</div></div></blockquote>', $text);
        }
        // Basic BBCodes
        $pattern = array('/\\[b\\](.*?)\\[\\/b\\]/s', '/\\[i\\](.*?)\\[\\/i\\]/s', '/\\[u\\](.*?)\\[\\/u\\]/s');
        $replace = array('<strong>$1</strong>', '<em>$1</em>', '<u>$1</u>');
        // This thing takes a while! :)
        $text = preg_replace($pattern, $replace, $text);
        // Do we allow urls?
        if ($config['bbcode_url']) {
            $pattern = array('/\\[url\\]([^\\[]*?)\\[\\/url\\]/e', '/\\[url=([^\\[]*?)\\](.*?)\\[\\/url\\]/e');
            $replace = array('url_tag(\'$1\')', 'url_tag(\'$1\', \'$2\')');
            $text = preg_replace($pattern, $replace, $text);
        }
        // Color
        $text = preg_replace("/\\[color=([a-zA-Z]*|\\#?[0-9a-fA-F]{6})]/s", '<span style="color: \\1">', $text);
        $text = preg_replace("/\\[\\/color\\]/s", '</span>', $text);
        // Do we allow images?
        if ($config['bbcode_image']) {
            $text = preg_replace('/\\[img\\]((ht|f)tps?:\\/\\/)([^\\s<\\"]*?)\\.(jpg|jpeg|png|gif)\\[\\/img\\]/s', '<img class="p-image" src="\\1\\3.\\4\\" />', $text);
        }
        // If we split up the message before we have to concatenate it together again (code tags)
        if (isset($inside)) {
            $outside = explode('<">', $text);
            $text = '';
            $num_tokens = count($outside);
            for ($i = 0; $i < $num_tokens; ++$i) {
                $text .= $outside[$i];
                if (isset($inside[$i])) {
                    $text .= '<div class="codebox"><h4>Code:</h4><div class="scrollbox"><pre>' . $inside[$i] . '</pre></div></div>';
                }
            }
        }
    }
    // Return base text!
    if (!$bbcode) {
        return $text;
    }
    // Return a fully parsed post / other
    return clickable(stripslashes(nl2br(str_replace(array('\\r\\n', '\\r', '\\n'), "<br />", html_entity_decode($text)))));
}
Example #3
0
                       while ($rowr = $dbr->fetch_assoc()) {
                           $replyID = $rowr['id'];
                           $replier_id = $rowr['replier_id'];
                           $reply_msg = $rowr['reply_msg'];
                           $reply_time = $rowr['reply_time'];
                           $dbff = new SQL(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME, false);
                           $dbff->query("SELECT * FROM forum_users WHERE id='{$replier_id}'");
                           if ($rowff = $dbff->fetch_array()) {
                               $replier_username = $rowff['username'];
                               $replier_realname = $rowff['realname'];
                           }
                           $dbf->close();
                           if ($replier_realname == null) {
                               echo '<div id="userReply-' . $replyID . '" class="user-reply" title="' . timeAgo($reply_time) . '"><a href="' . FORUM_ROOT . 'profile.php?section=about&id=' . $replier_id . '" class="label label-inverse"><i class="icon-user icon-white"></i> @' . $replier_username . '</a> ' . stripslashes(rtrim(clickable(replybbCode($reply_msg)))) . '</div>';
                           } else {
                               echo '<div id="userReply-' . $replyID . '" class="user-reply" title="' . timeAgo($reply_time) . '"><a href="' . FORUM_ROOT . 'profile.php?section=about&id=' . $replier_id . '" class="label label-inverse"><i class="icon-user icon-white"></i> ' . $replier_realname . '</a> ' . stripslashes(rtrim(clickable(replybbCode($reply_msg)))) . '</div>';
                           }
                           echo '<script>$("#userReply-' . $replyID . '").tooltip({placement: "right"});</script>';
                       }
                   } else {
                       echo '<div class="user-reply">No reply yet.</div>';
                   }
                   $dbr->close();
                   // End of Reply section
                   echo '</td></tr>';
               }
               echo '</tbody></table><div class="close-table"></div>';
           }
           $dbre->close();
           echo '
 <div id="replyForm" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            $get_realname = $rowf['realname'];
            $get_title = $rowf['title'];
            $show_avatar = $rowf['show_avatars'];
            $avatar_type = $rowf['avatar'];
        }
        $dbf->close();
        echo '<li id="' . $reqmsgid . '" class="left">';
        echo '<img class="avatar" alt="' . $get_username . '" src="' . get_avatar($avatar_type, $requser) . '">';
        echo '<span class="message"><span class="arrow"></span>';
        if ($get_realname == null) {
            echo '<span class="from"><strong>@' . $get_username . '</strong> ';
        } else {
            echo '<span class="from"><strong>' . $get_realname . '</strong> ';
        }
        echo '<span class="time muted"><small>' . timeAgo($reqmsgtime) . '</small></span>';
        echo '<span class="text" id="msg-' . $reqmsgid . '">' . stripslashes(rtrim(clickable(bbCode($reqmsg)))) . '</span>';
        echo '</span></li>';
    }
    $db->close();
    echo '</ul>';
    echo '</div>';
    echo '
<div id="rconsole" class="alert alert-error" style="display:none"></div>

<form id="shoutForm" class="form-horizontal">
   
<textarea id="replyTextarea" class="input-block-level msg-box" placeholder="Type your message here" rows="3" maxlength="500"></textarea>
<input type="hidden" id="replyUserId" value="' . $currentUserID . '">
<input type="hidden" id="requestMsgId" value="' . $reqmsgid . '">
      
<div class="post-control" style="min-height:30px">
Example #5
0
     $msg .= '<span class="pull-right">';
     // Like button
     $dbll = new SQL(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME, false);
     $dbll->query("SELECT COUNT(*) FROM ip_uplikes WHERE shout_id='{$get_shoutID}'");
     $total_like = implode($dbll->fetch_assoc());
     $dbll->close();
     $currentUserId = $_SESSION['current_userID'];
     if ($total_like > 0) {
         $msg .= '<button id="btnLike likeThisID-' . $get_shoutID . '" class="btn btn-mini tip-top" title="People like this" onClick="likeThism(\'' . $get_shoutID . '\',\'' . $currentUserId . '\')"><i class="icon-thumbs-up"></i> <span id="uplikeTotalm-' . $get_shoutID . '">' . $total_like . '</span></button>';
     } else {
         $msg .= '<button id="btnLike likeThisID-' . $get_shoutID . '" class="btn btn-mini tip-top" title="People like this" onClick="likeThism(\'' . $get_shoutID . '\',\'' . $currentUserId . '\')"><i class="icon-thumbs-up"></i> <span id="uplikeTotalm-' . $get_shoutID . '">0</span></button>';
     }
     // End of Like button
     $msg .= ' <button class="btn btn-mini tip-top" id="rtupdate-' . $get_shoutID . '" onClick="rtupdate(\'' . $get_shoutID . '\',\'' . $get_username . '\');" title="Reshout"><i class="icon-share"></i> RT</button> ';
     $msg .= '</span>';
     $msg .= '</div><div class="user-msg">' . stripslashes(rtrim(clickable(bbCode($get_shoutMsg)))) . '</div></td>';
     $msg .= '</tr>';
 }
 $db->close();
 // Content for Sharer's Updates
 $msg = '<table id="update" class="table update-table"><tbody>' . $msg . '</tbody></table><div class="close-table"></div>';
 $dbt = new SQL(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME, false);
 $dbt->query("SELECT COUNT(id) FROM ip_updates");
 $count = implode($dbt->fetch_assoc());
 $dbt->close();
 $no_of_paginations = ceil($count / $per_page);
 if ($cur_page >= 7) {
     $start_loop = $cur_page - 3;
     if ($no_of_paginations > $cur_page + 3) {
         $end_loop = $cur_page + 3;
     } else {
Example #6
0
define('terres_anciennes', true);
include '../common-inc/config.inc.php';
include '../common-inc/fonctions.php';
$link = @mysql_connect($dbhost, $dbname, $dbpass);
@mysql_select_db($dbbase, $link);
/*/ RECUPERE TOUT LES MESSAGE CONCERNES ET LES ASSEMBLE /*/
$pseudo = $_SESSION['infos']['pseudo'];
$sql = @mysql_query("SELECT * FROM archives WHERE pseudo = '{$pseudo}' ORDER BY time DESC LIMIT 80");
$nb = @mysql_num_rows($sql);
for ($i = 0; $i < $nb; $i++) {
    $message[$i] = mysql_fetch_array($sql, MYSQL_ASSOC);
}
if ($nb == 0) {
    echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n<head>\n  <title>TERRES - Messagerie - Lecture d'un message</title>\n  <link rel=\"stylesheet\" href=\"style.css\">\n</head>\n\n<body bgcolor=\"#000000\" text=\"#FFFFFF\" link=\"#FFFFFF\" alink=\"#FFFFFF\" vlink=\"#FFFFFF\">\n\n<div align=\"center\">\n<br>\n<font class=\"interdit\">Vous n'avez aucun messages archivés.</font><br><br>\n\n<a href=\"./messagerie.php\">Retour à votre boite de reception</a>\n</body>\n</head>\n</html>";
    exit;
}
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n<head>\n  <title>TERRES - Messagerie - Lecture d'un message</title>\n  <link rel=\"stylesheet\" href=\"style.css\">\n</head>\n\n<body bgcolor=\"#000000\" text=\"#FFFFFF\" link=\"#FFFFFF\" alink=\"#FFFFFF\" vlink=\"#FFFFFF\">\n\n<div align=\"center\">\n<br>";
for ($i = 0; $i < $nb; $i++) {
    $message[$i]['texte'] = ereg_replace("\n", "<br>", $message[$i]['texte']);
    $message[$i]['texte'] = bbcode_first($message[$i]['texte']);
    $message[$i]['texte'] = clickable($message[$i]['texte']);
    echo "<table border=1 align=\"center\" width=\"70%\" cellpadding=\"10\">\n<tr>\n  <td bgcolor=\"#DEDEBE\">\n    <div style=\"font-family: Arial,Verdana,times; font-size: 9pt; color: #000000;\">\n      <b>Sujet:</b> " . $message[$i]['sujet'] . " &nbsp; &nbsp; <b>envoy&eacute; par:</b> " . $message[$i]['part'] . " &nbsp; &nbsp; <b>le:</b> " . date("d/m/Y à H:i:s", $message[$i]['time']) . "\n      <a href=\"./archives_supr.php?id=" . $message[$i]['id'] . "\"><img src=\"./images/topic_delete.gif\" border=\"0\" alt=\"SUPRIMER DEFINITIVEMENT\" /></a></div>\n  </td>\n</tr>\n<tr>\n  <td bgcolor=\"#EEEEEE\">\n    <div style=\"font-family: Arial,Verdana,times; font-size: 9pt; color: #000000;\">\n      " . stripslashes($message[$i]['texte']) . "\n    </div>\n  </td>\n</tr>\n</table><br>\n\n";
}
?>

<a href="./messagerie.php">Retour à la messagerie</a>

</div>
</body>
</html>
Example #7
0
/**
 * Parse post content into readable data, or return default text
 * @global array
 * @param string $text data to be parsed
 * @param boolean $bbcode show bbcode or not?
 * @return mixed
 */
function parse($text, $bbcode_show = true)
{
    global $config, $parser;
    // Return base text!
    if (!$bbcode_show) {
        // Load the hook on a no bbcode parsing message
        load_hook('no_bbcode_message');
        return htmlspecialchars($text, ENT_QUOTES, 'UTF-8', FALSE);
    }
    // Do they allow bbcode or does this post allow bbcode?
    if ($config['bbcode'] && $bbcode_show) {
        // Convert special characters before bbcode :3
        $text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8', FALSE);
        // Load the hook after special characters just incase.
        load_hook('bbcode_before');
        // Convert newlines
        $text = preg_replace("/\r\n|\r|\n/", "\n", $text);
        // Strip everything but newlines
        if (!function_exists('bbcode_stripcontents')) {
            function bbcode_stripcontents($text)
            {
                return preg_replace("/[^\n]/", '', $text);
            }
        }
        // Convert codes related specifically to code bbcode
        if (!function_exists('bbcode_code_convert')) {
            function bbcode_code_convert($text)
            {
                return preg_replace("/(\n|\r\n)/", '%nl', $text);
            }
        }
        // Convert codes related specifically to code bbcode
        if (!function_exists('bbcode_code_revert')) {
            function bbcode_code_revert($text)
            {
                return preg_replace("/\\%nl/", chr(13) . chr(10), $text);
            }
        }
        // Quoting :D
        if (!function_exists('bbcode_quote')) {
            function bbcode_quote($action, $attributes, $content, $params, $node_object)
            {
                if ($action == 'validate') {
                    return true;
                }
                if (!isset($attributes['default'])) {
                    $name = $content;
                    if ($action == 'output') {
                        $text = $content;
                    }
                    return '<blockquote><div class="userquotebox"><h4>Quote:</h4><div class="text">' . $text . '</div></div></blockquote>';
                } else {
                    $name = $attributes['default'];
                    if ($action == 'output') {
                        $text = $content;
                    }
                    return '<blockquote><div class="userquotebox"><h4>' . $name . ' wrote:</h4><div class="text">' . $text . '</div></div></blockquote>';
                }
            }
        }
        if (!function_exists('bbcode_color')) {
            function bbcode_color($action, $attributes, $content, $params, $node_object)
            {
                if ($action == 'validate') {
                    if ($attributes['default'] == "") {
                        return false;
                    }
                    if (!preg_match('/([a-zA-Z]*|\\#?[0-9a-fA-F]{6})/i', $attributes['default'])) {
                        return false;
                    }
                    return true;
                }
                $color = $attributes['default'];
                $text = $content;
                return '<span style="color: ' . $color . '">' . $text . '</span>';
            }
        }
        // Url parsing
        if (!function_exists('bbcode_url')) {
            function bbcode_url($action, $attributes, $content, $params, $node_object)
            {
                if (!isset($attributes['default'])) {
                    $url = $content;
                    $text = $content;
                } else {
                    $url = $attributes['default'];
                    $text = $content;
                }
                if ($action == 'validate') {
                    if (substr($url, 0, 5) == 'data:' || substr($url, 0, 5) == 'file:' || substr($url, 0, 11) == 'javascript:' || substr($url, 0, 4) == 'jar:') {
                        return false;
                    }
                    if (!is_url($url)) {
                        return false;
                    }
                    return true;
                }
                return '<a href="' . $url . '" rel="no-follow">' . $text . '</a>';
            }
        }
        // Url parsing
        if (!function_exists('bbcode_img')) {
            function bbcode_img($action, $attributes, $content, $params, $node_object)
            {
                if ($action == 'validate') {
                    if (substr($content, 0, 5) == 'data:' || substr($content, 0, 5) == 'file:' || substr($content, 0, 11) == 'javascript:' || substr($content, 0, 4) == 'jar:') {
                        return false;
                    }
                    if (!preg_match('/((ht|f)tps?:\\/\\/)([^\\s<\\"]*?)\\.(jpg|jpeg|png|gif)/i', $content)) {
                        return false;
                    }
                    return true;
                }
                return '<img src="' . $content . '" rel="no-follow">';
            }
        }
        // Parsers
        $parser->addParser('list', 'bbcode_stripcontents');
        $parser->addParser('code', 'bbcode_code_convert');
        // Codes
        $parser->addCode('b', 'simple_replace', null, array('start_tag' => '<b>', 'end_tag' => '</b>'), 'inline', array('listitem', 'block', 'inline', 'link', 'quote'), array());
        $parser->addCode('i', 'simple_replace', null, array('start_tag' => '<i>', 'end_tag' => '</i>'), 'inline', array('listitem', 'block', 'inline', 'link', 'quote'), array());
        $parser->addCode('u', 'simple_replace', null, array('start_tag' => '<u>', 'end_tag' => '</u>'), 'inline', array('listitem', 'block', 'inline', 'link', 'quote'), array());
        $parser->addCode('s', 'simple_replace', null, array('start_tag' => '<s>', 'end_tag' => '</s>'), 'inline', array('listitem', 'block', 'inline', 'link', 'quote'), array());
        // Text related
        $parser->addCode('color', 'usecontent?', 'bbcode_color', array('usecontent_param' => 'default'), 'inline', array('listitem', 'block', 'inline', 'link', 'quote'), array('link'));
        // Links
        $parser->addCode('url', 'usecontent?', 'bbcode_url', array('usecontent_param' => 'default'), 'link', array('listitem', 'block', 'inline', 'link', 'quote'), array());
        $parser->addCode('link', 'usecontent', 'bbcode_url', array(), 'link', array('listitem', 'block', 'inline', 'quote'), array());
        // List
        $parser->addCode('list', 'simple_replace', null, array('start_tag' => '<ul>', 'end_tag' => '</ul>'), 'list', array('listitem', 'block', 'inline', 'link', 'quote'), array());
        $parser->addCode('*', 'simple_replace', null, array('start_tag' => '<li>', 'end_tag' => '</li>'), 'listitem', array('list'), array());
        // Images
        $parser->addCode('img', 'usecontent', 'bbcode_img', array(), 'image', array('listitem', 'block', 'inline', 'link', 'quote'), array());
        $parser->addCode('image', 'usecontent', 'bbcode_img', array(), 'image', array('listitem', 'block', 'inline', 'link', 'quote'), array());
        // Quote & Code
        $parser->addCode('quote', 'callback_replace', 'bbcode_quote', array('usecontent_param' => 'default'), 'quote', array('block', 'inline', 'quote'), array());
        $parser->addCode('code', 'simple_replace', null, array('start_tag' => '<div class="codebox"><h4>Code:</h4><div class="scrollbox"><pre>', 'end_tag' => '</pre></div></div>'), 'code', array('block', 'inline', 'quote'), array('listitem', 'link'));
        // Occurrences
        $parser->setOccurrenceType('img', 'image');
        $parser->setOccurrenceType('image', 'image');
        $parser->setOccurrenceType('url', 'link');
        $parser->setMaxOccurrences('image', 4);
        $parser->setMaxOccurrences('link', 20);
        // Flags
        $parser->setCodeFlag('*', 'closetag', BBCODE_CLOSETAG_OPTIONAL);
        $parser->setCodeFlag('*', 'paragraphs', false);
        $parser->setCodeFlag('list', 'paragraph_type', BBCODE_PARAGRAPH_BLOCK_ELEMENT);
        $parser->setCodeFlag('list', 'opentag.after.newline', BBCODE_NEWLINE_DROP);
        $parser->setCodeFlag('list', 'closetag.after.newline', BBCODE_NEWLINE_DROP);
        $parser->setCodeFlag('quote', 'opentag.after.newline', BBCODE_NEWLINE_DROP);
        $parser->setCodeFlag('quote', 'closetag.after.newline', BBCODE_NEWLINE_DROP);
        // Just before its parsed
        load_hook('bbcode_before_parse');
        // Parse the text
        $text = $parser->parse($text);
        // Just once
        $text = nl2br($text);
        // Clickable
        $text = clickable($text);
        // Revert the code changes
        $text = bbcode_code_revert($text);
        // After everything is done.
        load_hook('bbcode_after');
    }
    // Return a fully parsed post / other
    return $text;
}
function populate_shoutbox()
{
    $db = new SQL(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME, false);
    $db->query("SELECT * FROM ip_shouts ORDER BY id DESC LIMIT 100");
    echo '<ul id="chat" class="chat">';
    $count_shout = 0;
    while ($row = $db->fetch_assoc()) {
        $count_shout++;
        $get_shoutID = $row['id'];
        $get_userID = $row['user_id'];
        $get_shoutMsg = $row['shout_msg'];
        $get_sTime = $row['shout_time'];
        $dbf = new SQL(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME, false);
        $dbf->query("SELECT * FROM forum_users WHERE id='{$get_userID}'");
        if ($rowf = $dbf->fetch_array()) {
            $get_groupID = $rowf['group_id'];
            $get_username = $rowf['username'];
            $get_realname = $rowf['realname'];
            $get_title = $rowf['title'];
            $get_location = $rowf['location'];
            $get_registered = $rowf['registered'];
            $get_url = $rowf['url'];
            $get_facebook = $rowf['facebook'];
            $get_twitter = $rowf['twitter'];
            $show_avatar = $rowf['show_avatars'];
            $avatar_type = $rowf['avatar'];
            if ($get_facebook == null) {
                $facebook_url = '';
            } else {
                if (strpos($get_facebook, "http://") === 0 || strpos($get_facebook, "https://") === 0) {
                    $facebook_url = '<a href="' . $get_facebook . '">' . $get_facebook . '</a>';
                } else {
                    $facebook_url = '<a href="http://facebook.com/' . $get_facebook . '">http://facebook.com/' . $get_facebook . '</a>';
                }
            }
            if ($get_twitter == null) {
                $twitter_url = '';
            } else {
                if (strpos($get_twitter, "http://") === 0 || strpos($get_twitter, "https://") === 0) {
                    $twitter_url = '<a href="' . $get_twitter . '">' . $get_twitter . '</a>';
                } else {
                    $twitter_url = '<a href="http://twitter.com/' . $get_twitter . '">http://twitter.com/' . $get_twitter . '</a>';
                }
            }
            if ($get_url == null) {
                $website = '';
            } else {
                if (strpos($get_url, "http://") === 0 || strpos($get_url, "https://") === 0) {
                    $website = '<a href="' . $get_url . '">' . $get_url . '</a>';
                } else {
                    $website = '<a href="http://' . $get_url . '">http://' . $get_url . '</a>';
                }
            }
        }
        $dbf->close();
        if ($_SESSION['current_userID'] == $get_userID) {
            if ($count_shout == 20) {
                echo '<li id="lastShout" class="right">';
            } else {
                echo '<li class="right">';
            }
        } else {
            if ($count_shout == 20) {
                echo '<li id="lastShout" class="left">';
            } else {
                echo '<li class="left">';
            }
        }
        echo '<a href="profile.php?id=' . $get_userID . '"><img class="avatar" alt="' . $get_username . '" src="' . get_avatar($avatar_type, $get_userID) . '"></a>';
        echo '<span class="message"><span class="arrow"></span>';
        if ($get_realname == null) {
            echo '<span class="from"><a href="profile.php?id=' . $get_userID . '" class="user-name">@' . $get_username . '</a> ';
        } else {
            echo '<span class="from"><a href="profile.php?id=' . $get_userID . '" class="user-name">' . $get_realname . '</a> ';
        }
        if ($get_title !== null) {
            echo '<span class="forum-title"><em>' . $get_title . '</em></span></span> ';
        }
        echo '<span class="time muted"><small>' . timeAgo($get_sTime) . '</small></span>';
        if ($_SESSION['current_userID'] !== $get_userID) {
            echo '<span class="pull-right">';
            echo '<button class="btn btn-mini tip-top" id="rtshout-' . $get_shoutID . '" onClick="rtshout(\'' . $get_shoutID . '\',\'' . $get_username . '\');" title="Reshout"><i class="icon-share"></i> RT</button> ';
            echo '<button class="btn btn-mini" id="mention-' . $get_shoutID . '" onClick="insertNickname(\'' . $get_username . '\');"><i class="icon-circle"></i> Mention</button>';
            echo '</span>';
        }
        echo '<span class="text" id="msg-' . $get_shoutID . '">' . stripslashes(rtrim(clickable(bbCode($get_shoutMsg)))) . '</span>';
        echo '</span></li>';
    }
    if ($count_shout == 100) {
        echo '<div style="margin-top:10px;padding:10px;text-align:center;" id="more-' . $get_shoutID . '" class="morebox"><a href="#" id="' . $get_shoutID . '" class="btn btn-small btn-inverse more"><i class="icon-arrow-down icon-white"></i> Load more...</a></div>';
    }
    echo '</ul>';
    $db->close();
    echo '
    <script>
    $(document).ready(function () { // START DOCUMENT.READY
    
    $(".link-tip, .tip-top").tooltip();
    $(".more").click(function(e){
    e.preventDefault();
    var ID = $(this).attr("id");
    if (ID){
      $("#more-"+ID).html("<div class=\\"loader\\" style=\\"margin-top:10px\\"></div>");
      $.ajax({
        type: "GET", url: "subfiles/shoutbox_more.php?lastid=" + urlencode(ID),
        success: function(html){ $("ul#chat").append(html).fadeIn(); $("#more-"+ID).remove(); }
      });
    } else {
      $(".morebox").html("The End");
    }
    });
    
    }); // END DCOUMENT.READY
    
    function urlencode(a) {
      a = (a + "").toString();
      return encodeURIComponent(a).replace(/!/g, "%21").replace(/\'/g, "%27").replace(/\\(/g, "%28").replace(/\\)/g, "%29").replace(/\\*/g, "%2A").replace(/%20/g, "+")
    }
    function rtshout(msgid,user){      
      $.ajax({
        type: "GET", url: "subfiles/shoutbox_retweet.php?retweet=" + urlencode(msgid),
        success: function(html){
          if (html !== "KO") { $("#shoutTextarea").val("RT @"+user+": " + html); }
        }
      });
    }
    function insertNickname(nickname){
      var currentText = document.getElementById("shoutTextarea");
      var smileyWithPadding = " @" + nickname + " ";
      currentText.value += smileyWithPadding;
    }
    </script>
    ';
}
}
/*/ MET LE MESSAGE EN LU /*/
if ($message['lu'] == 0) {
    mysql_query("UPDATE messagerie SET lu='1' WHERE id = '" . $HTTP_GET_VARS['num'] . "'") or die("Erreur");
}
/*/ TRANSFORME LE MESSAGE /*/
define('IN_PHPBB', true);
$phpbb_root_path = '../../forum/';
include '../../forum/extension.inc';
include '../../forum/common.' . $phpEx;
include '../../forum/includes/bbcode.' . $phpEx;
@mysql_select_db($dbform);
$m['message'] = ereg_replace("\n", "<br>", $m['message']);
$m['message'] = bbcode_first($m['message']);
$m['message'] = smilies_pass_nicolas($m['message']);
$m['message'] = clickable($m['message']);
?>
<div align="center">

<br>
Envoyé par: <b><? echo $m['expediteur']; ?></b><br>
Recu par: <b><? echo $m['destinataire']; ?></b><br>
Le: <b><? echo date("d/m/Y à H:i:s",$m['time']); ?></b><p>

<table style="border: 1px solid black; border-collapse: collapse;" align="center" width="760" cellpadding="10">
<tr>
  <td rowspan="2" width="150" bgcolor="#EEEEEE" align="center">
    <b><u><? echo $m['expediteur']; ?></u></b><br><br>
    <? echo avatar($m['expediteur']); ?>
  </td>
  <td bgcolor="#DEDEBE" width="600" height="50">