Jump to content

neoaddict

Members
  • Posts

    35
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

neoaddict's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Any suggestions? Well, I echoed the variable that had the imploded array - it was exactly the way it was supposed to be.
  2. Could you pass me your UA string? I got it to detect Opera/9.01 as the latest version.
  3. This is an example of data of the only critical file (script gets data to loop from this file): [code]|rainbow|brown|orange|[/code] It keeps on either writing Array or nothing to the file. I expect the script to loop the data from the text.txt file, check if it exists, if it does, unset the first item of the array, reindex the array, reimplode the data and write it to a file.
  4. http://neo-addict.net There's some mild problems with Firefox 1.0.8 and Opera 8 (because we use the One True Layout) and I don't want to have too many CSS hacks. And if you don't like NAlerter, just clickie the close button.  :D
  5. Oops, a little mistake while I was altering the file paths to post on PHP Freaks. I got it to remove the first part of the array, got it to implode nicely, but: * Won't process multiple times (did I get the meaning of foreach wrong?  Shouldn't it be processed every time the loop, well, loops?) * Wipes file (Doesn't write anything to the file)
  6. Here's the code I've got so far: [code]<?php ob_start("ob_gzhandler"); ?> <?php error_reporting(E_ALL ^ E_WARNING); //********************* // Config!  o_O //********************* $wall = file_get_contents(text.txt"); $bk = file_get_contents("text.txt"); $walldef = file_get_contents("deftext.txt"); $year = date("Y"); $pieces = explode("|", $wall); $bkup = explode("|", $bk); $slices = explode("|", $walldef); $story = "<font size='2' face='Verdana'>"; $gotnews = ""; $time = date("U"); $fp = fopen("year.txt", "w"); fwrite($fp, $year); fclose($fp); if ($year == $year + 1) { $itsnewyear = fopen("text.txt", "w"); fwrite($itsnewyear, $walldef); fclose($itsnewyear); } foreach ($pieces as $run){ if( !fopen("http://images.neopets.com/games/new_tradingcards/sm_".$run."_day_".$year.".gif", "r") ) { $newsvar = false; } else{ $newsvar = true; $gotnews = "Confirmedsir"; $ca = file_get_contents("test2.txt"); $comment = fopen("test2.txt", "w"); fwrite($comment, "$time|>|\n$ca"); fclose($comment); } if ($newsvar == true && $gotnews == "Confirmedsir"){ $story = "<b><i>Wallpaper:</b></i><br /><br />"; } $newsvar = false; if ($newsvar != true && $gotnews == "Confirmedsir"){ $story .= "<img src=\"http://images.neopets.com/games/new_tradingcards/sm_".$run."_day_".$year.".gif\">"; $story .= "<br /><br />"; $write = fopen("3_Wallpaper.txt", 'w'); $bk = str_replace('||', '', $bk); unset($bkup[0]); $bkup = array_values($bkup); print_r($bkup); $bkup = implode("|", $bkup); fwrite($write, $bkup); fclose($write); } } if($gotnews == "Confirmedsir") { $category = "2"; $time = date("U"); $newsa = file_get_contents("test.txt"); $newsfile = fopen("test.txt", "w"); fwrite($newsfile, "$time|$me|$title|$story||$av|$category||\n$newsa"); fclose($newsfile); } else{ // Nothing } ?>[/code] OK, I got it to remove the first object of the array, but it only does it once instead of multiple times as it should in a foreach?
  7. [code]$bk = file_get_contents("text.txt"); $bkup = explode("|", $wall); $remove = "||"; str_replace($bkup[0], '', $bk); str_replace($remove, '', $bk);[/code] That's sort of the general idea right now, but it won't work.  :(
  8. How would I trim the value of a variable from a string in PHP?
  9. Any suggestions, ideas or recommendations?
  10. OK, I successfully got it to compare, but it keeps on giving me two of the same images instead of the images found.
  11. [code]<script type="text/javascript"> <!--     function makeRequest(url) {         var http_request = false;         if (window.XMLHttpRequest) {             http_request = new XMLHttpRequest();         } else if (window.ActiveXObject) {             try {                 http_request = new ActiveXObject("Msxml2.XMLHTTP");             } catch (e) {                 try {                     http_request = new ActiveXObject("Microsoft.XMLHTTP");                 } catch (e) {}             }         }         if (!http_request) {             alert('Your browser does not support AJAX or XMLHttpRequest!');             return false;         }         http_request.open('GET', url, true);         if (url == "checkcookie.php") {             http_request.onreadystatechange = parse;         }         http_request.send(null);     }     function parse() {         if (http_request.readyState == 4) {             if (http_request.status == 200) {                 var css = http_request.responseText;                 document.getElementById("topsites").style.display = css;             }             else{                 alert('There was a problem with the request.');             }         }     }     makeRequest('checkcookie.php');     function omgmagic() {         if(document.getElementById("topsites").style.display == 'none'){            makeRequest('show.php');            document.getElementById("topsites").style.display = '';         }         else{            makeRequest('hide.php');            document.getElementById("topsites").style.display = 'none';         }     } //--> </script>[/code] Fixed the parse error now. I don't know why it keeps on throwing up a [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Error: uncaught exception: Permission denied to call method XMLHttpRequest.open[/quote] when the file is not off-server...
  12. [code]<script type="text/javascript"> <!--     function makeRequest(url) {         var http_request = false;         if (window.XMLHttpRequest) {             http_request = new XMLHttpRequest();         } else if (window.ActiveXObject) {             try {                 http_request = new ActiveXObject("Msxml2.XMLHTTP");             } catch (e) {                 try {                     http_request = new ActiveXObject("Microsoft.XMLHTTP");                 } catch (e) {}             }         }         if (!http_request) {             alert('Your browser does not support AJAX or XMLHttpRequest!');             return false;         }         http_request.open('GET', url, true);         if (url == "checkcookie.php") {             http_request.onreadystatechange = parse;         }         http_request.send(null);     }     function parse() {         if (http_request.readyState == 4) {             if (http_request.status == 200) {                 var css = http_request.responseText;                 document.getElementById("topsites").style.display = css;             }             else{                 alert('There was a problem with the request.');             }     }     open('checkcookie.php');     function omgmagic() {         if(document.getElementById("topsites").style.display == 'none'){            makeRequest('show.php');            document.getElementById("topsites").style.display = '';         }         else{            makeRequest('hide.php');            document.getElementById("topsites").style.display = 'none';         }     } //--> </script>[/code] Here are the errors that Firefox's Error Console keeps on giving me: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Warning: function makeRequest does not always return a value Source file: [a href=\"http://www.neo-addict.net/******/portal/\" target=\"_blank\"]http://www.neo-addict.net/******/portal/[/a] Line: 202, Column: 4 Source code: } Error: missing } after function body Source file: [a href=\"http://www.neo-addict.net/*******/portal/\" target=\"_blank\"]http://www.neo-addict.net/*******/portal/[/a] Line: 228, Column: 5 Source code: //--> Warning: function makeRequest does not always return a value Source file: [a href=\"http://www.neo-addict.net/********/portal/\" target=\"_blank\"]http://www.neo-addict.net/********/portal/[/a] Line: 202, Column: 4 Source code: } [/quote] Thanks very much!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.