function createForumVars($res, $readoutMods = true) { global $apx, $db, $set, $user; global $collapse, $readthreads, $foruminfo; //Link $link = mkrellink('forum.php?id=' . $res['forumid'], 'forum,' . $res['forumid'] . ',1' . urlformat($res['title']) . '.html'); //Moderatoren $moddata = array(); if ($readoutMods) { //$mods=dash_unserialize($res['moderator']); $mods = $res['moderator']; if (count($mods)) { $userdata = $db->fetch("SELECT userid,username FROM " . PRE . "_user WHERE userid IN (" . implode(',', $mods) . ") ORDER BY username ASC"); if (count($userdata)) { foreach ($userdata as $modres) { ++$mi; $moddata[$mi]['USERID'] = $modres['userid']; $moddata[$mi]['USERNAME'] = replace($modres['username']); } } } } $forumdata['ID'] = $res['forumid']; $forumdata['ISCAT'] = $res['iscat']; $forumdata['LEVEL'] = $res['level']; $forumdata['TITLE'] = $res['title']; $forumdata['DESCRIPTION'] = $res['description']; $forumdata['LINKTO'] = $res['link']; $forumdata['LINK'] = $link; $forumdata['THREADS'] = '-'; $forumdata['POSTS'] = '-'; $forumdata['CLOSED'] = iif($res['open'], 0, 1); $forumdata['MODERATOR'] = $moddata; $forumdata['COLLAPSE'] = in_array($res['forumid'], $collapse); //Neues Thema erstellen, wenn Schreibrechte if (forum_access_open($res)) { $forumdata['LINK_NEWTHREAD'] = 'newthread.php?id=' . $res['forumid']; } //Nur anzeigen, wenn Leserechte if (forum_access_read($res) && correct_forum_password($res)) { $thread = false; //Lastvisit bestimmen $lastview = max(array($user->info['forum_lastonline'], forum_readtime($res['forumid']))); $forumdata['NEWPOSTS'] = iif($res['lastposttime'] && $res['lastposttime'] > $lastview, 1, 0); $forumdata['THREADS'] = number_format($res['threads'], 0, '', '.'); $forumdata['POSTS'] = number_format($res['posts'], 0, '', '.'); //Letzter Beitrag //if ( $res['lastposttime'] && $thread==false ) $thread=$db->first("SELECT threadid,title,icon FROM ".PRE."_forum_threads WHERE ( del=0 AND moved=0 AND forumid='".$res['forumid']."' ) ORDER BY lastposttime DESC LIMIT 1"); if ($res['lastthread_icon'] != -1 && isset($set['forum']['icons'][$res['lastthread_icon']])) { $icon = $set['forum']['icons'][$res['lastthread_icon']]['file']; } else { $icon = ''; } $forumdata['LASTPOST_THREADID'] = $res['lastthread']; $forumdata['LASTPOST_THREADTITLE'] = replace($res['lastthread_title']); $forumdata['LASTPOST_THREADPREFIX'] = forum_get_prefix($res['lastthread_prefix']); $forumdata['LASTPOST_USERNAME'] = replace($res['lastposter']); $forumdata['LASTPOST_USERID'] = $res['lastposter_userid']; $forumdata['LASTPOST_TIME'] = $res['lastposttime']; $forumdata['LASTPOST_LINK'] = 'thread.php?id=' . $res['lastthread'] . '&goto=lastpost'; $forumdata['LASTPOST_ICON'] = $icon; } return $forumdata; }
$apx->tmpl->assign('CONTACT_MSN', replace($userdat['msn'])); $apx->tmpl->assign('CONTACT_AIM', replace($userdat['aim'])); $apx->tmpl->assign('CONTACT_YIM', replace($userdat['yim'])); $apx->tmpl->assign('CONTACT_SKYPE', replace($userdat['skype'])); //Optionen if ($res['userid']) { $apx->tmpl->assign('LINK_USERPOSTS', HTTPDIR . $set['forum']['directory'] . '/search.php?send=1&author=' . urlencode($res['username'])); if (!$user->is_buddy($res['userid'])) { $apx->tmpl->assign('LINK_ADDBUDDY', mklink('user.php?action=addbuddy&id=' . $res['userid'], 'user,addbuddy,' . $res['userid'] . '.html')); } } $threadlink = mkrellink('thread.php?id=' . $threadinfo['threadid'], 'thread,' . $threadinfo['threadid'] . ',1' . urlformat($threadinfo['title']) . '.html'); $forumlink = mkrellink('forum.php?id=' . $foruminfo['forumid'], 'forum,' . $foruminfo['forumid'] . ',1' . urlformat($foruminfo['title']) . '.html'); $apx->tmpl->assign('THREADID', $threadinfo['threadid']); $apx->tmpl->assign('THREAD_TITLE', replace($threadinfo['title'])); $apx->tmpl->assign('THREAD_PREFIX', forum_get_prefix($threadinfo['prefix'])); $apx->tmpl->assign('THREAD_LINK', $threadlink); $apx->tmpl->assign('THREAD_DELETED', $threadinfo['del']); $apx->tmpl->assign('FORUMID', $foruminfo['forumid']); $apx->tmpl->assign('FORUM_TITLE', replace($foruminfo['title'])); $apx->tmpl->assign('FORUM_LINK', $forumlink); $apx->tmpl->assign('POSTID', $postinfo['postid']); $apx->tmpl->assign('RIGHT_POST', forum_access_post($foruminfo, $threadinfo)); $apx->tmpl->parse('post'); //////////////////////////////////////////////////////////////////////////////////////////////////////// $apx->tmpl->assign_static('STYLESHEET', compatible_hsc($foruminfo['stylesheet'])); $apx->tmpl->assign('PATH', forum_path($foruminfo, 1)); $apx->tmpl->assign('PATHEND', replace(iif($threadinfo['sticky'], $threadinfo['sticky_text'] . ': ') . $threadinfo['title'])); titlebar($threadinfo['title']); //////////////////////////////////////////////////////////////////////////////////////////////////////// require 'lib/_end.php';
//Die letzten 10 Beiträge $data = $db->fetch("SELECT postid,userid,username,text,time,allowcodes,allowsmilies FROM " . PRE . "_forum_posts WHERE ( del=0 AND threadid='" . $threadinfo['threadid'] . "' ) ORDER BY time DESC LIMIT 10"); if (count($data)) { foreach ($data as $res) { ++$i; //Text $text = forum_replace($res['text'], $res['allowcodes'], $res['allowsmilies']); $postdata[$i]['ID'] = $res['postid']; $postdata[$i]['USERID'] = $res['userid']; $postdata[$i]['USERNAME'] = replace($res['username']); $postdata[$i]['TEXT'] = $text; $postdata[$i]['TIME'] = $res['time']; } } $apx->tmpl->assign('POST', $postdata); $apx->tmpl->assign('ATTACH', forum_access_addattachment($foruminfo)); $apx->tmpl->assign('ID', $threadinfo['threadid']); $apx->tmpl->assign('HASH', $_POST['hash']); $apx->tmpl->parse('newpost'); //////////////////////////////////////////////////////////////////////////////////////////////////////// $threadpath = array(array('TITLE' => trim(compatible_hsc(strip_tags(forum_get_prefix($threadinfo['prefix']) . ' ') . $threadinfo['title'])), 'LINK' => mkrellink('thread.php?id=' . $threadinfo['threadid'], 'thread,' . $threadinfo['threadid'] . ',1' . urlformat($threadinfo['title']) . '.html'))); $apx->tmpl->assign_static('STYLESHEET', compatible_hsc($foruminfo['stylesheet'])); $apx->tmpl->assign('PATH', array_merge(forum_path($foruminfo, 1), $threadpath)); $apx->tmpl->assign('PATHEND', $apx->lang->get('HEADLINE_NEWPOST')); titlebar($apx->lang->get('HEADLINE_NEWPOST')); //////////////////////////////////////////////////////////////////////////////////////////////////////// require 'lib/_end.php'; /////////////////////////////////////////////////////////////////////////// require '../lib/_end.php'; //////////////////////////////////////////////////////// SCRIPT BEENDEN /// ////////////////////////////////////////////////////////////////////////////////////////////////////////
$icon = ''; } $notify = ''; $notification = $subsrcinfo_threads[$res['threadid']]['notification']; if ($notification == 'none') { $notify = $apx->lang->get('SUBSCRIPTION_NONE'); } elseif ($notification == 'instant') { $notify = $apx->lang->get('SUBSCRIPTION_INSTANT'); } elseif ($notification == 'daily') { $notify = $apx->lang->get('SUBSCRIPTION_DAILY'); } elseif ($notification == 'weekly') { $notify = $apx->lang->get('SUBSCRIPTION_WEEKLY'); } $threaddata[$i]['ID'] = $res['threadid']; $threaddata[$i]['TITLE'] = replace($res['title']); $threaddata[$i]['PREFIX'] = forum_get_prefix($res['prefix']); $threaddata[$i]['LINK'] = $link; $threaddata[$i]['ICON'] = $icon; $threaddata[$i]['OPENER_USERID'] = $res['opener_userid']; $threaddata[$i]['OPENER_USERNAME'] = replace($res['opener']); $threaddata[$i]['OPENTIME'] = $res['opentime']; $threaddata[$i]['LASTPOST_USERID'] = $res['lastposter_userid']; $threaddata[$i]['LASTPOST_USERNAME'] = replace($res['lastposter']); $threaddata[$i]['LASTPOST_TIME'] = $res['lastposttime']; $threaddata[$i]['LASTPOST_LINK'] = HTTPDIR . $set['forum']['directory'] . '/' . 'thread.php?id=' . $res['threadid'] . '&goto=lastpost'; $threaddata[$i]['LINK_UNREAD'] = HTTPDIR . $set['forum']['directory'] . '/' . 'thread.php?id=' . $res['threadid'] . '&goto=firstunread'; $threaddata[$i]['NEWPOSTS'] = iif($res['lastposttime'] && $res['lastposttime'] > $user->info['forum_lastonline'], 1, 0); $threaddata[$i]['CLOSED'] = !$res['open']; $threaddata[$i]['NOTIFICATION'] = $notify; //Optionen $threaddata[$i]['LINK_DEL'] = mklink('user.php?action=subscribe&option=delete&id=' . $subsrcinfo_threads[$res['threadid']]['id'], 'user,subscribe.html?option=delete&id=' . $subsrcinfo_threads[$res['threadid']]['id']);
function forum_threads_print($data, $template, $dateheadfield) { global $set; $tmpl = new tengine(); //Ausgabe if (count($data)) { foreach ($data as $res) { ++$i; //Verschoben if ($res['moved']) { $res['threadid'] = $res['moved']; } //Link $forumdir = $set['forum']['directory'] . '/'; $link = mkrellink(HTTPDIR . $forumdir . 'thread.php?id=' . $res['threadid'], HTTPDIR . $forumdir . 'thread,' . $res['threadid'] . ',1' . urlformat($res['title']) . '.html'); $tabledata[$i]['ID'] = $res['threadid']; $tabledata[$i]['PREFIX'] = forum_get_prefix($res['prefix']); $tabledata[$i]['TITLE'] = replace($res['title']); $tabledata[$i]['LINK'] = $link; $tabledata[$i]['OPENER_USERID'] = $res['opener_userid']; $tabledata[$i]['OPENER_USERNAME'] = replace($res['opener']); $tabledata[$i]['OPENTIME'] = $res['opentime']; $tabledata[$i]['LASTPOST_USERID'] = $res['lastposter_userid']; $tabledata[$i]['LASTPOST_USERNAME'] = replace($res['lastposter']); $tabledata[$i]['LASTPOST_TIME'] = $res['lastposttime']; $tabledata[$i]['POSTS'] = number_format($res['posts'], 0, '', '.'); $tabledata[$i]['VIEWS'] = number_format($res['views'], 0, '', '.'); //Datehead if ($laststamp != date('Y/m/d', $res[$dateheadfield] - TIMEDIFF)) { $tabledata[$i]['DATEHEAD'] = $res[$dateheadfield]; } $laststamp = date('Y/m/d', $res[$dateheadfield] - TIMEDIFF); } } $tmpl->assign('THREAD', $tabledata); $tmpl->parse('functions/' . $template, 'forum'); }
if ($_REQUEST['option'] == 'addforum') { $_POST['type'] = 'forum'; } else { $_POST['type'] = 'thread'; } //Benachrichtigung if (in_array($_POST['subscription'], array('none', 'instant', 'daily', 'weekly'))) { $_POST['notification'] = $_POST['subscription']; } else { $_POST['notification'] = 'none'; } $_POST['userid'] = $user->info['userid']; $_POST['source'] = $_POST['id']; //Duplikate vermeiden list($duplicate) = $db->first("SELECT id FROM " . PRE . "_forum_subscriptions WHERE ( type='" . addslashes($_POST['type']) . "' AND source='" . $_REQUEST['id'] . "' AND userid='" . $user->info['userid'] . "' ) LIMIT 1"); if (!$duplicate) { $db->dinsert(PRE . '_forum_subscriptions', 'userid,type,source,notification'); } message($apx->lang->get('MSG_SUBADD_OK'), mklink('user.php?action=subscriptions', 'user,subscriptions.html')); } else { require_once BASEDIR . getmodulepath('forum') . 'basics.php'; //Titel auslesen if ($_REQUEST['option'] == 'addforum') { list($title) = $db->first("SELECT title FROM " . PRE . "_forums WHERE forumid='" . $_REQUEST['id'] . "' LIMIT 1"); } else { list($prefix, $title) = $db->first("SELECT prefix,title FROM " . PRE . "_forum_threads WHERE threadid='" . $_REQUEST['id'] . "' LIMIT 1"); $title = trim(compatible_hsc(strip_tags(forum_get_prefix($prefix) . ' ') . $title)); } $input = array('ID' => $_REQUEST['id'], 'TITLE' => $title, 'OPTION' => $_REQUEST['option']); tmessage('subscription_add', $input); }
$apx->tmpl->assign('RIGHT_POST', forum_access_post($foruminfo, $threadinfo)); $apx->tmpl->assign('RIGHT_DELTHREAD', forum_access_delthread($foruminfo, $threadinfo)); $apx->tmpl->assign('POSTSPERPAGE', $user->info['forum_ppp']); $apx->tmpl->assign('HASH', md5(microtime())); //Aktivität forum_activity('forum', $foruminfo['forumid']); forum_activity('thread', $threadinfo['threadid']); list($userCount, $guestCount, $activelist) = forum_get_activity('thread', $threadinfo['threadid'], $foruminfo['moderator']); $apx->tmpl->assign('ACTIVITY_USERS', $userCount); $apx->tmpl->assign('ACTIVITY_GUESTS', $userCount); $apx->tmpl->assign('ACTIVITY', $activelist); $apx->tmpl->assign('LOGGED_IS_ADMIN', iif($user->info['gtype'] == 'admin', 1, 0)); $apx->tmpl->assign('LOGGED_IS_MODERATOR', iif(in_array($user->info['userid'], $foruminfo['moderator']), 1, 0)); //Spezielles Template für Druckansicht if ($_REQUEST['print']) { $apx->tmpl->parse('thread_print'); } else { $apx->tmpl->parse('thread'); } //////////////////////////////////////////////////////////////////////////////////////////////////////// $apx->tmpl->assign_static('STYLESHEET', compatible_hsc($foruminfo['stylesheet'])); $apx->tmpl->assign('PATH', forum_path($foruminfo, 1)); $apx->tmpl->assign('PATHEND', iif($threadinfo['sticky'], replace($threadinfo['sticky_text']) . ': ') . iif($threadinfo['prefix'], '<span class="thread_prefix">' . forum_get_prefix($threadinfo['prefix']) . '</span> ') . replace($threadinfo['title'])); $apx->tmpl->assign('PATHEND_LINK', $threadlink); titlebar($threadinfo['title']); //////////////////////////////////////////////////////////////////////////////////////////////////////// require 'lib/_end.php'; /////////////////////////////////////////////////////////////////////////// require '../lib/_end.php'; //////////////////////////////////////////////////////// SCRIPT BEENDEN /// ////////////////////////////////////////////////////////////////////////////////////////////////////////
$lastview = max(array($user->info['forum_lastonline'], thread_readtime($res['threadid']), forum_readtime($foruminfo['forumid']))); //Verschoben if ($res['moved']) { $res['threadid'] = $res['moved']; } //Link $link = mkrellink('thread.php?id=' . $res['threadid'], 'thread,' . $res['threadid'] . ',1' . urlformat($res['title']) . '.html'); //Icon if ($res['icon'] != -1 && isset($set['forum']['icons'][(int) $res['icon']])) { $icon = $set['forum']['icons'][(int) $res['icon']]['file']; } else { $icon = ''; } $pre['ID'] = $res['threadid']; $pre['TITLE'] = replace($res['title']); $pre['PREFIX'] = forum_get_prefix($res['prefix']); $pre['LINK'] = $link; $pre['ICON'] = $icon; $pre['OPENER_USERID'] = $res['opener_userid']; $pre['OPENER_USERNAME'] = replace($res['opener']); $pre['OPENTIME'] = $res['opentime']; $pre['LASTPOST_USERID'] = $res['lastposter_userid']; $pre['LASTPOST_USERNAME'] = replace($res['lastposter']); $pre['LASTPOST_TIME'] = $res['lastposttime']; $pre['LASTPOST_LINK'] = 'thread.php?id=' . $res['threadid'] . '&goto=lastpost'; $pre['LINK_UNREAD'] = 'thread.php?id=' . $res['threadid'] . '&goto=firstunread'; $pre['STICKY'] = replace($res['sticky_text']); $pre['POSTS'] = number_format($res['posts'] - 1, 0, '', '.'); $pre['VIEWS'] = number_format($res['views'], 0, '', '.'); $pre['HOT'] = iif($res['posts'] >= $set['forum']['hot_posts'] || $res['views'] >= $set['forum']['hot_views'], 1, 0); $pre['MOVED'] = $res['moved'];