SF Shoutbox Panel (sf_shoutbox_panel)
|
kibel |
Dodany dnia 02.02.2010 00:06:42
|
Początkujący
Postów: 157 Pomógł: 8 Ostrzeżeń: 2
Data rejestracji: 01.02.2010 18:02
ZBANOWANY: Dożywotnio
|
Panel umożliwiający oddawanie głosów w shoutboxie
Instalacja:
1. Wrzucamy pliki sf_shoutbox_panel do infusion na serwerze
2. Podmieniamy plik global.php lub go edytujecie
Szukacie linie
$locale['global_159'] = "Wpisz kod potwierdzaj:";
i pod nim wklejacie
// SF Shoutbox Additions
$locale['global_160'] = "Słabe";
$locale['global_161'] = "Dobre";
3. Logujecie się jako Administrator i przechodzićie do instalacji wtyczek i instalujecie sf-shoutbox_panel.
4. Wchodzicie w zarządzanie panelami i z listy wybieracie sf_shoutbox_panel i go włączacie
PS. Pamiętajcie aby wyłączyć stary shoutbox, bo oba jednocześnie nie będą działać.
W zalaczniku paczka zawierajaca pliki jezykowe kolegi krystian1988/Pieka
kibel dodał/a następującą plik:
Edytowane przez Pieka dnia 02.02.2010 19:44:11
|
|
|
|
Wścibski Gość |
Dodany dnia 21.11.2024 15:53:33
|
Pan Kontekstualny
Postów: n^x
Data rejestracji: Zawsze
|
|
IP: localhost |
|
|
krystian1988 |
Dodany dnia 02.02.2010 09:06:33
|
Zaawansowany
Postów: 1187 Pomógł: 100
v7.02.07 Data rejestracji: 07.05.2009 17:37
|
Śmiga jak należy. Poprawka daję Polskie locale w paczce kolegi są tylko Angielskie. Wystarczy zamienić.
Poprawiona paczka pietro wyzej/Pieka
Edytowane przez Pieka dnia 02.02.2010 10:50:13
BRAK STOPKI = BRAK POMOCY NA SUPPORCIE.PRZECZYTAJ:
Regulamin Supportu Nie pomagam na PW!!!
|
|
|
|
kibel |
Dodany dnia 02.02.2010 14:37:30
|
Początkujący
Postów: 157 Pomógł: 8 Ostrzeżeń: 2
Data rejestracji: 01.02.2010 18:02
ZBANOWANY: Dożywotnio
|
Dzięki krystian1988 złą paczke wrzuciłem poprawiłem na samej górze.
Przepraszam nie doczytałem dobrze.
Edytowane przez kibel dnia 02.02.2010 14:42:32
|
|
|
|
krystian1988 |
Dodany dnia 14.02.2010 13:56:27
|
Zaawansowany
Postów: 1187 Pomógł: 100
v7.02.07 Data rejestracji: 07.05.2009 17:37
|
Jedna prośba dla całej ekipy robiłem takie coś jak u was w shoutboxie czyli zakaz umieszczania linków i reklam i nie wyświetla mi się dopiero jak kliknę w okienko shoutboxa mi się wyświetla a mój kod shoutboxa jest taki:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: sf_shoutbox_panel.php
| Author: Nick Jones (Digitanium)
| Modified: Starefossen
+--------------------------------------------------------+
| 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")) { die("Access Denied"); }
?>
<script>
$(document).ready(function() {
$('#search').focus(function() {
if ($(this).val() == 'Zakaz umieszczania linków i reklam !!!') $(this).val('');
}).blur(function() {
if ($(this).val() == '') $(this).val('Zakaz umieszczania linków i reklam !!!');
});
});
</script>
<?php
require_once INFUSIONS."sf_shoutbox_panel/inc/functions.php";
$link = FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "");
$link = preg_replace("^(&|\?)s_action=(edit|delete|n_vote|y_vote)&shout_id=\d*^", "", $link);
$sep = stristr($link, "?") ? "&" : "?";
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']."'"))) {
$result = dbquery("DELETE FROM ".DB_SHOUTBOX." WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
}
redirect($link);
}
openside($locale['global_150']);
if (iMEMBER || $settings['guestposts'] == "1") {
include_once INCLUDES."bbcode_include.php"; if (isset($_POST['post_shout'])) {
$flood = false;
if (iMEMBER) {
$shout_name = $userdata['user_id'];
} elseif ($settings['guestposts'] == "1") {
$shout_name = trim(stripinput($_POST['shout_name']));
$shout_name = preg_replace("(^[0-9]*)", "", $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 (checkwords($shout_message)) { redirect(INFUSIONS."sf_shoutbox_panel/shoutbox_archive.php?message=".$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']."'"))) {
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) VALUES ('$shout_name', '$shout_message', '".time()."', '".USER_IP."')");
}
}
redirect($link);
} elseif (iMEMBER && (isset($_GET['s_action']) && (($_GET['s_action'] == "n_vote") || ($_GET['s_action'] == "y_vote")))
&& (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$result = dbquery(
"SELECT SUM(COALESCE(sv.vote_value,0)) as vote_count, ts.*, COALESCE(sa.shout_amnesty,0) as amnesty, tu.user_level
FROM ".DB_SHOUTBOX." ts
LEFT JOIN ".DB_USERS." tu ON ts.shout_name=tu.user_id
LEFT JOIN ".DB_SF_SHOUT_VOTE." sv ON ts.shout_id=sv.shout_id
LEFT JOIN ".DB_SF_SHOUT_AMNESTY." sa ON ts.shout_id=sa.shout_id
WHERE ts.shout_id = ".$_GET['shout_id']."
GROUP BY ts.shout_id
HAVING amnesty = 1 OR vote_count > ".SF_VOTE_LIMIT."
ORDER BY ts.shout_datestamp DESC
LIMIT 1"
);
if (dbrows($result)) {
$data = dbarray($result);
if (iMEMBER && $data['shout_name'] != $userdata['user_id'] && $data['amnesty'] == 0 && $data['user_level'] == 101) {
if (!dbcount("(vote_id)", DB_SF_SHOUT_VOTE, "shout_id='".$data['shout_id']."' AND vote_user_id='".$userdata['user_id']."'")) {
$vote_value = ($_GET['s_action'] == "y_vote" ? "1" : "-1");
$result = dbquery("INSERT INTO ".DB_SF_SHOUT_VOTE." (
vote_user_id,
shout_id,
vote_value,
vote_datestamp
) VALUES (
'".$userdata['user_id']."',
'".$_GET['shout_id']."',
'$vote_value',
'".time()."
')");
}
}
}
redirect($link."#edit_shout");
} elseif (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$esresult = dbquery(
"SELECT ts.*, tu.user_id, tu.user_name FROM ".DB_SHOUTBOX." ts
LEFT JOIN ".DB_USERS." tu ON ts.shout_name=tu.user_id
WHERE ts.shout_id='".$_GET['shout_id']."'"
);
if (dbrows($esresult)) {
$esdata = dbarray($esresult);
if ((iADMIN && checkrights("S")) || (iMEMBER && $esdata['shout_name'] == $userdata['user_id'] && isset($esdata['user_name']))) {
if ((isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$edit_url = $sep."s_action=edit&shout_id=".$esdata['shout_id'];
} else {
$edit_url = ""; }
$shout_link = $link.$edit_url;
$shout_message = $esdata['shout_message'];
}
} else {
$shout_link = $link;
$shout_message = ""; }
} else {
$shout_link = $link;
$shout_message = ""; }
echo "<a id='edit_shout' name='edit_shout'></a>\n"; echo "<form name='chatform' method='post' action='".$shout_link."'>\n"; if (iGUEST) {
echo $locale['global_151']."<br />\n";
echo "<input type='text' name='shout_name' value='' class='textbox' maxlength='30' style='width:140px' /><br />\n";
echo $locale['global_152']."<br />\n";
}
echo "<textarea name='shout_message rows='4' cols='20' id='search' class='textbox' style='width:140px'>".$shout_message."</textarea><br />\n";
echo display_bbcodes("150px;", "shout_message", "chatform", "smiley|b|u|url|color")."\n";
if (iGUEST) {
echo $locale['global_158']."<br />\n";
echo "<img id='sb_captcha' src='".INCLUDES."securimage/securimage_show.php' alt='' /><br />\n";
echo "<a href='".INCLUDES."securimage/securimage_play.php'><img src='".INCLUDES."securimage/images/audio_icon.gif' alt='' class='tbl-border' style='margin-bottom:1px' /></a>\n";
echo "<a href='#' onclick=\"document.getElementById('sb_captcha').src = '".INCLUDES."securimage/securimage_show.php?sid=' + Math.random(); return false\"><img src='".INCLUDES."securimage/images/refresh.gif' alt='' class='tbl-border' /></a><br />\n";
echo $locale['global_159']."<br />\n<input type='text' name='sb_captcha_code' class='textbox' style='width:100px' /><br />\n";
}
echo "<br /><input type='submit' name='post_shout' value='".$locale['global_153']."' class='button' />\n";
echo "</form>\n<br />\n";
} else {
echo "<div style='text-align:center'>".$locale['global_154']."</div><br />\n";
}
$numrows = dbcount_sb();
$result = dbquery(
"SELECT SUM(COALESCE(sv.vote_value,0)) as vote_count, ts.*, COALESCE(sa.shout_amnesty,0) as amnesty, tu.user_id, tu.user_name, tu.user_level
FROM ".DB_SHOUTBOX." ts
LEFT JOIN ".DB_USERS." tu ON ts.shout_name=tu.user_id
LEFT JOIN ".DB_SF_SHOUT_VOTE." sv ON ts.shout_id=sv.shout_id
LEFT JOIN ".DB_SF_SHOUT_AMNESTY." sa ON ts.shout_id=sa.shout_id
GROUP BY ts.shout_id
HAVING amnesty = 1 OR vote_count > ".SF_VOTE_LIMIT."
ORDER BY ts.shout_datestamp DESC
LIMIT 0,".$settings['numofshouts']
);
if (dbrows($result)) {
$i = 0;
while ($data = dbarray($result)) {
echo "<div class='shoutboxname'>";
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";
}
// Vote Images Start
if ($data['user_level'] == 101) {
echo "<strong>";
if ($data['vote_count'] < 0) {
echo "<span style='color:red;'>".$data['vote_count']."</span>";
} else {
echo ($data['vote_count'] > 0 ? "<span style='color:green;'>+".$data['vote_count']."</span>" : $data['vote_count']);
}
echo "</strong>\n";
}
if (iMEMBER && $data['user_id'] != $userdata['user_id'] && $data['amnesty'] == 0 && $data['user_level'] == 101) {
if (!dbcount("(vote_id)", DB_SF_SHOUT_VOTE, "shout_id='".$data['shout_id']."' AND vote_user_id='".$userdata['user_id']."'")) {
echo "<a href='".$link.$sep."s_action=n_vote&shout_id=".$data['shout_id']."'>";
echo "<img src='".INFUSIONS."sf_shoutbox_panel/images/h_down_2.gif' border='0' alt='-' title='".$locale['global_160']."' width='15' height='13'
onmouseover=\"this.src='".INFUSIONS."sf_shoutbox_panel/images/h_down_1.gif';\"
onmouseout=\"this.src='".INFUSIONS."sf_shoutbox_panel/images/h_down_2.gif';\" />";
echo "</a> ";
echo "<a href='".$link.$sep."s_action=y_vote&shout_id=".$data['shout_id']."'>";
echo "<img src='".INFUSIONS."sf_shoutbox_panel/images/h_up_1.gif' border='0' alt='+' title='".$locale['global_161']."' width='13' height='13'
onmouseover=\"this.src='".INFUSIONS."sf_shoutbox_panel/images/h_up_2.gif';\"
onmouseout=\"this.src='".INFUSIONS."sf_shoutbox_panel/images/h_up_1.gif';\" />";
echo "</a>";
}
}
// Vote Images End
echo "</div>\n";
echo "<div class='shoutboxdate'>".showdate("shortdate", $data['shout_datestamp'])."</div>";
echo "<div class='shoutbox'>".sbwrap(parseubb(parsesmileys($data['shout_message']), "b|i|u|url|color"))."</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"."' class='side'>".$locale['global_076']."</a>]\n";
echo "[<a href='".$link.$sep."s_action=delete&shout_id=".$data['shout_id']."' class='side'>".$locale['global_157']."</a>]<br />\n";
}
$i++;
if ($i != $numrows) { echo "<br />\n"; }
}
if ($numrows > $settings['numofshouts']) {
echo "<div style='text-align:center'>\n<a href='".INFUSIONS."sf_shoutbox_panel/shoutbox_archive.php' class='side'>".$locale['global_155']."</a>\n</div>\n";
}
} else {
echo "<div>".$locale['global_156']."</div>\n";
}
closeside();
?>
BRAK STOPKI = BRAK POMOCY NA SUPPORCIE.PRZECZYTAJ:
Regulamin Supportu Nie pomagam na PW!!!
|
|
|
|
Kaeste |
Dodany dnia 07.03.2010 19:09:50
|
Przedszkolak
Postów: 18 Ostrzeżeń: 2
Data rejestracji: 25.02.2010 14:39
|
Mam pytanko czy da się shoutboxa umieścić tylko na forum, aby nie był widoczny na innych stronach? |
|
|
|
karoldinho |
Dodany dnia 07.03.2010 19:15:51
|
Przedszkolak
Postów: 78 Pomógł: 7 Ostrzeżeń: 1
Data rejestracji: 11.08.2009 14:36
|
Chyba najprostszym sposobem na zrobienie tego będzie wyłączenie SB w bocznym panelu i umieszczenie go w kodzie forum za pomocą:
";include "infusions/NAZWAPANELA/NAZWAPANELA.php";
echo"
Kliknij i zaczekaj na załadowanie kodu ...
Edytowane przez karoldinho dnia 07.03.2010 19:18:16
|
|
|
|
Kaeste |
Dodany dnia 07.03.2010 19:22:45
|
Przedszkolak
Postów: 18 Ostrzeżeń: 2
Data rejestracji: 25.02.2010 14:39
|
karoldinho napisał/a:
Chyba najprostszym sposobem na zrobienie tego będzie wyłączenie SB w bocznym panelu i umieszczenie go w kodzie forum za pomocą:
";include "infusions/NAZWAPANELA/NAZWAPANELA.php";
echo"
Kliknij i zaczekaj na załadowanie kodu ...
Bardzo Cię proszę o instrukcję dla blondynek. |
|
|
|
karoldinho |
Dodany dnia 07.03.2010 19:39:24
|
Przedszkolak
Postów: 78 Pomógł: 7 Ostrzeżeń: 1
Data rejestracji: 11.08.2009 14:36
|
:D No to tak:
1) Wchodzisz do folderu /FORUM/, szukasz i otwierasz plik INDEX.PHP
2) w dowolnym miejscu (tam gdzie chcesz mieć SB) wklejasz ten kod (dałem adres standardowego forum, ale jak masz inne to daj przekierowanie do odpowiedniego pliku i folderu)
include "../infusions/shoutbox_panel/shoutbox_panel.php";
Kliknij i zaczekaj na załadowanie kodu ...
Możesz ten kod wkleić przed linijką
require_once THEMES."templates/footer.php";
?>
Kliknij i zaczekaj na załadowanie kodu ...
Zapisujesz i gotowe :)
PAMIĘTAJ, że musisz wyłączyć panel w PA/Zarządzanie Stroną/Zarządzanie Panelami
Edytowane przez karoldinho dnia 07.03.2010 19:40:40
|
|
|
|
Kaeste |
Dodany dnia 07.03.2010 21:46:42
|
Przedszkolak
Postów: 18 Ostrzeżeń: 2
Data rejestracji: 25.02.2010 14:39
|
Niestety nie hula :(
Oto błąd który wyskakuje po wpisaniu tego co podałeś:
Fatal error: Call to undefined function openside() in /home/users/mercedesczwa/www/infusions/shoutbox_panel/shoutbox_panel.php on line 71
PW od moderatora:
- Ogólna Uwaga - Pieka 07.03 - 21:52
Edytowane przez Pieka dnia 07.03.2010 21:52:32
|
|
|
|
poki289 |
Dodany dnia 07.03.2010 21:49:18
|
Początkujący
Postów: 240 Pomógł: 33 Ostrzeżeń: 1
v7.02.07 Data rejestracji: 26.12.2009 05:49
|
Zobacz tak.
include INFUSIONS."shoutbox_panel/shoutbox_panel.php";
|
|
|
|
Kaeste |
Dodany dnia 07.03.2010 22:19:20
|
Przedszkolak
Postów: 18 Ostrzeżeń: 2
Data rejestracji: 25.02.2010 14:39
|
Dodaje to tak:
require_once "../maincore.php";
include INFUSIONS."shoutbox_panel/shoutbox_panel.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."forum/main.php";
i niestety też nie działa :/ |
|
|
|
karoldinho |
Dodany dnia 07.03.2010 22:27:33
|
Przedszkolak
Postów: 78 Pomógł: 7 Ostrzeżeń: 1
Data rejestracji: 11.08.2009 14:36
|
Podmień może pliki
shoutbox_panel.php
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| 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 www.gnu.org/licen... Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
$link = FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "");
$link = preg_replace("^(&|\?)s_action=(edit|delete)&shout_id=\d*^", "", $link);
$sep = stristr($link, "?") ? "&" : "?";
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']."'"))) {
$result = dbquery("DELETE FROM ".DB_SHOUTBOX." WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
}
redirect($link);
}
function sbwrap($text) {
$i = 0; $tags = 0; $chars = 0; $res = "";
$str_len = strlen($text);
for ($i = 0; $i < $str_len; $i++) {
$chr = substr($text, $i, 1);
if ($chr == "<") {
if (substr($text, ($i + 1), 6) == "a href" || substr($text, ($i + 1), 3) == "img") {
$chr = " ".$chr;
$chars = 0;
}
$tags++;
} elseif ($chr == "&") {
if (substr($text, ($i + 1), 5) == "quot;") {
$chars = $chars - 5;
} elseif (substr($text, ($i + 1), 4) == "amp;" || substr($text, ($i + 1), 4) == "#39;" || substr($text, ($i + 1), 4) == "#92;") {
$chars = $chars - 4;
} elseif (substr($text, ($i + 1), 3) == "lt;" || substr($text, ($i + 1), 3) == "gt;") {
$chars = $chars - 3;
}
} elseif ($chr == ">") {
$tags--;
} elseif ($chr == " ") {
$chars = 0;
} elseif (!$tags) {
$chars++;
}
if (!$tags && $chars == 18) {
$chr .= "<br />";
$chars = 0;
}
$res .= $chr;
}
return $res;
}
if (iMEMBER || $settings['guestposts'] == "1") {
include_once INCLUDES."bbcode_include.php";
if (isset($_POST['post_shout'])) {
$flood = false;
if (iMEMBER) {
$shout_name = $userdata['user_id'];
} elseif ($settings['guestposts'] == "1") {
$shout_name = trim(stripinput($_POST['shout_name']));
$shout_name = preg_replace("(^[0-9]*)", "", $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']."'"))) {
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) VALUES ('$shout_name', '$shout_message', '".time()."', '".USER_IP."')");
}
}
redirect($link);
}
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$esresult = dbquery(
"SELECT ts.*, tu.user_id, tu.user_name FROM ".DB_SHOUTBOX." ts
LEFT JOIN ".DB_USERS." tu ON ts.shout_name=tu.user_id
WHERE ts.shout_id='".$_GET['shout_id']."'"
);
if (dbrows($esresult)) {
$esdata = dbarray($esresult);
if ((iADMIN && checkrights("S")) || (iMEMBER && $esdata['shout_name'] == $userdata['user_id'] && isset($esdata['user_name']))) {
if ((isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$edit_url = $sep."s_action=edit&shout_id=".$esdata['shout_id'];
} else {
$edit_url = "";
}
$shout_link = $link.$edit_url;
$shout_message = $esdata['shout_message'];
}
} else {
$shout_link = $link;
$shout_message = "";
}
} else {
$shout_link = $link;
$shout_message = "";
}
echo "<a id='edit_shout' name='edit_shout'></a>\n";
echo "<form name='shout_form' method='post' action='".$shout_link."'>\n";
if (iGUEST) {
echo $locale['global_151']."<br />\n";
echo "<input type='text' name='shout_name' value='' class='textbox' maxlength='30' style='width:140px' /><br />\n";
echo $locale['global_152']."<br />\n";
}
echo "<textarea name='shout_message' rows='4' cols='20' class='textbox' style='width:140px'>".$shout_message."</textarea><br />\n";
echo display_bbcodes("150px;", "shout_message", "shout_form", "smiley|b|u|url|color")."\n";
if (iGUEST) {
echo $locale['global_158']."<br />\n";
echo "<img id='sb_captcha' src='".INCLUDES."securimage/securimage_show.php' alt='' /><br />\n";
echo "<a href='".INCLUDES."securimage/securimage_play.php'><img src='".INCLUDES."securimage/images/audio_icon.gif' alt='' class='tbl-border' style='margin-bottom:1px' /></a>\n";
echo "<a href='#' onclick=\"document.getElementById('sb_captcha').src = '".INCLUDES."securimage/securimage_show.php?sid=' + Math.random(); return false\"><img src='".INCLUDES."securimage/images/refresh.gif' alt='' class='tbl-border' /></a><br />\n";
echo $locale['global_159']."<br />\n<input type='text' name='sb_captcha_code' class='textbox' style='width:100px' /><br />\n";
}
echo "<br /><input type='submit' name='post_shout' value='".$locale['global_153']."' class='button' />\n";
echo "</form>\n<br />\n";
} else {
echo "<div style='text-align:center'>".$locale['global_154']."</div><br />\n";
}
$numrows = dbcount("(shout_id)", DB_SHOUTBOX);
$result = dbquery(
"SELECT ts.*, tu.user_id, tu.user_name FROM ".DB_SHOUTBOX." ts
LEFT JOIN ".DB_USERS." tu ON ts.shout_name=tu.user_id
ORDER BY ts.shout_datestamp DESC LIMIT 0,".$settings['numofshouts']
);
if (dbrows($result)) {
$i = 0;
while ($data = dbarray($result)) {
echo "<div class='shoutboxname'>";
if ($data['user_name']) {
echo "Dodał <a href='".BASEDIR."profile.php?lookup=".$data['shout_name']."' class='side'>".$data['user_name']."</a> ".showdate("shortdate", $data['shout_datestamp'])."";
} else {
echo $data['shout_name']."";
}
echo "</div>";
echo "<div class='shoutboxdate'></div>";
echo "<div class='shoutbox'>".sbwrap(parseubb(parsesmileys($data['shout_message']), "b|i|u|url|color"))."</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"."' class='side'>".$locale['global_076']."</a>]\n";
echo "[<a href='".$link.$sep."s_action=delete&shout_id=".$data['shout_id']."' class='side'>".$locale['global_157']."</a>]<br />\n";
}
$i++;
if ($i != $numrows) { echo "<br />\n"; }
}
if ($numrows > $settings['numofshouts']) {
echo "<div style='text-align:center'>\n<a href='".INFUSIONS."shoutbox_panel/shoutbox_archive.php' class='side'>".$locale['global_155']."</a>\n</div>\n";
}
} else {
echo "<div>".$locale['global_156']."</div>\n";
}
?>
Kliknij i zaczekaj na załadowanie kodu ...
forum/index.php
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| Filename: index.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 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 THEMES."templates/header.php";
include LOCALE.LOCALESET."forum/main.php";
if (!isset($lastvisited) || !isnum($lastvisited)) { $lastvisited = time(); }
add_to_title($locale['global_200'].$locale['400']);
opentable($locale['400']);
echo "<!--pre_forum_idx--><table cellpadding='0' cellspacing='1' width='100%' class='tbl-border forum_idx_table'>\n<tr>\n";
echo "<td colspan='2' class='tbl2'>".$locale['401']."</td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>".$locale['402']."</td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>".$locale['403']."</td>\n";
echo "<td width='1%' class='tbl2' style='white-space:nowrap'>".$locale['404']."</td>\n";
echo "</tr>\n";
$forum_list = ""; $current_cat = "";
$result = dbquery(
"SELECT f.*, f2.forum_name AS forum_cat_name, u.user_id, u.user_name
FROM ".DB_FORUMS." f
LEFT JOIN ".DB_FORUMS." f2 ON f.forum_cat = f2.forum_id
LEFT JOIN ".DB_USERS." u ON f.forum_lastuser = u.user_id
WHERE ".groupaccess('f.forum_access')." AND f.forum_cat!='0' GROUP BY forum_id ORDER BY f2.forum_order ASC, f.forum_order ASC"
);
if (dbrows($result) != 0) {
while ($data = dbarray($result)) {
if ($data['forum_cat_name'] != $current_cat) {
$current_cat = $data['forum_cat_name'];
echo "<tr>\n<td colspan='5' class='forum-caption forum_cat_name'><!--forum_cat_name-->".$data['forum_cat_name']."</td>\n</tr>\n";
}
$moderators = "";
if ($data['forum_moderators']) {
$mod_groups = explode(".", $data['forum_moderators']);
foreach ($mod_groups as $mod_group) {
if ($moderators) $moderators .= ", ";
$moderators .= $mod_group<101 ? "<a href='".BASEDIR."profile.php?group_id=".$mod_group."'>".getgroupname($mod_group)."</a>" : getgroupname($mod_group);
}
}
$forum_match = "\|".$data['forum_lastpost']."\|".$data['forum_id'];
if ($data['forum_lastpost'] > $lastvisited) {
if (iMEMBER && preg_match("({$forum_match}\.|{$forum_match}$)", $userdata['user_threads'])) {
$fim = "<img src='".get_image("folder")."' alt='".$locale['561']."' />";
} else {
$fim = "<img src='".get_image("foldernew")."' alt='".$locale['560']."' />";
}
} else {
$fim = "<img src='".get_image("folder")."' alt='".$locale['561']."' />";
}
echo "<tr>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>$fim</td>\n";
echo "<td class='tbl1 forum_name'><!--forum_name--><a href='viewforum.php?forum_id=".$data['forum_id']."'>".$data['forum_name']."</a><br />\n";
if ($data['forum_description'] || $moderators) {
echo "<span class='small'>".$data['forum_description'].($data['forum_description'] && $moderators ? "<br />\n" : "");
echo ($moderators ? "<strong>".$locale['411']."</strong>".$moderators."</span>\n" : "</span>\n")."\n";
}
echo "</td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>".$data['forum_threadcount']."</td>\n";
echo "<td align='center' width='1%' class='tbl1' style='white-space:nowrap'>".$data['forum_postcount']."</td>\n";
echo "<td width='1%' class='tbl2' style='white-space:nowrap'>";
if ($data['forum_lastpost'] == 0) {
echo $locale['405']."</td>\n</tr>\n";
} else {
echo showdate("forumdate", $data['forum_lastpost'])."<br />\n";
echo "<span class='small'>".$locale['406']."<a href='".BASEDIR."profile.php?lookup=".$data['forum_lastuser']."'>".$data['user_name']."</a></span></td>\n";
echo "</tr>\n";
}
}
} else {
echo "<tr>\n<td colspan='5' class='tbl1'>".$locale['407']."</td>\n</tr>\n";
}
echo "</table><!--sub_forum_idx_table-->\n<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
echo "<td class='forum'><br />\n";
echo "<img src='".get_image("foldernew")."' alt='".$locale['560']."' style='vertical-align:middle;' /> - ".$locale['409']."<br />\n";
echo "<img src='".get_image("folder")."' alt='".$locale['561']."' style='vertical-align:middle;' /> - ".$locale['410']."\n";
echo "</td><td align='right' valign='bottom' class='forum'>\n";
echo "<form name='searchform' method='get' action='".BASEDIR."search.php?stype=forums'>\n";
echo "<input type='hidden' name='stype' value='forums' />\n";
echo "<input type='text' name='stext' class='textbox' style='width:150px' />\n";
echo "<input type='submit' name='search' value='".$locale['550']."' class='button' />\n";
echo "</form>\n</td>\n</tr>\n</table><!--sub_forum_idx-->\n";
closetable();
include INFUSIONS."shoutbox_panel/shoutbox_panel.php";
require_once THEMES."templates/footer.php";
?>
Kliknij i zaczekaj na załadowanie kodu ... |
|
|
|
Kaeste |
Dodany dnia 07.03.2010 22:34:45
|
Przedszkolak
Postów: 18 Ostrzeżeń: 2
Data rejestracji: 25.02.2010 14:39
|
karoldinho napisał/a:
Podmień może pliki
shoutbox_panel.php
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| 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 www.gnu.org/licen... Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
$link = FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "");
$link = preg_replace("^(&|\?)s_action=(edit|delete)&shout_id=\d*^", "", $link);
$sep = stristr($link, "?") ? "&" : "?";
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']."'"))) {
$result = dbquery("DELETE FROM ".DB_SHOUTBOX." WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
}
redirect($link);
}
function sbwrap($text) {
$i = 0; $tags = 0; $chars = 0; $res = "";
$str_len = strlen($text);
for ($i = 0; $i < $str_len; $i++) {
$chr = substr($text, $i, 1);
if ($chr == "<") {
if (substr($text, ($i + 1), 6) == "a href" || substr($text, ($i + 1), 3) == "img") {
$chr = " ".$chr;
$chars = 0;
}
$tags++;
} elseif ($chr == "&") {
if (substr($text, ($i + 1), 5) == "quot;") {
$chars = $chars - 5;
} elseif (substr($text, ($i + 1), 4) == "amp;" || substr($text, ($i + 1), 4) == "#39;" || substr($text, ($i + 1), 4) == "#92;") {
$chars = $chars - 4;
} elseif (substr($text, ($i + 1), 3) == "lt;" || substr($text, ($i + 1), 3) == "gt;") {
$chars = $chars - 3;
}
} elseif ($chr == ">") {
$tags--;
} elseif ($chr == " ") {
$chars = 0;
} elseif (!$tags) {
$chars++;
}
if (!$tags && $chars == 18) {
$chr .= "<br />";
$chars = 0;
}
$res .= $chr;
}
return $res;
}
if (iMEMBER || $settings['guestposts'] == "1") {
include_once INCLUDES."bbcode_include.php";
if (isset($_POST['post_shout'])) {
$flood = false;
if (iMEMBER) {
$shout_name = $userdata['user_id'];
} elseif ($settings['guestposts'] == "1") {
$shout_name = trim(stripinput($_POST['shout_name']));
$shout_name = preg_replace("(^[0-9]*)", "", $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']."'"))) {
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) VALUES ('$shout_name', '$shout_message', '".time()."', '".USER_IP."')");
}
}
redirect($link);
}
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$esresult = dbquery(
"SELECT ts.*, tu.user_id, tu.user_name FROM ".DB_SHOUTBOX." ts
LEFT JOIN ".DB_USERS." tu ON ts.shout_name=tu.user_id
WHERE ts.shout_id='".$_GET['shout_id']."'"
);
if (dbrows($esresult)) {
$esdata = dbarray($esresult);
if ((iADMIN && checkrights("S")) || (iMEMBER && $esdata['shout_name'] == $userdata['user_id'] && isset($esdata['user_name']))) {
if ((isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$edit_url = $sep."s_action=edit&shout_id=".$esdata['shout_id'];
} else {
$edit_url = "";
}
$shout_link = $link.$edit_url;
$shout_message = $esdata['shout_message'];
}
} else {
$shout_link = $link;
$shout_message = "";
}
} else {
$shout_link = $link;
$shout_message = "";
}
echo "<a id='edit_shout' name='edit_shout'></a>\n";
echo "<form name='shout_form' method='post' action='".$shout_link."'>\n";
if (iGUEST) {
echo $locale['global_151']."<br />\n";
echo "<input type='text' name='shout_name' value='' class='textbox' maxlength='30' style='width:140px' /><br />\n";
echo $locale['global_152']."<br />\n";
}
echo "<textarea name='shout_message' rows='4' cols='20' class='textbox' style='width:140px'>".$shout_message."</textarea><br />\n";
echo display_bbcodes("150px;", "shout_message", "shout_form", "smiley|b|u|url|color")."\n";
if (iGUEST) {
echo $locale['global_158']."<br />\n";
echo "<img id='sb_captcha' src='".INCLUDES."securimage/securimage_show.php' alt='' /><br />\n";
echo "<a href='".INCLUDES."securimage/securimage_play.php'><img src='".INCLUDES."securimage/images/audio_icon.gif' alt='' class='tbl-border' style='margin-bottom:1px' /></a>\n";
echo "<a href='#' onclick=\"document.getElementById('sb_captcha').src = '".INCLUDES."securimage/securimage_show.php?sid=' + Math.random(); return false\"><img src='".INCLUDES."securimage/images/refresh.gif' alt='' class='tbl-border' /></a><br />\n";
echo $locale['global_159']."<br />\n<input type='text' name='sb_captcha_code' class='textbox' style='width:100px' /><br />\n";
}
echo "<br /><input type='submit' name='post_shout' value='".$locale['global_153']."' class='button' />\n";
echo "</form>\n<br />\n";
} else {
echo "<div style='text-align:center'>".$locale['global_154']."</div><br />\n";
}
$numrows = dbcount("(shout_id)", DB_SHOUTBOX);
$result = dbquery(
"SELECT ts.*, tu.user_id, tu.user_name FROM ".DB_SHOUTBOX." ts
LEFT JOIN ".DB_USERS." tu ON ts.shout_name=tu.user_id
ORDER BY ts.shout_datestamp DESC LIMIT 0,".$settings['numofshouts']
);
if (dbrows($result)) {
$i = 0;
while ($data = dbarray($result)) {
echo "<div class='shoutboxname'>";
if ($data['user_name']) {
echo "Dodał <a href='".BASEDIR."profile.php?lookup=".$data['shout_name']."' class='side'>".$data['user_name']."</a> ".showdate("shortdate", $data['shout_datestamp'])."";
} else {
echo $data['shout_name']."";
}
echo "</div>";
echo "<div class='shoutboxdate'></div>";
echo "<div class='shoutbox'>".sbwrap(parseubb(parsesmileys($data['shout_message']), "b|i|u|url|color"))."</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"."' class='side'>".$locale['global_076']."</a>]\n";
echo "[<a href='".$link.$sep."s_action=delete&shout_id=".$data['shout_id']."' class='side'>".$locale['global_157']."</a>]<br />\n";
}
$i++;
if ($i != $numrows) { echo "<br />\n"; }
}
if ($numrows > $settings['numofshouts']) {
echo "<div style='text-align:center'>\n<a href='".INFUSIONS."shoutbox_panel/shoutbox_archive.php' class='side'>".$locale['global_155']."</a>\n</div>\n";
}
} else {
echo "<div>".$locale['global_156']."</div>\n";
}
?>
Kliknij i zaczekaj na załadowanie kodu ...
forum/i ndex.php
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| Filename: index.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 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 THEMES."templates/header.php";
include LOCALE.LOCALESET."forum/main.php";
if (!isset($lastvisited) || !isnum($lastvisited)) { $lastvisited = time(); }
add_to_title($locale['global_200'].$locale['400']);
opentable($locale['400']);
echo "<!--pre_forum_idx--><table cellpadding='0' cellspacing='1' width='100%' class='tbl-border forum_idx_table'>\n<tr>\n";
echo "<td colspan='2' class='tbl2'>".$locale['401']."</td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>".$locale['402']."</td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>".$locale['403']."</td>\n";
echo "<td width='1%' class='tbl2' style='white-space:nowrap'>".$locale['404']."</td>\n";
echo "</tr>\n";
$forum_list = ""; $current_cat = "";
$result = dbquery(
"SELECT f.*, f2.forum_name AS forum_cat_name, u.user_id, u.user_name
FROM ".DB_FORUMS." f
LEFT JOIN ".DB_FORUMS." f2 ON f.forum_cat = f2.forum_id
LEFT JOIN ".DB_USERS." u ON f.forum_lastuser = u.user_id
WHERE ".groupaccess('f.forum_access')." AND f.forum_cat!='0' GROUP BY forum_id ORDER BY f2.forum_order ASC, f.forum_order ASC"
);
if (dbrows($result) != 0) {
while ($data = dbarray($result)) {
if ($data['forum_cat_name'] != $current_cat) {
$current_cat = $data['forum_cat_name'];
echo "<tr>\n<td colspan='5' class='forum-caption forum_cat_name'><!--forum_cat_name-->".$data['forum_cat_name']."</td>\n</tr>\n";
}
$moderators = "";
if ($data['forum_moderators']) {
$mod_groups = explode(".", $data['forum_moderators']);
foreach ($mod_groups as $mod_group) {
if ($moderators) $moderators .= ", ";
$moderators .= $mod_group<101 ? "<a href='".BASEDIR."profile.php?group_id=".$mod_group."'>".getgroupname($mod_group)."</a>" : getgroupname($mod_group);
}
}
$forum_match = "\|".$data['forum_lastpost']."\|".$data['forum_id'];
if ($data['forum_lastpost'] > $lastvisited) {
if (iMEMBER && preg_match("({$forum_match}\.|{$forum_match}$)", $userdata['user_threads'])) {
$fim = "<img src='".get_image("folder")."' alt='".$locale['561']."' />";
} else {
$fim = "<img src='".get_image("foldernew")."' alt='".$locale['560']."' />";
}
} else {
$fim = "<img src='".get_image("folder")."' alt='".$locale['561']."' />";
}
echo "<tr>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>$fim</td>\n";
echo "<td class='tbl1 forum_name'><!--forum_name--><a href='viewforum.php?forum_id=".$data['forum_id']."'>".$data['forum_name']."</a><br />\n";
if ($data['forum_description'] || $moderators) {
echo "<span class='small'>".$data['forum_description'].($data['forum_description'] && $moderators ? "<br />\n" : "");
echo ($moderators ? "<strong>".$locale['411']."</strong>".$moderators."</span>\n" : "</span>\n")."\n";
}
echo "</td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>".$data['forum_threadcount']."</td>\n";
echo "<td align='center' width='1%' class='tbl1' style='white-space:nowrap'>".$data['forum_postcount']."</td>\n";
echo "<td width='1%' class='tbl2' style='white-space:nowrap'>";
if ($data['forum_lastpost'] == 0) {
echo $locale['405']."</td>\n</tr>\n";
} else {
echo showdate("forumdate", $data['forum_lastpost'])."<br />\n";
echo "<span class='small'>".$locale['406']."<a href='".BASEDIR."profile.php?lookup=".$data['forum_lastuser']."'>".$data['user_name']."</a></span></td>\n";
echo "</tr>\n";
}
}
} else {
echo "<tr>\n<td colspan='5' class='tbl1'>".$locale['407']."</td>\n</tr>\n";
}
echo "</table><!--sub_forum_idx_table-->\n<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
echo "<td class='forum'><br />\n";
echo "<img src='".get_image("foldernew")."' alt='".$locale['560']."' style='vertical-align:middle;' /> - ".$locale['409']."<br />\n";
echo "<img src='".get_image("folder")."' alt='".$locale['561']."' style='vertical-align:middle;' /> - ".$locale['410']."\n";
echo "</td><td align='right' valign='bottom' class='forum'>\n";
echo "<form name='searchform' method='get' action='".BASEDIR."search.php?stype=forums'>\n";
echo "<input type='hidden' name='stype' value='forums' />\n";
echo "<input type='text' name='stext' class='textbox' style='width:150px' />\n";
echo "<input type='submit' name='search' value='".$locale['550']."' class='button' />\n";
echo "</form>\n</td>\n</tr>\n</table><!--sub_forum_idx-->\n";
closetable();
include INFUSIONS."shoutbox_panel/shoutbox_panel.php";
require_once THEMES."templates/footer.php";
?>
Kliknij i zaczekaj na załadowanie kodu ...
Sorki jestem zielony i początkujący nie mam pojęcia co mam zrobić :/
Chcę tylko prostej rzeczy by się shoutbox pojawia tylko na forum i to wszystko :(
Edytowane przez Kaeste dnia 07.03.2010 22:35:37
Samochód to jest Mercedes reszta to już tylko wynalazki
|
|
|
|
karoldinho |
Dodany dnia 07.03.2010 23:29:05
|
Przedszkolak
Postów: 78 Pomógł: 7 Ostrzeżeń: 1
Data rejestracji: 11.08.2009 14:36
|
Kaeste napisał/a:
karoldinho napisał/a:
Podmień może pliki
shoutbox_panel.php
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| 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 www.gnu.org/licen... Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
$link = FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "");
$link = preg_replace("^(&|\?)s_action=(edit|delete)&shout_id=\d*^", "", $link);
$sep = stristr($link, "?") ? "&" : "?";
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']."'"))) {
$result = dbquery("DELETE FROM ".DB_SHOUTBOX." WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
}
redirect($link);
}
function sbwrap($text) {
$i = 0; $tags = 0; $chars = 0; $res = "";
$str_len = strlen($text);
for ($i = 0; $i < $str_len; $i++) {
$chr = substr($text, $i, 1);
if ($chr == "<") {
if (substr($text, ($i + 1), 6) == "a href" || substr($text, ($i + 1), 3) == "img") {
$chr = " ".$chr;
$chars = 0;
}
$tags++;
} elseif ($chr == "&") {
if (substr($text, ($i + 1), 5) == "quot;") {
$chars = $chars - 5;
} elseif (substr($text, ($i + 1), 4) == "amp;" || substr($text, ($i + 1), 4) == "#39;" || substr($text, ($i + 1), 4) == "#92;") {
$chars = $chars - 4;
} elseif (substr($text, ($i + 1), 3) == "lt;" || substr($text, ($i + 1), 3) == "gt;") {
$chars = $chars - 3;
}
} elseif ($chr == ">") {
$tags--;
} elseif ($chr == " ") {
$chars = 0;
} elseif (!$tags) {
$chars++;
}
if (!$tags && $chars == 18) {
$chr .= "<br />";
$chars = 0;
}
$res .= $chr;
}
return $res;
}
if (iMEMBER || $settings['guestposts'] == "1") {
include_once INCLUDES."bbcode_include.php";
if (isset($_POST['post_shout'])) {
$flood = false;
if (iMEMBER) {
$shout_name = $userdata['user_id'];
} elseif ($settings['guestposts'] == "1") {
$shout_name = trim(stripinput($_POST['shout_name']));
$shout_name = preg_replace("(^[0-9]*)", "", $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']."'"))) {
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) VALUES ('$shout_name', '$shout_message', '".time()."', '".USER_IP."')");
}
}
redirect($link);
}
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$esresult = dbquery(
"SELECT ts.*, tu.user_id, tu.user_name FROM ".DB_SHOUTBOX." ts
LEFT JOIN ".DB_USERS." tu ON ts.shout_name=tu.user_id
WHERE ts.shout_id='".$_GET['shout_id']."'"
);
if (dbrows($esresult)) {
$esdata = dbarray($esresult);
if ((iADMIN && checkrights("S")) || (iMEMBER && $esdata['shout_name'] == $userdata['user_id'] && isset($esdata['user_name']))) {
if ((isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$edit_url = $sep."s_action=edit&shout_id=".$esdata['shout_id'];
} else {
$edit_url = "";
}
$shout_link = $link.$edit_url;
$shout_message = $esdata['shout_message'];
}
} else {
$shout_link = $link;
$shout_message = "";
}
} else {
$shout_link = $link;
$shout_message = "";
}
echo "<a id='edit_shout' name='edit_shout'></a>\n";
echo "<form name='shout_form' method='post' action='".$shout_link."'>\n";
if (iGUEST) {
echo $locale['global_151']."<br />\n";
echo "<input type='text' name='shout_name' value='' class='textbox' maxlength='30' style='width:140px' /><br />\n";
echo $locale['global_152']."<br />\n";
}
echo "<textarea name='shout_message' rows='4' cols='20' class='textbox' style='width:140px'>".$shout_message."</textarea><br />\n";
echo display_bbcodes("150px;", "shout_message", "shout_form", "smiley|b|u|url|color")."\n";
if (iGUEST) {
echo $locale['global_158']."<br />\n";
echo "<img id='sb_captcha' src='".INCLUDES."securimage/securimage_show.php' alt='' /><br />\n";
echo "<a href='".INCLUDES."securimage/securimage_play.php'><img src='".INCLUDES."securimage/images/audio_icon.gif' alt='' class='tbl-border' style='margin-bottom:1px' /></a>\n";
echo "<a href='#' onclick=\"document.getElementById('sb_captcha').src = '".INCLUDES."securimage/securimage_show.php?sid=' + Math.random(); return false\"><img src='".INCLUDES."securimage/images/refresh.gif' alt='' class='tbl-border' /></a><br />\n";
echo $locale['global_159']."<br />\n<input type='text' name='sb_captcha_code' class='textbox' style='width:100px' /><br />\n";
}
echo "<br /><input type='submit' name='post_shout' value='".$locale['global_153']."' class='button' />\n";
echo "</form>\n<br />\n";
} else {
echo "<div style='text-align:center'>".$locale['global_154']."</div><br />\n";
}
$numrows = dbcount("(shout_id)", DB_SHOUTBOX);
$result = dbquery(
"SELECT ts.*, tu.user_id, tu.user_name FROM ".DB_SHOUTBOX." ts
LEFT JOIN ".DB_USERS." tu ON ts.shout_name=tu.user_id
ORDER BY ts.shout_datestamp DESC LIMIT 0,".$settings['numofshouts']
);
if (dbrows($result)) {
$i = 0;
while ($data = dbarray($result)) {
echo "<div class='shoutboxname'>";
if ($data['user_name']) {
echo "Dodał <a href='".BASEDIR."profile.php?lookup=".$data['shout_name']."' class='side'>".$data['user_name']."</a> ".showdate("shortdate", $data['shout_datestamp'])."";
} else {
echo $data['shout_name']."";
}
echo "</div>";
echo "<div class='shoutboxdate'></div>";
echo "<div class='shoutbox'>".sbwrap(parseubb(parsesmileys($data['shout_message']), "b|i|u|url|color"))."</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"."' class='side'>".$locale['global_076']."</a>]\n";
echo "[<a href='".$link.$sep."s_action=delete&shout_id=".$data['shout_id']."' class='side'>".$locale['global_157']."</a>]<br />\n";
}
$i++;
if ($i != $numrows) { echo "<br />\n"; }
}
if ($numrows > $settings['numofshouts']) {
echo "<div style='text-align:center'>\n<a href='".INFUSIONS."shoutbox_panel/shoutbox_archive.php' class='side'>".$locale['global_155']."</a>\n</div>\n";
}
} else {
echo "<div>".$locale['global_156']."</div>\n";
}
?>
Kliknij i zaczekaj na załadowanie kodu ...
forum/i ndex.php
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| Filename: index.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 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 THEMES."templates/header.php";
include LOCALE.LOCALESET."forum/main.php";
if (!isset($lastvisited) || !isnum($lastvisited)) { $lastvisited = time(); }
add_to_title($locale['global_200'].$locale['400']);
opentable($locale['400']);
echo "<!--pre_forum_idx--><table cellpadding='0' cellspacing='1' width='100%' class='tbl-border forum_idx_table'>\n<tr>\n";
echo "<td colspan='2' class='tbl2'>".$locale['401']."</td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>".$locale['402']."</td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>".$locale['403']."</td>\n";
echo "<td width='1%' class='tbl2' style='white-space:nowrap'>".$locale['404']."</td>\n";
echo "</tr>\n";
$forum_list = ""; $current_cat = "";
$result = dbquery(
"SELECT f.*, f2.forum_name AS forum_cat_name, u.user_id, u.user_name
FROM ".DB_FORUMS." f
LEFT JOIN ".DB_FORUMS." f2 ON f.forum_cat = f2.forum_id
LEFT JOIN ".DB_USERS." u ON f.forum_lastuser = u.user_id
WHERE ".groupaccess('f.forum_access')." AND f.forum_cat!='0' GROUP BY forum_id ORDER BY f2.forum_order ASC, f.forum_order ASC"
);
if (dbrows($result) != 0) {
while ($data = dbarray($result)) {
if ($data['forum_cat_name'] != $current_cat) {
$current_cat = $data['forum_cat_name'];
echo "<tr>\n<td colspan='5' class='forum-caption forum_cat_name'><!--forum_cat_name-->".$data['forum_cat_name']."</td>\n</tr>\n";
}
$moderators = "";
if ($data['forum_moderators']) {
$mod_groups = explode(".", $data['forum_moderators']);
foreach ($mod_groups as $mod_group) {
if ($moderators) $moderators .= ", ";
$moderators .= $mod_group<101 ? "<a href='".BASEDIR."profile.php?group_id=".$mod_group."'>".getgroupname($mod_group)."</a>" : getgroupname($mod_group);
}
}
$forum_match = "\|".$data['forum_lastpost']."\|".$data['forum_id'];
if ($data['forum_lastpost'] > $lastvisited) {
if (iMEMBER && preg_match("({$forum_match}\.|{$forum_match}$)", $userdata['user_threads'])) {
$fim = "<img src='".get_image("folder")."' alt='".$locale['561']."' />";
} else {
$fim = "<img src='".get_image("foldernew")."' alt='".$locale['560']."' />";
}
} else {
$fim = "<img src='".get_image("folder")."' alt='".$locale['561']."' />";
}
echo "<tr>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>$fim</td>\n";
echo "<td class='tbl1 forum_name'><!--forum_name--><a href='viewforum.php?forum_id=".$data['forum_id']."'>".$data['forum_name']."</a><br />\n";
if ($data['forum_description'] || $moderators) {
echo "<span class='small'>".$data['forum_description'].($data['forum_description'] && $moderators ? "<br />\n" : "");
echo ($moderators ? "<strong>".$locale['411']."</strong>".$moderators."</span>\n" : "</span>\n")."\n";
}
echo "</td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>".$data['forum_threadcount']."</td>\n";
echo "<td align='center' width='1%' class='tbl1' style='white-space:nowrap'>".$data['forum_postcount']."</td>\n";
echo "<td width='1%' class='tbl2' style='white-space:nowrap'>";
if ($data['forum_lastpost'] == 0) {
echo $locale['405']."</td>\n</tr>\n";
} else {
echo showdate("forumdate", $data['forum_lastpost'])."<br />\n";
echo "<span class='small'>".$locale['406']."<a href='".BASEDIR."profile.php?lookup=".$data['forum_lastuser']."'>".$data['user_name']."</a></span></td>\n";
echo "</tr>\n";
}
}
} else {
echo "<tr>\n<td colspan='5' class='tbl1'>".$locale['407']."</td>\n</tr>\n";
}
echo "</table><!--sub_forum_idx_table-->\n<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
echo "<td class='forum'><br />\n";
echo "<img src='".get_image("foldernew")."' alt='".$locale['560']."' style='vertical-align:middle;' /> - ".$locale['409']."<br />\n";
echo "<img src='".get_image("folder")."' alt='".$locale['561']."' style='vertical-align:middle;' /> - ".$locale['410']."\n";
echo "</td><td align='right' valign='bottom' class='forum'>\n";
echo "<form name='searchform' method='get' action='".BASEDIR."search.php?stype=forums'>\n";
echo "<input type='hidden' name='stype' value='forums' />\n";
echo "<input type='text' name='stext' class='textbox' style='width:150px' />\n";
echo "<input type='submit' name='search' value='".$locale['550']."' class='button' />\n";
echo "</form>\n</td>\n</tr>\n</table><!--sub_forum_idx-->\n";
closetable();
include INFUSIONS."shoutbox_panel/shoutbox_panel.php";
require_once THEMES."templates/footer.php";
?>
Kliknij i zaczekaj na załadowanie kodu ...
Sorki jestem zielony i początkujący nie mam pojęcia co mam zrobić :/
Chcę tylko prostej rzeczy by się shoutbox pojawia tylko na forum i to wszystko :(
Te kody co ci dałem...masz podmieć odpowiednio w pliku shoutbox_panel.php i index.php na katalogu forum. Zamień starą treść tych plików na tą i sprawdź efekty. |
|
|
|
poki289 |
Dodany dnia 07.03.2010 23:55:20
|
Początkujący
Postów: 240 Pomógł: 33 Ostrzeżeń: 1
v7.02.07 Data rejestracji: 26.12.2009 05:49
|
Paczka z 1 posta jest uszkodzona, a mianowicie brak ; (średnik) w localach i dodatkowo folder wtyczki jest w katalogu locale.
Z tego co zauważyłem nie zawsze można dodać dwa wpisy, no i nie można oceniac wpisów Super Admina.
PS. Jak nikt sie nie podejmie to jutro wszystko poprawie, bo dzis juz czasu nie mam.
|
|
|
|
krystian1988 |
Dodany dnia 08.03.2010 06:50:30
|
Zaawansowany
Postów: 1187 Pomógł: 100
v7.02.07 Data rejestracji: 07.05.2009 17:37
|
Co to za zabawa głosować na Admina czy też Super Admina i tak ma pełne prawa to czy plus czy minus to i tak nie grają jakiejkolwiek roli. Chyba że chcesz to dostosować jako punkt dodający bądź odejmujący ze systemu EPS. Tak to sądzę że bez sensu, ale jak kto woli wystarczy tylko zmienić odnośniki kierujące Admin na members.
BRAK STOPKI = BRAK POMOCY NA SUPPORCIE.PRZECZYTAJ:
Regulamin Supportu Nie pomagam na PW!!!
|
|
|
|
Kaeste |
Dodany dnia 08.03.2010 20:28:30
|
Przedszkolak
Postów: 18 Ostrzeżeń: 2
Data rejestracji: 25.02.2010 14:39
|
karoldinho napisał/a:
Kaeste napisał/a:
karoldinho napisał/a:
Podmień może pliki
shoutbox_panel.php
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| 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 www.gnu.org/licen... Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
$link = FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "");
$link = preg_replace("^(&|\?)s_action=(edit|delete)&shout_id=\d*^", "", $link);
$sep = stristr($link, "?") ? "&" : "?";
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']."'"))) {
$result = dbquery("DELETE FROM ".DB_SHOUTBOX." WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
}
redirect($link);
}
function sbwrap($text) {
$i = 0; $tags = 0; $chars = 0; $res = "";
$str_len = strlen($text);
for ($i = 0; $i < $str_len; $i++) {
$chr = substr($text, $i, 1);
if ($chr == "<") {
if (substr($text, ($i + 1), 6) == "a href" || substr($text, ($i + 1), 3) == "img") {
$chr = " ".$chr;
$chars = 0;
}
$tags++;
} elseif ($chr == "&") {
if (substr($text, ($i + 1), 5) == "quot;") {
$chars = $chars - 5;
} elseif (substr($text, ($i + 1), 4) == "amp;" || substr($text, ($i + 1), 4) == "#39;" || substr($text, ($i + 1), 4) == "#92;") {
$chars = $chars - 4;
} elseif (substr($text, ($i + 1), 3) == "lt;" || substr($text, ($i + 1), 3) == "gt;") {
$chars = $chars - 3;
}
} elseif ($chr == ">") {
$tags--;
} elseif ($chr == " ") {
$chars = 0;
} elseif (!$tags) {
$chars++;
}
if (!$tags && $chars == 18) {
$chr .= "<br />";
$chars = 0;
}
$res .= $chr;
}
return $res;
}
if (iMEMBER || $settings['guestposts'] == "1") {
include_once INCLUDES."bbcode_include.php";
if (isset($_POST['post_shout'])) {
$flood = false;
if (iMEMBER) {
$shout_name = $userdata['user_id'];
} elseif ($settings['guestposts'] == "1") {
$shout_name = trim(stripinput($_POST['shout_name']));
$shout_name = preg_replace("(^[0-9]*)", "", $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']."'"))) {
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) VALUES ('$shout_name', '$shout_message', '".time()."', '".USER_IP."')");
}
}
redirect($link);
}
if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$esresult = dbquery(
"SELECT ts.*, tu.user_id, tu.user_name FROM ".DB_SHOUTBOX." ts
LEFT JOIN ".DB_USERS." tu ON ts.shout_name=tu.user_id
WHERE ts.shout_id='".$_GET['shout_id']."'"
);
if (dbrows($esresult)) {
$esdata = dbarray($esresult);
if ((iADMIN && checkrights("S")) || (iMEMBER && $esdata['shout_name'] == $userdata['user_id'] && isset($esdata['user_name']))) {
if ((isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$edit_url = $sep."s_action=edit&shout_id=".$esdata['shout_id'];
} else {
$edit_url = "";
}
$shout_link = $link.$edit_url;
$shout_message = $esdata['shout_message'];
}
} else {
$shout_link = $link;
$shout_message = "";
}
} else {
$shout_link = $link;
$shout_message = "";
}
echo "<a id='edit_shout' name='edit_shout'></a>\n";
echo "<form name='shout_form' method='post' action='".$shout_link."'>\n";
if (iGUEST) {
echo $locale['global_151']."<br />\n";
echo "<input type='text' name='shout_name' value='' class='textbox' maxlength='30' style='width:140px' /><br />\n";
echo $locale['global_152']."<br />\n";
}
echo "<textarea name='shout_message' rows='4' cols='20' class='textbox' style='width:140px'>".$shout_message."</textarea><br />\n";
echo display_bbcodes("150px;", "shout_message", "shout_form", "smiley|b|u|url|color")."\n";
if (iGUEST) {
echo $locale['global_158']."<br />\n";
echo "<img id='sb_captcha' src='".INCLUDES."securimage/securimage_show.php' alt='' /><br />\n";
echo "<a href='".INCLUDES."securimage/securimage_play.php'><img src='".INCLUDES."securimage/images/audio_icon.gif' alt='' class='tbl-border' style='margin-bottom:1px' /></a>\n";
echo "<a href='#' onclick=\"document.getElementById('sb_captcha').src = '".INCLUDES."securimage/securimage_show.php?sid=' + Math.random(); return false\"><img src='".INCLUDES."securimage/images/refresh.gif' alt='' class='tbl-border' /></a><br />\n";
echo $locale['global_159']."<br />\n<input type='text' name='sb_captcha_code' class='textbox' style='width:100px' /><br />\n";
}
echo "<br /><input type='submit' name='post_shout' value='".$locale['global_153']."' class='button' />\n";
echo "</form>\n<br />\n";
} else {
echo "<div style='text-align:center'>".$locale['global_154']."</div><br />\n";
}
$numrows = dbcount("(shout_id)", DB_SHOUTBOX);
$result = dbquery(
"SELECT ts.*, tu.user_id, tu.user_name FROM ".DB_SHOUTBOX." ts
LEFT JOIN ".DB_USERS." tu ON ts.shout_name=tu.user_id
ORDER BY ts.shout_datestamp DESC LIMIT 0,".$settings['numofshouts']
);
if (dbrows($result)) {
$i = 0;
while ($data = dbarray($result)) {
echo "<div class='shoutboxname'>";
if ($data['user_name']) {
echo "Dodał <a href='".BASEDIR."profile.php?lookup=".$data['shout_name']."' class='side'>".$data['user_name']."</a> ".showdate("shortdate", $data['shout_datestamp'])."";
} else {
echo $data['shout_name']."";
}
echo "</div>";
echo "<div class='shoutboxdate'></div>";
echo "<div class='shoutbox'>".sbwrap(parseubb(parsesmileys($data['shout_message']), "b|i|u|url|color"))."</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"."' class='side'>".$locale['global_076']."</a>]\n";
echo "[<a href='".$link.$sep."s_action=delete&shout_id=".$data['shout_id']."' class='side'>".$locale['global_157']."</a>]<br />\n";
}
$i++;
if ($i != $numrows) { echo "<br />\n"; }
}
if ($numrows > $settings['numofshouts']) {
echo "<div style='text-align:center'>\n<a href='".INFUSIONS."shoutbox_panel/shoutbox_archive.php' class='side'>".$locale['global_155']."</a>\n</div>\n";
}
} else {
echo "<div>".$locale['global_156']."</div>\n";
}
?>
Kliknij i zaczekaj na załadowanie kodu ...
forum/i ndex.php
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| Filename: index.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 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 THEMES."templates/header.php";
include LOCALE.LOCALESET."forum/main.php";
if (!isset($lastvisited) || !isnum($lastvisited)) { $lastvisited = time(); }
add_to_title($locale['global_200'].$locale['400']);
opentable($locale['400']);
echo "<!--pre_forum_idx--><table cellpadding='0' cellspacing='1' width='100%' class='tbl-border forum_idx_table'>\n<tr>\n";
echo "<td colspan='2' class='tbl2'>".$locale['401']."</td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>".$locale['402']."</td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>".$locale['403']."</td>\n";
echo "<td width='1%' class='tbl2' style='white-space:nowrap'>".$locale['404']."</td>\n";
echo "</tr>\n";
$forum_list = ""; $current_cat = "";
$result = dbquery(
"SELECT f.*, f2.forum_name AS forum_cat_name, u.user_id, u.user_name
FROM ".DB_FORUMS." f
LEFT JOIN ".DB_FORUMS." f2 ON f.forum_cat = f2.forum_id
LEFT JOIN ".DB_USERS." u ON f.forum_lastuser = u.user_id
WHERE ".groupaccess('f.forum_access')." AND f.forum_cat!='0' GROUP BY forum_id ORDER BY f2.forum_order ASC, f.forum_order ASC"
);
if (dbrows($result) != 0) {
while ($data = dbarray($result)) {
if ($data['forum_cat_name'] != $current_cat) {
$current_cat = $data['forum_cat_name'];
echo "<tr>\n<td colspan='5' class='forum-caption forum_cat_name'><!--forum_cat_name-->".$data['forum_cat_name']."</td>\n</tr>\n";
}
$moderators = "";
if ($data['forum_moderators']) {
$mod_groups = explode(".", $data['forum_moderators']);
foreach ($mod_groups as $mod_group) {
if ($moderators) $moderators .= ", ";
$moderators .= $mod_group<101 ? "<a href='".BASEDIR."profile.php?group_id=".$mod_group."'>".getgroupname($mod_group)."</a>" : getgroupname($mod_group);
}
}
$forum_match = "\|".$data['forum_lastpost']."\|".$data['forum_id'];
if ($data['forum_lastpost'] > $lastvisited) {
if (iMEMBER && preg_match("({$forum_match}\.|{$forum_match}$)", $userdata['user_threads'])) {
$fim = "<img src='".get_image("folder")."' alt='".$locale['561']."' />";
} else {
$fim = "<img src='".get_image("foldernew")."' alt='".$locale['560']."' />";
}
} else {
$fim = "<img src='".get_image("folder")."' alt='".$locale['561']."' />";
}
echo "<tr>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>$fim</td>\n";
echo "<td class='tbl1 forum_name'><!--forum_name--><a href='viewforum.php?forum_id=".$data['forum_id']."'>".$data['forum_name']."</a><br />\n";
if ($data['forum_description'] || $moderators) {
echo "<span class='small'>".$data['forum_description'].($data['forum_description'] && $moderators ? "<br />\n" : "");
echo ($moderators ? "<strong>".$locale['411']."</strong>".$moderators."</span>\n" : "</span>\n")."\n";
}
echo "</td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>".$data['forum_threadcount']."</td>\n";
echo "<td align='center' width='1%' class='tbl1' style='white-space:nowrap'>".$data['forum_postcount']."</td>\n";
echo "<td width='1%' class='tbl2' style='white-space:nowrap'>";
if ($data['forum_lastpost'] == 0) {
echo $locale['405']."</td>\n</tr>\n";
} else {
echo showdate("forumdate", $data['forum_lastpost'])."<br />\n";
echo "<span class='small'>".$locale['406']."<a href='".BASEDIR."profile.php?lookup=".$data['forum_lastuser']."'>".$data['user_name']."</a></span></td>\n";
echo "</tr>\n";
}
}
} else {
echo "<tr>\n<td colspan='5' class='tbl1'>".$locale['407']."</td>\n</tr>\n";
}
echo "</table><!--sub_forum_idx_table-->\n<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
echo "<td class='forum'><br />\n";
echo "<img src='".get_image("foldernew")."' alt='".$locale['560']."' style='vertical-align:middle;' /> - ".$locale['409']."<br />\n";
echo "<img src='".get_image("folder")."' alt='".$locale['561']."' style='vertical-align:middle;' /> - ".$locale['410']."\n";
echo "</td><td align='right' valign='bottom' class='forum'>\n";
echo "<form name='searchform' method='get' action='".BASEDIR."search.php?stype=forums'>\n";
echo "<input type='hidden' name='stype' value='forums' />\n";
echo "<input type='text' name='stext' class='textbox' style='width:150px' />\n";
echo "<input type='submit' name='search' value='".$locale['550']."' class='button' />\n";
echo "</form>\n</td>\n</tr>\n</table><!--sub_forum_idx-->\n";
closetable();
include INFUSIONS."shoutbox_panel/shoutbox_panel.php";
require_once THEMES."templates/footer.php";
?>
Kliknij i zaczekaj na załadowanie kodu ...
Sorki jestem zielony i początkujący nie mam pojęcia co mam zrobić :/
Chcę tylko prostej rzeczy by się shoutbox pojawia tylko na forum i to wszystko :(
Te kody co ci dałem...masz podmieć odpowiednio w pliku shoutbox_panel.php i index.php na katalogu forum. Zamień starą treść tych plików na tą i sprawdź efekty.
Dobra powiedzmy że hula tylko jedno małe ale.. Shoutbox jest pośrodku a nie na boku jak był poprzednio :/ Da się to zmienić?
Dodatkowo jest taki błąd iż mianowicie jak klikasz na Archiwum Shoutboxa to przenosi na stronę główną tak gdzie był poprzednio shoutbox.
Edytowane przez Kaeste dnia 28.03.2010 14:13:25
Samochód to jest Mercedes reszta to już tylko wynalazki
|
|
|