jansonz Posted April 15, 2004 Report Share Posted April 15, 2004 <? function pievienotkomentus($kur) { global $heading, $texts; $fails = fopen ("cat$kur.txt", "a"); $datums=date("d-m-Y H:i"); $autors = ereg_replace("::","",$heading); $texts = strip_tags($texts, '<a><b><u><i>'); $texts = ereg_replace("\r","",$texts); $texts = ereg_replace("::","",$texts); $texts = ereg_replace("\n","<br>",$texts); $rinda="$heading::$datums::$texts\n"; fputs($fails,$rinda ); fclose($fails); } ?> Luuk mana funkcija! Tā ieliek ziņu faila beigās! Man vajadzētu lai tā pievieno datus faila sākumā! Nomainīju "a" uz "r+" bet tas pareizi nestrādāja! <_< Link to comment Share on other sites More sharing options...
Kips Posted April 15, 2004 Report Share Posted April 15, 2004 Nu vispaar mani shitaa lieta arii intresee, kaa dabuut ierakstu faila saakuma ;) Tikai visau laiku raksta virsuu vecajam txt.. Link to comment Share on other sites More sharing options...
Gacha Posted April 15, 2004 Report Share Posted April 15, 2004 Palasi šito: http://codewalkers.com/tutorials/5/1.html un šito http://codewalkers.com/tutorials/7/1.html Link to comment Share on other sites More sharing options...
bubu Posted April 16, 2004 Report Share Posted April 16, 2004 izlasiiju Gacha dotos linkus, bet neatradu kaa faila SAAKUMA ierakstiit rindinju. atradu tikai kaa visu kaajaam gaisaa apgriezt :) a normaali faila saakumaa nevar neko ierakstiit, ir vai nu viss jaaielasa atminjaa, tad fails veelreiz jaaatver rakstiishanai un jaaieraksta jaunaa rindinja un tad atminjas saturs, vai arii jaaveido jauns fails, kuraa ieraksta jauno rindinju un galaa vecaa faila saturu, un tad paarneimo jauno failu, lai saucaas kaa vecais (domaaju otrais variants buus ne tik prasiigs pret atminjas apjomu) Link to comment Share on other sites More sharing options...
jansonz Posted April 16, 2004 Author Report Share Posted April 16, 2004 Nevarētu iemest kādu piemēriņu?? :blink: Link to comment Share on other sites More sharing options...
trinklins Posted April 16, 2004 Report Share Posted April 16, 2004 $fails = fopen ("cat$kur.txt", "a"); nederees jo burtinsh "a" noliek kursoru vienmeer beigaas tur labaak izmantot "r+" starp citu manuali pie funcijas fopen ir pastaastiists ko kursh burtinsh dara ;) Link to comment Share on other sites More sharing options...
jansonz Posted April 16, 2004 Author Report Share Posted April 16, 2004 ;) Es tak raxtiiju ka meeginaaju arii ar "r+"! Manuaalii ar skatiijos.... Link to comment Share on other sites More sharing options...
trinklins Posted April 16, 2004 Report Share Posted April 16, 2004 (edited) sorry :D $fails = fopen('fails.txt','r+'); $data = file('fails.txt'); fwrite($fails,"citaats teikums varbuut kas cits\n"); foreach($data as $value){fwrite($fails,$value);} fclose($fails); shitais itkaa straadaa bet ir viens bet cik tas pareizi ir. tas laikam ir viens no bubu teiktiem variantiem Edited April 16, 2004 by trinklins Link to comment Share on other sites More sharing options...
jansonz Posted April 16, 2004 Author Report Share Posted April 16, 2004 :rolleyes: Paldies - buus jaanotestee...:) Link to comment Share on other sites More sharing options...
bubu Posted April 16, 2004 Report Share Posted April 16, 2004 trinklins variants ir taads kas izmanto daudz atminjas, viss fails jaanolasa atminjaa. ja faila izmeers kljuust lielaaks, tad jaauzmanaas :) Link to comment Share on other sites More sharing options...
trinklins Posted April 16, 2004 Report Share Posted April 16, 2004 (edited) to bubu : bet principaa tas ir tavs piedaavaatais pirmais variants, bet es jau teicu ka tas nav labaaakais variants. un veel kas manuālī arī tiek piedāvāts nolasīt pēc tam ierakstīt savu rindu un tad maukt nolasīto iekšā failā bet no otras puses cik tad atiecīgā faila komentu saturs ,kādi simts komenti tas pats lielākais pēc manām domām vairāk nebūs, tā jau nav grāmata B) Edited April 16, 2004 by trinklins Link to comment Share on other sites More sharing options...
bubu Posted April 16, 2004 Report Share Posted April 16, 2004 nee, nu ja ir simmts, ja arii 1000 rindinju tas siikums, bet ja fails saak vilt uz dazhiem megabaitiem, tad jau jaaskataas, jo ja vairaaku juuzeri reizee sasleedzas, tas viss pasaakums atminju eediis Link to comment Share on other sites More sharing options...
trinklins Posted April 16, 2004 Report Share Posted April 16, 2004 to bubu : par tiem juuzeriem es neiedomaajos bet tomeer neticu ka komentiem vajag paarus megus. viens jau manupraat buus ljoti daudz. kaa arii pamekleejos pa googli par sho probleemu bet risinaajumus aarzemnieki tik un taa piedaavaa taadus pashus. ir vieniigais variants funcija fseek() bet es to krustaam shkersaam bet taa neparakstaas. <_< Link to comment Share on other sites More sharing options...
Recommended Posts