[MOD] Shoutbox i linki
|
Wooya |
Dodany dnia 09.01.2007 08:59:39
|
Zaawansowany
Postów: 1449 Pomógł: 22
Data rejestracji: 30.01.2005 15:40
|
Problem linkow w shoutbox'ie boli zaloge supportu, ale niektorzy moze i by chcieli miec na swojej stronie mozliwosc parsowania linkow do postaci np. malej graficzki. Oto rozwiazanie, ktore zaczerpnelem z ... mFusion :D
Na przykladzie shoutbox'a z PHP-Fusion v6.01.6.
1) otwieramy plik infusions/shoutbox_panel/shoutbox_panel.php, odnajdujemy linijke #27:
$shout_message = preg_replace("/([^\s]{25})/", "$1\n", $shout_message);
oraz #29:
$shout_message = str_replace("\n", "<br>", $shout_message);
i je usuwamy.
2) za linia #12:
if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }
wstawiamy funkcje mywordwrap() i zmienna $link_replacement:
$link_replacement = "<img src='".INFUSIONS."shoutbox_panel/images/link.gif' alt='link' style='border:none'>";
function mywordwrap($string, $wlenght='20', $replacement="<wbr>") {
$length = strlen($string);
$skip = 0;
$wrap = 0;
$returnvar = "";
for ($i=0; $i<=$length; $i=$i+1) {
$char = substr($string, $i, 1);
if ($char == "<") $skip=1;
elseif ($char == ">") $skip=0;
elseif ($char == " ") $wrap=0;
if ($skip==0) $wrap=$wrap+1;
$returnvar = $returnvar . $char;
if ($wrap>$wlenght) {
$returnvar = $returnvar.$replacement;
$wrap = 0;
}
}
return $returnvar;
}
3) linijke #88:
echo "<br>\n<span class='shoutbox'>".parsesmileys($data['shout_message'])."</span><br>\n";
zastępujemy tymi:
$shouttext = $data['shout_message'];
$shouttext = parsesmileys($shouttext);
//replace links with link image
$shouttext = preg_replace("#(^|[\r\n ]|^\])((http|https|ftp|ftps)://[\w\#$%&~/.\-;:=,?@\[\]+]*)(|[\r\n ]|^\[)#si", "\\1<a href=\"\\2\" target=\"_blank\" title=\"autolink\">".$link_replacement."</a> ", $shouttext);
$shouttext = preg_replace("#(^|[\r\n ]|^\])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)(|[\r\n ]|^\[)#si", "\\1<a href=\"http://\\2\" target=\"_blank\" title=\"autolink\">".$link_replacement."</a> ", $shouttext);
//parsing urls only with domain without www\ftp, http(s): or ftp(s): at the beggining
$shouttext = preg_replace("#(^|[\r\n ]|^\])([\w\#$%&~/.\-;:=,?@\[\]+]*\.(html|php3|htm|php|com|net|org|info|biz|aero|coop|museum|name|pro|gov|edu|mil|int|ac|ad|ae|ag|am|as|au|bb|be|bg|bi|bm|br|bt|bv|ca|cc|cd|ch|ck|cl|cm|cn|cr|cu|cx|cz|de|dk|do|ec|ee|es|fj|fm|fo|fr|gb|ge|gi|gl|gm|gr|gs|gt|gu|hk|hm|hr|hu|id|ir|ie|il|in|io|is|it|jo|jp|kr|ky|kz|lb|li|lk|lt|lu|ly|mc|mn|ms|mw|mx|na|nc|nl|no|nu|nz|pe|ph|pk|pl|pm|py|re|ro|ru|sa|se|sg|sh|si|sk|sm|su|tc|tf|th|tj|to|tr|tv|tw|ua|ue|ug|uk|us|uy|uz|va|vc|vg|vi|vn|vu|wf|ws|za|ai|al|an|ao|ar|az|ba|bf|bn|bo|bs|by|bz|cg|ci|co|cy|dz|eg|fi|fk|ga|gg|gh|im|je|ke|kg|kh|lc|lv|mc|mh|mo|mp|mr|mt|my|ni|np|om|pn|pt|ga|rw|sb|sc|sj|sn|sv|tp|af|aw|bd|bh|bj|bw|cf|cv|dj|dm|eh|er|et|gd|gf|gn|gq|gw|gy|ht|iq|jm|ki|km|kn|kp|kw|la|lr|ls|ma|mg|mk|ml|mm|mq|mu|mv|mz|ne|nf|ng|nr|pa|pf|pg|pr|pw|sd|sl|so|sr|st|sy|sz|td|tg|tk|tm|tt|tz|um|ye|zm|zw|agent|arts|auction|chat|church|club|family|free|game|golf|inc|kids|law|llc|llp|love|ltd|med|mp3|school|scifi|shop|soc|sport|tech|travel|video|xxx|america|com2|etc|earth|not|online|usa|z))(|[\r\n ]|^\[)#si", "\\1<a href=\"http://\\2\" target=\"_blank\" title=\"autolink\">".$link_replacement."</a> ", $shouttext);
//replace links with link image
$shouttext = nl2br($shouttext);
$shouttext = mywordwrap($shouttext, 20, " ");
echo "<br>\n<span class='shoutbox'>".$shouttext."</span><br>\n";
4) otwieramy plik infusions/shoutbox_panel/shoutbox_archive.php i odnajdujemy linijke #39:
echo "<br>\n".str_replace("<br>", "", parsesmileys($data['shout_message']))."</td>\n</tr>\n";
i zastepujemy tymi:
$link_replacement = "<img src='".INFUSIONS."shoutbox_panel/images/link.gif' alt='link' style='border:none'>";
$shoutmessage = $data['shout_message'];
$shoutmessage = parsesmileys($shoutmessage);
//replace links with link image
$shoutmessage = preg_replace("#(^|[\r\n ]|^\])((http|https|ftp|ftps)://[\w\#$%&~/.\-;:=,?@\[\]+]*)(|[\r\n ]|^\[)#si", "\\1<a href=\"\\2\" target=\"_blank\" title=\"autolink\">".$link_replacement."</a> ", $shoutmessage);
$shoutmessage = preg_replace("#(^|[\r\n ]|^\])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)(|[\r\n ]|^\[)#si", "\\1<a href=\"http://\\2\" target=\"_blank\" title=\"autolink\">".$link_replacement."</a> ", $shoutmessage);
//parsing urls only with domain without www\ftp, http(s): or ftp(s): at the beggining
$shoutmessage = preg_replace("#(^|[\r\n ]|^\])([\w\#$%&~/.\-;:=,?@\[\]+]*\.(html|php3|htm|php|com|net|org|info|biz|aero|coop|museum|name|pro|gov|edu|mil|int|ac|ad|ae|ag|am|as|au|bb|be|bg|bi|bm|br|bt|bv|ca|cc|cd|ch|ck|cl|cm|cn|cr|cu|cx|cz|de|dk|do|ec|ee|es|fj|fm|fo|fr|gb|ge|gi|gl|gm|gr|gs|gt|gu|hk|hm|hr|hu|id|ir|ie|il|in|io|is|it|jo|jp|kr|ky|kz|lb|li|lk|lt|lu|ly|mc|mn|ms|mw|mx|na|nc|nl|no|nu|nz|pe|ph|pk|pl|pm|py|re|ro|ru|sa|se|sg|sh|si|sk|sm|su|tc|tf|th|tj|to|tr|tv|tw|ua|ue|ug|uk|us|uy|uz|va|vc|vg|vi|vn|vu|wf|ws|za|ai|al|an|ao|ar|az|ba|bf|bn|bo|bs|by|bz|cg|ci|co|cy|dz|eg|fi|fk|ga|gg|gh|im|je|ke|kg|kh|lc|lv|mc|mh|mo|mp|mr|mt|my|ni|np|om|pn|pt|ga|rw|sb|sc|sj|sn|sv|tp|af|aw|bd|bh|bj|bw|cf|cv|dj|dm|eh|er|et|gd|gf|gn|gq|gw|gy|ht|iq|jm|ki|km|kn|kp|kw|la|lr|ls|ma|mg|mk|ml|mm|mq|mu|mv|mz|ne|nf|ng|nr|pa|pf|pg|pr|pw|sd|sl|so|sr|st|sy|sz|td|tg|tk|tm|tt|tz|um|ye|zm|zw|agent|arts|auction|chat|church|club|family|free|game|golf|inc|kids|law|llc|llp|love|ltd|med|mp3|school|scifi|shop|soc|sport|tech|travel|video|xxx|america|com2|etc|earth|not|online|usa|z))(|[\r\n ]|^\[)#si", "\\1<a href=\"http://\\2\" target=\"_blank\" title=\"autolink\">".$link_replacement."</a> ", $shoutmessage);
//replace links with link image
echo "<br>\n".$shoutmessage."</td>\n</tr>\n";
5) nastepnie w katalogu infusions/shoutbox_panel/ tworzymy katalog images i wrzucamy tam obrazek o nazwie link.gif, np. ten >>>
Od tego czasu wszelkie linki w shoutbox'ie beda pokazywane w postaci tejze graficzki. Oczywiscie wystarczy na ta strzaleczke kliknac, aby przeniesc sie na strone ukryta pod nia :) Parser dziala na linki zaczynajace sie od http(s), ftp(s), www/ftp oraz na linki konczace sie na wszelkie znane domeny.
To na tyle ja - zly Wooya B)
Wooya dodał/a następującą grafikę:
Edytowane przez Pieka dnia 28.01.2008 21:45:00
... Pomagam tylko przy najnowszych wersjach PHP-Fusion ...
|
|
|
|
Wścibski Gość |
Dodany dnia 25.11.2024 03:43:54
|
Pan Kontekstualny
Postów: n^x
Data rejestracji: Zawsze
|
|
IP: localhost |
|
|
tywonek |
Dodany dnia 11.02.2007 22:57:20
|
Przedszkolak
Postów: 4
Data rejestracji: 29.08.2006 23:15
|
Wiesz co, łamią mi się te linki. To znaczy że tylko część długiego linku zastępowana jest prawidłowo, reszta pozostaje tekstem. Chodzi o stare linki które były dodane wcześniej
Edytowane przez tywonek dnia 11.02.2007 22:59:34
|
|
|
|
sd88 |
Dodany dnia 18.03.2007 18:29:18
|
Przedszkolak
Postów: 29
Data rejestracji: 30.01.2007 15:31
Złamana licencja
|
A jest może możliwość taka żeby nie otwierało strony |
|
|
|
ziteek |
Dodany dnia 04.11.2007 10:54:50
|
Przedszkolak
Postów: 9
Data rejestracji: 03.11.2007 22:59
|
Wooya czy zrobil byś to na przykładzie shoutbox'a PHP-Fusion v6.00.3
Proszę o odp/ |
|
|
|
Pieka |
Dodany dnia 04.11.2007 12:45:07
|
Postów: 19882 Pomógł: 767
v7.02.03 Data rejestracji: 23.02.2005 18:12
|
ziteek napisał/a:
Wooya czy zrobil byś to na przykładzie shoutbox'a PHP-Fusion v6.00.3
Proszę o odp/
Sprawdz na swojej wersji zamiast pytac.
Zmiany podane przez Wooye w zasadzie nie sa zalezne od wersji strony.
Nie sprawdzalem, ale powinno dzialac bez problemu.
Jestem jaki jestem
|
|
|
|
TIREXRMP |
Dodany dnia 23.11.2007 10:47:15
|
Przedszkolak
Postów: 18
Data rejestracji: 28.09.2007 23:21
ZBANOWANY: Dożywotnio
|
Zostalem odeslany do tego tematu, wiec pisze (mam nadzieje, ze tym razem mod/admin oprze sie pokusie i nie wywali mojego posta), wiec tak - slyszalem, ze mozna tak zmodyfikowac kod, zeby zamiast tego obrazka, pod ktorym jest link wyswietlal sie jakis napis (zamiast linka). Moglby mi ktos powiedziec jaki plik modyfikowac i co ew. zmienic ? ;> |
|
|
|
Pieka |
Dodany dnia 23.11.2007 11:47:57
|
Postów: 19882 Pomógł: 767
v7.02.03 Data rejestracji: 23.02.2005 18:12
|
TIREXRMP napisał/a:
Zostalem odeslany do tego tematu, wiec pisze (mam nadzieje, ze tym razem mod/admin oprze sie pokusie i nie wywali mojego posta), wiec tak - slyszalem, ze mozna tak zmodyfikowac kod, zeby zamiast tego obrazka, pod ktorym jest link wyswietlal sie jakis napis (zamiast linka). Moglby mi ktos powiedziec jaki plik modyfikowac i co ew. zmienic ? ;>
Nie bede modyfikowal kodu Wooyi, ale podam Ci inne i wielokrotnie stosowane rozwiazanie.
Edytuj plik shoutbox_panel.php i zaraz pod:
if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }
Wstaw nowa funkcje. I tu dam Ci do wyboru dwa rodzaje zachowan.
1. Zamiana linkow na tekst:
function parseurls($text)
{
$ret = ' ' . $text;
$ret = preg_replace( "`((http)+(s)?:(//)|(www\.))((\w|\.|\-|_)+)(/)?(\S+)?`i", "<b>Tu był link i został usunięty!</b>", $ret);
$ret = str_replace( "<br>", "", $ret);
$ret = substr($ret, 1);
return($ret);
}
2. Zamiana linkow na podlinkowane slowo "Link":
function parseurls($text)
{
$ret = ' ' . $text;
$ret = preg_replace( "`((http)+(s)?:(//)|(www\.))((\w|\.|\-|_)+)(/)?(\S+)?`i", "<a href=\"http\\3://\\5\\6\\8\\9\" target=\"_blank\">Link</a>", $ret);
$ret = str_replace( "<br>", "", $ret);
$ret = substr($ret, 1);
return($ret);
}
Nastepnie znajdz:
echo "<br>\n<span class='shoutbox'>".parsesmileys($data['shout_message'])."</span><br>\n";
I zamien na:
echo "<br>\n<span class='shoutbox'>".parseurls(parsesmileys($data['shout_message']))."</span><br>\n";
Idealne to nie jest, ale w wiekszosci przypadkow spelnia swoje zadanie :)
Edytowane przez Pieka dnia 23.11.2007 11:51:43
Jestem jaki jestem
|
|
|
|
TIREXRMP |
Dodany dnia 23.11.2007 12:11:49
|
Przedszkolak
Postów: 18
Data rejestracji: 28.09.2007 23:21
ZBANOWANY: Dożywotnio
|
Serdecznie dziękuje, dziala pięknie
Edytowane przez Pieka dnia 23.11.2007 12:18:52
|
|
|
|
2k7 |
Dodany dnia 20.01.2008 18:46:18
|
Przedszkolak
Postów: 12
Data rejestracji: 11.12.2007 12:37
ZBANOWANY: Dożywotnio
|
Mam pytanie.
Trzeba usunąć m.in. te linijki -
$shout_message = preg_replace("/^(.{255}).*$/", "$1", $shout_message);
$shout_message = preg_replace("/([^\s]{25})/", "$1\n", $shout_message);
Jednak na mam dodaną modyfikację Shoutbox z ajaxem by slawekneo (+ dodatkową mofyfikację, którą podał/a Pieka) i jest mały problem. Otóż jak nie ma tych linijek, to sb się czasami rozjeżdża (w wypadku, gdy ktoś napisze coś w tym stylu "bla_bla_bla"). Więc czy w pliku "shoutbox_panel.php" lub "message.php" możnaby było dodać funkcję, która limitowała by ilość znaków w jeden linii ?
Jeśli tak, to proszę o naprowadzenie mnie ;)
Mysle, ze dosc rzeczowo napisalem ocb :(
Dzis grzebalem troche w plikach shoutbox_panel.php, message.php i actions.php, ale nie mogę znaleźć tego, co potrzebuje, a jak jakis gamon pisze wszystko bez spacji, to sb ma z 20 cm długośći :/
Mysle, ze dosc rzeczowo napisalem ocb :(
Dzis grzebalem troche w plikach shoutbox_panel.php, message.php i actions.php, ale nie mogę znaleźć tego, co potrzebuje, a jak jakis gamon pisze wszystko bez spacji, to sb ma z 20 cm długośći :/
Edytowane przez 2k7 dnia 26.01.2008 15:49:42
|
|
|
|
TIREXRMP |
Dodany dnia 28.01.2008 21:03:40
|
Przedszkolak
Postów: 18
Data rejestracji: 28.09.2007 23:21
ZBANOWANY: Dożywotnio
|
Masz problem z zawijaniem wierszy (wordwrap).
Mysle, ze te dwie linijki trzeba wkleic do pliku "message.php", tylko w ktorym miejscu... ? |
|
|
|
Pieka |
Dodany dnia 28.01.2008 21:47:52
|
Postów: 19882 Pomógł: 767
v7.02.03 Data rejestracji: 23.02.2005 18:12
|
TIREXRMP napisał/a:
Masz problem z zawijaniem wierszy (wordwrap).
Mysle, ze te dwie linijki trzeba wkleic do pliku "message.php", tylko w ktorym miejscu... ?
Wierz mi lub nie, ale z pewnoscia nie w message.php, tylko actions.php
W pliku shotbox'a, a gdzie dokladnie dowiesz sie zagladajac do oryginalnego pliku panela.
Edytowane przez Pieka dnia 28.01.2008 21:52:25
Jestem jaki jestem
|
|
|
|
2k7 |
Dodany dnia 29.01.2008 17:57:46
|
Przedszkolak
Postów: 12
Data rejestracji: 11.12.2007 12:37
ZBANOWANY: Dożywotnio
|
W oryginalnej paczce z PHP Fusion nie mam pliku actios.php :/
Próbowałem coś podziałać, jednak to nie dawało rezultatów. Co prawda są tam linie, które niby za to odpowiadją, ale nadal się rozwala :/
<?php
require_once "../../maincore.php";
if($typek == "add"){
if (iMEMBER) {
$shout_name = $userdata['user_id'];
} elseif ($settings['guestposts'] == "1") {
$shout_name = trim(stripinput($_POST[sn]));
$shout_name = preg_replace("{255})", "", $shout_name);
$shout_name = "G_".$shout_name;
if (isNum($shout_name)) $shout_name="";
}
$shout_message = str_replace("\n", " ", $_POST[sm]);
$shout_message = preg_replace("/^(.{255}).*$/", "$1", $shout_message);
$shout_message = str_replace("[", " [", $shout_message);
$shout_message = preg_replace("/([^\s]{20})/", "$1\n", $shout_message);
$shout_message = trim(stripinput(censorwords($shout_message)));
$shout_message = str_replace("\n", "<br>", $shout_message);
$shout_messagee = str_replace("\n", "", $_POST[sm]);
if ($shout_name != "" && $shout_message != "" && $shout_name != "G_") {
dbquery("INSERT INTO ".$db_prefix."shoutbox (shout_name, shout_message, shout_datestamp, shout_ip) VALUES ('".$shout_name."', '".$shout_message."', '".time()."', '".USER_IP."')");
$oneMessage = true;
}
include INFUSIONS."shoutbox_panel/message.php";
} else if($typek == "dell"){
if(isNum($_GET['shoutid']) and iADMIN) $result = dbquery("DELETE FROM ".DB_PREFIX."shoutbox WHERE shout_id='".$_GET['shoutid']."'");
$oneMessage = true;
include INFUSIONS."shoutbox_panel/message.php";
} else if($typek == "editt"){
$shout_message = str_replace("\n", " ", $_POST['sm']);
$shout_message = preg_replace("/^(.{255}).*$/", "$1", $shout_message);
$shout_message = str_replace("[", " [", $shout_message);
$shout_message = preg_replace("/([^\s]{20})/", "$1\n", $shout_message);
$shout_message = trim(stripinput(censorwords($shout_message)));
$shout_message = str_replace("\n", "<br>", $shout_message);
if(isNum($_GET['shoutid']) and iADMIN) dbquery("UPDATE ".$db_prefix."shoutbox SET shout_message='$shout_message'WHERE shout_id='".$_GET['shoutid']."'");
$oneMessage = true;
include INFUSIONS."shoutbox_panel/message.php";
} else if($typek == "ref") {
if(!$oneMessage) $oneMessage = true;
else $oneMessage = false;
include INFUSIONS."shoutbox_panel/message.php";
}
?>
Help :( |
|
|
|
Eastbamo |
Dodany dnia 22.03.2008 18:25:53
|
Przedszkolak
Postów: 55 Ostrzeżeń: 2
Data rejestracji: 13.11.2006 18:23
|
Hmm, chłopaki a wiecie może jak zrobić odpowiednik tego moda na Panel Shoutboxa z Extreme Fusion IV ??
By Eastbamo::..
|
|
|
|
bartek124 |
Dodany dnia 23.03.2008 14:03:32
|
Weteran
Postów: 3264 Pomógł: 236
v7.02.06 Data rejestracji: 26.05.2007 12:25
|
Podobnie. Tylko linijek do usuwania nie musisz usuwać. Wklejasz funkcję a potem przypisujesz ją do $shout_message.
Nie pomagam na komunikatorach oraz PW!
|
|
|
|
Eastbamo |
Dodany dnia 24.03.2008 13:06:50
|
Przedszkolak
Postów: 55 Ostrzeżeń: 2
Data rejestracji: 13.11.2006 18:23
|
Nie za bardzo Cię kolego rozumiem :D .
Co gdzie i jak mam przypisać :D??
To jest mój kod shoutbox_panel.php z extreme fusion:
<?php
/*---------------------------------------------------+
| eXtreme-Fusion Content Management System |
+----------------------------------------------------+
| Copyright (c) 2005 eXtreme Crew |
| http://www.extreme-fusion.pl |
+----------------------------------------------------+
| Engine Php-fusion by Nick Jones |
| http://www.php-fusion.co.uk/ |
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the |
| GNU General Public License. For details refer to |
| the included gpl.txt file or visit http://gnu.org |
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }
if (isset($_GET[id]) && !isNum($_GET[id])) fallback(FUSION_SELF);
if (isset($_GET[shout]) && !preg_match("#(add|edit|delete)#iu", $_GET[shout])) fallback(FUSION_SELF);
define("SBX_EDIT_USER", $settings[sbx_edit_user]);
$shout = $_GET[shout]; $id = $_GET[id];
openside($locale['120']);
if (iMEMBER || $settings['guestposts'] == "1") {
$result = dbquery("SELECT * FROM ".$db_prefix."shoutbox WHERE shout_id='".$id."'");
if (dbrows($result)) $sdata = dbarray($result);
if (isset($_POST['post_shout']) && isset($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="";
}
$shout_message = str_replace("\n", " ", $_POST['shout_message']);
$shout_message = preg_replace("/^(.{999}).*$/", "$1", $shout_message);
$shout_message = str_replace("[", " [", $shout_message);
$shout_message = preg_replace("/([^\s]{21})/", "$1\n", $shout_message);
$shout_message = trim(stripinput(censorwords($shout_message)));
$shout_message = str_replace("\n", "<br>", $shout_message);
if ($shout_name != "" && $shout_message != "") {
$result = dbquery("SELECT MAX(shout_datestamp) AS last_shout FROM ".$db_prefix."shoutbox WHERE shout_ip='".USER_IP."'");
if (!iSUPERADMIN && dbrows($result) > 0) {
$data = dbarray($result);
if ((time() - $data['last_shout']) < $settings['flood_interval']) {
$flood = true;
$result = dbquery("INSERT INTO ".$db_prefix."flood_control (flood_ip, flood_timestamp) VALUES ('".USER_IP."', '".time()."')");
if (dbcount("(flood_ip)", "flood_control", "flood_ip='".USER_IP."'") > 4) {
if (iMEMBER) $result = dbquery("UPDATE ".$db_prefix."users SET user_status='1' WHERE user_id='".$userdata['user_id']."'");
}
}
}
if (!$flood) {
$lin = FUSION_QUERY;
if ($shout =='add') {
$result = dbquery("INSERT INTO ".$db_prefix."shoutbox (shout_name, shout_message, shout_datestamp, shout_ip) VALUES ('$shout_name', '$shout_message', '".time()."', '".USER_IP."')");
if (EPS && iMEMBER) {
$przydzial = dbarray(dbquery("SELECT point_ammount from ".DB_PREFIX."eps_points WHERE point_id='2'"));
$result = dbquery("UPDATE ".DB_PREFIX."users SET points_normal=points_normal+".($przydzial['point_ammount'])." WHERE user_id='".$userdata['user_id']."'");
}
}
if ($shout =='edit' AND checkrights("S")
OR SBX_EDIT_USER AND iMEMBER AND $sdata['shout_name'] == $userdata['user_id']) {
$result = dbquery("UPDATE ".$db_prefix."shoutbox SET shout_message='$shout_message' WHERE shout_id='".$id."'");
}
$lin = str_replace("&shout=$shout&id=$id", '', $lin);
$lin = str_replace("shout=$shout&id=$id", '', $lin);
if($lin != '') redirect(FUSION_SELF."?".$lin);
else redirect(FUSION_SELF.$lin);
}
}
}
if (
isset($shout) AND isset($id) AND isNum($id) AND checkrights("S")
OR isset($shout) AND isset($id) AND isNum($id) AND !checkrights("S") AND iMEMBER AND $sdata['shout_name'] == $userdata['user_id'] AND SBX_EDIT_USER
) {
if ($shout == 'edit') {
$shout_message = str_replace("<br>", "", $sdata[shout_message]);
$shout_message = str_replace(" [", "[", $shout_message);
} else if ($shout == 'delete') {
$result = dbquery("DELETE from ".$db_prefix."shoutbox WHERE shout_id='".$id."'");
$lin = FUSION_QUERY;
$lin = str_replace("&shout=$shout&id=$id", '', $lin);
$lin = str_replace("shout=$shout&id=$id", '', $lin);
if($lin != '') redirect(FUSION_SELF."?".$lin);
else redirect(FUSION_SELF.$lin);
}
} else {
$id = 0;
$shout = 'add';
$shout_message = '';
$shout_name = '';
}
if(iMEMBER){
$caution_r = dbquery("SELECT * from ".$db_prefix."cautions WHERE user_id=".$userdata['user_id']);
$caution = dbarray($caution_r);
$c_count = dbrows($caution_r);
$caution_conf = dbarray(dbquery("SELECT * from ".$db_prefix."cautions_config"));
}
if ($c_count > $caution_conf['shoutbox']) {
echo $caution_conf['shoutbox_info']."<br><br>";
} else {
if ($shout == 'add') {
echo "<form name='chatform' method='post' action='".FUSION_SELF.(FUSION_QUERY ? "?".str_replace("&","&",FUSION_QUERY."&shout=$shout&id=$id") : "?shout=add&id=$id")."'>";
} else {
echo "<form name='chatform' method='post' action='".FUSION_SELF.(FUSION_QUERY ? "?".str_replace("&","&",FUSION_QUERY) : "?shout=$shout&id=$id")."'>";
}
echo"
<table align='center' cellpadding='0' cellspacing='0'>
<tr>
<td colspan='2' style='text-align:center;'>\n";
if (iGUEST) {
echo $locale['121']."<br>
<input type='text' name='shout_name' value='$shout_name' class='textbox' maxlength='30' style='width:140px;'><br>
".$locale['122']."<br>\n";
}
echo" <textarea name='shout_message' rows='4' class='textbox' style='width:140px;'>$shout_message</textarea>";
echo" <center><A href=\"javascript:show_hide(ShowHide2)\"><img border='0' src='".INFUSIONS."shoutbox_panel/images/icon_select.gif' vspace='2' title='".$locale['129']."'></a> ";
echo" <A href=\"javascript:show_hide(ShowHide7)\"><img border='0' src='".INFUSIONS."shoutbox_panel/images/icon_bbcode.gif' vspace='2' title='BBCode'></a> ";
echo" <a href='".INFUSIONS."shoutbox_panel/shoutboxhelp.php'><img border='0' src='".INFUSIONS."shoutbox_panel/images/icon_help.gif' vspace='2' title='".$locale['130']."'></a>";
echo" <div id='ShowHide2'><FIELDSET><LEGEND>".$locale['131']."</LEGEND>";
echo displaysmileys("shout_message", 1)."</FIELDSET><script>show_hide(ShowHide2)</script></div>";
echo" <div id='ShowHide7'><FIELDSET><LEGEND>BBCode</LEGEND><center><input type='button' value='b' class='button' style='font-weight:bold;width:25px;' onClick=\"addText2('shout_message', '[b]', '[/b]');\">";
echo" <input type='button' value='i' class='button' style='font-style:italic;width:25px;' onClick=\"addText2('shout_message', '[i]', '[/i]');\">";
echo" <input type='button' value='u' class='button' style='text-decoration:underline;width:25px;' onClick=\"addText2('shout_message', '[u]', '[/u]');\"></center><br>";
echo" <select name='bbcolor' class='textbox' style='width:90px;' onChange=\"addText2('shout_message', '[color=' + this.options[this.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;\">
<option value=''>Default</option>
<option value='maroon' style='color:maroon;'>Maroon</option>
<option value='red' style='color:red;'>Red</option>
<option value='orange' style='color:orange;'>Orange</option>
<option value='brown' style='color:brown;'>Brown</option>
<option value='yellow' style='color:yellow;'>Yellow</option>
<option value='green' style='color:green;'>Green</option>
<option value='lime' style='color:lime;'>Lime</option>
<option value='olive' style='color:olive;'>Olive</option>
<option value='cyan' style='color:cyan;'>Cyan</option>
<option value='blue' style='color:blue;'>Blue</option>
<option value='navy' style='color:navy;'>Navy Blue</option>
<option value='purple' style='color:purple;'>Purple</option>
<option value='violet' style='color:violet;'>Violet</option>
<option value='black' style='color:black;'>Black</option>
<option value='gray' style='color:gray;'>Gray</option>
<option value='silver' style='color:silver;'>Silver</option>
<option value='white' style='color:white;'>White</option>
</select></FIELDSET>";
echo" </td>
</tr>";
echo" <tr>
<td align='center'>
<input type='submit' name='post_shout' value='".$locale['123']."' class='button'>";
echo" </td>
</tr>
</table></form></div>\n";
echo"<script>show_hide(ShowHide7)</script>";
}
echo"<br>\n";
} else {
echo"<center>".$locale['125']."</center><br>\n";
}
$result = dbquery("
SELECT * FROM ".DB_PREFIX."shoutbox
LEFT JOIN ".DB_PREFIX."users ON ".DB_PREFIX."shoutbox.shout_name=".DB_PREFIX."users.user_id
ORDER BY shout_datestamp DESC LIMIT 0,".$settings['numofshouts']
);
echo" <script type='text/javascript' src='".INFUSIONS."shoutbox_panel/js/lighttable.js' language='Javascript'></script>";
echo" <script type=\"text/javascript\">
iens6=document.all||document.getElementById
ns4=document.layers
//specify speed of scroll (greater=faster)
var speed=5
if (iens6){
document.write('<div id=\"container\" style=\"position:relative;width:100%;height:230px;border:0px solid #444444;overflow:hidden\">')
document.write('<div id=\"content\" style=\"position:absolute;width:100%;left:0;top:0\">')
}
</script>";
echo "<ilayer name=\"nscontainer\" width=100% height=250 clip=\"0,0,277,400\">";
echo "<layer name=\"nscontent\" width=100% height=250 visibility=hidden>";
if (dbrows($result) > 0) {
$gouest_opt = dbarray(dbquery("SELECT * FROM ".$db_prefix."colors WHERE user_level=0"));
while ($data = dbarray($result)) {
echo"<FIELDSET><LEGEND><span class='shoutboxname'>";
$user = "<span style='color:#".$data['user_color']."'>".$data['user_prefix'].$data['user_name']."</span>";
if ($data['user_name']) {
echo"<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' class='side'>$user</a><br>\n";
} else {
echo"<span style='color:#".$gouest_opt['user_color']."'>".$gouest_opt['user_prefix'].$data['shout_name']."</span>\n";
}
echo"</span></LEGEND>";
if (checkrights("S") AND $shout != "edit"){
echo "[ <a href='".FUSION_SELF.(FUSION_QUERY ? "?".str_replace("&","&",FUSION_QUERY)."&shout=delete&id=".$data['shout_id'] : "?shout=delete&id=".$data['shout_id'])."'>".$locale['133']."</a> | <a href='".FUSION_SELF.(FUSION_QUERY ? "?".str_replace("&","&",FUSION_QUERY)."&shout=edit&id=".$data['shout_id'] : "?shout=edit&id=".$data['shout_id'])."'>".$locale['134']."</a> ]<br><font style='font-style:italic;font-family:Tahoma;font-size:8;color:#777777;'>IP: ".$data['user_ip']."</font><br>";
} elseif (SBX_EDIT_USER AND iMEMBER AND $data['shout_name'] == $userdata['user_id'] AND $id == "" AND !checkrights("S")) {
echo "[ <a href='".FUSION_SELF.(FUSION_QUERY ? "?".str_replace("&","&",FUSION_QUERY)."&shout=edit&id=".$data['shout_id'] : "?shout=edit&id=".$data['shout_id'])."'>".$locale['134']."</a> ]<br>";
} else {
echo "\n";
}
echo "<span class='shoutboxdate'><font style='font-style:italic;font-family:Tahoma;font-size:8;color:#777777;'>".$locale['135']." ".showdate("shortdate", $data['shout_datestamp'])."</font></span><br>";
$mes = str_replace(" [", "[", $data[shout_message]);
$mes = nl2br(parseubb(parsesmileys($mes)));
echo "<span class='shoutbox'>".$mes ."</span></FIELDSET>";
echo "<br>\n";
}
} else {
echo "<div align='left'>".$locale['127']."</div>\n";
}
echo "</layer></ilayer><script language=\"JavaScript1.2\">
if (iens6)
document.write('</div></div>')
</script>";
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><td><p align=\"right\">";
echo "<a href=\"#\" onMouseover=\"moveup()\" onMouseout=\"clearTimeout(moveupvar)\"><img src=\"".INFUSIONS."shoutbox_panel/images/up.gif\" border=\"0\"></a> ";
echo "<a href=\"#\" onMouseover=\"movedown()\" onMouseout=\"clearTimeout(movedownvar)\"><img src=\"".INFUSIONS."shoutbox_panel/images/down.gif\" border=\"0\"></a>";
echo "</td></table>";
if (iMEMBER) {
echo "<hr><center>\n<img border='0' src='".THEME."images/bullet.gif'> ";
echo "<a href='".INFUSIONS."shoutbox_panel/shoutbox_archive.php' class='side'>".$locale['126']."</a> ";
echo "<img border='0' src='".THEME."images/bulletb.gif'></center>\n";
} else {
echo "<div align='left'></div>\n";
}
echo "<script language=\"JavaScript1.2\">
if (iens6) {
var crossobj=document.getElementById? document.getElementById(\"content\") : document.all.content
var contentheight=crossobj.offsetHeight
}
else if (ns4) {
var crossobj=document.nscontainer.document.nscontent
var contentheight=crossobj.clip.height
}
function movedown(){
if (iens6&&parseInt(crossobj.style.top)>=(contentheight*(-1)+100))
crossobj.style.top=parseInt(crossobj.style.top)-speed+\"px\"
else if (ns4&&crossobj.top>=(contentheight*(-1)+100))
crossobj.top-=speed
movedownvar=setTimeout(\"movedown()\",20)
}
function moveup(){
if (iens6&&parseInt(crossobj.style.top)<=0)
crossobj.style.top=parseInt(crossobj.style.top)+speed+\"px\"
else if (ns4&&crossobj.top<=0)
crossobj.top+=speed
moveupvar=setTimeout(\"moveup()\",20)
}
function getcontent_height(){
if (iens6)
contentheight=crossobj.offsetHeight
else if (ns4)
document.nscontainer.document.nscontent.visibility=\"show\"
}
window.onload=getcontent_height
</script>";
closeside();
?>
Ok, chłopacy z Extreme Fusion już mi pomogli - http://extreme-fu...840#post_0
Edytowane przez Eastbamo dnia 24.03.2008 14:38:59
By Eastbamo::..
|
|
|
|
bartek124 |
Dodany dnia 24.03.2008 16:05:56
|
Weteran
Postów: 3264 Pomógł: 236
v7.02.06 Data rejestracji: 26.05.2007 12:25
|
<?php
/*---------------------------------------------------+
| eXtreme-Fusion Content Management System |
+----------------------------------------------------+
| Copyright (c) 2005 eXtreme Crew |
| http://www.extrem... |
+----------------------------------------------------+
| Engine Php-fusion by Nick Jones |
| http://www.php-fu... |
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the |
| GNU General Public License. For details refer to |
| the included gpl.txt file or visit http://gnu.org |
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }
$link_replacement = "<img src='".INFUSIONS."shoutbox_panel/images/link.gif' alt='link' style='border:none'>";
function mywordwrap($string, $wlenght='20', $replacement="<wbr>") {
$length = strlen($string);
$skip = 0;
$wrap = 0;
$returnvar = "";
for ($i=0; $i<=$length; $i=$i+1) {
$char = substr($string, $i, 1);
if ($char == "<") $skip=1;
elseif ($char == ">") $skip=0;
elseif ($char == " ") $wrap=0;
if ($skip==0) $wrap=$wrap+1;
$returnvar = $returnvar . $char;
if ($wrap>$wlenght) {
$returnvar = $returnvar.$replacement;
$wrap = 0;
}
}
return $returnvar;
}
if (isset($_GET[id]) && !isNum($_GET[id])) fallback(FUSION_SELF);
if (isset($_GET[shout]) && !preg_match("#(add|edit|delete)#iu", $_GET[shout])) fallback(FUSION_SELF);
define("SBX_EDIT_USER", $settings[sbx_edit_user]);
$shout = $_GET[shout]; $id = $_GET[id];
openside($locale['120']);
if (iMEMBER || $settings['guestposts'] == "1") {
$result = dbquery("SELECT * FROM ".$db_prefix."shoutbox WHERE shout_id='".$id."'");
if (dbrows($result)) $sdata = dbarray($result);
if (isset($_POST['post_shout']) && isset($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="";
}
$shout_message = str_replace("\n", " ", $_POST['shout_message']);
$shout_message = preg_replace("/^(.{999}).*$/", "$1", $shout_message);
$shout_message = str_replace("[", " [", $shout_message);
$shout_message = preg_replace("/([^\s]{21})/", "$1\n", $shout_message);
$shout_message = trim(stripinput(censorwords($shout_message)));
$shout_message = str_replace("\n", "<br>", $shout_message);
if ($shout_name != "" && $shout_message != "") {
$result = dbquery("SELECT MAX(shout_datestamp) AS last_shout FROM ".$db_prefix."shoutbox WHERE shout_ip='".USER_IP."'");
if (!iSUPERADMIN && dbrows($result) > 0) {
$data = dbarray($result);
if ((time() - $data['last_shout']) < $settings['flood_interval']) {
$flood = true;
$result = dbquery("INSERT INTO ".$db_prefix."flood_control (flood_ip, flood_timestamp) VALUES ('".USER_IP."', '".time()."')");
if (dbcount("(flood_ip)", "flood_control", "flood_ip='".USER_IP."'") > 4) {
if (iMEMBER) $result = dbquery("UPDATE ".$db_prefix."users SET user_status='1' WHERE user_id='".$userdata['user_id']."'");
}
}
}
if (!$flood) {
$lin = FUSION_QUERY;
if ($shout =='add') {
$result = dbquery("INSERT INTO ".$db_prefix."shoutbox (shout_name, shout_message, shout_datestamp, shout_ip) VALUES ('$shout_name', '$shout_message', '".time()."', '".USER_IP."')");
if (EPS && iMEMBER) {
$przydzial = dbarray(dbquery("SELECT point_ammount from ".DB_PREFIX."eps_points WHERE point_id='2'"));
$result = dbquery("UPDATE ".DB_PREFIX."users SET points_normal=points_normal+".($przydzial['point_ammount'])." WHERE user_id='".$userdata['user_id']."'");
}
}
if ($shout =='edit' AND checkrights("S")
OR SBX_EDIT_USER AND iMEMBER AND $sdata['shout_name'] == $userdata['user_id']) {
$result = dbquery("UPDATE ".$db_prefix."shoutbox SET shout_message='$shout_message' WHERE shout_id='".$id."'");
}
$lin = str_replace("&shout=$shout&id=$id", '', $lin);
$lin = str_replace("shout=$shout&id=$id", '', $lin);
if($lin != '') redirect(FUSION_SELF."?".$lin);
else redirect(FUSION_SELF.$lin);
}
}
}
if (
isset($shout) AND isset($id) AND isNum($id) AND checkrights("S")
OR isset($shout) AND isset($id) AND isNum($id) AND !checkrights("S") AND iMEMBER AND $sdata['shout_name'] == $userdata['user_id'] AND SBX_EDIT_USER
) {
if ($shout == 'edit') {
$shout_message = str_replace("<br>", "", $sdata[shout_message]);
$shout_message = str_replace(" [", "[", $shout_message);
} else if ($shout == 'delete') {
$result = dbquery("DELETE from ".$db_prefix."shoutbox WHERE shout_id='".$id."'");
$lin = FUSION_QUERY;
$lin = str_replace("&shout=$shout&id=$id", '', $lin);
$lin = str_replace("shout=$shout&id=$id", '', $lin);
if($lin != '') redirect(FUSION_SELF."?".$lin);
else redirect(FUSION_SELF.$lin);
}
} else {
$id = 0;
$shout = 'add';
$shout_message = '';
$shout_name = '';
}
if(iMEMBER){
$caution_r = dbquery("SELECT * from ".$db_prefix."cautions WHERE user_id=".$userdata['user_id']);
$caution = dbarray($caution_r);
$c_count = dbrows($caution_r);
$caution_conf = dbarray(dbquery("SELECT * from ".$db_prefix."cautions_config"));
}
if ($c_count > $caution_conf['shoutbox']) {
echo $caution_conf['shoutbox_info']."<br><br>";
} else {
if ($shout == 'add') {
echo "<form name='chatform' method='post' action='".FUSION_SELF.(FUSION_QUERY ? "?".str_replace("&","&",FUSION_QUERY."&shout=$shout&id=$id") : "?shout=add&id=$id")."'>";
} else {
echo "<form name='chatform' method='post' action='".FUSION_SELF.(FUSION_QUERY ? "?".str_replace("&","&",FUSION_QUERY) : "?shout=$shout&id=$id")."'>";
}
echo"
<table align='center' cellpadding='0' cellspacing='0'>
<tr>
<td colspan='2' style='text-align:center;'>\n";
if (iGUEST) {
echo $locale['121']."<br>
<input type='text' name='shout_name' value='$shout_name' class='textbox' maxlength='30' style='width:140px;'><br>
".$locale['122']."<br>\n";
}
echo" <textarea name='shout_message' rows='4' class='textbox' style='width:140px;'>$shout_message</textarea>";
echo" <center><A href=\"javascript:show_hide(ShowHide2)\"><img border='0' src='".INFUSIONS."shoutbox_panel/images/icon_select.gif' vspace='2' title='".$locale['129']."'></a> ";
echo" <A href=\"javascript:show_hide(ShowHide7)\"><img border='0' src='".INFUSIONS."shoutbox_panel/images/icon_bbcode.gif' vspace='2' title='BBCode'></a> ";
echo" <a href='".INFUSIONS."shoutbox_panel/shoutboxhelp.php'><img border='0' src='".INFUSIONS."shoutbox_panel/images/icon_help.gif' vspace='2' title='".$locale['130']."'></a>";
echo" <div id='ShowHide2'><FIELDSET><LEGEND>".$locale['131']."</LEGEND>";
echo displaysmileys("shout_message", 1)."</FIELDSET><script>show_hide(ShowHide2)</script></div>";
echo" <div id='ShowHide7'><FIELDSET><LEGEND>BBCode</LEGEND><center><input type='button' value='b' class='button' style='font-weight:bold;width:25px;' onClick=\"addText2('shout_message', '', '');\">";
echo" <input type='button' value='i' class='button' style='font-style:italic;width:25px;' onClick=\"addText2('shout_message', '', '');\">";
echo" <input type='button' value='u' class='button' style='text-decoration:underline;width:25px;' onClick=\"addText2('shout_message', '', '');\"></center><br>";
echo" <select name='bbcolor' class='textbox' style='width:90px;' onChange=\"addText2('shout_message', '[color=' + this.options[this.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;\">
<option value=''>Default</option>
<option value='maroon' style='color:maroon;'>Maroon</option>
<option value='red' style='color:red;'>Red</option>
<option value='orange' style='color:orange;'>Orange</option>
<option value='brown' style='color:brown;'>Brown</option>
<option value='yellow' style='color:yellow;'>Yellow</option>
<option value='green' style='color:green;'>Green</option>
<option value='lime' style='color:lime;'>Lime</option>
<option value='olive' style='color:olive;'>Olive</option>
<option value='cyan' style='color:cyan;'>Cyan</option>
<option value='blue' style='color:blue;'>Blue</option>
<option value='navy' style='color:navy;'>Navy Blue</option>
<option value='purple' style='color:purple;'>Purple</option>
<option value='violet' style='color:violet;'>Violet</option>
<option value='black' style='color:black;'>Black</option>
<option value='gray' style='color:gray;'>Gray</option>
<option value='silver' style='color:silver;'>Silver</option>
<option value='white' style='color:white;'>White</option>
</select></FIELDSET>";
echo" </td>
</tr>";
echo" <tr>
<td align='center'>
<input type='submit' name='post_shout' value='".$locale['123']."' class='button'>";
echo" </td>
</tr>
</table></form></div>\n";
echo"<script>show_hide(ShowHide7)</script>";
}
echo"<br>\n";
} else {
echo"<center>".$locale['125']."</center><br>\n";
}
$result = dbquery("
SELECT * FROM ".DB_PREFIX."shoutbox
LEFT JOIN ".DB_PREFIX."users ON ".DB_PREFIX."shoutbox.shout_name=".DB_PREFIX."users.user_id
ORDER BY shout_datestamp DESC LIMIT 0,".$settings['numofshouts']
);
echo" <script type='text/javascript' src='".INFUSIONS."shoutbox_panel/js/lighttable.js' language='Javascript'></script>";
echo" <script type=\"text/javascript\">
iens6=document.all||document.getElementById
ns4=document.layers
//specify speed of scroll (greater=faster)
var speed=5
if (iens6){
document.write('<div id=\"container\" style=\"position:relative;width:100%;height:230px;border:0px solid #444444;overflow:hidden\">')
document.write('<div id=\"content\" style=\"position:absolute;width:100%;left:0;top:0\">')
}
</script>";
echo "<ilayer name=\"nscontainer\" width=100% height=250 clip=\"0,0,277,400\">";
echo "<layer name=\"nscontent\" width=100% height=250 visibility=hidden>";
if (dbrows($result) > 0) {
$gouest_opt = dbarray(dbquery("SELECT * FROM ".$db_prefix."colors WHERE user_level=0"));
while ($data = dbarray($result)) {
echo"<FIELDSET><LEGEND><span class='shoutboxname'>";
$user = "<span style='color:#".$data['user_color']."'>".$data['user_prefix'].$data['user_name']."</span>";
if ($data['user_name']) {
echo"<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' class='side'>$user</a><br>\n";
} else {
echo"<span style='color:#".$gouest_opt['user_color']."'>".$gouest_opt['user_prefix'].$data['shout_name']."</span>\n";
}
echo"</span></LEGEND>";
if (checkrights("S") AND $shout != "edit"){
echo "[ <a href='".FUSION_SELF.(FUSION_QUERY ? "?".str_replace("&","&",FUSION_QUERY)."&shout=delete&id=".$data['shout_id'] : "?shout=delete&id=".$data['shout_id'])."'>".$locale['133']."</a> | <a href='".FUSION_SELF.(FUSION_QUERY ? "?".str_replace("&","&",FUSION_QUERY)."&shout=edit&id=".$data['shout_id'] : "?shout=edit&id=".$data['shout_id'])."'>".$locale['134']."</a> ]<br><font style='font-style:italic;font-family:Tahoma;font-size:8;color:#777777;'>IP: ".$data['user_ip']."</font><br>";
} elseif (SBX_EDIT_USER AND iMEMBER AND $data['shout_name'] == $userdata['user_id'] AND $id == "" AND !checkrights("S")) {
echo "[ <a href='".FUSION_SELF.(FUSION_QUERY ? "?".str_replace("&","&",FUSION_QUERY)."&shout=edit&id=".$data['shout_id'] : "?shout=edit&id=".$data['shout_id'])."'>".$locale['134']."</a> ]<br>";
} else {
echo "\n";
}
echo "<span class='shoutboxdate'><font style='font-style:italic;font-family:Tahoma;font-size:8;color:#777777;'>".$locale['135']." ".showdate("shortdate", $data['shout_datestamp'])."</font></span><br>";
$shouttext = $data['shout_message'];
$shouttext = parsesmileys($shouttext);
//replace links with link image
$shouttext = preg_replace("#(^|[\r\n ]|^\])((http|https|ftp|ftps)://[\w\#$%&~/.\-;:=,?@\[\]+]*)(|[\r\n ]|^\[)#si", "\\1<a href=\"\\2\" target=\"_blank\" title=\"autolink\">".$link_replacement."</a> ", $shouttext);
$shouttext = preg_replace("#(^|[\r\n ]|^\])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)(|[\r\n ]|^\[)#si", "\\1<a href=\"http://\\2\" target=\"_blank\" title=\"autolink\">".$link_replacement."</a> ", $shouttext);
//parsing urls only with domain without www\ftp, http(s): or ftp(s): at the beggining
$shouttext = preg_replace("#(^|[\r\n ]|^\])([\w\#$%&~/.\-;:=,?@\[\]+]*\.(html|php3|htm|php|com|net|org|info|biz|aero|coop|museum|name|pro|gov|edu|mil|int|ac|ad|ae|ag|am|as|au|bb|be|bg|bi|bm|br|bt|bv|ca|cc|cd|ch|ck|cl|cm|cn|cr|cu|cx|cz|de|dk|do|ec|ee|es|fj|fm|fo|fr|gb|ge|gi|gl|gm|gr|gs|gt|gu|hk|hm|hr|hu|id|ir|ie|il|in|io|is|it|jo|jp|kr|ky|kz|lb|li|lk|lt|lu|ly|mc|mn|ms|mw|mx|na|nc|nl|no|nu|nz|pe|ph|pk|pl|pm|py|re|ro|ru|sa|se|sg|sh|si|sk|sm|su|tc|tf|th|tj|to|tr|tv|tw|ua|ue|ug|uk|us|uy|uz|va|vc|vg|vi|vn|vu|wf|ws|za|ai|al|an|ao|ar|az|ba|bf|bn|bo|bs|by|bz|cg|ci|co|cy|dz|eg|fi|fk|ga|gg|gh|im|je|ke|kg|kh|lc|lv|mc|mh|mo|mp|mr|mt|my|ni|np|om|pn|pt|ga|rw|sb|sc|sj|sn|sv|tp|af|aw|bd|bh|bj|bw|cf|cv|dj|dm|eh|er|et|gd|gf|gn|gq|gw|gy|ht|iq|jm|ki|km|kn|kp|kw|la|lr|ls|ma|mg|mk|ml|mm|mq|mu|mv|mz|ne|nf|ng|nr|pa|pf|pg|pr|pw|sd|sl|so|sr|st|sy|sz|td|tg|tk|tm|tt|tz|um|ye|zm|zw|agent|arts|auction|chat|church|club|family|free|game|golf|inc|kids|law|llc|llp|love|ltd|med|mp3|school|scifi|shop|soc|sport|tech|travel|video|xxx|america|com2|etc|earth|not|online|usa|z))(|[\r\n ]|^\[)#si", "\\1<a href=\"http://\\2\" target=\"_blank\" title=\"autolink\">".$link_replacement."</a> ", $shouttext);
//replace links with link image
$shouttext = nl2br($shouttext);
$shouttext = mywordwrap($shouttext, 20, " ");
echo "<span class='shoutbox'>".$shouttext."</span></FIELDSET>";
echo "<br>\n";
}
} else {
echo "<div align='left'>".$locale['127']."</div>\n";
}
echo "</layer></ilayer><script language=\"JavaScript1.2\">
if (iens6)
document.write('</div></div>')
</script>";
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><td><p align=\"right\">";
echo "<a href=\"#\" onMouseover=\"moveup()\" onMouseout=\"clearTimeout(moveupvar)\"><img src=\"".INFUSIONS."shoutbox_panel/images/up.gif\" border=\"0\"></a> ";
echo "<a href=\"#\" onMouseover=\"movedown()\" onMouseout=\"clearTimeout(movedownvar)\"><img src=\"".INFUSIONS."shoutbox_panel/images/down.gif\" border=\"0\"></a>";
echo "</td></table>";
if (iMEMBER) {
echo "<hr><center>\n<img border='0' src='".THEME."images/bullet.gif'> ";
echo "<a href='".INFUSIONS."shoutbox_panel/shoutbox_archive.php' class='side'>".$locale['126']."</a> ";
echo "<img border='0' src='".THEME."images/bulletb.gif'></center>\n";
} else {
echo "<div align='left'></div>\n";
}
echo "<script language=\"JavaScript1.2\">
if (iens6) {
var crossobj=document.getElementById? document.getElementById(\"content\") : document.all.content
var contentheight=crossobj.offsetHeight
}
else if (ns4) {
var crossobj=document.nscontainer.document.nscontent
var contentheight=crossobj.clip.height
}
function movedown(){
if (iens6&&parseInt(crossobj.style.top)>=(contentheight*(-1)+100))
crossobj.style.top=parseInt(crossobj.style.top)-speed+\"px\"
else if (ns4&&crossobj.top>=(contentheight*(-1)+100))
crossobj.top-=speed
movedownvar=setTimeout(\"movedown()\",20)
}
function moveup(){
if (iens6&&parseInt(crossobj.style.top)<=0)
crossobj.style.top=parseInt(crossobj.style.top)+speed+\"px\"
else if (ns4&&crossobj.top<=0)
crossobj.top+=speed
moveupvar=setTimeout(\"moveup()\",20)
}
function getcontent_height(){
if (iens6)
contentheight=crossobj.offsetHeight
else if (ns4)
document.nscontainer.document.nscontent.visibility=\"show\"
}
window.onload=getcontent_height
</script>";
closeside();
?>
Powinno być dobrze.
Nie pomagam na komunikatorach oraz PW!
|
|
|