示例#1
1
         }
         $my_rsos[] = $my_rs;
     } else {
         $my_rsos[] = '';
     }
 }
 $useroutils = '';
 $useroutils .= '<hr />';
 if ($posterdata['uid'] != 1 and $posterdata['uid'] != '') {
     $useroutils .= '<a class="list-group-item text-primary" href="user.php?op=userinfo&amp;uname=' . $posterdata['uname'] . '" target="_blank" title="' . translate("Profile") . '" data-toggle="tooltip"><i class="fa fa-2x fa-user"></i>&nbsp;' . translate("Profile") . '</a>';
 }
 if ($user) {
     $useroutils .= '<a class="list-group-item text-primary" href="powerpack.php?op=instant_message&amp;to_userid=' . $posterdata["uname"] . '" title="' . translate("Send internal Message") . '" data-toggle="tooltip"><i class="fa fa-2x fa-envelope-o"></i>&nbsp;' . translate("Send internal Message") . '</a>';
 }
 if ($posterdata['femail'] != '') {
     $useroutils .= '<a class="list-group-item text-primary" href="mailto:' . anti_spam($posterdata['femail'], 1) . '" target="_blank" title="' . translate("Email") . '" data-toggle="tooltip"><i class="fa fa-at fa-2x"></i>&nbsp;' . translate("Email") . '</a>';
 }
 if ($posterdata['url'] != '') {
     if (strstr('http://', $posterdata['url'])) {
         $posterdata['url'] = 'http://' . $posterdata['url'];
     }
     $useroutils .= '<a class="list-group-item text-primary" href="' . $posterdata['url'] . '" target="_blank" title="' . translate("Visit this Website") . '" data-toggle="tooltip"><i class="fa fa-2x fa-external-link"></i>&nbsp;' . translate("Visit this Website") . '</a>';
 }
 if ($posterdata['mns']) {
     $useroutils .= '<a class="list-group-item text-primary" href="minisite.php?op=' . $posterdata['uname'] . '" target="_blank" target="_blank" title="' . translate("Visit the Mini Web Site !") . '" data-toggle="tooltip"><i class="fa fa-2x fa-desktop"></i>&nbsp;' . translate("Visit the Mini Web Site !") . '</a>';
 }
 echo '
   <div class="row">
      <a name="' . $forum . $topic . $myrow['post_id'] . '"></a>';
 if ($count + 2 == $mycount) {
     echo '<a name="last-post"></a>';
示例#2
1
function Q_spambot()
{
    // Idée originale, développement et intégration - Gérald MARINO alias neo-machine
    // Rajout brouillage anti_spam() : David MARTINET, alias Boris (2011)
    // Other stuff : Dev 2012
    global $user;
    $asb_question = array('4 - (3 / 1)' => 1, '7 - 5 - 0' => 2, '2 + (1 / 1)' => 3, '2 + (1 + 1)' => 4, '3 + (0) + 2' => 5, '3 + (9 / 3)' => 6, '4 + 3 - 0' => 7, '6 + (0) + 2' => 8, '8 + (5 - 4)' => 9, '0 + (6 + 4)' => 10, '(5 * 2) + 1' => 11, '6 + (3 + 3)' => 12, '1 + (6 * 2)' => 13, '(8 / 1) + 6 ' => 14, '6 + (5 + 4)' => 15, '8 + (4 * 2)' => 16, '1 + (8 * 2)' => 17, '9 + (3 + 6)' => 18, '(7 * 2) + 5' => 19, '(8 * 3) - 4' => 20, '7 + (2 * 7)' => 21, '9 + 5 + 8' => 22, '(5 * 4) + 3' => 23, '0 + (8 * 3)' => 24, '1 + (4 * 6)' => 25, '(6 * 5) - 4' => 26, '3 * (9 + 0)' => 27, '4 + (3 * 8)' => 28, '(6 * 4) + 5' => 29, '0 + (6 * 5)' => 30);
    // START ALEA
    mt_srand((double) microtime() * 1000000);
    // choix de la question
    $asb_index = mt_rand(0, count($asb_question) - 1);
    $ibid = array_keys($asb_question);
    $aff = $ibid[$asb_index];
    // translate
    $tab = explode(' ', str_replace(')', '', str_replace('(', '', $aff)));
    $al1 = mt_rand(0, count($tab) - 1);
    $aff = str_replace($tab[$al1], translate($tab[$al1]), $aff);
    // mis en majuscule
    if ($asb_index % 2) {
        $aff = ucfirst($aff);
    }
    // END ALEA
    //Captcha - si GD
    if (function_exists("imagepng")) {
        $aff = "<img src=\"getfile.php?att_id=" . rawurlencode(encrypt($aff . " = ")) . "&amp;apli=captcha\" style=\"vertical-align: middle;\" />";
    } else {
        $aff = "" . anti_spam($aff . " = ", 0) . "";
    }
    $tmp = '';
    if (!isset($user)) {
        $tmp = '
      <div class="form-group row">
         <div class="col-sm-9">
            <label class="form-control-label text-danger" for="asb_reponse">' . translate("Anti-Spam / Thank to reply to the question :") . '&nbsp;&nbsp;' . $aff . '</label>
         </div>
         <div class="col-sm-2 col-md-2 text-xs-right">
            <input class="form-control" type="text" name="asb_reponse" maxlength="2" onclick="this.value" />
            <input type="hidden" name="asb_question" value="' . encrypt($ibid[$asb_index] . ',' . time()) . '" />
         </div>
      </div>';
    } else {
        $tmp = '
      <input type="hidden" name="asb_question" value="" />
      <input type="hidden" name="asb_reponse" value="" />';
    }
    return $tmp;
}
示例#3
1
function makebranch($parcat, $table, $level, $maxlevel, $max_post_id, $clas, $idtog)
{
    global $imgtmpPI, $imgtmpNE;
    global $smilies, $theme, $forum, $forum_type, $allow_bbcode, $allow_to_post, $forum_access, $Mmod, $topic, $lock_state, $userdata;
    global $allow_upload_forum, $att, $anonymous, $short_user, $last_read, $toggle;
    settype($result, 'string');
    $my_rsos = array();
    $count = 0;
    settype($idtog, 'integer');
    $list = $table[$parcat];
    while (list($key, $val) = each($list)) {
        $myrow = unserialize($val);
        if ($level != '0') {
            if ($level == 1) {
                $clas = 'collapse col-sm-11 offset-sm-1';
                $idtog = $idtog . ($count + 1);
            } else {
                $idtog = $idtog . $count;
            }
        } else {
            $idtog = $level + 1 . ($count + 1);
            //            $idtog = $forum.$topic.$myrow['post_id'].'y';
        }
        $posterdata = get_userdata_from_id($myrow['poster_id']);
        $posts = $posterdata['posts'];
        $socialnetworks = array();
        $posterdata_extend = array();
        $res_id = array();
        $my_rs = '';
        if (!$short_user) {
            $posterdata_extend = get_userdata_extend_from_id($myrow['poster_id']);
            include 'modules/reseaux-sociaux/reseaux-sociaux.conf.php';
            if ($posterdata_extend['M2'] != '') {
                $socialnetworks = explode(';', $posterdata_extend['M2']);
                foreach ($socialnetworks as $socialnetwork) {
                    $res_id[] = explode('|', $socialnetwork);
                }
                sort($res_id);
                sort($rs);
                foreach ($rs as $v1) {
                    foreach ($res_id as $y1) {
                        $k = array_search($y1[0], $v1);
                        if (false !== $k) {
                            $my_rs .= '<a class="mr-1" href="';
                            if ($v1[2] == 'skype') {
                                $my_rs .= $v1[1] . $y1[1] . '?chat';
                            } else {
                                $my_rs .= $v1[1] . $y1[1];
                            }
                            $my_rs .= '" target="_blank"><i class="fa fa-' . $v1[2] . ' fa-2x text-primary"></i></a> ';
                            break;
                        } else {
                            $my_rs .= '';
                        }
                    }
                }
                $my_rsos[] = $my_rs;
            } else {
                $my_rsos[] = '';
            }
        }
        $useroutils = '';
        $useroutils .= '<hr />';
        if ($posterdata['uid'] != 1 and $posterdata['uid'] != '') {
            $useroutils .= '<a class="list-group-item text-primary" href="user.php?op=userinfo&amp;uname=' . $posterdata['uname'] . '" target="_blank" title="' . translate("Profile") . '" data-toggle="tooltip"><i class="fa fa-2x fa-user"></i>&nbsp;' . translate("Profile") . '</a>';
        }
        if ($user) {
            $useroutils .= '<a class="list-group-item text-primary" href="powerpack.php?op=instant_message&amp;to_userid=' . $posterdata["uname"] . '" title="' . translate("Send internal Message") . '" data-toggle="tooltip"><i class="fa fa-2x fa-envelope-o"></i>&nbsp;' . translate("Send internal Message") . '</a>';
        }
        if ($posterdata['femail'] != '') {
            $useroutils .= '<a class="list-group-item text-primary" href="mailto:' . anti_spam($posterdata['femail'], 1) . '" target="_blank" title="' . translate("Email") . '" data-toggle="tooltip"><i class="fa fa-at fa-2x"></i>&nbsp;' . translate("Email") . '</a>';
        }
        if ($posterdata['url'] != '') {
            if (strstr('http://', $posterdata['url'])) {
                $posterdata['url'] = 'http://' . $posterdata['url'];
            }
            $useroutils .= '<a class="list-group-item text-primary" href="' . $posterdata['url'] . '" target="_blank" title="' . translate("Visit this Website") . '" data-toggle="tooltip"><i class="fa fa-2x fa-external-link"></i>&nbsp;' . translate("Visit this Website") . '</a>';
        }
        if ($posterdata['mns']) {
            $useroutils .= '<a class="list-group-item text-primary" href="minisite.php?op=' . $posterdata['uname'] . '" target="_blank" target="_blank" title="' . translate("Visit the Mini Web Site !") . '" data-toggle="tooltip"><i class="fa fa-2x fa-desktop"></i>&nbsp;' . translate("Visit the Mini Web Site !") . '</a>';
        }
        echo '
      <div id="tog_' . $idtog . '" class="row ' . $clas . '">
         <a name="' . $forum . $topic . $myrow['post_id'] . '"></a>';
        if ($myrow['post_id'] == $max_post_id) {
            echo '<a name="last-post"></a>';
        }
        echo '
         <div class="col-xs-12">
            <div class="card">
               <div class="card-header">';
        if ($smilies) {
            if ($posterdata['user_avatar'] != '') {
                if (stristr($posterdata['user_avatar'], "users_private")) {
                    $imgtmp = $posterdata['user_avatar'];
                } else {
                    if ($ibid = theme_image("forum/avatar/" . $posterdata['user_avatar'])) {
                        $imgtmp = $ibid;
                    } else {
                        $imgtmp = "images/forum/avatar/" . $posterdata['user_avatar'];
                    }
                }
                echo '
          <a style="position:absolute; top:1rem;" tabindex="0" data-toggle="popover" data-html="true" data-title="' . $posterdata['uname'] . '" data-content=\'' . member_qualif($posterdata['uname'], $posts, $posterdata['rank']) . '<br /><div class="list-group">' . $useroutils . '</div><hr />' . $my_rsos[$count] . '\'><img class=" btn-secondary img-thumbnail img-fluid n-ava" src="' . $imgtmp . '" alt="' . $posterdata['uname'] . '" /></a>';
            }
        }
        echo '&nbsp;<span style="position:absolute; left:6em;" class="text-muted"><strong>' . $posterdata['uname'] . '</strong></span>';
        echo '<span class="float-xs-right">';
        if ($myrow['image'] != '') {
            if ($ibid = theme_image("forum/subject/" . $myrow['image'])) {
                $imgtmp = $ibid;
            } else {
                $imgtmp = "images/forum/subject/" . $myrow['image'];
            }
            echo '<img class="n-smil" src="' . $imgtmp . '" alt="" />';
        } else {
            echo '<img class="n-smil" src="' . $imgtmpPI . '" alt="" />';
        }
        echo '</span>
            </div>';
        $message = stripslashes($myrow['post_text']);
        echo '
               <div class="card-block">
                  <div class="card-text pt-1">';
        $date_post = convertdateTOtimestamp($myrow['post_time']);
        if ($last_read != '') {
            if ($last_read <= $date_post and $userdata[3] != '' and $last_read != "0" and $userdata[0] != $myrow['poster_id']) {
                echo '&nbsp;<img src="' . $imgtmpNE . '" alt="" />';
            }
        }
        echo '
               </div>
               <div class="card-text pt-1">';
        if ($allow_bbcode and $forum_type != 6 and $forum_type != 5) {
            $message = smilie($message);
            $message = aff_video_yt($message);
        }
        if ($forum_type == '6' or $forum_type == '5') {
            highlight_string(stripslashes($myrow['post_text'])) . '<br /><br />';
        } else {
            echo str_replace('[addsig]', '<div class="n-signature">' . nl2br($posterdata['user_sig']) . '</div>', $message);
        }
        if ($att > 0) {
            $post_id = $myrow['post_id'];
            echo '<div class="card-text">';
            echo display_upload("forum_npds", $post_id, $Mmod);
            echo '</div>';
        }
        echo '
               </div>
            </div>
            <div class="card-footer">
               <div class="row">
                  <div class=" col-sm-6 text-muted small">' . post_convertdate($date_post) . '</div>
                  <div class=" col-sm-6 text-xs-right">';
        if ($forum_access != 9) {
            if ($allow_to_post) {
                echo aff_pub_in($lock_state, $topic, $forum, $myrow['post_id'], 1);
            }
            if ($Mmod or $posterdata['uid'] == $userdata[0] and !$lock_state and $posterdata['uid'] != '') {
                echo '<a class="mr-1" href="editpost.php?post_id=' . $myrow["post_id"] . '&amp;topic=' . $topic . '&amp;forum=' . $forum . '&amp;arbre=1" title="' . translate("Edit") . '" data-toggle="tooltip"><i class="fa fa-edit fa-lg"></i></a>';
                if ($allow_upload_forum) {
                    $PopUp = win_upload("forum_npds", $myrow['post_id'], $forum, $topic, "popup");
                    echo '<a class="mr-1" href="javascript:void(0);" onclick="window.open(' . $PopUp . ');" title="' . translate("Files") . '" data-toggle="tooltip"><i class="fa fa-download fa-lg"></i></a>';
                }
            }
            if ($allow_to_post and !$lock_state and $posterdata['uid'] != '') {
                echo '<a class="mr-1" href="replyH.php?topic=' . $topic . '&amp;forum=' . $forum . '&amp;post=' . $myrow['post_id'] . '&amp;citation=1" title="' . translate("Quote") . '" data-toggle="tooltip"><i class="fa fa-quote-left fa-lg"></i></a>';
            }
            echo '<a class="mr-1" href="prntopic.php?forum=' . $forum . '&amp;topic=' . $topic . '&amp;post_id=' . $myrow['post_id'] . '" title="' . translate("Print") . '" data-toggle="tooltip"><i class="fa fa-print fa-lg"></i></a>';
            if ($Mmod) {
                echo '<a class="mr-1" href="topicadmin.php?mode=viewip&amp;topic=' . $topic . '&amp;post=' . $myrow['post_id'] . '&amp;forum=' . $forum . '&amp;arbre=1" title="IP" data-toggle="tooltip" ><i class="fa fa-laptop fa-lg"></i></a>';
                if (!$myrow['post_aff']) {
                    echo '&nbsp;<a href="topicadmin.php?mode=aff&amp;topic=' . $topic . '&amp;post=' . $myrow['post_id'] . '&amp;ordre=1&amp;forum=' . $forum . '&amp;arbre=1" title="' . translate("Show this post") . '" data-toggle="tooltip"><i class="fa fa-eye text-danger fa-lg"></i></a>&nbsp;';
                } else {
                    echo '&nbsp;<a href="topicadmin.php?mode=aff&amp;topic=' . $topic . '&amp;post=' . $myrow['post_id'] . '&amp;ordre=0&amp;forum=' . $forum . '&amp;arbre=1" title="' . translate("Hide this post") . '" data-toggle="tooltip"><i class="fa fa-eye-slash fa-lg "></i></a>&nbsp;';
                }
            }
        }
        echo '
                     </div>
                  </div>
               </div>';
        if (isset($table[$key]) and ($maxlevel > $level + 1 or $maxlevel == '0')) {
            echo '
         <div><a class="float-xs-right" data-toggle="collapse" href="#tog_' . $idtog . '" aria-expanded="false" aria-controls=""><i class="togglearbr-icon fa fa-level-down fa-2x"></i></a></div>';
            //unset ($idtog);
            $result .= makebranch($key, $table, $level + 1, $maxlevel, $max_post_id, $clas, $idtog);
        }
        echo '
            </div>
         </div>
      </div>';
        $count++;
    }
    return $result;
}
示例#4
1
 } else {
     $imgtmpLP = "images/forum/icons/lock_post.gif";
 }
 do {
     $posterdata = get_userdata_from_id($myrow['poster_id']);
     $posts = $posterdata['posts'];
     $useroutils = '';
     $useroutils .= '<hr />';
     if ($posterdata['uid'] != 1 and $posterdata['uid'] != "") {
         $useroutils .= '<a href="user.php?op=userinfo&amp;uname=' . $posterdata['uname'] . '" target="_blank" title="' . translate("Profile") . '" data-toggle="tooltip"><i class="fa fa-lg fa-user"></i>&nbsp;' . translate("Profile") . '</a>';
     }
     if ($posterdata['uname'] != $anonymous) {
         $useroutils .= '<br /><a href="powerpack.php?op=instant_message&amp;to_userid=' . $posterdata["uname"] . '" title="' . translate("Send internal Message") . '" data-toggle="tooltip"><i class="fa fa-lg fa-envelope-o"></i>&nbsp;' . translate("Send internal Message") . '</a>';
     }
     if ($posterdata['femail'] != "") {
         $useroutils .= '<br /><a href="mailto:' . anti_spam($posterdata['femail'], 1) . '" target="_blank" title="' . translate("Email") . '" data-toggle="tooltip"><i class="fa fa-at fa-lg"></i>&nbsp;' . translate("Email") . '</a>';
     }
     if ($posterdata['url'] != "") {
         if (strstr("http://", $posterdata['url'])) {
             $posterdata['url'] = "http://" . $posterdata['url'];
         }
         $useroutils .= '<br /><a href="' . $posterdata['url'] . '" target="_blank" title="' . translate("Visit this Website") . '" data-toggle="tooltip"><i class="fa fa-lg fa-external-link"></i>&nbsp;' . translate("Visit this Website") . '</a>';
     }
     if ($posterdata['mns']) {
         $useroutils .= '<br /><a href="minisite.php?op=' . $posterdata['uname'] . '" target="_blank" target="_blank" title="' . translate("Visit the Mini Web Site !") . '" data-toggle="tooltip"><i class="fa fa-lg fa-desktop"></i>&nbsp;' . translate("Visit the Mini Web Site !") . '</a>';
     }
     echo '
   <div class="row">
      <a name="' . $forum . $topic . $myrow['post_id'] . '"></a>';
     if ($count + 2 == $mycount) {
         echo '<a name="last-post"></a>';
示例#5
0
文件: user.php 项目: phrev/npds_dune
function userinfo($uname)
{
    global $NPDS_Prefix;
    global $user, $sitename, $smilies, $short_user, $site_font;
    global $name, $email, $url, $bio, $user_avatar, $user_from, $user_occ, $user_intrest, $user_sig, $user_journal;
    $uname = removeHack($uname);
    $result = sql_query("SELECT uid, name, femail, url, bio, user_avatar, user_from, user_occ, user_intrest, user_sig, user_journal, mns FROM " . $NPDS_Prefix . "users WHERE uname='{$uname}'");
    list($uid, $name, $femail, $url, $bio, $user_avatar, $user_from, $user_occ, $user_intrest, $user_sig, $user_journal, $mns) = sql_fetch_row($result);
    if (!$uid) {
        header("location: index.php");
    }
    global $cookie;
    include "header.php";
    include_once "functions.php";
    $email = removeHack($femail);
    $name = stripslashes(removeHack($name));
    $url = removeHack($url);
    $bio = stripslashes(removeHack($bio));
    $user_from = stripslashes(removeHack($user_from));
    $user_occ = stripslashes(removeHack($user_occ));
    $user_intrest = stripslashes(removeHack($user_intrest));
    $user_sig = nl2br(removeHack($user_sig));
    $user_journal = stripslashes(removeHack($user_journal));
    $op = "userinfo";
    if (stristr($user_avatar, "users_private")) {
        $direktori = '';
    } else {
        global $theme;
        $direktori = "images/forum/avatar/";
        if (function_exists("theme_image")) {
            if (theme_image("forum/avatar/blank.gif")) {
                $direktori = "themes/{$theme}/images/forum/avatar/";
            }
        }
    }
    $my_rsos = array();
    $socialnetworks = array();
    $posterdata_extend = array();
    $res_id = array();
    $my_rs = '';
    if (!$short_user) {
        $posterdata_extend = get_userdata_extend_from_id($uid);
        include 'modules/reseaux-sociaux/reseaux-sociaux.conf.php';
        if ($posterdata_extend['M2'] != '') {
            $socialnetworks = explode(';', $posterdata_extend['M2']);
            foreach ($socialnetworks as $socialnetwork) {
                $res_id[] = explode('|', $socialnetwork);
            }
            sort($res_id);
            sort($rs);
            foreach ($rs as $v1) {
                foreach ($res_id as $y1) {
                    $k = array_search($y1[0], $v1);
                    if (false !== $k) {
                        $my_rs .= '<a class="mr-1" href="';
                        if ($v1[2] == 'skype') {
                            $my_rs .= $v1[1] . $y1[1] . '?chat';
                        } else {
                            $my_rs .= $v1[1] . $y1[1];
                        }
                        $my_rs .= '" target="_blank"><i class="fa fa-' . $v1[2] . ' fa-2x text-primary"></i></a> ';
                        break;
                    } else {
                        $my_rs .= '';
                    }
                }
            }
            $my_rsos[] = $my_rs;
        } else {
            $my_rsos[] = '';
        }
    }
    $posterdata = get_userdata_from_id($uid);
    $useroutils = '';
    if ($user) {
        $useroutils .= '<a class=" text-primary mr-1" href="powerpack.php?op=instant_message&amp;to_userid=' . $posterdata["uname"] . '" ><i class="fa fa-2x fa-envelope-o" title="' . translate("Send internal Message") . '" data-toggle="tooltip"></i></a>&nbsp;';
    }
    if ($posterdata['femail'] != '') {
        $useroutils .= '<a class=" text-primary mr-1" href="mailto:' . anti_spam($posterdata['femail'], 1) . '" target="_blank" ><i class="fa fa-at fa-2x" title="' . translate("Email") . '" data-toggle="tooltip"></i></a>&nbsp;';
    }
    if ($posterdata['url'] != '') {
        if (strstr('http://', $posterdata['url'])) {
            $posterdata['url'] = 'http://' . $posterdata['url'];
        }
        $useroutils .= '<a class=" text-primary mr-1" href="' . $posterdata['url'] . '" target="_blank" ><i class="fa fa-2x fa-external-link" title="' . translate("Visit this Website") . '" data-toggle="tooltip"></i></a>&nbsp;';
    }
    if ($posterdata['mns']) {
        $useroutils .= '<a class=" text-primary mr-1" href="minisite.php?op=' . $posterdata['uname'] . '" target="_blank" target="_blank" ><i class="fa fa-2x fa-desktop" title="' . translate("Visit the Mini Web Site !") . '" data-toggle="tooltip"></i></a>&nbsp;';
    }
    echo '
   <div class="row">
      <div class="col-sm-2"><img src="' . $direktori . $user_avatar . '" class=" rounded-circle center-block" /></div>
      <div class="col-sm-10">
         <h2>' . translate("User") . '&nbsp;<span class="text-muted">' . $uname . '</span></h2>';
    if ($uname !== $cookie[1]) {
        echo $useroutils;
    }
    echo $my_rsos[0];
    if ($uname == $cookie[1]) {
        //            <h3>'.translate("Welcome to").' '.$sitename.'</h3>
        echo '
         <p class="lead">' . translate("This is your personal page") . '</p>';
    }
    echo '
      </div>
   </div>
   <hr />';
    if ($uname == $cookie[1]) {
        nav($mns);
    }
    echo '
   <div class="card card-block">
      <div class="row">';
    if ($posterdata_extend['C7'] != '') {
        echo '
         <div class="col-md-6">';
    } else {
        echo '
         <div class="col-md-12">';
    }
    include "modules/sform/extend-user/aff_extend-user.php";
    echo '
         </div>';
    if ($posterdata_extend['C7'] != '') {
        $content = '';
        include 'modules/geoloc/geoloc_conf.php';
        $content .= '
<div class="col-md-6">
<div id="map_user" style="width:100%; height:400px;"></div>';
        $content .= '
<script type="text/javascript">
//<![CDATA[

   var 
   map_u, map_b,
   mapdivu = document.getElementById("map_user"),
   mapdivbl = document.getElementById("map_bloc");
   function geoloc_loaduser() {
   icon_u = {
      path: fontawesome.markers.USER,
      scale: ' . $acg_sc . ',
      strokeWeight: ' . $acg_t_ep . ',
      strokeColor: "' . $acg_t_co . '",
      strokeOpacity: ' . $acg_t_op . ',
      fillColor: "' . $acg_f_co . '",
      fillOpacity: ' . $acg_f_op . ',
   };

   icon_bl = {
      url: "' . $ch_img . $img_mbgb . '",
      size: new google.maps.Size(' . $w_ico_b . ',' . $h_ico_b . '),
      origin: new google.maps.Point(0, 0),
      anchor: new google.maps.Point(0, 0),
      scaledSize: new google.maps.Size(' . $w_ico_b . ', ' . $h_ico_b . ')
   };
      
   //==> carte du bloc
   if (document.getElementById("map_bloc")) {

      map_b = new google.maps.Map(mapdivbl,{
         center: new google.maps.LatLng(45, 0),
         zoom :3,
         zoomControl:false,
         streetViewControl:false,
         mapTypeControl: false,
         disableDoubleClickZoom: true 
      });
      map_b.setMapTypeId(google.maps.MapTypeId.' . $cartyp_b . ');
      function createMarkerB(point_b) {
         var marker_b = new google.maps.Marker({
            position: point_b,
            map: map_b,
            icon: icon_bl
         })
         return marker_b;
     }
        //== Fonction qui traite le fichier JSON ==
      $.getJSON("modules/geoloc/include/data.json", {}, function(data){
         $.each(data.markers, function(i, item){
            var point_b = new google.maps.LatLng(item.lat,item.lng);
            var marker_b = createMarkerB(point_b);
         });
      });
   };
   //<== carte du bloc
   
      map_u = new google.maps.Map(mapdivu,{
         center: new google.maps.LatLng(' . $posterdata_extend['C7'] . ', ' . $posterdata_extend['C8'] . '),
         zoom :7,
         zoomControl:true,
         streetViewControl:true,
         mapTypeControl: true,
         scrollwheel: false,
         disableDoubleClickZoom: true 
      });
      map_u.setMapTypeId(google.maps.MapTypeId.' . $cartyp_b . ');
      function createMarkerU(point_u) {
         var marker_u = new google.maps.Marker({
            position: point_u,
            map: map_u,
            title: "' . $uname . '",
            icon: icon_u
         })
         return marker_u;
      }
      var point_u = new google.maps.LatLng(' . $posterdata_extend['C7'] . ',' . $posterdata_extend['C8'] . ');
      var marker_u = createMarkerU(point_u);
   }
   $(document.body).attr("onload", "geoloc_loaduser()");
//]]>
</script>';
        $content .= '<div class="mt-1"><a href="modules.php?ModPath=geoloc&amp;ModStart=geoloc"><i class="fa fa-globe fa-lg"></i>&nbsp;[french]Carte[/french][english]Map[/english][chinese]&#x5730;&#x56FE;[/chinese]</a>';
        if ($admin) {
            $content .= '&nbsp;&nbsp;<a href="admin.php?op=Extend-Admin-SubModule&amp;ModPath=geoloc&amp;ModStart=admin/geoloc_set"><i class="fa fa-cogs fa-lg"></i>&nbsp;[french]Admin[/french] [english]Admin[/english] [chinese]Admin[/chinese]</a>';
        }
        $content .= '</div></div>';
        $content = aff_langue($content);
        echo $content;
    }
    echo '
      </div>
   </div>';
    /*   if ($uname == $cookie[1]) {
       echo '
       <div class="card text-xs-center">
          <div class="card-header">
             <img src="'.$direktori.$user_avatar.'" class="n-ava  thumbnail" />
             <p class="card-text card-title "></p>
          </div>
          <div class="card-block">
             <h3 class="card-title">'.$name.' <span class="text-muted">alias</span> '.$uname.'</h3>
             <p class="card-text">You can contact me @ '.$email.'</p>
             <p class="card-text">Don not forget to visit <a href="'.$url.'" class="oo">my web-site</a>';
       if ($mns) {echo ' OR my <a href="minisite.php?op='.$uname.'" target="_blank">'.translate("Mini-Web site").'</a>';}
       echo '
             </p>
          </div>
          <div class="card-footer text-muted">
             '.$user_sig.'
          </div>
       </div>';
       }; */
    echo '
    <br />
    <h4>' . translate("Online journal for") . ' ' . $uname . '.</h4>
    <div id="online_user_journal" class="card card-block mb-1">' . $user_journal . '</div>';
    $file = '';
    $handle = opendir('modules/comments');
    while (false !== ($file = readdir($handle))) {
        if (!preg_match('#\\.conf\\.php$#i', $file)) {
            continue;
        }
        $topic = "#topic#";
        include "modules/comments/{$file}";
        $filelist[$forum] = $url_ret;
    }
    closedir($handle);
    echo '
   <h4 class="mt-1">' . translate("Last 10 comments by") . ' ' . $uname . '.</h4>
   <div id="last_ten_comment" class="card card-block mb-1">';
    $url = '';
    $result = sql_query("SELECT topic_id, forum_id, post_text, post_time FROM " . $NPDS_Prefix . "posts WHERE forum_id<0 and poster_id='{$uid}' ORDER BY post_time DESC LIMIT 0,10");
    while (list($topic_id, $forum_id, $post_text, $post_time) = sql_fetch_row($result)) {
        $url = str_replace("#topic#", $topic_id, $filelist[$forum_id]);
        echo '<p><a href="' . $url . '">' . translate("Posted: ") . convertdate($post_time) . '</a></p>';
        $message = smilie(stripslashes($post_text));
        $message = aff_video_yt($message);
        $message = str_replace('[addsig]', '', $message);
        if (stristr($message, "<a href")) {
            $message = preg_replace('#_blank(")#i', '_blank\\1 class=\\1noir\\1', $message);
        }
        echo nl2br($message) . '<hr />';
    }
    echo '
    </div>
    <h4 class="mt-1">' . translate("Last 10 news submissions sent by") . ' ' . $uname . '.</h4>
    <div id="last_ten_comment" class="card card-block mb-1">';
    $xtab = news_aff("libre", "WHERE informant='{$uname}' ORDER BY sid DESC LIMIT 10", '', 10);
    $story_limit = 0;
    while ($story_limit < 10 and $story_limit < sizeof($xtab)) {
        list($sid, $catid, $aid, $title) = $xtab[$story_limit];
        $story_limit++;
        echo '
      <p><a href="article.php?sid=' . $sid . '">' . aff_langue($title) . '</a></p>';
    }
    echo '
   </div>
   <hr />
   <p class="n-signature">' . $user_sig . '</p>';
    include "footer.php";
}