\r\n"); } // echo "\xC2"; $commentParser->open($file); $commentParser->read(); $commentParser->read(); $comments = getComments($curID, $commentParser); $rating = getRating($curID); $extraElements = ""; $extraElements .= ""; $voteLayout = str_replace(""; $firstButton .= ""; $firstButton .= ""; $firstButton .= ""; $firstButton .= str_replace("
", "", str_replace("
", "", $addButton)); $firstButton .= ""; do { switch ($parser->getAttribute("id")) { case $curID . "": $comments = stripXML($parser, $comments); // echo $comments; $temp = $comments; /** grab the ips */ while (substr_count($temp, " 0) { if (subParse($temp, "time=\"", "\"") + 24 * 60 * 60 < time()) { break; } $ips[] = subParse($temp, "url=\"", "\""); $temp = strstr($temp, $ips[count($ips) - 1]); $temp = strstr($temp, "time"); } $id = subParse($comments, "", ""); $firstButton = str_replace("-1", $id, $firstButton); if (substr_count($comments, "") > 0) { $comments = convertToHTML($comments); $comments = str_replace("\r\n", "
", $comments); $done = true; } break; } } while ($parser->next()); if (!$done) { // global $commentLayout; // $comments = str_replace("#add", "", str_replace("#comment", "", str_replace("#delete", "", $commentLayout))); $comments = ""; } return $comments; } function convertToHTML($comments) { global $localOpen; global $localClose; global $addButton; global $deleteButton; global $commentAction; global $deleteAction; global $enableDelete; global $commentLayout; global $loc; $reg_replace = "
"; $reg_replace .= ""; $reg_replace .= ""; $reg_replace .= str_replace("", "", str_replace("
", "", $addButton)); $reg_replace .= ""; $reg_replace .= "
"; $reg_replace .= ""; $reg_replace .= ""; $reg_replace .= str_replace("", "", str_replace("
", "", $deleteButton)); $reg_replace .= ""; $comments = str_replace("", "", str_replace("", "", ereg_replace("-?[0-9]*", $reg_replace, $comments))); $comments = str_replace("\\\\", "\\", str_replace("\\\"", "\"", str_replace("\\'", "'", $comments))); //echo $comments . "\n\n"; $commentParts = split("", $comments, -1); $splitComments = array(""); $comments = formatComments($comments); return $comments; } /** * Formats the comments, putting them into the form specified by $commentLayout */ function formatComments($comments) { global $commentLayout; global $enableDelete; while (substr_count($comments, "") > 0) { $needle = substr($comments, 0, strpos($comments, "")) . ""; $needle = substr($needle, strrpos($needle, "")); $curParts = split("", "", str_replace("", "", $needle))); $trimNeedle = str_replace("", "", str_replace("", "", $needle)); if (substr_count($comments, "") > 0) { $replaceString = str_replace("#add", "", "", substr(strstr($needle, $curParts[2]), strpos($curParts[2], "") + 7)), $replaceString); $replaceString = str_replace("#comment", $curParts[0], $replaceString); $comments = str_replace($needle, $replaceString, $comments); } $regString = ""; $comments = ereg_replace($regString, "", $comments); $comments = strstr($comments, "/form>
"); $comments = strstr($comments, "
"); $comments = substr($comments, 7); //echo $comments; //exit; return $comments; } ?>