tiy Posted December 13, 2005 Report Share Posted December 13, 2005 Ka var izdarit ta, lai varetu dabut Online counter, lai raditu cik cilveku ir portala shobrid. Es lasu php manuali, bet nevaru piebraukt ir connction_status un ignore_user_abort, kas lauj pateikt kad useris ir nospiedis stop vai izgajis lauka no saita, bet kaut ka neiet ta lieta. Ne jau visi useri spiedis iziet vai logout. Ka tad isti tur viss notiek, biju dzirdejis par variantu, kad skatas kad useris modifikacijas, ieraksta laiku un, tad atkal skatas pec kada laika vai useris atkal ir kaut ko veicis kaut ka ta. Isti nezinu un gribetos, lai pastastitu, vai vel paraditu kadas funkcijas. Link to comment Share on other sites More sharing options...
rpr Posted December 13, 2005 Report Share Posted December 13, 2005 http://php.lv/f/index.php?showtopic=3652 Link to comment Share on other sites More sharing options...
tiy Posted December 13, 2005 Author Report Share Posted December 13, 2005 (edited) tas ir biku cits man vajag idejas ,man neinterse kaut kur registreties utt., es pats gribu uzrakstit ka man vajag. Edited December 13, 2005 by tiy Link to comment Share on other sites More sharing options...
v3rb0 Posted December 13, 2005 Report Share Posted December 13, 2005 (edited) pieraksti katra usera pēdējās aktivitātes timestapmu, saskaiti cik useri ir bijuši aktīvi pēdējās 5, 10, 15min, tad pieņem ka tie ir arī vēl šobrīd online. ja ir logoff fīča, tad vari pie logoffa nonuļot pēdējās aktivitātes laiku vai kaut kā citādi atzīmēt ka useris ir izlogojies. Edited December 13, 2005 by v3rb0 Link to comment Share on other sites More sharing options...
tiy Posted December 13, 2005 Author Report Share Posted December 13, 2005 Ka isti un pareizi atzimet to aktivitati. Link to comment Share on other sites More sharing options...
rpr Posted December 13, 2005 Report Share Posted December 13, 2005 http://php.lv/f/index.php?showtopic=2935 Link to comment Share on other sites More sharing options...
v3rb0 Posted December 13, 2005 Report Share Posted December 13, 2005 nu ja mysql datubāze, tad viens variants ir uztaisīt memory (heap) tipa tabulu last_action ar laukiem usera_id|pedeja_aktivitate, usera_id uzliec unikālu. pie katras usera darbibas izdari kveriju 'replace into last_action set usera_id=1, pedeja_aktivitate='.time().''; onlainā esosos dabū ar select count(*) as is_online from last_action where pedeja_aktivitate > '.time() - (60 * 5).' usera_id vietā var arī izmantot sessijas id. Link to comment Share on other sites More sharing options...
tiy Posted December 13, 2005 Author Report Share Posted December 13, 2005 Bez msql lietoshanas. Kas isti shi par par funkciju -timestapmu. P.s es izlasiju tos linkus, bet tur nav neka pratiga viens saka ieliec scriptu otrs nepatemu atbild kaut ko. Link to comment Share on other sites More sharing options...
rpr Posted December 13, 2005 Report Share Posted December 13, 2005 saglabaa failaa rezultaatus, manupraat pat vienaa no tiem rakstiem bija gatavs piemeers. ar mktime() var izveidot timestampu Link to comment Share on other sites More sharing options...
v3rb0 Posted December 13, 2005 Report Share Posted December 13, 2005 nu bez db princips tak tāds pats, tik kveriju vietā jātaisa pašām visa ņemšanās ar faila rakstīšanu/lasīšanu/lockošanu. var iztikt arī bez mktime(), jo vajag tik tekošo unix timestampu un tekošais timestamps mīnus kaut kādas sekundes. Link to comment Share on other sites More sharing options...
Grey_Wolf Posted December 13, 2005 Report Share Posted December 13, 2005 Kas isti shi par par funkciju -timestapmu. meklee Goglee --> unixtimestamp Link to comment Share on other sites More sharing options...
tiy Posted December 14, 2005 Author Report Share Posted December 14, 2005 (edited) Paldies par idejam man viss strada, sanaca viss scripts uz 20 rindinam Edited December 14, 2005 by tiy Link to comment Share on other sites More sharing options...
Recommended Posts