<?php
# Copyright by: Manuel
# Support: www.ilch.de
defined (
'main'
)
or
die
(
'no direct access'
);
require_once
(
'include/contents/ilchbb_forum/ilchbb_loader.php'
);
# check ob ein fehler aufgetreten ist.
check_forum_failure(
$forum_failure
);
if
(
$menu
->get(3) ==
'firstnew'
) {
$check
=
$ilchBB
->checkNewTopics(
$fid
,
$tid
);
if
(
$check
== TRUE) {
list(
$page
,
$post
) =
$ilchBB
->newestPostPage(
$fid
,
$tid
,
$allgAr
[
'Fpanz'
]);
header(
'Location: index.php?forum-showposts-'
.
$tid
.
'-p'
.
$page
.
'#'
.
$post
);
exit
;
}
}
if
(
$menu
->get(2) ==
'reportpost'
AND isset(
$_POST
[
'tid'
]) AND isset(
$_POST
[
'pid'
]) AND isset(
$_POST
[
'page'
]) AND isset(
$_POST
[
'grounds'
])) {
if
(!loggedin()) {
echo
'Du musst eingeloggt sein, um einen Beitrag zu melden.'
;
exit
;
}
$Ptid
= escape(
$_POST
[
'tid'
],
'integer'
);
$Ppid
= escape(
$_POST
[
'pid'
],
'integer'
);
$Ppage
= escape(
$_POST
[
'page'
],
'integer'
);
$grounds
= utf8_decode((
$_POST
[
'grounds'
]));
if
(!
is_numeric
(
$Ptid
) OR !
is_numeric
(
$Ppid
) OR
empty
(
$grounds
)) {
echo
'Bitte alle Felder ausfuellen!'
;
exit
;
}
$link
=
$_SERVER
[
"HTTP_HOST"
].
$_SERVER
[
"SCRIPT_NAME"
].
'?forum-showposts-'
.
$Ptid
.
'-p'
.
$Ppage
.
'#'
.
$Ppid
;
$txt
= escape(
"[b]Grund der Meldung[/b]\n"
.
$grounds
.
"\n\n[b]Beitrag[/b]\n[url]"
.
$link
.
"[/url]"
,
'textarea'
);
sendpm(
$_SESSION
[
'authid'
], 1,
'Gemeldeter Beitrag'
,
$txt
);
echo
'Vielen Dank fuer den Hinweis. Dieser wird umgehend bearbeitet.'
;
exit
;
}
if
(
$menu
->get(2) ==
'ratepost'
AND isset(
$_POST
[
'pid'
]) AND
$allgAr
[
'ilchbb_forum_ratepost'
] == 1) {
if
(!loggedin()) {
echo
'Du musst eingeloggt sein, um einen Beitrag gut zu finden.'
;
exit
;
}
if
(!isset(
$_SESSION
[
'ilchbb_ratetime'
]))
$_SESSION
[
'ilchbb_ratetime'
] = 0;
if
(
$_SESSION
[
'ilchbb_ratetime'
]+
$allgAr
[
'ilchbb_forum_ratetime'
] >= time()) {
echo
'Du bewertes die Beitraege zu schnell. Bitte beurteile die Beitraege bedacht.'
;
exit
;
}
$Ppid
= escape(
$_POST
[
'pid'
],
'integer'
);
if
(!
is_numeric
(
$Ppid
)) {
echo
'Hoppla. Da lief etwas schief!'
;
exit
;
}
$query
= db_query(
'SELECT `erstid`, `ilchbb_rate` FROM `prefix_posts` WHERE `id` = '
.
$Ppid
);
$result
= db_fetch_assoc(
$query
);
if
(
$result
[
'erstid'
] ==
$_SESSION
[
'authid'
]) {
echo
'Du kannst deine eigenen Beitraege leider nicht beurteilen.'
;
exit
;
}
$ilchbb_rate
= unserialize(
$result
[
'ilchbb_rate'
]);
if
(!
is_array
(
$ilchbb_rate
))
$ilchbb_rate
=
array
();
if
(isset(
$ilchbb_rate
[
$_SESSION
[
'authid'
]])) {
$time
=
$ilchbb_rate
[
$_SESSION
[
'authid'
]];
echo
'Diese Aktion hast du bereits am '
.
date
(
'd.m.Y'
,
$time
).
' durchgefuehrt.'
;
exit
;
}
$ilchbb_rate
[
$_SESSION
[
'authid'
]] = time();
$ilchbb_rate
= escape(serialize(
$ilchbb_rate
),
'string'
);
db_query(
'UPDATE `prefix_posts` SET `ilchbb_rate` = "'
.
$ilchbb_rate
.
'" WHERE `id` = '
.
$Ppid
);
$_SESSION
[
'ilchbb_ratetime'
] = time();
exit
;
}
$title
=
$allgAr
[
'title'
].
' :: Forum :: '
.
$aktTopicRow
[
'name'
].
' :: Beiträge zeigen'
;
$hmenu
=
$extented_forum_menu
.
'<a class="smalfont" href="index.php?forum">Forum</a><b> » </b>'
.aktForumCats(
$aktForumRow
[
'kat'
]).
'<b> » </b><a class="smalfont" href="index.php?forum-showtopics-'
.
$fid
.
'">'
.
$aktForumRow
[
'name'
].
'</a><b> » </b>'
;
$hmenu
.=
$aktTopicRow
[
'name'
].
$extented_forum_menu_sufix
;
$design
=
new
design (
$title
,
$hmenu
, 1);
$design
->header();
$ilchbb_tpl
=
new
tpl(
'ilchbb_forum/load_extensions'
);
$ilchbb_tpl
->out(0);
# Topic Hits werden eins hochgesetzt.
db_query(
'UPDATE `prefix_topics` SET hit = hit + 1 WHERE id = "'
.
$tid
.
'"'
);
# mehrere seiten fals gefordert
$limit
=
$allgAr
[
'Fpanz'
];
$page
= (
$menu
->getA(3) ==
'p'
?
$menu
->getE(3) : 1 );
$MPL
= db_make_sites (
$page
,
"WHERE tid = "
.
$tid
,
$limit
,
'index.php?forum-showposts-'
.
$tid
,
'posts'
);
$anfang
= (
$page
- 1) *
$limit
;
$antworten
=
''
;
if
((
$aktTopicRow
[
'stat'
] == 1 AND
$forum_rights
[
'reply'
] == TRUE) OR (
$_SESSION
[
'authright'
] <=
'-7'
OR
$forum_rights
[
'mods'
] == TRUE)) {
$antworten
=
'<div class="button_post_new" style="float: left;"><a href="index.php?forum-newpost-'
.
$tid
.
'"></a></div>'
;
}
$class
=
'Cmite'
;
$tpl
=
new
tpl (
'ilchbb_forum/showpost'
);
$ar
=
array
(
'SITELINK'
=>
$MPL
,
'tid'
=>
$tid
,
'ANTWORTEN'
=>
$antworten
,
'TOPICNAME'
=>
$aktTopicRow
[
'name'
],
'page'
=>
$page
);
$tpl
->set_ar_out(
$ar
,0);
$i
=
$anfang
+1;
$ges_ar
=
array
(
'wurstegal'
,
'maennlich'
,
'weiblich'
);
$erg
= db_query("SELECT `a`.`id`, `a`.`txt`, `a`.`time`, `a`.`erstid`, `a`.`erst`,
`a`.`ilchbb_rate`, `b`.`geschlecht`, `b`.`sig`, `b`.`avatar`,
`b`.`posts`, `b`.`icq`, `b`.`homepage`, `b`.`opt_mail`,
`b`.`opt_pm`, `b`.`regist`, `b`.`wohnort`, `b`.`msn`, `b`.`yahoo`
FROM `prefix_posts` AS `a`
LEFT JOIN `prefix_user` AS `b` ON `a`.`erstid` = `b`.`id`
WHERE `a`.`tid` =
".$tid."
ORDER BY `a`.`time` LIMIT
".$anfang."
,".
$limit
);
while
(
$row
= db_fetch_assoc(
$erg
)) {
$class
= (
$class
==
'Cnorm'
?
'Cmite'
:
'Cnorm'
);
$new
=
$ilchBB
->checkPostTime(
$fid
,
$tid
,
$row
[
'time'
]);
if
(
$new
=== TRUE) {
$row
[
'STATUS_SRC'
] =
'_unread'
;
$row
[
'STATUS_TITLE'
] =
'Neuer Beitrag'
;
}
else
{
$row
[
'STATUS_SRC'
] =
''
;
$row
[
'STATUS_TITLE'
] =
'Beitrag'
;
}
$row
[
'rate_allow'
] =
$allgAr
[
'ilchbb_forum_ratepost'
];
if
(
$row
[
'rate_allow'
] == 1) {
$rate_ar
= unserialize(
$row
[
'ilchbb_rate'
]);
if
(
is_array
(
$rate_ar
)) {
$row
[
'rate'
] =
count
(
$rate_ar
);
}
else
{
$row
[
'rate'
] = 0;
}
}
if
(
$row
[
'posts'
] != 0) {
$query
=
"SELECT * FROM prefix_online where uid = "
.
$row
[
'erstid'
];
$result
= db_query(
$query
);
if
(db_num_rows(
$result
) > 0) {
$row
[
'online'
] =
' <img src="include/images/ilchbb_forum/icon_online.gif" border="0">'
;
}
else
{
$row
[
'online'
] =
' <img src="include/images/ilchbb_forum/icon_offline.gif" border="0">'
;
}
}
else
{
$row
[
'online'
] =
''
;
}
if
(
$row
[
'posts'
] != 0) {
$row
[
'details'
] =
'Registriert: '
.
date
(
'd.m.Y'
,
$row
[
'regist'
]);
}
else
{
$row
[
'details'
] =
''
;
}
if
(!
empty
(
$row
[
'wohnort'
]) AND
$row
[
'posts'
] != 0) {
$row
[
'details'
] .=
'<br />Wohnort: '
.
$row
[
'wohnort'
];
}
if
(loggedin()) {
$row
[
'report'
] =
'<a href="javascript:void(0);" onClick="reportPost('
.
$tid
.
','
.
$row
[
'id'
].
','
.
$page
.
');" title="Melden" class="icon post_report" id="report_'
.
$row
[
'id'
].
'"></a>'
;
}
else
{
$row
[
'report'
] =
''
;
}
if
((
$aktTopicRow
[
'stat'
] == 1 AND
$forum_rights
[
'reply'
] == TRUE) OR (
$_SESSION
[
'authright'
] <=
'-7'
OR
$forum_rights
[
'mods'
] == TRUE)) {
$row
[
'quote'
] =
'<a href="index.php?forum-newpost-'
.
$tid
.
'-z'
.
$row
[
'id'
].
'" title="Zitieren" class="icon post_quote"></a>'
;
}
else
{
$row
[
'quote'
] =
''
;
}
if
(
$row
[
'msn'
] !=
''
AND
$row
[
'posts'
] != 0) {
$row
[
'msn'
] = urlencode(
$row
[
'msn'
]);
$row
[
'msn'
] =
'<a href="http://members.msn.com/?mem='
.
$row
[
'msn'
].
'&submit=&lang=de" title="MSN Profil" class="icon contact_msn"></a> '
;
}
else
{
$row
[
'msn'
] =
''
;
}
if
(
$row
[
'yahoo'
] !=
''
AND
$row
[
'posts'
] != 0) {
$row
[
'yahoo'
] = urlencode(
$row
[
'yahoo'
]);
}
else
{
$row
[
'yahoo'
] =
''
;
}
if
(
$row
[
'posts'
] != 0) {
$row
[
'icq'
] =
str_replace
(
"-"
,
""
,
$row
[
'icq'
]);
$row
[
'icq'
] =
str_replace
(
"."
,
""
,
$row
[
'icq'
]);
$row
[
'icq'
] =
str_replace
(
" "
,
""
,
$row
[
'icq'
]);
if
(
is_numeric
(
$row
[
'icq'
])) {
}
}
else
{
$row
[
'icq'
] =
''
;
}
if
(
$row
[
'homepage'
] !=
''
AND
$row
[
'posts'
] != 0) {
$row
[
'www'
] =
'<a href="'
.
$row
[
'homepage'
].
'" title="Homepage" target="_blank" class="icon contact_www"></a> '
;
}
else
{
$row
[
'www'
] =
''
;
}
if
(
$row
[
'opt_pm'
] ==
'1'
) {
$row
[
'pm'
] =
'<a href="index.php?forum-privmsg-new=0&empfid='
.
$row
[
'erstid'
].
'" title="Nachricht schreiben" class="icon contact_pm"></a> '
;
}
else
{
$row
[
'pm'
] =
''
;
}
if
(
$row
[
'opt_mail'
] ==
'1'
) {
$row
[
'email'
] =
'<a href="?user-mail-'
.
$row
[
'erstid'
].
'" title="E-Mail" class="icon contact_email"></a> '
;
}
else
{
$row
[
'email'
] =
''
;
}
# define some vars.
$row
[
'sig'
] = (
empty
(
$row
[
'sig'
]) ?
''
:
'<br /><hr style="width: 50%;" align="left">'
.bbcode(
$row
[
'sig'
]) );
$row
[
'TID'
] =
$tid
;
$row
[
'class'
] =
$class
;
$row
[
'date'
] =
date
(
'd.m.Y - H:i:s'
,
$row
[
'time'
] );
$row
[
'delete'
] =
''
;
$row
[
'change'
] =
''
;
if
(!
is_numeric
(
$row
[
'geschlecht'
])) {
$row
[
'geschlecht'
] = 0;
}
if
(
file_exists
(
$row
[
'avatar'
])) {
$row
[
'avatar'
] =
'<br /><br /><img src="'
.
$row
[
'avatar'
].
'" alt="User Pic" border="0" /><br />'
;
}
elseif
(
$allgAr
[
'forum_default_avatar'
]) {
$row
[
'avatar'
] =
'<br /><br /><img src="include/images/avatars/'
.
$ges_ar
[
$row
[
'geschlecht'
]].
'.jpg" alt="User Pic" border="0" /><br />'
;
}
else
{
$row
[
'avatar'
] =
''
;
}
$row
[
'rang'
] = userrang (
$row
[
'posts'
],
$row
[
'erstid'
]);
if
(
$row
[
'time'
] <= 1439739471) {
$row
[
'txt'
] = bbcode(
$row
[
'txt'
]); ## <= 01.08.2015
}
else
{
$row
[
'txt'
] = html_entity_decode(
$row
[
'txt'
], ILCH_ENTITIES_FLAGS, ILCH_CHARSET);
}
$row
[
'txt'
] = (isset(
$_GET
[
'such'
]) ? markword(
$row
[
'txt'
],
$_GET
[
'such'
]) :
$row
[
'txt'
]);
$row
[
'i'
] =
$i
;
$row
[
'page'
] =
$page
;
if
(
$row
[
'posts'
] != 0 ) {
$row
[
'erst'
] =
'<a href="index.php?user-details-'
.
$row
[
'erstid'
].
'"><b>'
.
$row
[
'erst'
].
'</b></a>'
;
}
elseif
(
$row
[
'erstid'
] != 0 ) {
$row
[
'rang'
] =
'gelöschter User'
;
}
if
(
$forum_rights
[
'mods'
] == true AND
$i
> 1) {
$row
[
'delete'
] =
'<a href="index.php?forum-delpost-'
.
$tid
.
'-'
.
$row
[
'id'
].
'" title="Löschen" class="icon post_delete"></a>'
;
}
if
((
$forum_rights
[
'mods'
] == true OR
$row
[
'erstid'
] ==
$_SESSION
[
'authid'
]) AND loggedin()) {
$row
[
'change'
] =
'<a href="index.php?forum-editpost-'
.
$tid
.
'-'
.
$row
[
'id'
].
'-'
.
$i
.
'" title="Bearbeiten" class="icon post_edit"></a>'
;
}
$row
[
'posts'
] = (
$row
[
'posts'
]?
'Beiträge: '
.
$row
[
'posts'
]:
''
).
'<br />'
;
$row
[
'team'
] = db_result(db_query("SELECT a.name
FROM prefix_groups AS a
LEFT JOIN prefix_groupusers AS b
ON a.id = b.gid WHERE b.uid = ".
$row
[
'erstid'
]));
$tpl
->set_ar_out(
$row
,1);
$i
++;
}
$tpl
->set_ar_out(
array
(
'SITELINK'
=>
$MPL
,
'ANTWORTEN'
=>
$antworten
) , 2 );
if
(loggedin()) {
if
(((
$aktTopicRow
[
'stat'
] == 1 AND
$forum_rights
[
'reply'
] == TRUE) OR (
$_SESSION
[
'authright'
] <=
'-7'
OR
$forum_rights
[
'mods'
] == TRUE))
AND
$allgAr
[
'ilchbb_forum_qpost'
] == 1 AND loggedin() AND
is_numeric
(
$allgAr
[
'antispam'
]) AND has_right(
$allgAr
[
'antispam'
])) {
$tpl
->out(4);
}
if
(
$menu
->get(3) ==
'topicalert'
) {
if
(1 == db_result(db_query(
"SELECT COUNT(*) FROM prefix_topic_alerts WHERE uid = "
.
$_SESSION
[
'authid'
].
" AND tid = "
.
$tid
),0)) {
db_query(
"DELETE FROM prefix_topic_alerts WHERE uid = "
.
$_SESSION
[
'authid'
].
" AND tid = "
.
$tid
);
}
else
{
db_query(
"INSERT INTO prefix_topic_alerts (tid,uid) VALUES ("
.
$tid
.
", "
.
$_SESSION
[
'authid'
].
")"
);
}
}
if
(1 == db_result(db_query(
"SELECT COUNT(*) FROM prefix_topic_alerts WHERE uid = "
.
$_SESSION
[
'authid'
] .
" AND tid = "
.
$tid
), 0)) {
echo
'<div class="forum ui-corner-all" style="background-color: #DCDDE2; text-align: center;"><a href="index.php?forum-showposts-'
.
$tid
.
'-topicalert">'
.
$lang
[
'nomailonreply'
] .
'</a></div>'
;
}
else
{
echo
'<div class="forum ui-corner-all" style="background-color: #DCDDE2; text-align: center;"><a href="index.php?forum-showposts-'
.
$tid
.
'-topicalert">'
.
$lang
[
'mailonreply'
] .
'</a></div>'
;
}
$ilchBB
->deleteNewTopics(
$fid
,
$tid
);
}
if
(
$forum_rights
[
'mods'
] == TRUE ) {
$tpl
->set (
'status'
, (
$aktTopicRow
[
'stat'
] == 1 ?
$lang
[
'close'
] :
$lang
[
'open'
] ) );
$tpl
->set (
'festnorm'
, (
$aktTopicRow
[
'art'
] == 0 ?
$lang
[
'fixedtopic'
] :
$lang
[
'normaltopic'
] ) );
$tpl
->set(
'tid'
,
$tid
);
$tpl
->out(3);
}
$ilchbb_tpl
->out(1);
$design
->footer();
?>