" . $uid . "") > 0 && $uid > 0) { $foundIt = true; $count = 0; } else if ($uid == -1 && substr_count($newData[$i], " 0) { $total = subParse($newData[$i], "total=\"", "\""); echo "."; $votes = subParse($newData[$i], "votes=\"", "\""); $allData .= str_repeat("\t", $superCount - 1) . "\n"; $allData .= str_repeat("\t", $superCount) . "" . --$newID . "\n"; $allData .= str_repeat("\t", $superCount) . "\n"; $allData .= str_repeat("\t", $superCount + 1) . "\n"; $allData .= str_repeat("\t", $superCount + 1) . "" . ++$newID . "\n"; $allData .= str_repeat("\t", $superCount) . "\n"; $allData .= str_repeat("\t", $superCount - 1) . "\n"; $done = true; $recent = true; fscanf($fh, "%[^\n]"); fscanf($fh, "%[^\n]"); } if ($foundIt) { if ((!$done) && $uid == -1) { $allData .= str_repeat("\t", $superCount - 1) . "\n"; $allData .= str_repeat("\t", $superCount) . "" . --$newID . "\n"; $allData .= str_repeat("\t", $superCount) . "\n"; $allData .= str_repeat("\t", $superCount + 1) . "\n"; $allData .= str_repeat("\t", $superCount + 1) . "" . ++$newID . "\n"; $allData .= str_repeat("\t", $superCount) . "\n"; $allData .= str_repeat("\t", $superCount - 1) . "\n"; $done = true; } else { if (substr_count($newData[$i], "") > 0) { $count++; } else if((!$done) && substr_count($newData[$i], "") > 0 | substr_count($newData[$i], "") > 0) { if ($count == 0) { $allData .= str_repeat("\t", $superCount) . "\n"; $allData .= str_repeat("\t", $superCount + 1) . "\n"; $allData .= str_repeat("\t", $superCount + 1) . "$newID\n"; $allData .= str_repeat("\t", $superCount) . "\n"; $done = true; } $count--; } } } if (substr_count($newData[$i], "") > 0) { $superCount++; } else if(substr_count($newData[$i], "") > 0) { $superCount--; } if (substr_count($newData[$i], " 0) { $newID = str_replace("", "", $newData[$i])); $newID = substr($newID, 0, strlen($newID) - 1); $newID++; if ($uid == -1 | $uid == -2) { $newID++; } $foundIt = true; $allData .= "\n"; } else if (!$recent) { $allData .= $newData[$i]; } else { !$recent = false; } } $newData = ""; } fclose($fh); $allData = str_replace("\r", "\n", $allData);//have to replace all newline things with \ns, then //replace those with \r\ns or it won't work on a //windows system $fh = fopen($data, 'wb'); $newData = explode("\n", $allData); for ($i = 0; $i < sizeof($newData); $i++) { fwrite($fh, $newData[$i] . "\r\n"); } fclose($fh); echo $successMessage; echo ""; } else if (isset($_POST["curID"]) && isset($_POST["curPath"]) && isset($_POST["vote"])) { if ($_POST["vote"][0] > 0 && $_POST["vote"][0] < 11) { $vote = $_POST["vote"][0]; } else if ($_POST["vote"][1] > 0 && $_POST["vote"][1] < 11) { $vote = $_POST["vote"][1]; } else { echo "Stop trying to access this page with scripts. Use it normally like a big boy"; exit; } $id = $_POST['curID']; //everying came in correctly, toss a vote in and redirect the user //search for " 0) { $allData .= $searchString; $total = subParse($newData[$i], "total=\"", "\"") + $vote; $allData .= "total=\"$total\" "; $votes = subParse($newData[$i], "votes=\"", "\"") + 1; $allData .= "votes=\"$votes\">\n"; $tempData = fscanf($fh, "%[^\n]"); $allData .= $tempData[0]; $allData .= "\t\t\n"; $done = true; } else if (substr_count($newData[$i], "") > 0) { if (!$done) { $allData .= "\t\n"; $allData .= "\t\t-2\n"; $allData .= "\t\t\n"; $allData .= "\t\n"; $allData .= $newData[$i]; } else { $allData .= $newData[$i]; } } else { $allData .= $newData[$i]; } } $newData = ""; } fclose($fh); $allData = str_replace("\r", "\n", $allData);//have to replace all newline things with \ns, then //replace those with \r\ns or it won't work on a //windows system $fh = fopen($data, 'wb'); $newData = explode("\n", $allData); for ($i = 0; $i < sizeof($newData); $i++) { fwrite($fh, $newData[$i] . "\r\n"); } fclose($fh); $curPath = $_POST["curPath"]; echo ""; } else { if (isset($_GET["uid"]) && isset($_GET["curPath"])) { echo $commentText; echo "
"; echo ""; echo ""; if (isset($_GET["curID"])) { echo ""; } } else if (isset($_POST["uid"]) && isset($_POST["curPath"]) && isset($_POST["submit"]) && isset($_POST["comment"])) { echo $commentText; echo ""; echo ""; echo ""; if (isset($_POST["curID"])) { echo ""; } } else { echo "Stop trying to access this page with scripts. Use it normally like a big boy"; exit; } ?>