function getSingleNode($row) { /* $singleNode = "{"; $singleNode .= '"id":"' . $row['id'] . '",'; $singleNode .= ' "title":"' . $row['title'] . '",'; $singleNode .= ' "trick":"' . $row['trick'] . '",'; $singleNode .= ' "image":"'. curPageURL() . $imageBase . $row['image_url'] . '",'; $singleNode .= '"name":"' . $row['name'] . '",'; $singleNode .= '"votes":"' . $row['votes'] . '"'; $singleNode .= "}"; */ $row['image_url'] = curpageURL() . $row['image_url']; $row['image'] = $row['image_url']; $row['voted'] = checkIsVoted($row['id']); return json_encode($row); }
<?php function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") { $pageURL .= "s"; } $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]; } return $pageURL; } global $userrow; if ($userrow != false) { $meio = explode("narutorpg/", curpageURL()); $updatequery = doquery("UPDATE {{table}} SET pagina='" . $meio[1] . "' WHERE charname='" . $userrow["charname"] . "' LIMIT 1", "users"); }