![]() |
![]() |
![]() ![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 134 Pomógł: 5 Dołączył: 9.08.2008 Skąd: Szczecin Ostrzeżenie: (0%) ![]() ![]() |
Witam,
Wyszukałem w sieci shoutbox ajax.(Trudno nie było znaleźć) http://webscripts.softpedia.com/script/Cha...Ajax-39032.html No i tak: - Shoutbox opiera się na pliku txt - Dodałem opcje, że dodaje posty do bazy mysql, aby wyświetlać je w "Archiwum" - Wartość teraźniejszą odczytuje w pliku txt Skrypt jest podzielony na "odbierz" i "wyświetl" Odbierz - Zapisuje post, user, data to txt oraz do bazy mysql Wyświetl - Wyświetla wyniki z pliku txt i tak: Zmieniłem sortowanie, aby było odwrotnie, najnowsze wiadomości u góry i jest ok jak wejdziesz na strone, ale jak ktoś doda post to idzie na sam dół, i tu jest problem: Nie wiem jak zrobić, aby wpisany post szedł zaraz na samą górę. Wiem, że rozwiązanie problemu zajmie chwilkę czasu, ale z góry dziękuje. Jeżeli coś jest nie zrozumiałe to proszę pisać. tutaj moja strona: http://tv.dobryrap.pl/ shoutbox jest na dole |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 134 Pomógł: 5 Dołączył: 9.08.2008 Skąd: Szczecin Ostrzeżenie: (0%) ![]() ![]() |
To że czyta od " Ż do A " tylko że u mnie jest to data
rsort($arr); case 'view': $data = array(); $arr = file('messages.txt'); rsort($arr); if(!$_GET['time']) $_GET['time'] = 0; foreach($arr as $row) { $aTemp = null; list($aTemp['time'], $aTemp['nickname'], $aTemp['message']) = explode('|', $row); if($aTemp['message'] AND $aTemp['time'] > $_GET['time']) $data[] = $aTemp; } //file_put_contents('debug.txt', print_r($data, true)); break; Zaraz zobacze z tym InsertBefore. Kod wrap: function() { // The elements to wrap the target around var a = jQuery.clean(arguments); // Wrap each of the matched elements individually return this.each(function(){ // Clone the structure that we're using to wrap var b = a[0].cloneNode(true); // Insert it before the element to be wrapped this.parentNode.insertBefore( b, this ); // Find the deepest point in the wrap structure while ( b.firstChild ) b = b.firstChild; // Move the matched element to within the wrap structure b.appendChild( this ); }); }, Znalazłem taki kod (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) Powiem, że w ajax jestem na razie ciemny. ps... trochę dłuższy ten kod jest... 60 pare kilo ma jquery.js w plikach masz ta gdzie podalem link Ten post edytował tomekpl 25.12.2008, 12:36:46 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 13.10.2025 - 01:14 |