Sylvia - System Ostrzeżeń (sylvia)
|
Creeper |
Dodany dnia 26.10.2012 19:07:19
|
Początkujący
Postów: 290 Pomógł: 45
v7.02.06 Data rejestracji: 24.10.2011 14:51
|
Sylvia to system ostrzeżeń dla PHP-Fusion. Ma dwa typy ostrzeżeń - liczbowy oraz procentowy. Pierwszy typ to zliczanie na zasadzie ilości ostrzeżeń, a drugi na zasadzie procentowej (np. Ostrzeżenie pierwsze: 10%, Ostrzeżenie drugie: 5%, Razem: 15%).
W systemie można definiować blokady i dodawać je do odpowiednich miejsc na stronie. Domyślnie są trzy blokady - na Forum, Shoutbox'a i Komentarze. System wymaga modyfikacji tylko jednego pliku, reszta działa automatycznie. Ilość ostrzeżeń jest wyświetlana na Forum oraz w Profilu (po dodaniu pola).
Po osiągnięciu pewnej liczby ostrzeżeń (lub 100% w przypadku procentowego typu) użytkownik może zostać zablokowany czasowo lub na stałe (zależy od ustawień).
Wersja: 1.0.2
Autor: Yodix
Wersja PHP-Fusion: Testowano na v7.02.05, ale powinno działać na wszystkich z serii v7.02
Wtyczka ma też możliwość połączenia z PointX. Dzięki temu za każde dodane ostrzeżenie można odbierać określoną ilość punktów. Wymagana wersja PointX to 2.0.2 lub nowsza.
Instalacja została opisana w pliku ReadmePL.html. Dostępna jest wersja angielska.
Paczka o nazwie v7_02_05-sylvia-1_0_2_fixed.zip zawiera poprawkę błędu, który może się pojawiać jeżeli na stronie nie jest zainstalowany PointX.
Screeny:
PW od moderatora:
- Odświeżenie tematu - khaman 06.12.2012 22:43
Creeper dodał/a następującą pliki:
Edytowane przez Creeper dnia 06.01.2013 10:53:37
|
|
|
|
Wścibski Gość |
Dodany dnia 25.11.2024 02:20:03
|
Pan Kontekstualny
Postów: n^x
Data rejestracji: Zawsze
|
|
IP: localhost |
|
|
piterus |
Dodany dnia 26.10.2012 22:30:12
|
Bywalec
Postów: 490 Pomógł: 33
v7.02.07 Data rejestracji: 19.12.2005 09:29
|
Coś nie mam szczęścia ostatnio do wtyczek Yodixa. :( Przy wejściu w profil użytkownika, po uprzednim włączeniu tego pola w profilu, serwer na którym stoi Akademia częstuje mnie błędem o numerku 500. Natomiast kopia na localhoście Fatal error: Call to a member function setInitializer() on a non-object in C:\WebServ\httpd\infusions\sylvia\sylvia_core.php on line 95 .
Piterus World mój blog i miejsce moich eksperymentów. Ubi lex, ibi poena Kontakt przez komunikatory tylko dla znajomych...
|
|
|
|
Creeper |
Dodany dnia 26.10.2012 22:50:17
|
Początkujący
Postów: 290 Pomógł: 45
v7.02.06 Data rejestracji: 24.10.2011 14:51
|
Co do Błędu o numerze 500 nie wiem jak temu zaradzić, ale na localhost akurat znam przyczynę. Jeżeli używasz WebServ to ten błąd (nie wiadomo z jakiej przyczyny, ja obstawiam wersję PHP) się pojawia. Spróbuj na XAMPP. Ja testowałem właśnie na nim i na Nazwa.pl - wszystko działa jak trzeba.
Dla pewności sprawdziłem archiwum i był problem ze ścieżkami do plików językowych. Teraz w wgraj i sprawdź, czy jest ten Error 500. |
|
|
|
bartek124 |
Dodany dnia 27.10.2012 14:53:16
|
Weteran
Postów: 3264 Pomógł: 236
v7.02.06 Data rejestracji: 26.05.2007 12:25
|
Błąd 500 pojawia się w przypadku, gdy na stronie wystąpi błąd, a wyświetlanie ich jest wyłączone
Nie pomagam na komunikatorach oraz PW!
|
|
|
|
adams1692 |
Dodany dnia 28.10.2012 11:27:34
|
Początkujący
Postów: 105 Ostrzeżeń: 2
v7.02.07 Data rejestracji: 05.12.2008 17:27
|
Wtyczka działa bardzo dobrze jednak brakuje mi wysyłania wiadomości do osoby która otrzymuje ostrzeżenie.
|
|
|
|
BigLebowski |
Dodany dnia 08.11.2012 22:08:46
|
Przedszkolak
Postów: 58 Ostrzeżeń: 2
v7.02.05 Data rejestracji: 16.08.2012 14:24
|
Trochę Yodix przesadził z menu głównym wtyczki, ale poza tym jest bardzo solidna i działa bez zarzutu z PointX.
Swoją drogą jeżeli byłaby taka możliwość to up do posta kolegi powyżej, przydało by się coś takiego.
#Edit 9.11.12
Userfield się nie wyświetla dla niezalogowanych !
Jeżeli możesz to zgłosić, to proszę.
Edytowane przez BigLebowski dnia 09.11.2012 14:39:43
|
|
|
|
krystian1988 |
Dodany dnia 10.11.2012 08:40:54
|
Zaawansowany
Postów: 1187 Pomógł: 100
v7.02.07 Data rejestracji: 07.05.2009 17:37
|
Rangi na forum zamienia. Adminów rang graficznych nie pokazuje Administratorom, a daje post niżej czyli zwykłemu użytkownikowi.
BRAK STOPKI = BRAK POMOCY NA SUPPORCIE.PRZECZYTAJ:
Regulamin Supportu Nie pomagam na PW!!!
|
|
|
|
BigLebowski |
Dodany dnia 12.11.2012 18:43:24
|
Przedszkolak
Postów: 58 Ostrzeżeń: 2
v7.02.05 Data rejestracji: 16.08.2012 14:24
|
Creeper, zgłosisz to? |
|
|
|
Creeper |
Dodany dnia 12.11.2012 19:07:58
|
Początkujący
Postów: 290 Pomógł: 45
v7.02.06 Data rejestracji: 24.10.2011 14:51
|
Zgłoszone. Nowa wersja jest w trakcie tworzenia i będzie prawdopodobnie w Weekend. Kilka rzeczy zostało dodanych np. Zgłoszenia zdefiniowane oraz wysyłanie PW po otrzymaniu ostrzeżenia. |
|
|
|
BigLebowski |
Dodany dnia 17.11.2012 23:12:07
|
Przedszkolak
Postów: 58 Ostrzeżeń: 2
v7.02.05 Data rejestracji: 16.08.2012 14:24
|
Czekamy z niecierpliwością . |
|
|
|
Creeper |
Dodany dnia 18.11.2012 11:49:36
|
Początkujący
Postów: 290 Pomógł: 45
v7.02.06 Data rejestracji: 24.10.2011 14:51
|
Nowa wersja dodana w pierwszym poście. |
|
|
|
jozio_94 |
Dodany dnia 18.11.2012 14:08:45
|
Przedszkolak
Postów: 84 Pomógł: 7 Ostrzeżeń: 2
Data rejestracji: 15.02.2011 21:39
|
Wtyczka jest po prostu świetna :) Tego właśnie szukałem. Mam jednak mały problem. Mój plik viewthread.php jest lekko zmodyfikowany i nie wyświetla mi się liczba ostrzeżeń na forum. Domyślam się, że trzeba coś zmienić w pliku SylviaForumGenerator.class.php. Podaję mój viewthread.php:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| Filename: viewthread.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licen... Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../maincore.php";
require_once INCLUDES."forum_include.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."forum/main.php";
// subkategorie
if (file_exists(INFUSIONS."forum_subcats/locale/".$settings['locale'].".php")) {
include INFUSIONS."forum_subcats/locale/".$settings['locale'].".php";
} else {
include INFUSIONS."forum_subcats/locale/Polish.php";
}
require_once INFUSIONS."forum_subcats/class.ForumSubCats.php";
require_once INCLUDES."infusions_include.php";
$fsc_settings = get_settings("forum_subcats");
$subForumClass = new ForumSubCats();
$subForumClass->_subCatsEnabled = $fsc_settings['fsc_enabled'];
// ------------
$posts_per_page = 20;
add_to_title($locale['global_200'].$locale['400']);
if (!isset($_GET['thread_id']) || !isnum($_GET['thread_id'])) { redirect("index.php"); }
$result = dbquery(
"SELECT t.*, f.*, f2.forum_name AS forum_cat_name
FROM "
.DB_THREADS." t
LEFT JOIN "
.DB_FORUMS." f ON t.forum_id=f.forum_id
LEFT JOIN "
.DB_FORUMS." f2 ON f.forum_cat=f2.forum_id
WHERE t.thread_id='"
.$_GET['thread_id']."' AND t.thread_hidden='0'"
);
if (dbrows($result)) {
$fdata = dbarray($result);
if (!checkgroup($fdata['forum_access']) || !$fdata['forum_cat'] || $fdata['thread_hidden'] == "1") { redirect("index.php"); }
} else {
redirect("index.php");
}
if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
if (isset($_GET['pid']) && isnum($_GET['pid'])) {
$reply_count = dbcount("(post_id)", DB_POSTS, "thread_id='".$fdata['thread_id']."' AND post_id<='".$_GET['pid']."' AND post_hidden='0'");
if ($reply_count > $posts_per_page) { $_GET['rowstart'] = ((ceil($reply_count / $posts_per_page)-1) * $posts_per_page); }
}
if ($fdata['forum_post'] != 0 && checkgroup($fdata['forum_post'])) {
$can_post = true;
} else {
$can_post = false;
}
if ($fdata['forum_reply'] != 0 && checkgroup($fdata['forum_reply'])) {
$can_reply = true;
} else {
$can_reply = false;
}
if ($settings['forum_edit_lock'] == 1) {
$lock_edit = true;
} else {
$lock_edit = false;
}
//locale dependent forum buttons
if (is_array($fusion_images)) {
if ($settings['locale'] != "English") {
$newpath = "";
$oldpath = explode("/", $fusion_images['newthread']);
$c_path = count($oldpath);
for ($i = 0; $i < $c_path - 1; $i++) {
$newpath .= $oldpath[$i]."/";
}
if (is_dir($newpath.$settings['locale'])) {
redirect_img_dir($newpath, $newpath.$settings['locale']."/");
}
}
}
//javascript to footer
$highlight_js = ""; $colorbox_js = ""; $edit_reason_js = "";
// moderators
$mod_groups = explode(".", $fdata['forum_moderators']);
if (iSUPERADMIN) { define("iMOD", true); }
if (!defined("iMOD") && iMEMBER && $fdata['forum_moderators']) {
foreach ($mod_groups as $mod_group) {
if (!defined("iMOD") && checkgroup($mod_group)) { define("iMOD", true); }
}
}
if (!defined("iMOD")) { define("iMOD", false); }
if (iMOD && (((isset($_POST['delete_posts']) || isset($_POST['move_posts'])) && isset($_POST['delete_post'])) || isset($_GET['error']))) {
require_once FORUM."viewthread_options.php";
}
// polls
$poll_on_first_page_only = ($_GET['rowstart'] == 0) ? true : false;
$poll_there = false; $poll_data = false; $poll_options = 0;
$can_vote = false; $had_voted = false;
if ($fdata['thread_poll'] == "1") { // bug #1012
$poll_there = true;
if (iMEMBER) {
$presult = dbquery(
"SELECT tfp.forum_poll_title, tfp.forum_poll_votes, tfv.forum_vote_user_id FROM "
.DB_FORUM_POLLS." tfp
LEFT JOIN "
.DB_FORUM_POLL_VOTERS." tfv
ON tfp.thread_id=tfv.thread_id AND forum_vote_user_id='"
.$userdata['user_id'
]."'
WHERE tfp.thread_id='"
.$_GET['thread_id']."'"
);
} else {
$presult = dbquery(
"SELECT tfp.forum_poll_title, tfp.forum_poll_votes FROM "
.DB_FORUM_POLLS." tfp
WHERE tfp.thread_id='"
.$_GET['thread_id']."'"
);
}
if (dbrows($presult)) {
$poll_data = true;
$pdata = dbarray($presult);
if (isset($pdata['forum_vote_user_id'])) { $had_voted = true; }
$presult2 = dbquery("SELECT forum_poll_option_votes, forum_poll_option_text FROM ".DB_FORUM_POLL_OPTIONS." WHERE thread_id='".$_GET['thread_id']."' ORDER BY forum_poll_option_id ASC");
$poll_options = dbrows($presult2);
}
$can_vote = (!$had_voted && $fdata['forum_vote'] != 0 && checkgroup($fdata['forum_vote'])) ? true : false;
}
if (iMOD) { $can_vote = !$had_voted; }
if ($poll_there && $can_vote && !$had_voted && isset($_POST['cast_vote']) && (isset($_POST['poll_option']) && isnum($_POST['poll_option'])) && ($_POST['poll_option'] <= $poll_options)) { // bug #1012
$result = dbquery("UPDATE ".DB_FORUM_POLL_OPTIONS." SET forum_poll_option_votes=forum_poll_option_votes+1 WHERE thread_id='".$_GET['thread_id']."' AND forum_poll_option_id='".$_POST['poll_option']."'");
$result = dbquery("UPDATE ".DB_FORUM_POLLS." SET forum_poll_votes=forum_poll_votes+1 WHERE thread_id='".$_GET['thread_id']."'");
$result = dbquery("INSERT INTO ".DB_FORUM_POLL_VOTERS." (thread_id, forum_vote_user_id, forum_vote_user_ip, forum_vote_user_ip_type) VALUES ('".$_GET['thread_id']."', '".$userdata['user_id']."', '".USER_IP."', '".USER_IP_TYPE."')");
redirect(FUSION_SELF."?thread_id=".$_GET['thread_id']);
}
// user fields
$user_field = array("user_sig" => false, "user_web" => false);
if (iMEMBER) {
$thread_match = $fdata['thread_id']."\|".$fdata['thread_lastpost']."\|".$fdata['forum_id'];
if (($fdata['thread_lastpost'] > $lastvisited) && !preg_match("(^\.{$thread_match}$|\.{$thread_match}\.|\.{$thread_match}$)", $userdata['user_threads'])) {
$result = dbquery("UPDATE ".DB_USERS." SET user_threads='".$userdata['user_threads'].".".stripslashes($thread_match)."' WHERE user_id='".$userdata['user_id']."'");
}
if (isset($userdata['user_sig'])) { $user_field['user_sig'] = true; }
if (isset($userdata['user_web'])) { $user_field['user_web'] = true; }
} else {
$result = dbquery("SELECT field_name FROM ".DB_USER_FIELDS." WHERE field_name='user_sig' OR field_name='user_web'");
while ($data = dbarray($result)) {
$user_field[$data['field_name']] = true;
}
}
opentable($locale['500'].": ".$fdata['thread_subject']);
// breadcrumbs & subkategorie
$caption = $subForumClass->showCaption($fdata['forum_id'], $fdata['forum_cat_name'], $fdata['forum_name']);
echo "<!--pre_forum_thread--><div class='tbl2 forum_breadcrumbs' style='margin:0px 0px 4px 0px'><a href='index.php' id='top'>Index</a> » ".$caption."</div>\n";
// thread
list($rows, $last_post) = dbarraynum(dbquery(
"SELECT COUNT(post_id), MAX(post_id) FROM ".DB_POSTS." WHERE thread_id='".$_GET['thread_id']."' AND post_hidden='0' GROUP BY thread_id"));
if (($rows > $posts_per_page) || ($can_post || $can_reply)) {
echo "<table cellspacing='0' cellpadding='0' width='100%'>\n<tr>\n";
if ($rows > $posts_per_page) { echo "<td style='padding:4px 0px 4px 0px'>".makepagenav($_GET['rowstart'],$posts_per_page,$rows,3,FUSION_SELF."?thread_id=".$_GET['thread_id']."&")."</td>\n"; }
if (iMEMBER && $can_post) {
echo "<td align='right' style='padding:0px 0px 4px 0px'>\n<!--pre_forum_buttons-->\n";
if ($can_post) {
echo "<a href='post.php?action=newthread&forum_id=".$fdata['forum_id']."'>";
echo "<img src='".get_image("newthread")."' alt='".$locale['566']."' style='border:0px' /></a>\n";
}
if (!$fdata['thread_locked'] && $can_reply) {
echo "<a href='post.php?action=reply&forum_id=".$fdata['forum_id']."&thread_id=".$_GET['thread_id']."'>";
echo "<img src='".get_image("reply")."' alt='".$locale['565']."' style='border:0px' /></a>\n";
}
echo "</td>\n";
}
echo "</tr>\n</table>\n";
}
if ($rows != 0) {
dbquery("UPDATE ".DB_THREADS." SET thread_postcount='$rows', thread_lastpostid='$last_post', thread_views=thread_views+1 WHERE thread_id='".$_GET['thread_id']."'");
/* poll */
if ($poll_on_first_page_only && $poll_there && $poll_data) {
$i = 1;
if ($can_vote) { echo "<form name='voteform' method='post' action='".FUSION_SELF."?forum_id=".$fdata['forum_id']."&thread_id=".$_GET['thread_id']."'>\n"; }
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin-bottom:5px'>\n<tr>\n";
echo "<td align='center' class='tbl2'><strong>".$pdata['forum_poll_title']."</strong></td>\n</tr>\n<tr>\n<td class='tbl1'>\n";
echo "<table align='center' cellpadding='0' cellspacing='0'>\n";
while ($pvdata = dbarray($presult2)) {
if (!$can_vote) {
$option_votes = ($pdata['forum_poll_votes'] ? number_format(100 / $pdata['forum_poll_votes'] * $pvdata['forum_poll_option_votes']) : 0);
echo "<tr>\n<td class='tbl1'>".$pvdata['forum_poll_option_text']."</td>\n";
echo "<td class='tbl1'><img src='".get_image("pollbar")."' alt='".$pvdata['forum_poll_option_text']."' height='12' width='".(200 / 100 * $option_votes)."' class='poll' /></td>\n";
echo "<td class='tbl1'>".$option_votes."%</td><td class='tbl1'>[".$pvdata['forum_poll_option_votes']." ".($pvdata['forum_poll_option_votes'] == 1 ? $locale['global_133'] : $locale['global_134'])."]</td>\n</tr>\n";
} else {
echo "<tr>\n<td class='tbl1'><label><input type='radio' name='poll_option' value='".$i."' style='vertical-align:middle' /> ".$pvdata['forum_poll_option_text']."</label></td>\n</tr>\n";
$i++;
}
}
if (!$can_vote) {
echo "<tr>\n<td align='center' colspan='4' class='tbl1'>".$locale['480']." : ".$pdata['forum_poll_votes']."</td>\n</tr>\n";
} else {
echo "<tr>\n<td class='tbl1'><input type='submit' name='cast_vote' value='".$locale['481']."' class='button' /></td>\n</tr>\n";
}
echo "</table>\n</td>\n</tr>\n</table>\n";
if ($can_vote) { echo "</form>\n"; }
}
/* end poll */
$result = dbquery(
"SELECT p.forum_id, p.thread_id, p.post_id, p.post_message, p.post_showsig, p.post_smileys, p.post_author,
p.post_datestamp, p.post_ip, p.post_ip_type, p.post_edituser, p.post_edittime, p.post_editreason,
u.user_id, u.user_name, u.user_status, u.user_avatar, u.user_level, u.user_posts, u.user_groups, u.user_joined,
"
.($user_field['user_sig'] ? " u.user_sig," : "").($user_field['user_web'] ? " u.user_web," : ""
)."
u2.user_name AS edit_name, u2.user_status AS edit_status
FROM "
.DB_POSTS." p
LEFT JOIN "
.DB_USERS." u ON p.post_author = u.user_id
LEFT JOIN "
.DB_USERS." u2 ON p.post_edituser = u2.user_id AND post_edituser > '0'
WHERE p.thread_id='"
.$_GET['thread_id'
]."' AND post_hidden='0'
ORDER BY post_datestamp LIMIT "
.$_GET['rowstart'].",$posts_per_page"
);
if (iMOD) { echo "<form name='mod_form' method='post' action='".FUSION_SELF."?thread_id=".$_GET['thread_id']."&rowstart=".$_GET['rowstart']."'>\n"; }
echo "<br><br><br><table cellpadding='0' cellspacing='1' width='100%' class='tbl-border forum_thread_table'>\n";
$numrows = dbrows($result); $current_row = 1; $colorbox_rel = array(); $edit_reason = false;
while ($data = dbarray($result)) {
$message = $data['post_message'];
if ($data['post_smileys']) { $message = parsesmileys($message); }
echo "<!--forum_thread_prepost_".$current_row."-->\n";
if ($current_row > 1) { echo "<tr>\n<td colspan='2' class='tbl1 forum_thread_post_space' style='height: 40px'></td>\n</tr>\n"; }
echo "<tr><td colspan='' class='tbl2 forum_thread_post_date' >";
echo "<div style='float:left' class='small'>";
echo "<a href='#post_".$data['post_id']."' name='post_".$data['post_id']."' id='post_".$data['post_id']."'>#".($current_row+$_GET['rowstart'])."</a>";
echo " <a href='".BASEDIR."print.php?type=F&thread=".$_GET['thread_id']."&Post=".$data['post_id']."&nr=".($current_row+$_GET['rowstart'])."'></a></div>\n";
echo "<div class='small'>".$locale['505'].showdate("forumdate", $data['post_datestamp'])."</div>\n";
echo "</td>\n";
echo "<tr><td><div style='position: relative;'>\n";
echo "<div style='position: absolute; top: -56px; right: 0; border: 2px solid #52879F;'>\n";
if ($data['user_avatar'] && file_exists(IMAGES."avatars/".$data['user_avatar']) && $data['user_status']!=6 && $data['user_status']!=5) {
echo "<center><img src='".IMAGES."avatars/".$data['user_avatar']."' alt='".$locale['567']."' style='width: 75px; height: 75px;'/></center>\n";
} else {
echo "<center><img src='".IMAGES."avatars/noavatar100.png' alt='".$locale['567']."' style='width: 75px; height: 75px;'/></center>\n";
}
echo "</div></td>\n";
echo "<tr><td colspan='4' class='tbl2 forum_thread_post_date' >";
echo "".profile_link($data['user_id'], $data['user_name'], $data['user_status'])."";
if ($data['user_level'] >= 102) {
echo $settings['forum_ranks'] ? show_forum_rank($data['user_posts'], $data['user_level'], $data['user_groups']) : getuserlevel($data['user_level']);
} else {
$is_mod = false;
foreach ($mod_groups as $mod_group) {
if (!$is_mod && preg_match("(^\.{$mod_group}$|\.{$mod_group}\.|\.{$mod_group}$)", $data['user_groups'])) {
$is_mod = true;
}
}
if ($settings['forum_ranks']) {
echo $is_mod ? show_forum_rank($data['user_posts'], 104, $data['user_groups']) : show_forum_rank($data['user_posts'], $data['user_level'], $data['user_groups']);
} else {
echo $is_mod ? $locale['userf1'] : getuserlevel($data['user_level']);
}
}
// ostrzeżenia
// --------------------
echo "</td></tr>\n";
echo "</div>\n";
echo "<td colspan='3' colspan='2' valign='top' class='tbl' style='border-right: 1px solid #52879F; border-left: 1px solid #52879F;'>\n";
if (iMOD) { echo "<div style='float:right'><input type='checkbox' name='delete_post[]' value='".$data['post_id']."' /></div>\n"; }
$message = parseubb($message);
$message = (isset($_GET['highlight'])) ? "<div class='search_result'>".$message."</div>\n" : $message;
echo nl2br($message);
// notki od moderatorów
echo "<br>";
$notki = dbquery("SELECT m.*, u.user_name FROM ".$db_prefix."uwagi_mod m LEFT JOIN ".DB_USERS." u ON (m.user_id=u.user_id) WHERE post_id=".$data['post_id']."");
if (dbquery("SELECT FOUND_ROWS()") > 0 ) {
while ($r = dbarray($notki)) {
echo " <hr class='notka-hr'>
<span style='font-size: 9px; color: gold;'><b>Od moderatora </b> dnia ".strftime("%d.%m godz. %H:%M", $r['time']).":<br> <ol><li>".stripslash($r['notka'])." - ".$r['user_name']." </ol></li></span>";
if(iMOD) {
echo "<script type='text/javascript'>
function Defuse() {
return confirm('Czy na pewno chcesz usun±ć notkę?');
}
</script>\n";
echo " <a href='".BASEDIR."notka.php?edit=1&post_id=".$data['post_id']."&forum_id=".$data['forum_id']."¬ka_id=".$r['notka_id']."&thread_id=".$data['thread_id']."' style='border:0px;vertical-align:middle'>Edytuj</a>
<a href='".BASEDIR."notka.php?del=1&post_id=".$data['post_id']."&forum_id=".$data['forum_id']."¬ka_id=".$r['notka_id']."&thread_id=".$data['thread_id']."' style='border:0px;vertical-align:middle' onclick='return Defuse();'>Usuń</a><br>";
}
}
}
// -----------------------
echo "<!--sub_forum_post_message-->";
$a_result = dbquery("SELECT * FROM ".DB_FORUM_ATTACHMENTS." WHERE post_id='".$data['post_id']."'");
$a_files = ""; $a_images = ""; $i_files = 0; $i_images = 0;
if(dbrows($a_result)){
if (checkgroup($fdata['forum_attach_download'])) {
while($a_data = dbarray($a_result)){
if (!file_exists(FORUM."attachments/".$a_data['attach_name'])) { break; }
if (in_array($a_data['attach_ext'], $imagetypes) && @getimagesize(FORUM."attachments/".$a_data['attach_name'])) {
$a_images .= display_image_attach($a_data['attach_name'], "100", "100", $data['post_id'])."\n";
$i_images++;
} else {
if($i_files > 0) $a_files .= "<br />\n";
$a_files .= "<a href='".FUSION_SELF."?thread_id=".$_GET['thread_id']."&getfile=".$a_data['attach_id']."'>".$a_data['attach_name']."</a> ";
$a_files .= "[<span class='small'>".parsebytesize(filesize(FORUM."attachments/".$a_data['attach_name']))." / ".$a_data['attach_count'].$locale['507a']."</span>]\n";
$i_files++;
}
}
} else {
$a_files = $locale['507b'];
}
if ($a_files) {
echo "<div class='emulated-fieldset'>\n";
echo "<span class='emulated-legend'>".profile_link($data['user_id'], $data['user_name'], $data['user_status']).$locale['506'].($i_files > 1 ? $locale['506d'] : $locale['506c'])."</span>\n";
echo "<div class='attachments-list'>".$a_files."</div>\n";
echo "</div>\n";
}
if($a_images){
$colorbox_rel[] = $data['post_id'];
echo "<div class='emulated-fieldset'>\n";
echo "<span class='emulated-legend'>".profile_link($data['user_id'], $data['user_name'], $data['user_status']).$locale['506'].($i_images > 1 ? $locale['506b'] : $locale['506a'])."</span>\n";
echo "<div class='attachments-list'>".$a_images."</div>\n";
echo "</div>\n";
}
}
if ($data['post_edittime'] != "0") {
echo "\n<hr />\n<span class='small'>".$locale['508'].profile_link($data['post_edituser'], $data['edit_name'], $data['edit_status']).$locale['509'].showdate("forumdate", $data['post_edittime'])."</span>\n";
if ($data['post_editreason'] != "" && iMEMBER) {
$edit_reason = true;
echo "<br /><div class='edit_reason'><a id='reason_pid_".$data['post_id']."' rel='".$data['post_id']."' class='reason_button small' href='#reason_div_pid_".$data['post_id']."'>";
echo "<strong>".$locale['508a']."</strong>";
echo "</a>\n";
echo "<div id='reason_div_pid_".$data['post_id']."' class='reason_div small'>".$data['post_editreason']."</div></div>\n";
}
}
if ($data['post_showsig'] && isset($data['user_sig']) && $data['user_sig'] && $data['user_status']!=6 && $data['user_status']!=5) {
echo "\n<br><hr /><div class='forum_sig'>".nl2br(parseubb(parsesmileys($data['user_sig']), "b|i|u||center|small|url|mail|img|color")) . "</div>\n";
}
echo "<br><br><br><!--sub_forum_post-->\n";
echo "<tr>\n<td colspan='3' class='tbl2 forum_thread_userbar'>\n<div style='float:left; white-space:nowrap;' class='small'><!--forum_thread_userbar-->\n";
if (isset($data['user_web']) && $data['user_web'] && (iADMIN || $data['user_status']!=6 && $data['user_status']!=5)) {
if (!strstr($data['user_web'], "http://")) { $urlprefix = "http://"; } else { $urlprefix = ""; }
echo "<a href='".$urlprefix."".$data['user_web']."' target='_blank'><img src='".get_image("web")."' title='".$data['user_web']."' style='border:0;vertical-align:middle' /></a> ";
}
if (iMEMBER && $data['user_id']!=$userdata['user_id'] && (iADMIN || $data['user_status']!=6 && $data['user_status']!=5)) {
echo "<a href='".BASEDIR."messages.php?msg_send=".$data['user_id']."'><img src='".get_image("pm")."' title='".$locale['572']."' style='border:0;vertical-align:middle' /></a>\n";
}
echo "</div>\n<div style='float:right' class='small'>\n";
if (iMEMBER && ($can_post || $can_reply)) {
if (!$fdata['thread_locked']) {
echo "<a href='post.php?action=reply&forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."&post_id=".$data['post_id']."&quote=".$data['post_id']."'><img src='".get_image("quote")."' title='".$locale['569']."' style='border:0px;vertical-align:middle' /></a>\n";
if (iMOD || (($lock_edit && $last_post['post_id'] == $data['post_id'] || !$lock_edit)) && ($userdata['user_id'] == $data['post_author']) && ($settings['forum_edit_timelimit'] <= 0 || time() - $settings['forum_edit_timelimit']*60 < $data['post_datestamp'])) {
echo "<a href='post.php?action=edit&forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."&post_id=".$data['post_id']."'><img src='".get_image("forum_edit")."' title='".$locale['568']."' style='border:0px;vertical-align:middle' /></a>\n";
}
} elseif (iMOD) {
echo "<a href='post.php?action=edit&forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."&post_id=".$data['post_id']."'><img src='".get_image("forum_edit")."' title='".$locale['568']."' style='border:0px;vertical-align:middle' /></a>\n";
}
}
if(iMOD) {
echo "<a href='".BASEDIR."notka.php?post_id=".$data['post_id']."&forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."'><img src='".THEME."forum/notice.png' title='Dodaj notkę' style='border:0;vertical-align:middle' /></a>\n";
}
echo "</div>\n</td>\n</tr>\n";
$current_row++;
}
/** javascript **/
// highlight jQuery plugin
if (isset($_GET['highlight'])) {
$words = explode(" ", urldecode($_GET['highlight']));
$higlight = ""; $i = 1; $c_words = count($words);
foreach ($words as $hlight) {
$higlight .= "'".$hlight."'";
$higlight .= ($i < $c_words ? "," : "");
$i++;
}
add_to_head("<script type='text/javascript' src='".INCLUDES."jquery/jquery.highlight.js'></script>");
$highlight_js .= "jQuery('.search_result').highlight([".$higlight."],{wordsOnly:true});";
$highlight_js .= "jQuery('.highlight').css({backgroundColor:'#FFFF88'});"; //better via theme or settings
}
// colourbox jQuery plugin
if (count($colorbox_rel) > 0) {
add_to_head("<link rel='stylesheet' href='".INCLUDES."jquery/colorbox/colorbox.css' type='text/css' media='screen' />");
add_to_head("<script type='text/javascript' src='".INCLUDES."jquery/colorbox/jquery.colorbox.js'></script>");
$colorbox_js .= "jQuery('a[rel^=\"attach\"]').colorbox({";
$colorbox_js .= "current:'".$locale['506e']." {current} ".$locale['506f']." {total}',width:'80%',height:'80%'";
$colorbox_js .= "});";
} unset($colorbox_rel);
// edit reason
if ($edit_reason) {
$edit_reason_js .= "jQuery('div[id^=\"reason_div_pid\"]').hide();";
$edit_reason_js .= "jQuery('div').find('a[id^=\"reason_pid\"]').css({cursor:'pointer'})";
$edit_reason_js .= ".removeAttr('href')";
$edit_reason_js .= ".attr('title','".str_replace("'","'",$locale['508b'])."')";
$edit_reason_js .= ".bind('click',function(){";
$edit_reason_js .= "jQuery('#reason_div_pid_'+this.rel).slideToggle('slow');";
$edit_reason_js .= "});";
}
}
echo "</table>\n";
echo "<!--sub_forum_thread_table-->\n";
if (iMOD) {
echo "<table cellspacing='0' cellpadding='0' width='100%'>\n<tr>\n<td style='padding-top:5px'>";
echo "<a href='#' onclick=\"javascript:setChecked('mod_form','delete_post[]',1);return false;\">".$locale['460']."</a> ::\n";
echo "<a href='#' onclick=\"javascript:setChecked('mod_form','delete_post[]',0);return false;\">".$locale['461']."</a></td>\n";
echo "<td align='right' style='padding-top:5px'><input type='submit' name='move_posts' value='".$locale['517a']."' class='button' onclick=\"return confirm('".$locale['518a']."');\" />\n<input type='submit' name='delete_posts' value='".$locale['517']."' class='button' onclick=\"return confirm('".$locale['518']."');\" /></td>\n";
echo "</tr>\n</table>\n</form>\n";
}
if ($rows > $posts_per_page) {
echo "<div align='center' style='padding-top:5px'>\n";
echo makepagenav($_GET['rowstart'],$posts_per_page,$rows,3,FUSION_SELF."?thread_id=".$_GET['thread_id'].(isset($_GET['highlight']) ? "&highlight=".urlencode($_GET['highlight']):"")."&")."\n";
echo "</div>\n";
}
$result = dbquery(
"SELECT f.forum_id, f.forum_name, f.forum_main, f2.forum_name AS forum_cat_name
FROM ".DB_FORUMS." f
INNER JOIN ".DB_FORUMS." f2 ON f.forum_cat=f2.forum_id
WHERE ".groupaccess('f.forum_access')." AND f.forum_cat!='0' AND f.forum_main='0' ORDER BY f2.forum_order ASC, f.forum_order ASC"
);
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
echo "<td style='padding-top:5px'>".$locale['540']."<br />\n";
echo "<select name='jump_id' class='textbox' onchange=\"jumpforum(this.options[this.selectedIndex].value);\">\n";
echo $subForumClass->forumSubList($fdata['forum_id'], $result)."</select>\n</td>\n";
if (iMOD) {
echo "<td align='right' style='padding-top:5px'>\n";
echo $locale['520']."<br />\n<select name='step' class='textbox'>\n";
echo "<option value='none'> </option>\n";
echo "<option value='renew'>".$locale['527']."</option>\n";
echo "<option value='delete'>".$locale['521']."</option>\n";
echo "<option value='".($fdata['thread_locked'] ? "unlock" : "lock")."'>".($fdata['thread_locked'] ? $locale['523'] : $locale['522'])."</option>\n";
echo "<option value='".($fdata['thread_sticky'] ? "nonsticky" : "sticky")."'>".($fdata['thread_sticky'] ? $locale['525'] : $locale['524'])."</option>\n";
echo "<option value='move'>".$locale['526']."</option>\n";
echo "</select>\n<input type='submit' name='go' value='".$locale['528']."' class='button' />\n";
echo "</td>\n";
}
echo "</tr>\n</table>\n"; if (iMOD) { echo "</form>\n"; }
if ($can_post || $can_reply) {
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
echo "<td align='right' style='padding-top:10px'>\n<!--post_forum_buttons-->\n";
if ($can_post) {
echo "<a href='post.php?action=newthread&forum_id=".$fdata['forum_id']."'>";
echo "<img src='".get_image("newthread")."' alt='".$locale['566']."' style='border:0px' /></a>\n";
}
if (!$fdata['thread_locked'] && $can_reply) {
echo "<a href='post.php?action=reply&forum_id=".$fdata['forum_id']."&thread_id=".$_GET['thread_id']."'>";
echo "<img src='".get_image("reply")."' alt='".$locale['565']."' style='border:0px' /></a>\n";
}
echo "</td>\n</tr>\n</table>\n";
}
closetable();
if ($can_reply && !$fdata['thread_locked']) {
require_once INCLUDES."bbcode_include.php";
opentable($locale['512']);
echo "<form name='inputform' method='post' action='".FORUM."post.php?action=reply&forum_id=".$fdata['forum_id']."&thread_id=".$_GET['thread_id']."'>\n";
echo "<table cellpadding='0' cellspacing='1' class='tbl-border center'>\n<tr>\n";
echo "<td align='center' class='tbl1'><textarea name='message' cols='70' rows='7' class='textbox' style='width:98%'></textarea><br />\n";
echo display_bbcodes("360px", "message")."</td>\n";
echo "</tr>\n<tr>\n";
echo "<td align='center' class='tbl2'><label><input type='checkbox' name='disable_smileys' value='1' /> ".$locale['513']."</label>";
if (array_key_exists("user_sig", $userdata) && $userdata['user_sig']) {
echo "<br />\n<label><input type='checkbox' name='show_sig' value='1' checked='checked' /> ".$locale['513a']."</label>";
}
if ($settings['thread_notify']) {
if (dbcount("(thread_id)", DB_THREAD_NOTIFY, "thread_id='".$_GET['thread_id']."' AND notify_user='".$userdata['user_id']."'")) {
$notify_checked = " checked='checked'";
} else {
$notify_checked = "";
}
echo "<br />\n<label><input type='checkbox' name='notify_me' value='1'".$notify_checked." /> ".$locale['513b']."</label>";
}
echo "</td>\n";
echo "</tr>\n<tr>\n";
echo "<td align='center' class='tbl1'>\n";
echo "<input type='submit' name='previewreply' value='".$locale['514a']."' class='button' /> \n";
echo "<input type='submit' name='postreply' value='".$locale['514']."' class='button' />\n";
echo "</td>\n";
echo "</tr>\n</table>\n</form><!--sub_forum_thread-->\n";
closetable();
}
// viewthread javascript, moved to footer
$viewthread_js = "<script type='text/javascript'>";
$viewthread_js .= "/*<![CDATA[*/";
$viewthread_js .= "jQuery(document).ready(function(){";
if (!empty($highlight_js) || !empty($colorbox_js) || !empty($edit_reason_js)){
$viewthread_js .= $highlight_js.$colorbox_js.$edit_reason_js;
}
$viewthread_js .= "jQuery('a[href=#top]').click(function(){";
$viewthread_js .= "jQuery('html, body').animate({scrollTop:0}, 'slow');";
$viewthread_js .= "return false;";
$viewthread_js .= "});";
$viewthread_js .= "});";
// below functions could be made more unobtrusive thanks to jQuery, giving a more accessible cms
$viewthread_js .= "function jumpforum(forum_id){";
$viewthread_js .= "document.location.href='".FORUM."viewforum.php?forum_id='+forum_id;";
$viewthread_js .= "}";
if (iMOD) { // only moderators need this javascript
$viewthread_js .= "function setChecked(frmName,chkName,val){";
$viewthread_js .= "dml=document.forms[frmName];";
$viewthread_js .= "len=dml.elements.length;";
$viewthread_js .= "for(i=0;i<len;i++){";
$viewthread_js .= "if(dml.elements[i].name==chkName){";
$viewthread_js .= "dml.elements[i].checked=val;";
$viewthread_js .= "}";
$viewthread_js .= "}";
$viewthread_js .= "}"; }
$viewthread_js .= "/*]]>*/";
$viewthread_js .= "</script>";
add_to_footer($viewthread_js); //unset($viewthread_js);
require_once THEMES."templates/footer.php";
?>
Chciałbym wrzucić tą liczbę ostrzeżeń obok obrazków z forumowymi rangami. Czy jest ktoś w stanie pomóc? |
|
|
|
Creeper |
Dodany dnia 18.11.2012 14:33:15
|
Początkujący
Postów: 290 Pomógł: 45
v7.02.06 Data rejestracji: 24.10.2011 14:51
|
Generator na Forum używa domyślnego dla PHP-Fusion oznaczenia informacji o użytkowniku:
<!--forum_thread_user_info-->
Wystarczy dodać to w wybranym miejscu pliku. Zmodyfikowałem Twój plik:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| Filename: viewthread.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licen... Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../maincore.php";
require_once INCLUDES."forum_include.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."forum/main.php";
// subkategorie
if (file_exists(INFUSIONS."forum_subcats/locale/".$settings['locale'].".php")) {
include INFUSIONS."forum_subcats/locale/".$settings['locale'].".php";
} else {
include INFUSIONS."forum_subcats/locale/Polish.php";
}
require_once INFUSIONS."forum_subcats/class.ForumSubCats.php";
require_once INCLUDES."infusions_include.php";
$fsc_settings = get_settings("forum_subcats");
$subForumClass = new ForumSubCats();
$subForumClass->_subCatsEnabled = $fsc_settings['fsc_enabled'];
// ------------
$posts_per_page = 20;
add_to_title($locale['global_200'].$locale['400']);
if (!isset($_GET['thread_id']) || !isnum($_GET['thread_id'])) { redirect("index.php"); }
$result = dbquery(
"SELECT t.*, f.*, f2.forum_name AS forum_cat_name
FROM "
.DB_THREADS." t
LEFT JOIN "
.DB_FORUMS." f ON t.forum_id=f.forum_id
LEFT JOIN "
.DB_FORUMS." f2 ON f.forum_cat=f2.forum_id
WHERE t.thread_id='"
.$_GET['thread_id']."' AND t.thread_hidden='0'"
);
if (dbrows($result)) {
$fdata = dbarray($result);
if (!checkgroup($fdata['forum_access']) || !$fdata['forum_cat'] || $fdata['thread_hidden'] == "1") { redirect("index.php"); }
} else {
redirect("index.php");
}
if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
if (isset($_GET['pid']) && isnum($_GET['pid'])) {
$reply_count = dbcount("(post_id)", DB_POSTS, "thread_id='".$fdata['thread_id']."' AND post_id<='".$_GET['pid']."' AND post_hidden='0'");
if ($reply_count > $posts_per_page) { $_GET['rowstart'] = ((ceil($reply_count / $posts_per_page)-1) * $posts_per_page); }
}
if ($fdata['forum_post'] != 0 && checkgroup($fdata['forum_post'])) {
$can_post = true;
} else {
$can_post = false;
}
if ($fdata['forum_reply'] != 0 && checkgroup($fdata['forum_reply'])) {
$can_reply = true;
} else {
$can_reply = false;
}
if ($settings['forum_edit_lock'] == 1) {
$lock_edit = true;
} else {
$lock_edit = false;
}
//locale dependent forum buttons
if (is_array($fusion_images)) {
if ($settings['locale'] != "English") {
$newpath = "";
$oldpath = explode("/", $fusion_images['newthread']);
$c_path = count($oldpath);
for ($i = 0; $i < $c_path - 1; $i++) {
$newpath .= $oldpath[$i]."/";
}
if (is_dir($newpath.$settings['locale'])) {
redirect_img_dir($newpath, $newpath.$settings['locale']."/");
}
}
}
//javascript to footer
$highlight_js = ""; $colorbox_js = ""; $edit_reason_js = "";
// moderators
$mod_groups = explode(".", $fdata['forum_moderators']);
if (iSUPERADMIN) { define("iMOD", true); }
if (!defined("iMOD") && iMEMBER && $fdata['forum_moderators']) {
foreach ($mod_groups as $mod_group) {
if (!defined("iMOD") && checkgroup($mod_group)) { define("iMOD", true); }
}
}
if (!defined("iMOD")) { define("iMOD", false); }
if (iMOD && (((isset($_POST['delete_posts']) || isset($_POST['move_posts'])) && isset($_POST['delete_post'])) || isset($_GET['error']))) {
require_once FORUM."viewthread_options.php";
}
// polls
$poll_on_first_page_only = ($_GET['rowstart'] == 0) ? true : false;
$poll_there = false; $poll_data = false; $poll_options = 0;
$can_vote = false; $had_voted = false;
if ($fdata['thread_poll'] == "1") { // bug #1012
$poll_there = true;
if (iMEMBER) {
$presult = dbquery(
"SELECT tfp.forum_poll_title, tfp.forum_poll_votes, tfv.forum_vote_user_id FROM "
.DB_FORUM_POLLS." tfp
LEFT JOIN "
.DB_FORUM_POLL_VOTERS." tfv
ON tfp.thread_id=tfv.thread_id AND forum_vote_user_id='"
.$userdata['user_id'
]."'
WHERE tfp.thread_id='"
.$_GET['thread_id']."'"
);
} else {
$presult = dbquery(
"SELECT tfp.forum_poll_title, tfp.forum_poll_votes FROM "
.DB_FORUM_POLLS." tfp
WHERE tfp.thread_id='"
.$_GET['thread_id']."'"
);
}
if (dbrows($presult)) {
$poll_data = true;
$pdata = dbarray($presult);
if (isset($pdata['forum_vote_user_id'])) { $had_voted = true; }
$presult2 = dbquery("SELECT forum_poll_option_votes, forum_poll_option_text FROM ".DB_FORUM_POLL_OPTIONS." WHERE thread_id='".$_GET['thread_id']."' ORDER BY forum_poll_option_id ASC");
$poll_options = dbrows($presult2);
}
$can_vote = (!$had_voted && $fdata['forum_vote'] != 0 && checkgroup($fdata['forum_vote'])) ? true : false;
}
if (iMOD) { $can_vote = !$had_voted; }
if ($poll_there && $can_vote && !$had_voted && isset($_POST['cast_vote']) && (isset($_POST['poll_option']) && isnum($_POST['poll_option'])) && ($_POST['poll_option'] <= $poll_options)) { // bug #1012
$result = dbquery("UPDATE ".DB_FORUM_POLL_OPTIONS." SET forum_poll_option_votes=forum_poll_option_votes+1 WHERE thread_id='".$_GET['thread_id']."' AND forum_poll_option_id='".$_POST['poll_option']."'");
$result = dbquery("UPDATE ".DB_FORUM_POLLS." SET forum_poll_votes=forum_poll_votes+1 WHERE thread_id='".$_GET['thread_id']."'");
$result = dbquery("INSERT INTO ".DB_FORUM_POLL_VOTERS." (thread_id, forum_vote_user_id, forum_vote_user_ip, forum_vote_user_ip_type) VALUES ('".$_GET['thread_id']."', '".$userdata['user_id']."', '".USER_IP."', '".USER_IP_TYPE."')");
redirect(FUSION_SELF."?thread_id=".$_GET['thread_id']);
}
// user fields
$user_field = array("user_sig" => false, "user_web" => false);
if (iMEMBER) {
$thread_match = $fdata['thread_id']."\|".$fdata['thread_lastpost']."\|".$fdata['forum_id'];
if (($fdata['thread_lastpost'] > $lastvisited) && !preg_match("(^\.{$thread_match}$|\.{$thread_match}\.|\.{$thread_match}$)", $userdata['user_threads'])) {
$result = dbquery("UPDATE ".DB_USERS." SET user_threads='".$userdata['user_threads'].".".stripslashes($thread_match)."' WHERE user_id='".$userdata['user_id']."'");
}
if (isset($userdata['user_sig'])) { $user_field['user_sig'] = true; }
if (isset($userdata['user_web'])) { $user_field['user_web'] = true; }
} else {
$result = dbquery("SELECT field_name FROM ".DB_USER_FIELDS." WHERE field_name='user_sig' OR field_name='user_web'");
while ($data = dbarray($result)) {
$user_field[$data['field_name']] = true;
}
}
opentable($locale['500'].": ".$fdata['thread_subject']);
// breadcrumbs & subkategorie
$caption = $subForumClass->showCaption($fdata['forum_id'], $fdata['forum_cat_name'], $fdata['forum_name']);
echo "<!--pre_forum_thread--><div class='tbl2 forum_breadcrumbs' style='margin:0px 0px 4px 0px'><a href='index.php' id='top'>Index</a> » ".$caption."</div>\n";
// thread
list($rows, $last_post) = dbarraynum(dbquery(
"SELECT COUNT(post_id), MAX(post_id) FROM ".DB_POSTS." WHERE thread_id='".$_GET['thread_id']."' AND post_hidden='0' GROUP BY thread_id"));
if (($rows > $posts_per_page) || ($can_post || $can_reply)) {
echo "<table cellspacing='0' cellpadding='0' width='100%'>\n<tr>\n";
if ($rows > $posts_per_page) { echo "<td style='padding:4px 0px 4px 0px'>".makepagenav($_GET['rowstart'],$posts_per_page,$rows,3,FUSION_SELF."?thread_id=".$_GET['thread_id']."&")."</td>\n"; }
if (iMEMBER && $can_post) {
echo "<td align='right' style='padding:0px 0px 4px 0px'>\n<!--pre_forum_buttons-->\n";
if ($can_post) {
echo "<a href='post.php?action=newthread&forum_id=".$fdata['forum_id']."'>";
echo "<img src='".get_image("newthread")."' alt='".$locale['566']."' style='border:0px' /></a>\n";
}
if (!$fdata['thread_locked'] && $can_reply) {
echo "<a href='post.php?action=reply&forum_id=".$fdata['forum_id']."&thread_id=".$_GET['thread_id']."'>";
echo "<img src='".get_image("reply")."' alt='".$locale['565']."' style='border:0px' /></a>\n";
}
echo "</td>\n";
}
echo "</tr>\n</table>\n";
}
if ($rows != 0) {
dbquery("UPDATE ".DB_THREADS." SET thread_postcount='$rows', thread_lastpostid='$last_post', thread_views=thread_views+1 WHERE thread_id='".$_GET['thread_id']."'");
/* poll */
if ($poll_on_first_page_only && $poll_there && $poll_data) {
$i = 1;
if ($can_vote) { echo "<form name='voteform' method='post' action='".FUSION_SELF."?forum_id=".$fdata['forum_id']."&thread_id=".$_GET['thread_id']."'>\n"; }
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin-bottom:5px'>\n<tr>\n";
echo "<td align='center' class='tbl2'><strong>".$pdata['forum_poll_title']."</strong></td>\n</tr>\n<tr>\n<td class='tbl1'>\n";
echo "<table align='center' cellpadding='0' cellspacing='0'>\n";
while ($pvdata = dbarray($presult2)) {
if (!$can_vote) {
$option_votes = ($pdata['forum_poll_votes'] ? number_format(100 / $pdata['forum_poll_votes'] * $pvdata['forum_poll_option_votes']) : 0);
echo "<tr>\n<td class='tbl1'>".$pvdata['forum_poll_option_text']."</td>\n";
echo "<td class='tbl1'><img src='".get_image("pollbar")."' alt='".$pvdata['forum_poll_option_text']."' height='12' width='".(200 / 100 * $option_votes)."' class='poll' /></td>\n";
echo "<td class='tbl1'>".$option_votes."%</td><td class='tbl1'>[".$pvdata['forum_poll_option_votes']." ".($pvdata['forum_poll_option_votes'] == 1 ? $locale['global_133'] : $locale['global_134'])."]</td>\n</tr>\n";
} else {
echo "<tr>\n<td class='tbl1'><label><input type='radio' name='poll_option' value='".$i."' style='vertical-align:middle' /> ".$pvdata['forum_poll_option_text']."</label></td>\n</tr>\n";
$i++;
}
}
if (!$can_vote) {
echo "<tr>\n<td align='center' colspan='4' class='tbl1'>".$locale['480']." : ".$pdata['forum_poll_votes']."</td>\n</tr>\n";
} else {
echo "<tr>\n<td class='tbl1'><input type='submit' name='cast_vote' value='".$locale['481']."' class='button' /></td>\n</tr>\n";
}
echo "</table>\n</td>\n</tr>\n</table>\n";
if ($can_vote) { echo "</form>\n"; }
}
/* end poll */
$result = dbquery(
"SELECT p.forum_id, p.thread_id, p.post_id, p.post_message, p.post_showsig, p.post_smileys, p.post_author,
p.post_datestamp, p.post_ip, p.post_ip_type, p.post_edituser, p.post_edittime, p.post_editreason,
u.user_id, u.user_name, u.user_status, u.user_avatar, u.user_level, u.user_posts, u.user_groups, u.user_joined,
"
.($user_field['user_sig'] ? " u.user_sig," : "").($user_field['user_web'] ? " u.user_web," : ""
)."
u2.user_name AS edit_name, u2.user_status AS edit_status
FROM "
.DB_POSTS." p
LEFT JOIN "
.DB_USERS." u ON p.post_author = u.user_id
LEFT JOIN "
.DB_USERS." u2 ON p.post_edituser = u2.user_id AND post_edituser > '0'
WHERE p.thread_id='"
.$_GET['thread_id'
]."' AND post_hidden='0'
ORDER BY post_datestamp LIMIT "
.$_GET['rowstart'].",$posts_per_page"
);
if (iMOD) { echo "<form name='mod_form' method='post' action='".FUSION_SELF."?thread_id=".$_GET['thread_id']."&rowstart=".$_GET['rowstart']."'>\n"; }
echo "<br><br><br><table cellpadding='0' cellspacing='1' width='100%' class='tbl-border forum_thread_table'>\n";
$numrows = dbrows($result); $current_row = 1; $colorbox_rel = array(); $edit_reason = false;
while ($data = dbarray($result)) {
$message = $data['post_message'];
if ($data['post_smileys']) { $message = parsesmileys($message); }
echo "<!--forum_thread_prepost_".$current_row."-->\n";
if ($current_row > 1) { echo "<tr>\n<td colspan='2' class='tbl1 forum_thread_post_space' style='height: 40px'></td>\n</tr>\n"; }
echo "<tr><td colspan='' class='tbl2 forum_thread_post_date' >";
echo "<div style='float:left' class='small'>";
echo "<a href='#post_".$data['post_id']."' name='post_".$data['post_id']."' id='post_".$data['post_id']."'>#".($current_row+$_GET['rowstart'])."</a>";
echo " <a href='".BASEDIR."print.php?type=F&thread=".$_GET['thread_id']."&Post=".$data['post_id']."&nr=".($current_row+$_GET['rowstart'])."'></a></div>\n";
echo "<div class='small'>".$locale['505'].showdate("forumdate", $data['post_datestamp'])."</div>\n";
echo "</td>\n";
echo "<tr><td><div style='position: relative;'>\n";
echo "<div style='position: absolute; top: -56px; right: 0; border: 2px solid #52879F;'>\n";
if ($data['user_avatar'] && file_exists(IMAGES."avatars/".$data['user_avatar']) && $data['user_status']!=6 && $data['user_status']!=5) {
echo "<center><img src='".IMAGES."avatars/".$data['user_avatar']."' alt='".$locale['567']."' style='width: 75px; height: 75px;'/></center>\n";
} else {
echo "<center><img src='".IMAGES."avatars/noavatar100.png' alt='".$locale['567']."' style='width: 75px; height: 75px;'/></center>\n";
}
echo "</div></td>\n";
echo "<tr><td colspan='4' class='tbl2 forum_thread_post_date' >";
echo "".profile_link($data['user_id'], $data['user_name'], $data['user_status'])."";
if ($data['user_level'] >= 102) {
echo $settings['forum_ranks'] ? show_forum_rank($data['user_posts'], $data['user_level'], $data['user_groups']) : getuserlevel($data['user_level']);
} else {
$is_mod = false;
foreach ($mod_groups as $mod_group) {
if (!$is_mod && preg_match("(^\.{$mod_group}$|\.{$mod_group}\.|\.{$mod_group}$)", $data['user_groups'])) {
$is_mod = true;
}
}
if ($settings['forum_ranks']) {
echo $is_mod ? show_forum_rank($data['user_posts'], 104, $data['user_groups']) : show_forum_rank($data['user_posts'], $data['user_level'], $data['user_groups']);
} else {
echo $is_mod ? $locale['userf1'] : getuserlevel($data['user_level']);
}
}
// ostrzeżenia
echo "<!--forum_thread_user_info-->\n";
// --------------------
echo "</td></tr>\n";
echo "</div>\n";
echo "<td colspan='3' colspan='2' valign='top' class='tbl' style='border-right: 1px solid #52879F; border-left: 1px solid #52879F;'>\n";
if (iMOD) { echo "<div style='float:right'><input type='checkbox' name='delete_post[]' value='".$data['post_id']."' /></div>\n"; }
$message = parseubb($message);
$message = (isset($_GET['highlight'])) ? "<div class='search_result'>".$message."</div>\n" : $message;
echo nl2br($message);
// notki od moderatorów
echo "<br>";
$notki = dbquery("SELECT m.*, u.user_name FROM ".$db_prefix."uwagi_mod m LEFT JOIN ".DB_USERS." u ON (m.user_id=u.user_id) WHERE post_id=".$data['post_id']."");
if (dbquery("SELECT FOUND_ROWS()") > 0 ) {
while ($r = dbarray($notki)) {
echo " <hr class='notka-hr'>
<span style='font-size: 9px; color: gold;'><b>Od moderatora </b> dnia ".strftime("%d.%m godz. %H:%M", $r['time']).":<br> <ol><li>".stripslash($r['notka'])." - ".$r['user_name']." </ol></li></span>";
if(iMOD) {
echo "<script type='text/javascript'>
function Defuse() {
return confirm('Czy na pewno chcesz usun±ć notkę?');
}
</script>\n";
echo " <a href='".BASEDIR."notka.php?edit=1&post_id=".$data['post_id']."&forum_id=".$data['forum_id']."¬ka_id=".$r['notka_id']."&thread_id=".$data['thread_id']."' style='border:0px;vertical-align:middle'>Edytuj</a>
<a href='".BASEDIR."notka.php?del=1&post_id=".$data['post_id']."&forum_id=".$data['forum_id']."¬ka_id=".$r['notka_id']."&thread_id=".$data['thread_id']."' style='border:0px;vertical-align:middle' onclick='return Defuse();'>Usuń</a><br>";
}
}
}
// -----------------------
echo "<!--sub_forum_post_message-->";
$a_result = dbquery("SELECT * FROM ".DB_FORUM_ATTACHMENTS." WHERE post_id='".$data['post_id']."'");
$a_files = ""; $a_images = ""; $i_files = 0; $i_images = 0;
if(dbrows($a_result)){
if (checkgroup($fdata['forum_attach_download'])) {
while($a_data = dbarray($a_result)){
if (!file_exists(FORUM."attachments/".$a_data['attach_name'])) { break; }
if (in_array($a_data['attach_ext'], $imagetypes) && @getimagesize(FORUM."attachments/".$a_data['attach_name'])) {
$a_images .= display_image_attach($a_data['attach_name'], "100", "100", $data['post_id'])."\n";
$i_images++;
} else {
if($i_files > 0) $a_files .= "<br />\n";
$a_files .= "<a href='".FUSION_SELF."?thread_id=".$_GET['thread_id']."&getfile=".$a_data['attach_id']."'>".$a_data['attach_name']."</a> ";
$a_files .= "[<span class='small'>".parsebytesize(filesize(FORUM."attachments/".$a_data['attach_name']))." / ".$a_data['attach_count'].$locale['507a']."</span>]\n";
$i_files++;
}
}
} else {
$a_files = $locale['507b'];
}
if ($a_files) {
echo "<div class='emulated-fieldset'>\n";
echo "<span class='emulated-legend'>".profile_link($data['user_id'], $data['user_name'], $data['user_status']).$locale['506'].($i_files > 1 ? $locale['506d'] : $locale['506c'])."</span>\n";
echo "<div class='attachments-list'>".$a_files."</div>\n";
echo "</div>\n";
}
if($a_images){
$colorbox_rel[] = $data['post_id'];
echo "<div class='emulated-fieldset'>\n";
echo "<span class='emulated-legend'>".profile_link($data['user_id'], $data['user_name'], $data['user_status']).$locale['506'].($i_images > 1 ? $locale['506b'] : $locale['506a'])."</span>\n";
echo "<div class='attachments-list'>".$a_images."</div>\n";
echo "</div>\n";
}
}
if ($data['post_edittime'] != "0") {
echo "\n<hr />\n<span class='small'>".$locale['508'].profile_link($data['post_edituser'], $data['edit_name'], $data['edit_status']).$locale['509'].showdate("forumdate", $data['post_edittime'])."</span>\n";
if ($data['post_editreason'] != "" && iMEMBER) {
$edit_reason = true;
echo "<br /><div class='edit_reason'><a id='reason_pid_".$data['post_id']."' rel='".$data['post_id']."' class='reason_button small' href='#reason_div_pid_".$data['post_id']."'>";
echo "<strong>".$locale['508a']."</strong>";
echo "</a>\n";
echo "<div id='reason_div_pid_".$data['post_id']."' class='reason_div small'>".$data['post_editreason']."</div></div>\n";
}
}
if ($data['post_showsig'] && isset($data['user_sig']) && $data['user_sig'] && $data['user_status']!=6 && $data['user_status']!=5) {
echo "\n<br><hr /><div class='forum_sig'>".nl2br(parseubb(parsesmileys($data['user_sig']), "b|i|u||center|small|url|mail|img|color")) . "</div>\n";
}
echo "<br><br><br><!--sub_forum_post-->\n";
echo "<tr>\n<td colspan='3' class='tbl2 forum_thread_userbar'>\n<div style='float:left; white-space:nowrap;' class='small'><!--forum_thread_userbar-->\n";
if (isset($data['user_web']) && $data['user_web'] && (iADMIN || $data['user_status']!=6 && $data['user_status']!=5)) {
if (!strstr($data['user_web'], "http://")) { $urlprefix = "http://"; } else { $urlprefix = ""; }
echo "<a href='".$urlprefix."".$data['user_web']."' target='_blank'><img src='".get_image("web")."' title='".$data['user_web']."' style='border:0;vertical-align:middle' /></a> ";
}
if (iMEMBER && $data['user_id']!=$userdata['user_id'] && (iADMIN || $data['user_status']!=6 && $data['user_status']!=5)) {
echo "<a href='".BASEDIR."messages.php?msg_send=".$data['user_id']."'><img src='".get_image("pm")."' title='".$locale['572']."' style='border:0;vertical-align:middle' /></a>\n";
}
echo "</div>\n<div style='float:right' class='small'>\n";
if (iMEMBER && ($can_post || $can_reply)) {
if (!$fdata['thread_locked']) {
echo "<a href='post.php?action=reply&forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."&post_id=".$data['post_id']."&quote=".$data['post_id']."'><img src='".get_image("quote")."' title='".$locale['569']."' style='border:0px;vertical-align:middle' /></a>\n";
if (iMOD || (($lock_edit && $last_post['post_id'] == $data['post_id'] || !$lock_edit)) && ($userdata['user_id'] == $data['post_author']) && ($settings['forum_edit_timelimit'] <= 0 || time() - $settings['forum_edit_timelimit']*60 < $data['post_datestamp'])) {
echo "<a href='post.php?action=edit&forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."&post_id=".$data['post_id']."'><img src='".get_image("forum_edit")."' title='".$locale['568']."' style='border:0px;vertical-align:middle' /></a>\n";
}
} elseif (iMOD) {
echo "<a href='post.php?action=edit&forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."&post_id=".$data['post_id']."'><img src='".get_image("forum_edit")."' title='".$locale['568']."' style='border:0px;vertical-align:middle' /></a>\n";
}
}
if(iMOD) {
echo "<a href='".BASEDIR."notka.php?post_id=".$data['post_id']."&forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."'><img src='".THEME."forum/notice.png' title='Dodaj notkę' style='border:0;vertical-align:middle' /></a>\n";
}
echo "</div>\n</td>\n</tr>\n";
$current_row++;
}
/** javascript **/
// highlight jQuery plugin
if (isset($_GET['highlight'])) {
$words = explode(" ", urldecode($_GET['highlight']));
$higlight = ""; $i = 1; $c_words = count($words);
foreach ($words as $hlight) {
$higlight .= "'".$hlight."'";
$higlight .= ($i < $c_words ? "," : "");
$i++;
}
add_to_head("<script type='text/javascript' src='".INCLUDES."jquery/jquery.highlight.js'></script>");
$highlight_js .= "jQuery('.search_result').highlight([".$higlight."],{wordsOnly:true});";
$highlight_js .= "jQuery('.highlight').css({backgroundColor:'#FFFF88'});"; //better via theme or settings
}
// colourbox jQuery plugin
if (count($colorbox_rel) > 0) {
add_to_head("<link rel='stylesheet' href='".INCLUDES."jquery/colorbox/colorbox.css' type='text/css' media='screen' />");
add_to_head("<script type='text/javascript' src='".INCLUDES."jquery/colorbox/jquery.colorbox.js'></script>");
$colorbox_js .= "jQuery('a[rel^=\"attach\"]').colorbox({";
$colorbox_js .= "current:'".$locale['506e']." {current} ".$locale['506f']." {total}',width:'80%',height:'80%'";
$colorbox_js .= "});";
} unset($colorbox_rel);
// edit reason
if ($edit_reason) {
$edit_reason_js .= "jQuery('div[id^=\"reason_div_pid\"]').hide();";
$edit_reason_js .= "jQuery('div').find('a[id^=\"reason_pid\"]').css({cursor:'pointer'})";
$edit_reason_js .= ".removeAttr('href')";
$edit_reason_js .= ".attr('title','".str_replace("'","'",$locale['508b'])."')";
$edit_reason_js .= ".bind('click',function(){";
$edit_reason_js .= "jQuery('#reason_div_pid_'+this.rel).slideToggle('slow');";
$edit_reason_js .= "});";
}
}
echo "</table>\n";
echo "<!--sub_forum_thread_table-->\n";
if (iMOD) {
echo "<table cellspacing='0' cellpadding='0' width='100%'>\n<tr>\n<td style='padding-top:5px'>";
echo "<a href='#' onclick=\"javascript:setChecked('mod_form','delete_post[]',1);return false;\">".$locale['460']."</a> ::\n";
echo "<a href='#' onclick=\"javascript:setChecked('mod_form','delete_post[]',0);return false;\">".$locale['461']."</a></td>\n";
echo "<td align='right' style='padding-top:5px'><input type='submit' name='move_posts' value='".$locale['517a']."' class='button' onclick=\"return confirm('".$locale['518a']."');\" />\n<input type='submit' name='delete_posts' value='".$locale['517']."' class='button' onclick=\"return confirm('".$locale['518']."');\" /></td>\n";
echo "</tr>\n</table>\n</form>\n";
}
if ($rows > $posts_per_page) {
echo "<div align='center' style='padding-top:5px'>\n";
echo makepagenav($_GET['rowstart'],$posts_per_page,$rows,3,FUSION_SELF."?thread_id=".$_GET['thread_id'].(isset($_GET['highlight']) ? "&highlight=".urlencode($_GET['highlight']):"")."&")."\n";
echo "</div>\n";
}
$result = dbquery(
"SELECT f.forum_id, f.forum_name, f.forum_main, f2.forum_name AS forum_cat_name
FROM ".DB_FORUMS." f
INNER JOIN ".DB_FORUMS." f2 ON f.forum_cat=f2.forum_id
WHERE ".groupaccess('f.forum_access')." AND f.forum_cat!='0' AND f.forum_main='0' ORDER BY f2.forum_order ASC, f.forum_order ASC"
);
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
echo "<td style='padding-top:5px'>".$locale['540']."<br />\n";
echo "<select name='jump_id' class='textbox' onchange=\"jumpforum(this.options[this.selectedIndex].value);\">\n";
echo $subForumClass->forumSubList($fdata['forum_id'], $result)."</select>\n</td>\n";
if (iMOD) {
echo "<td align='right' style='padding-top:5px'>\n";
echo $locale['520']."<br />\n<select name='step' class='textbox'>\n";
echo "<option value='none'> </option>\n";
echo "<option value='renew'>".$locale['527']."</option>\n";
echo "<option value='delete'>".$locale['521']."</option>\n";
echo "<option value='".($fdata['thread_locked'] ? "unlock" : "lock")."'>".($fdata['thread_locked'] ? $locale['523'] : $locale['522'])."</option>\n";
echo "<option value='".($fdata['thread_sticky'] ? "nonsticky" : "sticky")."'>".($fdata['thread_sticky'] ? $locale['525'] : $locale['524'])."</option>\n";
echo "<option value='move'>".$locale['526']."</option>\n";
echo "</select>\n<input type='submit' name='go' value='".$locale['528']."' class='button' />\n";
echo "</td>\n";
}
echo "</tr>\n</table>\n"; if (iMOD) { echo "</form>\n"; }
if ($can_post || $can_reply) {
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
echo "<td align='right' style='padding-top:10px'>\n<!--post_forum_buttons-->\n";
if ($can_post) {
echo "<a href='post.php?action=newthread&forum_id=".$fdata['forum_id']."'>";
echo "<img src='".get_image("newthread")."' alt='".$locale['566']."' style='border:0px' /></a>\n";
}
if (!$fdata['thread_locked'] && $can_reply) {
echo "<a href='post.php?action=reply&forum_id=".$fdata['forum_id']."&thread_id=".$_GET['thread_id']."'>";
echo "<img src='".get_image("reply")."' alt='".$locale['565']."' style='border:0px' /></a>\n";
}
echo "</td>\n</tr>\n</table>\n";
}
closetable();
if ($can_reply && !$fdata['thread_locked']) {
require_once INCLUDES."bbcode_include.php";
opentable($locale['512']);
echo "<form name='inputform' method='post' action='".FORUM."post.php?action=reply&forum_id=".$fdata['forum_id']."&thread_id=".$_GET['thread_id']."'>\n";
echo "<table cellpadding='0' cellspacing='1' class='tbl-border center'>\n<tr>\n";
echo "<td align='center' class='tbl1'><textarea name='message' cols='70' rows='7' class='textbox' style='width:98%'></textarea><br />\n";
echo display_bbcodes("360px", "message")."</td>\n";
echo "</tr>\n<tr>\n";
echo "<td align='center' class='tbl2'><label><input type='checkbox' name='disable_smileys' value='1' /> ".$locale['513']."</label>";
if (array_key_exists("user_sig", $userdata) && $userdata['user_sig']) {
echo "<br />\n<label><input type='checkbox' name='show_sig' value='1' checked='checked' /> ".$locale['513a']."</label>";
}
if ($settings['thread_notify']) {
if (dbcount("(thread_id)", DB_THREAD_NOTIFY, "thread_id='".$_GET['thread_id']."' AND notify_user='".$userdata['user_id']."'")) {
$notify_checked = " checked='checked'";
} else {
$notify_checked = "";
}
echo "<br />\n<label><input type='checkbox' name='notify_me' value='1'".$notify_checked." /> ".$locale['513b']."</label>";
}
echo "</td>\n";
echo "</tr>\n<tr>\n";
echo "<td align='center' class='tbl1'>\n";
echo "<input type='submit' name='previewreply' value='".$locale['514a']."' class='button' /> \n";
echo "<input type='submit' name='postreply' value='".$locale['514']."' class='button' />\n";
echo "</td>\n";
echo "</tr>\n</table>\n</form><!--sub_forum_thread-->\n";
closetable();
}
// viewthread javascript, moved to footer
$viewthread_js = "<script type='text/javascript'>";
$viewthread_js .= "/*<![CDATA[*/";
$viewthread_js .= "jQuery(document).ready(function(){";
if (!empty($highlight_js) || !empty($colorbox_js) || !empty($edit_reason_js)){
$viewthread_js .= $highlight_js.$colorbox_js.$edit_reason_js;
}
$viewthread_js .= "jQuery('a[href=#top]').click(function(){";
$viewthread_js .= "jQuery('html, body').animate({scrollTop:0}, 'slow');";
$viewthread_js .= "return false;";
$viewthread_js .= "});";
$viewthread_js .= "});";
// below functions could be made more unobtrusive thanks to jQuery, giving a more accessible cms
$viewthread_js .= "function jumpforum(forum_id){";
$viewthread_js .= "document.location.href='".FORUM."viewforum.php?forum_id='+forum_id;";
$viewthread_js .= "}";
if (iMOD) { // only moderators need this javascript
$viewthread_js .= "function setChecked(frmName,chkName,val){";
$viewthread_js .= "dml=document.forms[frmName];";
$viewthread_js .= "len=dml.elements.length;";
$viewthread_js .= "for(i=0;i<len;i++){";
$viewthread_js .= "if(dml.elements[i].name==chkName){";
$viewthread_js .= "dml.elements[i].checked=val;";
$viewthread_js .= "}";
$viewthread_js .= "}";
$viewthread_js .= "}"; }
$viewthread_js .= "/*]]>*/";
$viewthread_js .= "</script>";
add_to_footer($viewthread_js); //unset($viewthread_js);
require_once THEMES."templates/footer.php";
?>
Dodałem owe oznaczenie pod linią:
// ostrzeżenia
|
|
|
|
jozio_94 |
Dodany dnia 18.11.2012 14:56:16
|
Przedszkolak
Postów: 84 Pomógł: 7 Ostrzeżeń: 2
Data rejestracji: 15.02.2011 21:39
|
Dzięki wielkie #Creeper, o to mi chodziło :) A można zrobić tak, aby blokada pisania w Shoutboxie działała nie tylko w tym standardowym? Bo ja na przykład mam Shoutboxa z odświeżaniem. Mój shoutbox_panel.php wygląda tak:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: shoutbox_panel.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }
include_once INFUSIONS."shoutbox_panel/infusion_db.php";
include_once INCLUDES."infusions_include.php";
echo " <script type='text/javascript' src='".INFUSIONS."shoutbox_panel/js/shoutbox.js'></script>";
// SlimScroll - początek
add_to_head("<script type='text/javascript' src='".INFUSIONS."shoutbox_panel/js/jquery-ui.js'></script>");
add_to_head("<script type='text/javascript' src='".INFUSIONS."shoutbox_panel/js/slimscroll.min.js'></script>");
add_to_head("<script type='text/javascript'>
$(document).ready(function() {
$('#sb_scroll').slimScroll({
width: '100%',
height: '150px',
size: '7px',
color: '#101010',
alwaysVisible: true
});
});
</script>");
// SlimScroll - koniec
// Check if locale file is available matching the current site locale setting.
if (file_exists(INFUSIONS."shoutbox_panel/locale/".$settings['locale'].".php")) {
// Load the locale file matching the current site locale setting.
include INFUSIONS."shoutbox_panel/locale/".$settings['locale'].".php";
} else {
// Load the infusion's default locale file.
include INFUSIONS."shoutbox_panel/locale/English.php";
}
///move to settings
//settings
$sb_online_t = (time()- 600 ); //10 mins (60*10)
$sb_chidden = '<p class="admin-message">hidden</p>';
$sb_bbcodes = 'smiley|b|i|color|url';
$sb_bbcodesp = 'b|i|u|url|color|quote';
if (!function_exists("sbwrap")) {
function sbwrap($text) {
global $locale;
$i = 0; $tags = 0; $chars = 0; $res = "";
$str_len = strlen($text);
for ($i = 0; $i < $str_len; $i++) {
$chr = mb_substr($text, $i, 1, $locale['charset']);
if ($chr == "<") {
if (mb_substr($text, ($i + 1), 6, $locale['charset']) == "a href" || mb_substr($text, ($i + 1), 3, $locale['charset']) == "img") {
$chr = " ".$chr;
$chars = 0;
}
$tags++;
} elseif ($chr == "&") {
if (mb_substr($text, ($i + 1), 5, $locale['charset']) == "quot;") {
$chars = $chars - 5;
} elseif (mb_substr($text, ($i + 1), 4, $locale['charset']) == "amp;" || mb_substr($text, ($i + 1), 4, $locale['charset']) == "#39;" || mb_substr($text, ($i + 1), 4, $locale['charset']) == "#92;") {
$chars = $chars - 4;
} elseif (mb_substr($text, ($i + 1), 3, $locale['charset']) == "lt;" || mb_substr($text, ($i + 1), 3, $locale['charset']) == "gt;") {
$chars = $chars - 3;
}
} elseif ($chr == ">") {
$tags--;
} elseif ($chr == " ") {
$chars = 0;
} elseif (!$tags) {
$chars++;
}
if (!$tags && $chars == 47) {
$chr .= "<br />";
$chars = 0;
}
$res .= $chr;
}
return $res;
}
}
$shout_settings = get_settings('shoutbox_panel');
$link = FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "");
$link = preg_replace("^(&|\?)s_action=(edit|delete)&shout_id=\d*^", "", $link);
$sep = stristr($link, "?") ? "&" : "?";
$shout_link = '';$shout_message = '';
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "delete") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
if ((iADMIN && checkrights("S")) || (iMEMBER && dbcount("(shout_id)", DB_SHOUTBOX, "shout_id='".$_GET['shout_id']."' AND shout_name='".$userdata['user_id']."' AND shout_hidden='0'"))) {
$result = dbquery("DELETE FROM ".DB_SHOUTBOX." WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
}
redirect($link);
}
if (!defined('ashSCRIPT')) {
add_to_head('<script type="text/javascript" src="'.INFUSIONS.'shoutbox_panel/ash.js"></script>');
define('ashSCRIPT', true);
}
openside($locale['SB_title']);
if (iMEMBER || $shout_settings['guest_shouts'] == "1") {
include_once INCLUDES."bbcode_include.php";
if (isset($_POST['post_shout'])) {
$flood = false;
if (iMEMBER) {
$shout_name = $userdata['user_id'];
} elseif ($shout_settings['guest_shouts'] == "1") {
$shout_name = trim(stripinput($_POST['shout_name']));
$shout_name = preg_replace("(^[+0-9\s]*)", "", $shout_name);
if (isnum($shout_name)) { $shout_name = ""; }
include_once INCLUDES."securimage/securimage.php";
$securimage = new Securimage();
if (!isset($_POST['sb_captcha_code']) || $securimage->check($_POST['sb_captcha_code']) == false) { redirect($link); }
}
$shout_message = str_replace("\n", " ", $_POST['shout_message']);
$shout_message = preg_replace("/^(.{255}).*$/", "$1", $shout_message);
$shout_message = trim(stripinput(censorwords($shout_message)));
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$comment_updated = false;
if ((iADMIN && checkrights("S")) || (iMEMBER && dbcount("(shout_id)", DB_SHOUTBOX, "shout_id='".$_GET['shout_id']."' AND shout_name='".$userdata['user_id']."' AND shout_hidden='0'"))) {
if ($shout_message) {
$result = dbquery("UPDATE ".DB_SHOUTBOX." SET shout_message='$shout_message' WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
}
}
redirect($link);
} elseif ($shout_name && $shout_message) {
require_once INCLUDES."flood_include.php";
if (!flood_control("shout_datestamp", DB_SHOUTBOX, "shout_ip='".USER_IP."'")) {
$result = dbquery("INSERT INTO ".DB_SHOUTBOX." (shout_name, shout_message, shout_datestamp, shout_ip, shout_ip_type, shout_hidden) VALUES ('$shout_name', '$shout_message', '".time()."', '".USER_IP."', '".USER_IP_TYPE."', '0')");
}
}
redirect($link);
}
echo "<table align='left' border='0' cellpadding='0' cellspacing='0' width='100%'><tr>";
echo "<td align='left' valign='top' width='100%'>\n";
echo "<a id='edit_shout' name='edit_shout'></a>\n";
echo "<form name='shout_form' method='post' action='$shout_link' ".(iMEMBER?'onsubmit="ash_send();return false;"':'').">\n";
if (iGUEST) {
echo $locale['SB_name']."<br />\n";
echo "<input type='text' name='shout_name' value='' class='textbox' />\n";
echo $locale['SB_message']."\n";
}
echo "<input name='shout_message' class='textbox' maxlength='200' style='width:98%;' onKeyDown='textCount(c_sbform.shout_message,c_sbform.com_len);sh_center(event);' onKeyUp='textCount(c_sbform.shout_message,c_sbform.com_len);'>$shout_message</textarea>\n";
echo "</td>\n";
echo "<td valign='top'>\n";
echo '<input style="font-weight:bold;" class="textbox" readonly="readonly" type="text" name="com_len" size="2" value="200">';
echo "</td>\n";
echo "<td valign='top'>\n";
echo "<input type='submit' name='post_shout' value='".$locale['SB_shout']."' class='button' title='Enter' />\n";
echo "</td>\n";
echo "</tr></table>";
} else {
echo "<div style='text-align:center'>".$locale['SB_login_req']."</div>\n";
}
echo "<table border='0' cellpadding='0' cellspacing='0' width='98%' height='1'><tr>\n";
echo "<td valign='top'>\n";
echo "<table border='0' cellpadding='0' cellspacing='0' width='88%' align='right'><tr>\n";
echo "<td width='55' valign='top'>\n";
echo '<script type="text/javascript">//<![CDATA[
document.write(\' '.(iMEMBER?' <a href="http://#" onclick="ash_refresh(0);return false;"style="text-decoration: none" class="small"><b>'.$locale['405'].'</b></a>':'').'\');
var sb_fldr="'.INFUSIONS.'shoutbox_panel/",inc_row='.$shout_settings['visible_shouts'].',c_sbform=document.forms["shout_form"];
//]]></script>';
echo "</td>\n";
echo "<td valign='top'>\n";
if (iMEMBER) {
echo "<a style='text-decoration:none; font-weight:bold;' href='".INFUSIONS."shoutbox_panel/shoutbox_archive.php' >".$locale['SB_archive']."</a>";
}
echo "</td>\n";
echo "<td align='right' valign='top'>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
if (iMEMBER) {
echo "<script type='text/javascript'>
function showSpoiler(obj)
{
var inner = obj.parentNode.getElementsByTagName('div')[0];
if (inner.style.display == 'none')
inner.style.display = '';
else
inner.style.display = 'none';
}
</script><div>";
echo '<a style="cursor: pointer; text-decoration:none;" onclick="showSpoiler(this);" ><b>'.$locale['fb_003'].'</b></a><div style="display:none;">';
echo displaysmileys("shout_message", 1);
echo "</div></div>";
}
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<div id='sb_scroll' style='overflow: auto; height: 150px;'>
<div id='sb_scroll_text'>
<div id='lol'>";
echo '<div id="sb_adiv">';
$row = 0 ;
if (isset($_GET['row']) && isnum($_GET['row'])) {$row = $_GET['row'];}
$numrows = dbcount('(shout_id)', DB_SHOUTBOX,(checkrights('S')?'':"shout_hidden='0'"));
$result = dbquery("SELECT ts.shout_id, ts.shout_name, ts.shout_message, ts.shout_datestamp,".(checkrights('S')?'ts.shout_ip,ts.shout_hidden,':'')." tu.user_id, tu.user_name,tu.user_avatar,tu.user_level,tu.user_lastvisit,tu.user_status FROM ".DB_SHOUTBOX." ts
LEFT JOIN ".DB_USERS." tu ON ts.shout_name=tu.user_id
".(checkrights('S')?'':"WHERE shout_hidden='0'")."
ORDER BY ts.shout_datestamp DESC LIMIT $row,".$shout_settings['visible_shouts']);
if (dbrows($result)) {
$i = 0;
while ($data = dbarray($result)) {
echo "<div class='shoutboxname'>";
echo "<table border='0' cellpadding='0' cellspacing='0' width='100%' style='margin-bottom: 2px;'><tr>";
echo "<td valign='middle'><div>\n";
if ($data['user_name']) {
echo "<a href='".BASEDIR."profile.php?lookup=".$data['shout_name']."' class='side'>".$data['user_name']."</a>\n";
} else {
echo $data['shout_name']."\n";
}
if (iMEMBER || $shout_settings['guest_shouts'] == "1") //if shout exist
echo "<a href='javascript:insertText(\"shout_message\",\"[b]".($data['user_name']?$data['user_name']:$data['shout_name'])."[/b], \", \"shout_form\");' class='small side'>[!]</a>";
echo "<span class='shoutboxdate' valign='middle'>".($data['user_lastvisit']>$sb_online_t?' <img src="'.INFUSIONS.'shoutbox_panel/images/sh_online.png" border="0" title="Online" alt="[on]"/> ':' <img src="'.INFUSIONS.'shoutbox_panel/images/sh_offline.png" border="0" title="Offline" alt="[off]"/> ').showdate("forumdate", $data['shout_datestamp'])."</span>";
echo "</div></td>\n";
echo "</tr></table>";
echo "<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr>";
echo "<td><img src='".INFUSIONS."shoutbox_panel/images/bullet.jpg' border='0' hspace='16'></td>\n";
echo "</tr><tr>\n";
echo "<td class='ramka' valign='top' background='".INFUSIONS."shoutbox_panel/images/background.jpg'>\n";
echo "<div class='shoutbox'>".(checkrights('S')&&$data['shout_hidden']?$sb_chidden:'').sbwrap(parseubb(parsesmileys($data['shout_message']), $sb_bbcodesp))."</div>\n";
if ((iADMIN && checkrights('S')) || (iMEMBER && $data['shout_name'] == $userdata['user_id'] && isset($data['user_name']))) {
echo "<a href='".$link.$sep."s_action=edit&shout_id=".$data['shout_id']."#edit_shout"."' onclick='ash_edit(\"".$data['shout_id']."\");return false;' class='side' >".$locale['SB_edit']."</a>\n";
echo "<a href='".$link.$sep."s_action=delete&shout_id=".$data['shout_id']."' onclick='ash_del(\"".$data['shout_id']."\");return false;' class='side' >".$locale['SB_delete']."</a>";
}
echo "</td>\n";
echo "</tr><tr>\n";
echo "<td height='4'></td>\n";
echo "</tr></table>";
$i++;
if ($i != $numrows) { echo "\n"; }
}
}
echo "</div></div> ";
echo '</div>';
closeside();
?>
|
|
|
|
Creeper |
Dodany dnia 18.11.2012 17:58:41
|
Początkujący
Postów: 290 Pomógł: 45
v7.02.06 Data rejestracji: 24.10.2011 14:51
|
Nie jestem do końca pewny, czy będzie działać, bo nie testowałem, ale spróbuj i daj znać jakby co:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: shoutbox_panel.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }
include_once INFUSIONS."shoutbox_panel/infusion_db.php";
include_once INCLUDES."infusions_include.php";
echo " <script type='text/javascript' src='".INFUSIONS."shoutbox_panel/js/shoutbox.js'></script>";
// SlimScroll - początek
add_to_head("<script type='text/javascript' src='".INFUSIONS."shoutbox_panel/js/jquery-ui.js'></script>");
add_to_head("<script type='text/javascript' src='".INFUSIONS."shoutbox_panel/js/slimscroll.min.js'></script>");
add_to_head("<script type='text/javascript'>
$(document).ready(function() {
$('#sb_scroll').slimScroll({
width: '100%',
height: '150px',
size: '7px',
color: '#101010',
alwaysVisible: true
});
});
</script>");
// SlimScroll - koniec
// Check if locale file is available matching the current site locale setting.
if (file_exists(INFUSIONS."shoutbox_panel/locale/".$settings['locale'].".php")) {
// Load the locale file matching the current site locale setting.
include INFUSIONS."shoutbox_panel/locale/".$settings['locale'].".php";
} else {
// Load the infusion's default locale file.
include INFUSIONS."shoutbox_panel/locale/English.php";
}
///move to settings
//settings
$sb_online_t = (time()- 600 ); //10 mins (60*10)
$sb_chidden = '<p class="admin-message">hidden</p>';
$sb_bbcodes = 'smiley|b|i|color|url';
$sb_bbcodesp = 'b|i|u|url|color|quote';
if (!function_exists("sbwrap")) {
function sbwrap($text) {
global $locale;
$i = 0; $tags = 0; $chars = 0; $res = "";
$str_len = strlen($text);
for ($i = 0; $i < $str_len; $i++) {
$chr = mb_substr($text, $i, 1, $locale['charset']);
if ($chr == "<") {
if (mb_substr($text, ($i + 1), 6, $locale['charset']) == "a href" || mb_substr($text, ($i + 1), 3, $locale['charset']) == "img") {
$chr = " ".$chr;
$chars = 0;
}
$tags++;
} elseif ($chr == "&") {
if (mb_substr($text, ($i + 1), 5, $locale['charset']) == "quot;") {
$chars = $chars - 5;
} elseif (mb_substr($text, ($i + 1), 4, $locale['charset']) == "amp;" || mb_substr($text, ($i + 1), 4, $locale['charset']) == "#39;" || mb_substr($text, ($i + 1), 4, $locale['charset']) == "#92;") {
$chars = $chars - 4;
} elseif (mb_substr($text, ($i + 1), 3, $locale['charset']) == "lt;" || mb_substr($text, ($i + 1), 3, $locale['charset']) == "gt;") {
$chars = $chars - 3;
}
} elseif ($chr == ">") {
$tags--;
} elseif ($chr == " ") {
$chars = 0;
} elseif (!$tags) {
$chars++;
}
if (!$tags && $chars == 47) {
$chr .= "<br />";
$chars = 0;
}
$res .= $chr;
}
return $res;
}
}
$shout_settings = get_settings('shoutbox_panel');
$link = FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "");
$link = preg_replace("^(&|\?)s_action=(edit|delete)&shout_id=\d*^", "", $link);
$sep = stristr($link, "?") ? "&" : "?";
$shout_link = '';$shout_message = '';
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "delete") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
if ((iADMIN && checkrights("S")) || (iMEMBER && dbcount("(shout_id)", DB_SHOUTBOX, "shout_id='".$_GET['shout_id']."' AND shout_name='".$userdata['user_id']."' AND shout_hidden='0'"))) {
$result = dbquery("DELETE FROM ".DB_SHOUTBOX." WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
}
redirect($link);
}
if (!defined('ashSCRIPT')) {
add_to_head('<script type="text/javascript" src="'.INFUSIONS.'shoutbox_panel/ash.js"></script>');
define('ashSCRIPT', true);
}
openside($locale['SB_title']);
if (iMEMBER || $shout_settings['guest_shouts'] == "1") {
include_once INCLUDES."bbcode_include.php";
if (isset($_POST['post_shout'])) {
$flood = false;
if (iMEMBER) {
$shout_name = $userdata['user_id'];
} elseif ($shout_settings['guest_shouts'] == "1") {
$shout_name = trim(stripinput($_POST['shout_name']));
$shout_name = preg_replace("(^[+0-9\s]*)", "", $shout_name);
if (isnum($shout_name)) { $shout_name = ""; }
include_once INCLUDES."securimage/securimage.php";
$securimage = new Securimage();
if (!isset($_POST['sb_captcha_code']) || $securimage->check($_POST['sb_captcha_code']) == false) { redirect($link); }
}
$shout_message = str_replace("\n", " ", $_POST['shout_message']);
$shout_message = preg_replace("/^(.{255}).*$/", "$1", $shout_message);
$shout_message = trim(stripinput(censorwords($shout_message)));
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$comment_updated = false;
if ((iADMIN && checkrights("S")) || (iMEMBER && dbcount("(shout_id)", DB_SHOUTBOX, "shout_id='".$_GET['shout_id']."' AND shout_name='".$userdata['user_id']."' AND shout_hidden='0'"))) {
if ($shout_message) {
$result = dbquery("UPDATE ".DB_SHOUTBOX." SET shout_message='$shout_message' WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
}
}
redirect($link);
} elseif ($shout_name && $shout_message) {
require_once INCLUDES."flood_include.php";
if (!flood_control("shout_datestamp", DB_SHOUTBOX, "shout_ip='".USER_IP."'")) {
$result = dbquery("INSERT INTO ".DB_SHOUTBOX." (shout_name, shout_message, shout_datestamp, shout_ip, shout_ip_type, shout_hidden) VALUES ('$shout_name', '$shout_message', '".time()."', '".USER_IP."', '".USER_IP_TYPE."', '0')");
}
}
redirect($link);
}
$Sylvia->InitBlockade("Fh1Vc6884Z9ejwz24d2K6fI6P");
echo "<table align='left' border='0' cellpadding='0' cellspacing='0' width='100%'><tr>";
echo "<td align='left' valign='top' width='100%'>\n";
echo "<a id='edit_shout' name='edit_shout'></a>\n";
echo "<form name='shout_form' method='post' action='$shout_link' ".(iMEMBER?'onsubmit="ash_send();return false;"':'').">\n";
if (iGUEST) {
echo $locale['SB_name']."<br />\n";
echo "<input type='text' name='shout_name' value='' class='textbox' />\n";
echo $locale['SB_message']."\n";
}
if ($Sylvia->LoadBlockade(TRUE) == FALSE) {
echo "<input name='shout_message' class='textbox' maxlength='200' style='width:98%;' onKeyDown='textCount(c_sbform.shout_message,c_sbform.com_len);sh_center(event);' onKeyUp='textCount(c_sbform.shout_message,c_sbform.com_len);'>$shout_message</textarea>\n";
} elseif ($Sylvia->LoadBlockade(TRUE) == TRUE) {
echo "<input name='shout_message' class='textbox' maxlength='200' style='width:98%;' disabled='disabled' onKeyDown='textCount(c_sbform.shout_message,c_sbform.com_len);sh_center(event);' onKeyUp='textCount(c_sbform.shout_message,c_sbform.com_len);'>".$Sylvia->LoadBlockade()."</textarea>\n";
}
echo "</td>\n";
echo "<td valign='top'>\n";
echo '<input style="font-weight:bold;" class="textbox" readonly="readonly" type="text" name="com_len" size="2" value="200">';
echo "</td>\n";
echo "<td valign='top'>\n";
if ($Sylvia->LoadBlockade(TRUE) == TRUE) {
echo "<input type='submit' name='post_shout' value='".$locale['SB_shout']."' class='button' title='Enter' />\n";
}
echo "</td>\n";
echo "</tr></table>";
$Sylvia->DestructBlockade();
} else {
echo "<div style='text-align:center'>".$locale['SB_login_req']."</div>\n";
}
echo "<table border='0' cellpadding='0' cellspacing='0' width='98%' height='1'><tr>\n";
echo "<td valign='top'>\n";
echo "<table border='0' cellpadding='0' cellspacing='0' width='88%' align='right'><tr>\n";
echo "<td width='55' valign='top'>\n";
echo '<script type="text/javascript">//<![CDATA[
document.write(\' '.(iMEMBER?' <a href="http://#" onclick="ash_refresh(0);return false;"style="text-decoration: none" class="small"><b>'.$locale['405'].'</b></a>':'').'\');
var sb_fldr="'.INFUSIONS.'shoutbox_panel/",inc_row='.$shout_settings['visible_shouts'].',c_sbform=document.forms["shout_form"];
//]]></script>';
echo "</td>\n";
echo "<td valign='top'>\n";
if (iMEMBER) {
echo "<a style='text-decoration:none; font-weight:bold;' href='".INFUSIONS."shoutbox_panel/shoutbox_archive.php' >".$locale['SB_archive']."</a>";
}
echo "</td>\n";
echo "<td align='right' valign='top'>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
if (iMEMBER) {
echo "<script type='text/javascript'>
function showSpoiler(obj)
{
var inner = obj.parentNode.getElementsByTagName('div')[0];
if (inner.style.display == 'none')
inner.style.display = '';
else
inner.style.display = 'none';
}
</script><div>";
echo '<a style="cursor: pointer; text-decoration:none;" onclick="showSpoiler(this);" ><b>'.$locale['fb_003'].'</b></a><div style="display:none;">';
echo displaysmileys("shout_message", 1);
echo "</div></div>";
}
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<div id='sb_scroll' style='overflow: auto; height: 150px;'>
<div id='sb_scroll_text'>
<div id='lol'>";
echo '<div id="sb_adiv">';
$row = 0 ;
if (isset($_GET['row']) && isnum($_GET['row'])) {$row = $_GET['row'];}
$numrows = dbcount('(shout_id)', DB_SHOUTBOX,(checkrights('S')?'':"shout_hidden='0'"));
$result = dbquery("SELECT ts.shout_id, ts.shout_name, ts.shout_message, ts.shout_datestamp,".(checkrights('S')?'ts.shout_ip,ts.shout_hidden,':'')." tu.user_id, tu.user_name,tu.user_avatar,tu.user_level,tu.user_lastvisit,tu.user_status FROM ".DB_SHOUTBOX." ts
LEFT JOIN ".DB_USERS." tu ON ts.shout_name=tu.user_id
".(checkrights('S')?'':"WHERE shout_hidden='0'")."
ORDER BY ts.shout_datestamp DESC LIMIT $row,".$shout_settings['visible_shouts']);
if (dbrows($result)) {
$i = 0;
while ($data = dbarray($result)) {
echo "<div class='shoutboxname'>";
echo "<table border='0' cellpadding='0' cellspacing='0' width='100%' style='margin-bottom: 2px;'><tr>";
echo "<td valign='middle'><div>\n";
if ($data['user_name']) {
echo "<a href='".BASEDIR."profile.php?lookup=".$data['shout_name']."' class='side'>".$data['user_name']."</a>\n";
} else {
echo $data['shout_name']."\n";
}
if (iMEMBER || $shout_settings['guest_shouts'] == "1") //if shout exist
echo "<a href='javascript:insertText(\"shout_message\",\"[b]".($data['user_name']?$data['user_name']:$data['shout_name'])."[/b], \", \"shout_form\");' class='small side'>[!]</a>";
echo "<span class='shoutboxdate' valign='middle'>".($data['user_lastvisit']>$sb_online_t?' <img src="'.INFUSIONS.'shoutbox_panel/images/sh_online.png" border="0" title="Online" alt="[on]"/> ':' <img src="'.INFUSIONS.'shoutbox_panel/images/sh_offline.png" border="0" title="Offline" alt="[off]"/> ').showdate("forumdate", $data['shout_datestamp'])."</span>";
echo "</div></td>\n";
echo "</tr></table>";
echo "<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr>";
echo "<td><img src='".INFUSIONS."shoutbox_panel/images/bullet.jpg' border='0' hspace='16'></td>\n";
echo "</tr><tr>\n";
echo "<td class='ramka' valign='top' background='".INFUSIONS."shoutbox_panel/images/background.jpg'>\n";
echo "<div class='shoutbox'>".(checkrights('S')&&$data['shout_hidden']?$sb_chidden:'').sbwrap(parseubb(parsesmileys($data['shout_message']), $sb_bbcodesp))."</div>\n";
if ((iADMIN && checkrights('S')) || (iMEMBER && $data['shout_name'] == $userdata['user_id'] && isset($data['user_name']))) {
echo "<a href='".$link.$sep."s_action=edit&shout_id=".$data['shout_id']."#edit_shout"."' onclick='ash_edit(\"".$data['shout_id']."\");return false;' class='side' >".$locale['SB_edit']."</a>\n";
echo "<a href='".$link.$sep."s_action=delete&shout_id=".$data['shout_id']."' onclick='ash_del(\"".$data['shout_id']."\");return false;' class='side' >".$locale['SB_delete']."</a>";
}
echo "</td>\n";
echo "</tr><tr>\n";
echo "<td height='4'></td>\n";
echo "</tr></table>";
$i++;
if ($i != $numrows) { echo "\n"; }
}
}
echo "</div></div> ";
echo '</div>';
closeside();
?>
|
|
|
|
jozio_94 |
Dodany dnia 18.11.2012 18:24:34
|
Przedszkolak
Postów: 84 Pomógł: 7 Ostrzeżeń: 2
Data rejestracji: 15.02.2011 21:39
|
Niestety wywala taki błąd: Fatal error: Call to a member function InitBlockade() on a non-object in /home/dbheart/public_html/infusions/shoutbox_panel/shoutbox_panel.php on line 153
Edytowane przez jozio_94 dnia 18.11.2012 18:51:30
|
|
|
|
BigLebowski |
Dodany dnia 18.11.2012 22:59:57
|
Przedszkolak
Postów: 58 Ostrzeżeń: 2
v7.02.05 Data rejestracji: 16.08.2012 14:24
|
Ja na marginesie mam drobną sugestię, że dobrze by było gdyby w poście u dołu przy którym otrzymaliśmy ostrzeżenie pojawiała się jego treść. (Mniej więcej tak jak na naszym supporcie). Wyglądało by to fajnie.
Dodatkowo zgłaszam, że z pointx nie specjalnie to działa. Mam na myśli opcję "punktów" przy dawaniu ostrzeżenia. |
|
|
|
Konto ukryte |
Dodany dnia 19.11.2012 13:46:19
|
Bywalec
Postów: 522 Pomógł: 6 Ostrzeżeń: 4
Data rejestracji: 17.02.2007 02:25
ZBANOWANY: Dożywotnio
|
Swietna sprawa. Wielkie dzięki Creeper YATB !! |
|
|
|
krystian1988 |
Dodany dnia 19.11.2012 15:55:19
|
Zaawansowany
Postów: 1187 Pomógł: 100
v7.02.07 Data rejestracji: 07.05.2009 17:37
|
Co do rang nadal nie ma poprawy, aczkolwiek ja poprawiłem:
otwieramy:
sylvia/system/SylviaForumGenerator.class.php
szukamy:
if ($user_level == 101) {
zamieniamy na:
if ($user_level >= 101) {
BRAK STOPKI = BRAK POMOCY NA SUPPORCIE.PRZECZYTAJ:
Regulamin Supportu Nie pomagam na PW!!!
|
|
|
|
Creeper |
Dodany dnia 19.11.2012 16:26:33
|
Początkujący
Postów: 290 Pomógł: 45
v7.02.06 Data rejestracji: 24.10.2011 14:51
|
BigLebowski napisał(a):
Ja na marginesie mam drobną sugestię, że dobrze by było gdyby w poście u dołu przy którym otrzymaliśmy ostrzeżenie pojawiała się jego treść. (Mniej więcej tak jak na naszym supporcie). Wyglądało by to fajnie.
Dodatkowo zgłaszam, że z pointx nie specjalnie to działa. Mam na myśli opcję "punktów" przy dawaniu ostrzeżenia.
Podaj jaki błąd się wyświetla, bo u mnie na stronie działa wszystko jak trzeba.
krystian1988 napisał(a):
Co do rang nadal nie ma poprawy, aczkolwiek ja poprawiłem:
otwieramy:
sylvia/system/SylviaForumGenerator.class.php
szukamy:
if ($user_level == 101) {
zamieniamy na:
if ($user_level >= 101) {
To w praktyce było zamierzone, gdyż Administracji nie można dodać ostrzeżenia więc nie ma sensu wyświetlanie stanu ostrzeżeń :) |
|
|