$post_message = $originalpost['post_smileys'] == 1 ? parsesmileys($originalpost['post_message']) : $originalpost['post_message'];
         $post_message = phpentities(nl2br(parseubb($post_message)));
         echo " title=\"header=[ " . str_replace("]", "]]", str_replace("[", "[[", trimlink($data['thread_subject'], 70))) . "] body=[" . str_replace("]", "]]", str_replace("[", "[[", trimlink($post_message, 150))) . "] delay=[0] fade=[on]\"";
     }
     echo " href='" . FORUM . "viewthread.php?thread_id=" . $data['thread_id'] . "' title='" . $data['thread_subject'] . "'\n\t\tstyle='text-decoration:underline; font-size:12px;{$threadbold}'>" . trimlink($data['thread_subject'], 40) . "</a> ";
     if ($fb4['latest_post']) {
         echo "&nbsp;<a";
         if ($fb4['latest_popup']) {
             $originalpost = dbarray(dbquery("select * from " . DB_POSTS . " where post_id='" . $data['thread_lastpostid'] . "' order by post_id asc limit 1"));
             $post = trimlink(nl2br(stripinput(parseubb($originalpost['post_message']))), 200);
             echo " title='header=[" . $locale['fb615'] . ":] body=[" . $post . "] delay=[0] fade=[on]'";
         }
         echo " href='" . FORUM . "viewthread.php?thread_id=" . $data['thread_id'] . "&amp;pid=" . $data['thread_lastpostid'] . "#post_" . $data['thread_lastpostid'] . "'" . (!$fb4['latest_popup'] ? " title='" . $locale['fb615'] . "'" : "") . " class='small'>(<b>&raquo;</b>)</a>";
     }
     echo "<br />\n<a href='" . BASEDIR . "profile.php?lookup=" . $data['original_id'] . "' style='font-size:11px;'>" . showLabel($data['original_id'], false, "panel") . "</a><br />\n\t\t<span style='font-size:10px;'>" . $timepassed . "</span>\n\t\t</td>\n";
     echo "<td width='20%' class='" . $row_color . "' style='text-align:right;white-space:nowrap'>\n\t\t" . timePassed($data['thread_lastpost'], false) . "<br />\n\t\tby <a href='" . BASEDIR . "profile.php?lookup=" . $data['thread_lastuser'] . "'>" . showLabel($data['thread_lastuser'], false, "panel") . "</a>";
     if (!$fb4['latest_post']) {
         echo "&nbsp;<a";
         if ($fb4['latest_popup']) {
             $originalpost = dbarray(dbquery("select * from " . DB_POSTS . " where post_id='" . $data['thread_lastpostid'] . "' order by post_id asc limit 1"));
             $post = trimlink(nl2br(stripinput(parseubb($originalpost['post_message']))), 200);
             echo " title='header=[" . ($data['thread_postcount'] - 1 > 0 ? "RE: " : "") . $data['thread_subject'] . "] body=[" . $post . "] delay=[0] fade=[on]'";
         }
         echo " href='" . FORUM . "viewthread.php?thread_id=" . $data['thread_id'] . "&amp;pid=" . $data['thread_lastpostid'] . "#post_" . $data['thread_lastpostid'] . "' title='" . $locale['fb615'] . "'><b>&raquo;&raquo;</b></a>";
     }
     echo "</td>\n";
     echo "<td width='1%' class='" . $row_color . "' style='text-align:center;white-space:nowrap'>" . $data['thread_views'] . "</td>\n";
     echo "<td width='1%' class='" . $row_color . "' style='text-align:center;white-space:nowrap'>" . ($data['thread_postcount'] - 1) . "</td>\n";
     echo "</tr>\n";
     $i++;
 }
Esempio n. 2
0
 if ($data['user_birthdate'] !== "0000-00-00") {
     $birthday = explode("-", $data['user_birthdate']);
     $age = strftime("%Y") - $birthday[0];
     if (strftime("%m") < $birthday[1]) {
         $age--;
     } elseif (strftime("%m") == $birthday[1]) {
         if (strftime("%d") < $birthday[2]) {
             $age--;
         }
     }
     echo "<br /><span class='small'><strong>" . $locale['fb512'] . "</strong> {$age}</span>\n";
 }
 echo showWarning($data['user_id']);
 echo "<br /></td>";
 echo "<td valign='top' class='tbl2' style='height:1px; margin-top:2px; padding:10px;' colspan='2'><div style='float:right' class='small'><a href='#post_" . $data['post_id'] . "' name='post_" . $data['post_id'] . "' id='post_" . $data['post_id'] . "'>#" . ($current_row + $_GET['rowstart']) . "</a></div>\n";
 echo "<span style='font-size:18px; font-weight:bold;'><a href='" . BASEDIR . "profile.php?lookup=" . $data['user_id'] . "'>" . showLabel($data['user_id'], false, "post") . "</a>";
 renderAwards($data['user_id']);
 echo "</span>";
 echo $title;
 renderMods(false, true);
 echo "</span>";
 echo "</td></tr><tr><td class='tbl1' colspan='2' valign='top' style='padding:8px;'>\n";
 if (iMOD) {
     echo "<div style='float:right'><input type='checkbox' name='delete_post[]' value='" . $data['post_id'] . "' /></div>\n";
 }
 if (isset($_GET['highlight'])) {
     $words = explode(" ", urldecode($_GET['highlight']));
     $message = parseubb(highlight_words($words, $message));
 } else {
     $message = parseubb($message);
 }
Esempio n. 3
0
            $members = dbquery("SELECT * FROM " . DB_USERS . " WHERE user_groups REGEXP('^\\\\.{$data['group_id']}\$|\\\\.{$data['group_id']}\\\\.|\\\\.{$data['group_id']}\$') or user_groups='" . $data['group_id'] . "' ORDER BY user_level DESC, user_name");
            $members = dbrows($members);
            $wallposts = dbcount("(comment_id)", DB_COMMENTS, "comment_type='g' and comment_item_id='" . $data['group_id'] . "'");
            echo "<tr>\n<td class='tbl2' style='padding:7px;'><span style='font-size:13px;'><a href='" . FUSION_SELF . "?section=groups&amp;view=" . $data['group_id'] . "' style='text-decoration:underline;'>" . $data['group_name'] . "</a></span>\n";
            if ($data['group_description']) {
                echo "<br />\n<span class='small'>" . trimlink($data['group_description'], 30) . "</span>\n";
            }
            echo "</td>\n";
            echo "<td class='tbl1' style='white-space:nowrap;padding:7px;'>" . timePassed($data['group_created'], false) . "</td>\n";
            echo "<td class='tbl2' style='text-align:center;padding:7px;'>{$members}</td>\n";
            echo "<td class='tbl1' style='text-align:center;padding:7px;'>{$wallposts}</td>\n";
            echo "<td class='tbl2' style='padding:7px;'>";
            if ($wallposts) {
                $latest = dbarray(dbquery("select c.*, u.* from " . DB_COMMENTS . " c\n\t\t\t\tleft join " . DB_USERS . " u on u.user_id=c.comment_name\n\t\t\t\twhere c.comment_type='g' and c.comment_item_id='" . $data['group_id'] . "' order by c.comment_datestamp desc limit 1"));
                echo timepassed($latest['comment_datestamp']) . "<br />\n";
                echo $locale['uc282'] . "<a href='" . BASEDIR . "profile.php?lookup=" . $latest['user_id'] . "'>" . showLabel($latest['user_id']) . "</a>\n";
            } else {
                echo $locale['uc281'];
            }
            echo "</td>\n</tr>\n";
        }
    } else {
        echo "<tr>\n<td class='tbl1' style='text-align:center;'>" . $locale['uc258'] . "</td>\n</tr>\n";
    }
    echo "<tr>\n<td class='tbl1' style='text-align:center;'" . ($rows ? " colspan='5'" : "") . ">" . (checkgroup($fb4['group_create']) ? "<a href='" . FUSION_SELF . "?section=groups&amp;action=create'>" . $locale['uc256'] . "</a> :: " : "") . "<a href='" . FUSION_SELF . "?section=groups&amp;action=search'>" . $locale['uc257'] . "</a></td>\n</tr>\n";
}
if (!defined("USER_CP")) {
    echo "</table>\n</td>\n</tr>\n</table>\n";
    closetable();
    require_once THEMES . "templates/footer.php";
}
Esempio n. 4
0
 function renderSubforums($forum)
 {
     global $locale, $userdata, $db_prefix, $lastvisited, $fb4;
     $forum_list = "";
     $current_cat = "";
     $result = dbquery("SELECT f.*, f2.forum_name AS forum_cat_name, u.user_id, u.user_name\n\t\tFROM " . DB_FORUMS . " f\n\t\tLEFT JOIN " . DB_FORUMS . " f2 ON f.forum_cat = f2.forum_id\n\t\tLEFT JOIN " . DB_USERS . " u ON f.forum_lastuser = u.user_id\n\t\tLEFT JOIN " . DB_PREFIX . "fb_forums f3 on f3.forum_id=f.forum_id\n\t\tWHERE " . groupaccess('f.forum_access') . " AND f3.forum_parent='" . $forum . "' GROUP BY forum_id ORDER BY f2.forum_order ASC, f.forum_order ASC");
     if (dbrows($result) != 0) {
         $state = "off";
         $boxname = "subforums";
         echo "<!--pre_forum_idx--><table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n";
         if ($fb4['forum_icons']) {
             echo "<tr>\n<td colspan='6' class='forum-caption' style='padding:7px;'><div style='float:right'>" . panelbutton($state, $boxname) . "</div>\n\n\t\t\t<!--forum_cat_name_cell-->" . $locale['fb553'] . "</td>\n</tr>";
             echo "</table>" . panelstate($state, $boxname) . "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n";
             echo "<tr>\n<td colspan='3' class='tbl2' width='65%'>" . $locale['401'] . "</td>\n";
         } else {
             echo "<tr>\n<td colspan='6' class='forum-caption' style='padding:7px;'><div style='float:right'>" . panelbutton($state, $boxname) . "</div>\n\n\t\t\t<!--forum_cat_name_cell-->" . $locale['fb553'] . "</td>\n</tr>";
             echo "</table>" . panelstate($state, $boxname) . "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n";
             echo "<tr>\n<td colspan='2' class='tbl2' width='65%'>" . $locale['401'] . "</td>\n";
         }
         echo "<td class='tbl2' width='35%' style='white-space:nowrap'>" . $locale['404'] . "</td>\n";
         echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>" . $locale['402'] . "</td>\n";
         echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>" . $locale['403'] . "</td>\n";
         echo "</tr>\n";
         while ($data = dbarray($result)) {
             $moderators = "";
             if ($data['forum_moderators']) {
                 $mod_groups = explode(".", $data['forum_moderators']);
                 foreach ($mod_groups as $mod_group) {
                     if ($moderators) {
                         $moderators .= ", ";
                     }
                     $moderators .= $mod_group < 101 ? "<a href='" . BASEDIR . "profile.php?group_id=" . $mod_group . "'>" . getgroupname($mod_group) . "</a>" : getgroupname($mod_group);
                 }
             }
             $forum_match = "\\|" . $data['forum_lastpost'] . "\\|" . $data['forum_id'];
             if ($data['forum_lastpost'] > $lastvisited) {
                 if (iMEMBER && preg_match("({$forum_match}\\.|{$forum_match}\$)", $userdata['user_threads'])) {
                     $fim = "<img src='" . get_image("folder") . "' alt='" . $locale['561'] . "' />";
                 } else {
                     $fim = "<img src='" . get_image("foldernew") . "' alt='" . $locale['560'] . "' />";
                 }
             } else {
                 $fim = "<img src='" . get_image("folder") . "' alt='" . $locale['561'] . "' />";
             }
             echo "<tr>\n";
             echo "<td align='center' width='1%' class='tbl1' style='white-space:nowrap' style='padding:7px;'>{$fim}</td>\n";
             $iconQuery = dbquery("select * from " . $db_prefix . "fb_forums where forum_id='" . $data['forum_id'] . "'");
             if (dbrows($iconQuery)) {
                 $iconData = dbarray($iconQuery);
                 $ficon = $iconData['forum_icon'] !== "" ? $iconData['forum_icon'] : "folder.png";
             } else {
                 $ficon = "folder.png";
             }
             if ($fb4['forum_icons']) {
                 $ficon = "<img src='" . INFUSIONS . "fusionboard4/images/forum_icons/{$ficon}' alt='' />";
                 echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap; padding:7px;'>{$ficon}</td>\n";
             }
             echo "<td class='tbl1' style='padding:5px;width:65%;'><a href='viewforum.php?forum_id=" . $data['forum_id'] . "' style='font-size:12px; text-decoration:underline; font-weight:bold;'>\n\t\t\t<!--forum_name_cell-->" . $data['forum_name'] . "</a><br />\n";
             if ($data['forum_description'] || $moderators) {
                 echo "<span class='small'>" . $data['forum_description'] . ($data['forum_description'] && $moderators ? "<br />\n" : "");
                 echo ($moderators ? "<strong>" . $locale['411'] . "</strong>" . $moderators . "</span>\n" : "</span>\n") . "\n";
             }
             $c_res = dbquery("select * from " . DB_PREFIX . "forums f\n\t\t\tleft join " . DB_PREFIX . "fb_forums f2 on f2.forum_id=f.forum_id\n\t\t\twhere " . groupaccess("f.forum_access") . " AND f2.forum_parent='" . $data['forum_id'] . "'");
             if (dbrows($c_res)) {
                 if ($fb4['subforum_view']) {
                     echo "<br /><span class='small'><strong>" . $locale['fb552'] . "</strong> ";
                     $i = dbrows($c_res);
                     while ($c_data = dbarray($c_res)) {
                         $i--;
                         echo "<a href='" . FORUM . "viewforum.php?forum_id=" . $c_data['forum_id'] . "'>" . $c_data['forum_name'] . "</a>";
                         if ($i > 0) {
                             echo ", ";
                         }
                     }
                     echo "</span>";
                 } else {
                     $counter = 0;
                     $rows = 3;
                     $sfimage1 = file_exists(THEME . "images/folder_open.png") ? THEME . "images/folder_open.png" : INFUSIONS . "fusionboard4/images/folder_open.png";
                     $sfimage2 = file_exists(THEME . "images/subforum.png") ? THEME . "images/subforum.png" : INFUSIONS . "fusionboard4/images/subforum.png";
                     echo "<br /><img src='{$sfimage1}' alt='' style='vertical-align:middle;'> <span class='small' style='font-weight:bold;'>" . $locale['fb552'] . "</span><br />";
                     echo "<table cellspacing='0' cellpadding='0' border='0' width='100%' style='padding-left:10px;'><tr>\n\t\t\t\t\t<td width='50%' class='small' style='padding-left:3px; padding-right:3px; vertical-align:top;'>";
                     while ($c_data = dbarray($c_res)) {
                         if ($counter != 0 && $counter % $rows == 0) {
                             echo "</td><td width='50%' class='small' style='padding-left:3px; padding-right:3px; vertical-align:top;'>\n";
                         }
                         $subforum = is_file(THEME . "images/subforum.png") ? THEME . "images/subforum.png" : INFUSIONS . "fusionboard4/images/subforum.png";
                         echo "<img src='{$sfimage2}' alt='' style='vertical-align:middle;'> \n\t\t\t\t\t\t<a href='" . FORUM . "viewforum.php?forum_id=" . $c_data['forum_id'] . "' class='small'>" . $c_data['forum_name'] . "</a><br />";
                         $counter++;
                     }
                     echo "</td></tr></table>";
                 }
             }
             echo "</td>\n";
             echo "<td class='tbl2' style='white-space:nowrap; padding:5px;width:35%;'>";
             $children = array();
             $child_res = dbquery("select * from " . $db_prefix . "fb_forums f\n\t\t\tleft join " . $db_prefix . "forums f2 on f2.forum_id=f.forum_id\n\t\t\twhere " . groupaccess("f2.forum_access") . " and f.forum_parent='" . $data['forum_id'] . "'");
             if (dbrows($child_res)) {
                 while ($child_data = dbarray($child_res)) {
                     array_push($children, $child_data['forum_id']);
                     findChildren($child_data['forum_id']);
                 }
             }
             if (count($children)) {
                 $where = "";
                 $counter = count($children);
                 foreach ($children as $child) {
                     $where .= "t.forum_id='{$child}' " . ($counter > 1 ? "OR " : "");
                     $counter--;
                 }
                 $childrenForums = dbquery("select * from " . $db_prefix . "threads t\n\t\t\t\tleft join " . $db_prefix . "users u on u.user_id=t.thread_lastuser\n\t\t\t\tleft join " . $db_prefix . "posts p on p.post_id=t.thread_lastpostid\n\t\t\t\twhere ({$where} OR t.forum_id='" . $data['forum_id'] . "') \n\t\t\t\torder by t.thread_lastpost desc limit 1");
                 if (!dbrows($childrenForums)) {
                     echo $locale['405'] . "</td>\n";
                 } else {
                     $childrenData = dbarray($childrenForums);
                     echo "<b><a href='viewthread.php?thread_id=" . $childrenData['thread_id'] . "' style='text-decoration:underline;'>" . trimlink($childrenData['thread_subject'], 30) . "</a></b><br />";
                     echo "" . $locale['406'] . "<a href='" . BASEDIR . "profile.php?lookup=" . $childrenData['thread_lastuser'] . "'>" . showLabel($childrenData['user_id'], false, "index") . "</a><br />\n\t\t\t\t\t<div align='right'>" . timePassed($childrenData['thread_lastpost'], false) . "\n\t\t\t\t\t<a href='" . FORUM . "viewthread.php?thread_id=" . $childrenData['thread_id'] . "&amp;pid=" . $childrenData['thread_lastpostid'] . "#post_" . $childrenData['thread_lastpostid'] . "' title='Go To Last Post'><b>»</b></a></div></td>\n";
                 }
             } else {
                 if ($data['forum_lastpost'] == 0) {
                     echo $locale['405'] . "</td>\n";
                 } else {
                     $threadData = dbarray(dbquery("select * from " . $db_prefix . "threads t\n\t\t\t\t\tleft join " . $db_prefix . "posts p on p.post_id=t.thread_lastpostid\n\t\t\t\t\twhere t.thread_lastpost='" . $data['forum_lastpost'] . "'"));
                     echo "<b><a href='viewthread.php?thread_id=" . $threadData['thread_id'] . "' style='text-decoration:underline;'>" . trimlink($threadData['thread_subject'], 30) . "</a></b><br />";
                     echo "" . $locale['406'] . "<a href='" . BASEDIR . "profile.php?lookup=" . $data['forum_lastuser'] . "' style='text-decoration:underline;'>" . showLabel($data['forum_lastuser'], false, "index") . "</a><br />\n\t\t\t\t\t<div align='right'>" . timePassed($data['forum_lastpost'], false) . "\n\t\t\t\t\t<a href='" . FORUM . "viewthread.php?thread_id=" . $threadData['thread_id'] . "&amp;pid=" . $threadData['thread_lastpostid'] . "#post_" . $threadData['thread_lastpostid'] . "' title='Go To Last Post'><b>»</b></a></div></td>\n";
                 }
             }
             echo "<td align='center' width='1%' class='tbl1' style='white-space:nowrap'>" . $data['forum_threadcount'] . "</td>\n";
             echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>" . $data['forum_postcount'] . "</td>\n";
             echo "</tr>\n";
         }
         echo "</table></div>";
     }
 }
Esempio n. 5
0
     echo "<div class='tbl-border' style='height:2px;overflow:hidden; margin-top:5px; margin-bottom:5px;width:320px;'>&nbsp;</div><span class='small'";
     if (isset($edit_reason) && $edit_reason !== "") {
         echo " title='header=[" . $locale['fb502'] . "] body=[{$edit_reason}]'";
     }
     echo ">" . $locale['508'] . "\n\t\t<a href='../profile.php?lookup=" . $data['post_edituser'] . "'>" . $data['edit_name'] . "</a> " . timePassed($data['post_edittime'], false);
     echo "</span>\n";
 }
 echo "<!--sub_forum_post--></td><td style='vertical-align:top;width:180px;'>\n\t<div class='small' style='border-left:1px solid #ccc;padding:7px;line-height:1.3em;'>";
 if ($data['user_avatar'] && file_exists(IMAGES . "avatars/" . $data['user_avatar'])) {
     echo "<img src='" . IMAGES . "avatars/" . $data['user_avatar'] . "' alt='" . $locale['567'] . "' /><br />\n";
 } else {
     if ($fb4['no_avatar']) {
         echo "<img src='" . IMAGES . "noav.gif' alt='" . $locale['567'] . "' /><br />\n";
     }
 }
 echo "<a href='" . BASEDIR . "profile.php?lookup=" . $data['user_id'] . "' style='font-size:12px;'>" . showLabel($data['user_id'], false, "post") . "</a><br />";
 if ($fb4['user_titles_posts'] && $fb4['user_titles']) {
     $titleLookup = dbquery("select * from " . $db_prefix . "fb_titles where title_id='" . $data['user_title'] . "' and (" . useraccess("title_access") . ")");
     if (dbrows($titleLookup)) {
         $titleData = dbarray($titleLookup);
         $title = stripslash($titleData['title_title']);
     } else {
         $title = stripslash($data['user_title']);
     }
 } else {
     $title = getusergroups($data['user_id']);
 }
 echo "<span class='small'>" . $title . "</span><br />";
 renderMods(true, false);
 echo "<br /><br />";
 renderAwards($data['user_id'], "", "<br /><br />");
Esempio n. 6
0
     if (isset($edit_reason) && $edit_reason !== "") {
         echo " title='header=[" . $locale['fb502'] . "] body=[{$edit_reason}]'";
     }
     echo ">&nbsp;|&nbsp;" . $locale['508'] . "\n\t\t<a href='../profile.php?lookup=" . $data['post_edituser'] . "'>" . $data['edit_name'] . "</a> " . timePassed($data['post_edittime'], false);
     echo "</span>\n";
 }
 echo "</td>\n";
 echo "</tr>\n<tr>\n<td valign='top' class='tbl2' style='width:140px; padding:6px;'>\n";
 if ($data['user_avatar'] && file_exists(IMAGES . "avatars/" . $data['user_avatar'])) {
     echo "<img src='" . IMAGES . "avatars/" . $data['user_avatar'] . "' alt='" . $locale['567'] . "' /><br /><br />\n";
 } else {
     if ($fb4['no_avatar']) {
         echo "<img src='" . IMAGES . "noav.gif' alt='" . $locale['567'] . "' /><br /><br />\n";
     }
 }
 echo "<span style='font-size:14px;'>\n\t<a href='../profile.php?lookup=" . $data['user_id'] . "'><!--forum_thread_user_name-->" . showLabel($data['user_id'], false, "post") . "</a></span><br /><span class='small'>";
 if ($fb4['user_titles_posts'] && $fb4['user_titles']) {
     $titleLookup = dbquery("select * from " . $db_prefix . "fb_titles where title_id='" . $data['user_title'] . "' and (" . useraccess("title_access") . ")");
     if (dbrows($titleLookup)) {
         $titleData = dbarray($titleLookup);
         $title = stripslash($titleData['title_title']);
     } else {
         $title = stripslash($data['user_title']);
     }
     echo "<b>" . $title . "</b><br />";
 }
 renderMods();
 echo "</span><br /><br />\n";
 renderAwards($data['user_id'], "", "<br /><br />");
 echo "<!--forum_thread_user_info--><span class='small'><strong>" . $locale['502'] . "</strong> " . $data['user_posts'] . "</span><br />\n";
 echo "<span class='small'><strong>" . $locale['504'] . "</strong> " . showdate("%d.%m.%y", $data['user_joined']) . "</span>\n";
Esempio n. 7
0
         $ctr = 0;
         $ctr2 = 1;
         $pages = "";
         while ($ctr2 <= $reps) {
             $pnum = "<a href='viewthread.php?thread_id=" . $tdata['thread_id'] . "&amp;rowstart={$ctr}'>{$ctr2}</a> ";
             $pages = $pages . $pnum;
             $ctr = $ctr + $posts_per_page;
             $ctr2++;
         }
         $threadsubject .= "&nbsp;<span class='small'>(" . $locale['455'] . trim($pages) . ")</span>";
     }
     echo "<td class='tbl1'>";
     echo $threadsubject;
     echo "<br />\n\t\t<span class='small'><a href='../profile.php?lookup=" . $tdata['thread_author'] . "'>" . showLabel($tdata['thread_author'], false, "index") . "</a></span></td>\n";
     echo "<td class='tbl1' style='white-space:nowrap; text-align:right;'>\n\t\t" . timePassed($tdata['thread_lastpost'], false) . "<br />\n";
     echo "<span class='small'>" . $locale['406'] . "<a href='../profile.php?lookup=" . $tdata['thread_lastuser'] . "'>" . showLabel($tdata['thread_lastuser'], false, "index") . "</a></span></td>\n";
     echo "<td align='center' width='1%' class='tbl1' style='white-space:nowrap'>" . $tdata['thread_views'] . "</td>\n";
     echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>" . ($tdata['thread_postcount'] - 1) . "</td>\n";
     if (iMOD) {
         echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><input type='checkbox' name='check_mark[]' value='" . $tdata['thread_id'] . "' /></td>\n";
     }
     echo "</tr>\n";
     $counter++;
 }
 $totalThreads = dbcount("(thread_id)", DB_THREADS, "forum_id='" . $_GET['forum_id'] . "' and thread_sticky='0'");
 if (isset($_POST['order_by'])) {
     $_POST['order_by'] = $_POST['order_by'];
 } elseif (isset($_GET['order_by'])) {
     $_POST['order_by'] = $_GET['order_by'];
 } else {
     $_POST['order_by'] = "";
Esempio n. 8
0
function showcomments($ctype, $cdb, $ccol, $cid, $clink, $ingroup)
{
    global $settings, $locale, $userdata, $aidlink;
    if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
        $eresult = dbquery("SELECT tcm.*,user_name FROM " . DB_COMMENTS . " tcm\n\t\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\n\t\t\tWHERE comment_id='" . $_GET['comment_id'] . "' AND comment_item_id='" . $cid . "' AND comment_type='" . $ctype . "'");
        if (dbrows($eresult)) {
            $edata = dbarray($eresult);
            if (iADMIN && checkrights("C") || iMEMBER && $edata['comment_name'] == $userdata['user_id'] && isset($edata['user_name'])) {
                $clink .= "&amp;c_action=edit&amp;comment_id=" . $edata['comment_id'];
                $comment_message = $edata['comment_message'];
            }
        } else {
            $comment_message = "";
        }
    } else {
        $comment_message = "";
    }
    if (iMEMBER && $ingroup) {
        add_to_head("<script type='text/javascript'>window.onload=setTimeout(\"hideall()\", 250);\n\t\tfunction hideall(){\n\t\t\tdocument.getElementById('bbcode').style.display='none';\n\t\t}\n\t\tfunction showhide(msg_id) {\n\t\t   document.getElementById(msg_id).style.display = document.getElementById(msg_id).style.display == 'none' ? 'block' : 'none';\n\t\t}</script>\n");
        require_once INCLUDES . "bbcode_include.php";
        echo "<a id='edit_comment' name='edit_comment'></a>\n";
        echo "<form name='inputform' method='post' action='" . $clink . "'>\n";
        echo "<div align='center'>\n";
        echo "<textarea name='comment_message' rows='2' class='textbox' style='width:90%'>" . $comment_message . "</textarea><br />\n";
        echo "<input type='submit' name='post_comment' value='" . $locale['uc283'] . "' class='button' /> :: <a onClick='showhide(\"bbcode\")'>" . $locale['uc285'] . "</a>\n";
        echo "<div id='bbcode'><br />" . display_bbcodes("360px", "comment_message") . "</div>\n";
        echo "</div>\n</form>\n";
    } else {
        echo "<div align='center'>" . $locale['uc289'] . "</div>\n";
    }
    echo "</td>\n</tr>\n";
    echo "<tr>\n<td class='tbl1' style='padding:6px;'>\n";
    if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "delete") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
        if (iADMIN && checkrights("C") || iMEMBER && dbcount("(comment_id)", DB_COMMENTS, "comment_id='" . $_GET['comment_id'] . "' AND comment_name='" . $userdata['user_id'] . "'")) {
            $result = dbquery("DELETE FROM " . DB_COMMENTS . " WHERE comment_id='" . $_GET['comment_id'] . "'" . (iADMIN ? "" : " AND comment_name='" . $userdata['user_id'] . "'"));
        }
        redirect($clink);
    }
    if ((iMEMBER || $settings['guestposts'] == "1") && isset($_POST['post_comment'])) {
        if (iMEMBER) {
            $comment_name = $userdata['user_id'];
        } elseif ($settings['guestposts'] == "1") {
            $comment_name = trim(stripinput($_POST['comment_name']));
            $comment_name = preg_replace("(^[0-9]*)", "", $comment_name);
            if (isnum($comment_name)) {
                $comment_name = "";
            }
        }
        $comment_message = trim(stripinput(censorwords($_POST['comment_message'])));
        if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
            $comment_updated = false;
            if (iADMIN && checkrights("C") || iMEMBER && dbcount("(comment_id)", DB_COMMENTS, "comment_id='" . $_GET['comment_id'] . "' AND comment_name='" . $userdata['user_id'] . "'")) {
                if ($comment_message) {
                    $result = dbquery("UPDATE " . DB_COMMENTS . " SET comment_message='{$comment_message}' WHERE comment_id='" . $_GET['comment_id'] . "'" . (iADMIN ? "" : " AND comment_name='" . $userdata['user_id'] . "'"));
                    $comment_updated = true;
                }
            }
            if ($comment_updated) {
                $c_start = (ceil(dbcount("(comment_id)", DB_COMMENTS, "comment_id<='" . $_GET['comment_id'] . "' AND comment_item_id='" . $cid . "' AND comment_type='" . $ctype . "'") / 10) - 1) * 10;
            }
            redirect($clink . "&amp;rstart=" . (isset($c_start) && isnum($c_start) ? $c_start : ""));
        } else {
            if (!dbcount("(" . $ccol . ")", $cdb, $ccol . "='" . $cid . "'")) {
                redirect(BASEDIR . "index.php");
            }
            if ($comment_name && $comment_message) {
                require_once INCLUDES . "flood_include.php";
                if (!flood_control("comment_datestamp", DB_COMMENTS, "comment_ip='" . USER_IP . "'")) {
                    $result = dbquery("INSERT INTO " . DB_COMMENTS . " (comment_item_id, comment_type, comment_name, comment_message, comment_datestamp, comment_ip) VALUES ('{$cid}', '{$ctype}', '{$comment_name}', '{$comment_message}', '" . time() . "', '" . USER_IP . "')");
                }
            }
            $c_start = (ceil(dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='" . $cid . "' AND comment_type='" . $ctype . "'") / 10) - 1) * 10;
            redirect($clink . "&amp;rstart=" . $c_start);
        }
    }
    echo "<a id='comments' name='comments'></a>";
    $c_rows = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='{$cid}' AND comment_type='{$ctype}'");
    if (!isset($_GET['c_start']) || !isnum($_GET['c_start'])) {
        $_GET['c_start'] = 0;
    }
    $result = dbquery("SELECT tcm.*,tcu.* FROM " . DB_COMMENTS . " tcm\n\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\n\t\tWHERE comment_item_id='{$cid}' AND comment_type='{$ctype}'\n\t\tORDER BY comment_datestamp DESC LIMIT " . $_GET['c_start'] . ",10");
    if (dbrows($result)) {
        $i = $_GET['c_start'] + 1;
        if ($c_rows > 10) {
            echo "<div style='text-align:center;margin-bottom:5px;'>" . makecommentnav($_GET['c_start'], 10, $c_rows, 3, $clink . "&amp;") . "</div>\n";
        }
        echo "<table width='100%' cellspacing='1' cellpadding='0'>\n";
        while ($data = dbarray($result)) {
            echo "<tr><td class='tbl2' rowspan='2' width='1'>\n";
            if ($data['user_avatar']) {
                list($width, $height) = getimagesize(IMAGES . "avatars/" . $data['user_avatar']);
                $new_width = 70;
                $new_height = $height * ($new_width / $height);
                echo "<img src='" . IMAGES . "avatars/" . $data['user_avatar'] . "' alt='' style='width:" . $new_width . "px;height:" . $new_height . "px'>\n";
            } else {
                echo "<img src='" . IMAGES . "noav.gif' alt='' style='width:70px;height:70px'>\n";
            }
            echo "</td>\n<td class='tbl2' style='height:30px;'>";
            if (iADMIN && checkrights("C") || iMEMBER && $data['comment_name'] == $userdata['user_id'] && isset($data['user_name'])) {
                echo "<div style='float:right'>\n<a href='" . FUSION_REQUEST . "&amp;c_action=edit&amp;comment_id=" . $data['comment_id'] . "#edit_comment'>" . $locale['c108'] . "</a> |\n";
                echo "<a href='" . FUSION_REQUEST . "&amp;c_action=delete&amp;comment_id=" . $data['comment_id'] . "'>" . $locale['c109'] . "</a>\n</div>\n";
            }
            echo "<a href='" . FUSION_REQUEST . "#c" . $data['comment_id'] . "' id='c" . $data['comment_id'] . "' name='c" . $data['comment_id'] . "'>#" . $i . "</a> | ";
            echo "<a href='" . BASEDIR . "profile.php?lookup=" . $data['comment_name'] . "'>" . showLabel($data['comment_name']) . "</a>\n";
            echo "<span class='small'>" . timepassed($data['comment_datestamp']) . "</span></td></tr>\n<tr><td class='tbl1' style='vertical-align:top;'>\n";
            echo nl2br(parseubb(parsesmileys($data['comment_message']))) . "</td></tr>\n";
            $i++;
        }
        echo "</table>";
        if (iADMIN && checkrights("C")) {
            echo "<div align='right' class='tbl2'><a href='" . ADMIN . "comments.php" . $aidlink . "&amp;ctype={$ctype}&amp;cid={$cid}'>" . $locale['c106'] . "</a></div>\n";
        }
        if ($c_rows > 10) {
            echo "<div style='text-align:center;margin-top:5px;'>" . makecommentnav($_GET['c_start'], 10, $c_rows, 3, $clink . "&amp;") . "</div>\n";
        }
    } else {
        echo $locale['uc284'] . "\n";
    }
}
Esempio n. 9
0
         if ($data['buddy_user'] !== $userdata['user_id']) {
             $user = dbarray(dbquery("select * from " . DB_USERS . " where user_id='" . $data['buddy_user'] . "'"));
         } else {
             $user = dbarray(dbquery("select * from " . DB_USERS . " where user_id='" . $data['buddy_buddy'] . "'"));
         }
         echo "<td>\n<div class='tbl2 users'>\n";
         if ($user['user_avatar']) {
             list($width, $height) = getimagesize(IMAGES . "avatars/" . $user['user_avatar']);
             $new_width = 70;
             $new_height = $height * ($new_width / $height);
             echo "<div style='float:left;height:70px;'>\n<img src='" . IMAGES . "avatars/" . $user['user_avatar'] . "' alt='' style='padding-right:5px;width:" . $new_width . "px;height:" . $new_height . "px'>\n</div>\n";
         } else {
             echo "<div style='float:left;height:70px;'>\n<img src='" . IMAGES . "noav.gif' alt='' style='padding-right:5px;width:70px;height:70px'>\n</div>\n";
         }
         echo "<div style='float:right;'><a href='" . FUSION_SELF . "?section=buddies&amp;cancel=" . $data['buddy_id'] . "'>" . $locale['uc232'] . "</a></div>\n";
         echo "<a href='" . BASEDIR . "profile.php?lookup=" . $user['user_id'] . "'>" . showLabel($user['user_id']) . "</a>\n";
         if ($fb4['user_titles']) {
             echo "<br />" . showtitle($user) . "\n";
         }
         echo "<br /><span class='small'>Last Seen: " . timepassed($user['user_lastvisit'], false) . "</span><br /><br />\n";
         echo "</div>\n</td>\n";
         $counter++;
     }
     echo "</tr>\n</table>\n";
 } else {
     echo "<div align='center'>" . $locale['uc223'] . "</div>\n";
 }
 echo "</fieldset>\n</div>\n</td></tr>\n";
 echo "<tr>\n<td class='tbl2 navsection'>" . $locale['uc222'] . "</td>\n</tr>\n<tr>\n<td class='tbl1'>\n";
 echo "<div align='center'>\n";
 echo "<fieldset class='fields' style='width:500px;'><legend><a name=''>" . $locale['uc222'] . "</a></legend>\n";