FORUM."images/admin_comment.png",
"bullet" => FORUM."images/bullet.gif",
"email" => FORUM."images/email.gif",
"folder_open" => FORUM."images/folder_open.png",
"icq" => FORUM."images/icq.gif",
"menu_open" => FORUM."images/menu_open.gif",
"member" => FORUM."images/member.gif",
"messages" => FORUM."images/message.gif",
"new_post" => FORUM."images/new_post.gif",
"newpost" => FORUM."images/newpost.gif",
"new_day" => FORUM."images/new_day.gif",
"no_attach" => FORUM."images/attach.png",
"no_avatar" => FORUM."images/no_avatar.gif",
"poll" => FORUM."images/poll.gif",
"privatmsg" => FORUM."images/priv.png",
"quickreply" => FORUM."images/quickreply.png",
"quickquote" => FORUM."images/quickquote.gif",
"report" => FORUM."images/report.gif",
"rss" => FORUM."images/rss.png",
"send_email" => FORUM."images/email.png",
"sub_forum" => FORUM."images/sub_forum.gif",
"subforum" => FORUM."images/subforum.png",
"thanks" => FORUM."images/thanks.gif",
"up" => FORUM."images/up.png",
"view_attach" => FORUM."images/attach.gif"
);
$forum_images = array_merge($forum_images);
// Functions
function get_forum_image($image, $alt = "", $style = "", $title = "", $atts = "") {
global $forum_images;
if (isset($forum_images[$image])) {
$url = $forum_images[$image];
} else {
$url = FORUM."images/error.png";
}
if (!$alt && !$style && !$title) {
return $url;
} else {
return "";
}
}
function nav_menu($page, $viewforum_id, $viewthread, $local=false) {
global $settings, $locale, $forum_settings, $userdata, $base_forum, $main_forum;
if (iMEMBER && (preg_match("/(post.php)/im", FUSION_REQUEST))) {
add_to_head("");
add_to_head("");
add_to_head("");
}
echo "
\n";
echo "\n";
echo "\n";
echo "";
if ($settings['enable_terms'] == 1) { echo ""; }
if (iMEMBER) {
echo "";
echo "";
echo "";
}
echo "";
echo " | \n";
echo " | \n";
if (!iMEMBER && $page != "error_massege") {
echo "\n";
echo "\n";
echo " | \n";
} else if (iMEMBER) {
$msg_new_count = dbcount("(message_id)", DB_MESSAGES, "message_to='".$userdata['user_id']."' AND message_read='0' AND message_folder='0'");
$msg_total_count = dbcount("(message_id)", DB_MESSAGES, "message_to='".$userdata['user_id']."' AND message_folder='0'");
echo "\n";
echo "\n";
echo "\n";
echo " \n";
echo "".$locale['PFN103'].showdate("longdate", $userdata['user_lastvisit'])." \n";
echo "".$locale['PFN104']."".$locale['PFN105'].$msg_new_count.$locale['PFN106'].$msg_total_count." | \n";
echo " \n";
echo " | \n";
}
echo "
\n";
/***************************************************************************/
if ($page != "main") {
if ($viewforum_id || $viewthread) {
if ($page == "viewthread") {
$result3 = dbarray(dbquery("SELECT forum_id FROM ".DB_THREADS." WHERE thread_id='".$viewthread."'"));
$view_id = $result3['forum_id'];
} else { $view_id = $viewforum_id;}
$result_n = dbquery(
"SELECT f.forum_name, f.forum_cat, sf.forum_cat AS cat, f.forum_id, sf.forum_id AS id, sf.forum_name AS main_forum, mf.forum_name AS base FROM ".DB_FORUMS." f
LEFT JOIN ".DB_FORUMS." sf ON sf.forum_id=f.forum_cat
LEFT JOIN ".DB_FORUMS." mf ON mf.forum_id=sf.forum_cat
WHERE f.forum_id='".$view_id."'"
);
$data_n = dbarray($result_n); $sub_forum = $data_n['forum_name'];
if ($data_n['cat'] == 0) {
$main_forum = " » ".$data_n['main_forum']."";
} elseif ($data_n['cat'] > 0) {
$main_forum = " » ".$data_n['main_forum'].""; }
if ($data_n['base'] != '') { $base_forum = " » ".$data_n['base']; } else { $base_forum = ""; }
}
if ($page == "viewthread" || $page == "viewforum") { $stile = "margin: 0.6em 0em 0em 0em;"; } else { $stile = "margin: 0.6em 0em;"; }
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo " | \n";
echo "".$local." | \n";
echo " \n";
echo " | \n";
echo "
\n";
if (($viewthread) && ($page != "viewthread") && ($page != "options")) {
$result_t = dbquery("SELECT thread_subject, thread_icon FROM ".DB_THREADS." WHERE thread_id='".$viewthread."' AND forum_id='".$viewforum_id."'");
$data_t = dbarray($result_t);
echo "\n";
}
}
}
function rating($thread_id) {
global $locale;
$wynik = dbquery("SELECT SUM(rating_vote) FROM ".DB_RATINGS." WHERE rating_type='B' AND rating_item_id='".$thread_id."'");
$info = dbresult($wynik,0);
$num_rating = dbcount("(rating_vote)", DB_RATINGS, "rating_type='B' AND rating_item_id='".$thread_id."'");
$wyn_rating = ($num_rating ? $info / $num_rating : 0);
if ($wyn_rating > 0) {
$text = "\n";
} else { $text = ""; }
return $text;
}
function show_warning($postid, $userid, $forumid, $thread_id){
global $locale;
$show_warning = "";
$num_warning = dbcount("(warnings)", DB_PREFIX."forum_warning", "warning_user='".$userid."'");
$times = $num_warning;
if(!$times) $times = 0;
$minus = $times - 1;
$add = $times + 1;
if ($times != 0 && iADMIN) {
$show_warning .= "";
}
$show_warning .= "";
if ($times != 5 && iADMIN) {
$show_warning .= "";
}
return $show_warning;
}
function show_medal($postid, $userid){
global $locale;
$resultm = dbquery("SELECT * FROM ".DB_PREFIX."forum_medals WHERE medal_user='".$userid."'");
if(dbrows($resultm)){
echo "
\n";
echo "
\n";
}
}
function rss_feeds($page, $name_forum, $name_thread) {
global $locale, $forum_settings;
if ($forum_settings['rss_feeds'] == "1") {
add_to_head("");
if ($page == "viewforum") {
add_to_head("");
} elseif ($page == "viewthread") {
add_to_head("");
}
}
}
function online_user($online_user_id, $online_user_level) {
global $forum_settings, $now_online, $num_online, $date_online;
$now_online = dbrows(dbquery("SELECT * FROM ".DB_ONLINE.""));
$online_records = explode(".",$forum_settings['online_record']);
$num_online = $online_records[0]; $date_online = $online_records[1];
if ($now_online > $num_online && $now_online != $num_online) {
$online_record = "".($now_online.".".time())."";
$result = dbquery("UPDATE ".DB_PREFIX."forum_settings SET forum_settings_value='".stripslashes($online_record)."' WHERE forum_settings_name='online_record'");//
}
}
function user_color($userid=false) {
global $forum_settings;
if ($userid != 0 || $userid == true) {
$data_u = dbarray(dbquery("SELECT us.user_groups, us.user_level, us.user_status FROM ".DB_USERS." us WHERE us.user_id = ".$userid.""));
$pff_user_status = $data_u['user_status'];
$group = explode(".",$data_u['user_groups']);
foreach ($group as $number_group) { $group_id = $number_group; }
$user_colors = explode("|",$forum_settings['user_colors']);
$color_sadmin = $user_colors[0]; $color_admin = $user_colors[1]; $color_member = $user_colors[2]; $color_bmember = $user_colors[3];
if ($group_id && $pff_user_status == 0) {
$result_c = dbquery("SELECT group_color FROM ".DB_USER_GROUPS." WHERE group_id = ".$group_id."");
while ($data_c = dbarray($result_c)) { return "#".$data_c['group_color']; }
}
elseif ($data_u['user_level'] == 101 && !$group_id && $pff_user_status == 0) { return "#".$color_member; }
elseif ($data_u['user_level'] == 102 && $pff_user_status == 0) { return "#".$color_admin; }
elseif ($data_u['user_level'] == 103 && $pff_user_status == 0) { return "#".$color_sadmin; }
elseif ($pff_user_status == 1) { return "#".$color_bmember; }
} else { return "#000000";}
}
function show_user_thanks($post_id) {
global $locale, $userdata;
$result2 = dbquery("SELECT t1.user_id, t2.user_name, t1.thanks_datestamp FROM ".DB_PREFIX."forum_thanks AS t1
JOIN ".DB_USERS." AS t2 USING (user_id) WHERE post_id='".$post_id."' ORDER BY thanks_id");
$thanks = dbrows($result2);
if ($thanks != 0) {
echo "\n";
echo "".$locale['THNK_01']."{$thanks}".$locale['THNK_02']." ".$locale['THNK_03']." | \n";
echo "\n";
$tcount = 0;
while($data2 = dbarray($result2)) {
if ($userdata['user_id'] == $data2['user_id']) { $dele_thx = " "; } else { $dele_thx = ""; }
echo ($tcount != 0 ? ",\n " : "")."".$data2['user_name']." (".date("d.m.Y", $data2['thanks_datestamp']).")".$dele_thx;
$tcount ++;
}
echo " | \n
\n
\n"; }
}
function OptionsThread($thread_id, $forum_id) {
global $locale, $settings, $userdata;
echo "\n";
echo "
\n";
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
echo "
\n";
echo "
\n";
}
function write_in_log($event,$error=false) {
global $userdata;
if ($userdata['user_name']) { $name = $userdata['user_name']; } else { $name = "Unspecified"; }
$date = date("d.m.Y H:i:s", time());
$ip = USER_IP;
$text = "".$date." | ".$ip." | ".$name." | ".$event."\r\n";
$filename = FORUM."logs/event_log.txt";
if (is_writeable($filename)) {
$fh = fopen($filename, "a+");
flock($fh, LOCK_EX);
fputs($fh, $text);
fflush($fh);
flock($fh, LOCK_UN);
fclose($fh);
}
}
?>