Jump to content

Ruko

Members
  • Posts

    57
  • Joined

  • Last visited

    Never

Everything posted by Ruko

  1. Changed the code a bit more... I apologize if im bumping Options +FollowSymLinks Options +Indexes RewriteEngine On RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteCond %{HTTP_HOST} !^www\.terra-boards\.com$ [NC] RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.terra-boards\.com$ [NC] RewriteRule .* /phpbbforums/$1 [L] This time, everytime i go on some other page in test.terra-boards.com, it redirects to the index and the url bar stays the same.
  2. ok i got part of it fixed. Now all i need to do is... how do i remove the phpbbforums in test.multiforum.com/phpbbforums? RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www\.terra-boards\.com$ RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9][a-z0-9\-]*[a-z0-9])\.terra-boards\.com$ [NC] RewriteRule ^$ /phpbbforums/ [L]
  3. moving all the files in the root would mean that i have to replace my website's index.php, so i cant move all the files in the root.
  4. I recently recoded a multiforum software, it works fine but the problem is, the redirection. I have a wildcard domain setup, and if people visit "test.multiforum.com" then it works. but if they visit something like for example "test.multiforum.com/viewforum.php" then it leads to 404 error. Here's what i have been getting on the error log. 2011-11-15 17:19:38.914 [iNFO] [**.***.**.***:50039-0#APVH_*.terra-boards.com] File not found [/home/n****x/public_html/terra-b****s.com/viewforum.php] I don't know why im getting that error. Here's my .htaccess file, I don't know what i did wrong. RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www\.terra-boards\.com$ RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9][a-z0-9\-]*[a-z0-9])\.terra-boards\.com$ [NC] RewriteCond %{REQUEST_URI} !^phpbbforums/ RewriteRule ^$ phpbbforums/ [L] Can someone help me on this?
  5. Is there any way to turn XML data into PHP variables. I tried this code $xml = simplexml_load_file("../inc/xml/style.xml); $result = $xml->xpath("styleinfo"); // lets make sql querys to upload the XML style info to the database $name = $result[0]->name; $desc = $result[0]->description; $copyright = $result[0]->copyright; $version = $result[0]->version; $designer = $result[0]->designer; mysql_query("INSERT INTO styles (stylename, styledescription, stylecopyright, version, designer) VALUES ('$name', '$desc', '$copyright', '$version', '$designer')") or die(mysql_error()); and the XML data outputs as blank. Help pls
  6. Edited some parts of the code, and got this error: Query was empty if ($_SERVER["HTTP_HOST"]) { $selectdb = mysql_select_db("ruko_forumaccounts", $con); $serverurl = $_SERVER["HTTP_HOST"]; $forumurl = "SELECT * FROM forumaccounts WHERE forumurl = '. $serverurl .'"; $result=mysql_query($sql, $con) or die(mysql_error()); while ($row=mysql_fetch_array($result)) { if ($_SERVER["HTTP_HOST"] == '"$row["forumurl"];"') { $dbms = 'mysqli'; $dbhost = 'localhost'; $dbport = ''; $dbname = 'ruko_phpbbmulti'; $dbuser = 'ruko_phpbbm'; $dbpasswd = 'luigi1997'; $table_prefix = '$row["forumprefix"];'; $acm_type = 'file'; $load_extensions = ''; } } }
  7. rewrote the code, looks like im getting there. Also I get this phpBB error now: Warning: require(./includes/acm/acm_.php) [function.require]: failed to open stream: No such file or directory in /home/ruko/public_html/phpBB3MULT6242/common.php on line 189 if ($_SERVER["HTTP_HOST"] == '*.terraboards.co.cc') { $selectdb = mysql_select_db("ruko_forumaccounts", $con); $serverurl = $_SERVER["HTTP_HOST"]; $forumurl = "SELECT * FROM 'forumaccounts' WHERE forumurl LIKE '. $serverurl .'"; $result=mysql_query($sql, $con) or die(mysql_error()); while ($row=mysql_fetch_array($result)) { if ($_SERVER["HTTP_HOST"] == '"$row["forumurl"];"') { $dbms = 'mysqli'; $dbhost = 'localhost'; $dbport = ''; $dbname = 'ruko_phpbbmulti'; $dbuser = 'ruko_phpbbm'; $dbpasswd = '*****'; $table_prefix = '$row["forumprefix"];'; $acm_type = 'file'; $load_extensions = ''; } } }
  8. Im trying to make a multiforum software for phpBB and im stuck. Ive been trying to figure this out for HOURS and still, I end up with f**king syntax errors. Kind of hard to explain. If they visit forumname.terraboards.com then it will load their forum tables. But instead I end up with errors. The codes I tried does not work. Now I don't know where to start.s I feel like im trying to create a impossible triangle. Is there any solution? My Code: $serverurl = $_SERVER["HTTP_HOST"]; $forumurl = "SELECT * FROM 'forumaccounts' WHERE forumurl LIKE '. $serverurl .'"; $result=mysql_query($sql, $con) or die(mysql_error()); while ($row=mysql_fetch_array($result)) { if ($_SERVER["HTTP_HOST"] == '$row["forumurl"];') { $dbms = 'mysqli'; $dbhost = 'localhost'; $dbport = ''; $dbname = '***_phpbbmulti'; $dbuser = '***_phpbbm'; $dbpasswd = '****'; $table_prefix = '$row["forumprefix"];'; $acm_type = 'file'; $load_extensions = ''; } else { die ("Invalid forum"); } }
  9. Parse error: syntax error, unexpected ']' in /home/minivid/public_html/myart/index.php on line 23
  10. $admin = mysql_query("SELECT level FROM users WHERE admin = '¥'") or die(mysql_error()); $array = mysql_fetch_assoc($admin); if ($array['admin'] != '$nonadmins']) { } Hows that code? Similar to deviantart usernames, for example, im the main admin, my username should be: ¥Ruko
  11. I didn't write any code, I can't seem to write it, how do I do this?
  12. If an mysql value from a table is in a certain text (for example, in the users table, at the permissions column , it says "admin"), then run a block of code
  13. Hello, is there something like this? If mysql record is admin, then a block of code How do I do something like that
  14. Hello, I dont really understand the for and while loops. And I have bad vocabulary so, can explain these two things in plain english. Thanks
  15. echo '<script>alert("The email you have entred is an invalid email address.")';</script>; should be echo '<script>alert("The email you have entred is an invalid email address.")</script>';
  16. Ok, first off, I tested my own coded reg system and when I make an error test, the error shows but the user info gets added to the database. How can I stop letting the code add the user to the database when an error occurs. <?php include "lang.php"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>PokePals - Registering</title> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js" /> <link rel="stylesheet" type="text/css" href="style.css" /></head> <body> <?php include "navbar.php"; ?> <?php // Important stuff goes here include "sql_local.php"; include "ban.php"; // Now for the registration page echo "<div class='panel'>"; if (isset($_POST["submit"])) { // Define the variables here $user = mysql_real_escape_string ($_POST["user"]); $pass1 = mysql_real_escape_string ($_POST["pass"]); $pass2 = mysql_real_escape_string ($_POST["passconf"]); $email = mysql_real_escape_string ($_POST["email"]); $email2 = mysql_real_escape_string ($_POST["email2"]); $dpfc = mysql_real_escape_string ($_POST["dpfc"]); $platinumfc = mysql_real_escape_string ($_POST["platinumfc"]); $hgssfc = mysql_real_escape_string ($_POST["hgssfc"]); $otherfc = mysql_real_escape_string ($_POST["otherfc"]); $favoritepkmn = mysql_real_escape_string ($_POST["favoritepkmn"]); $aboutme = mysql_real_escape_string ($_POST["aboutme"]); $hobbies = mysql_real_escape_string ($_POST["hobbies"]); $favorites = mysql_real_escape_string ($_POST["favorites"]); $gender = mysql_real_escape_string ($_POST["gender"]); // Now check for some errors // Did he/she fill out the form completely? Lets find out function errors() { if (!$_POST["user"] | !$_POST["pass"] | !$_POST["email"] ) { echo "<div class='error'>Please fill in the required fields</div>"; } // Passwords match if ($_POST['pass'] != $_POST['passconf']) { echo "<div class='error'>Password does not match with the other one</div>"; } // Email match if ($_POST['email'] != $_POST['email2']) { echo "<div class='error'>Email does not match with the other one</div>"; } } // Is the user banned? foreach($banned_ips as $ip_ban) { if($user_ip == $ip_ban) { die ("<div class='error'>Your IP address is banned from registering. Contact the site administrator for more info</div>"); } } // If there are no errors, start adding the information to the database if (!errors()) { // Secure the passwords $securepass = md5($pass1); // Submit to the database $insertuser = "INSERT INTO users (user, password, email, dpfc, platinumfc, hgssfc, otherfc, favoritepkmn, aboutme, hobbies, favorites, gender, regip) values ('$user', '$securepass', '$email', '$dpfc', '$platinumfc', '$hgssfc', '$otherfc', '$favoritepkmn', '$aboutme', '$hobbies', '$favorites', '$gender', '$user_ip')"; $add = mysql_query($insertuser, $con) or die ('Error: ' . mysql_error() . ' Please contact an admin'); if ($add) { echo ("<h3>Registration Success</h3><p>You may now login using your username and password. Start hatching some eggs now!</p>"); } } } ?> <div class='registerform'><form action='register.php' method='post'> <label>Username *</label> <input type='text' name='user' class='form1' value='<?php echo @$_POST['user']; ?>' /> <fieldset><legend>Password</legend> <label>Enter your password *</label> <input type='password' name='pass' class='form1' value='<?php echo @$_POST['pass']; ?>' /> <label>Password again *</label> <input type='password' name='passconf' class='form1' value='<?php echo @$_POST['passconf']; ?>' /> </fieldset> <fieldset><legend>Email</legend> <label>Enter your email *</label> <input type="text" name="email" class="form1" value="<?php echo @$_POST['email']; ?>" /> <label>Enter email again *</label> <input type="text" name="email2" class="form1" value="<?php echo @$_POST['email2']; ?>" /> </fieldset> <input type="submit" name="submit" class="submitbutton" value="Register!" /> </form>
  17. I need a tutorial/script for a simple downtime checker. Google can't seem to find any.
  18. Sorry to bump, I just followed your tutorial. And still is causing GID conflict. <?php require_once("mysql.php"); mysql_select_db("ruko_fp", $con); $thispage = $_SERVER["REQUEST_URI"]; $gid = strstr("$thispage","="); $gid = substr($gid, 1); $result = mysql_query("SELECT * FROM games WHERE gid='$gid'"); $num_rows = mysql_num_rows($result); if($num_rows == 0) { echo "Sorry! You reached a page or a game that doesn't exist. Please check your URL and try again. If the problem continues, then contact the webmaster or use the report us system."; } else { while($row = mysql_fetch_array($result)) { $imgsrc = $row['imgsrc']; $gid = $row['gid']; $gametitle = $row['gametitle']; $gamedescription = $row['gamedescription']; $gamerating = $row['gamerating']; $gamereview = $row['gamereview']; $gamecreator = $row['gamecreator']; $swf = $row['gameswf']; $longdes = $row['longdescription']; $dateadded = $row['dateadded']; $gameurl = $row['gameurl']; } } /* Counter goes below these lines <!-----------------> <!-----------------> <!-----------------> */ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Now Playing - <?=$gametitle;?></title> <meta name="description" content="<?=$gamedescription;?>" /> <meta name="keywords" content="Game, Fun, Flash, <?=$gametitle;?>" /> <meta name="author" content="Luigi R." /> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" /> <link rel="icon" type="image/png" href="images/favi.png" /> <link rel="stylesheet" href="style.css" type="text/css" media="screen" /> <link rel="stylesheet" href="style.css" type="text/css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js" type="text/javascript"></script> <script src="common.js" type="text/javascript"></script> <script language="javascript"> // Copyright 2006-2007 javascript-array.com var timeout = 500; var closetimer = 0; var ddmenuitem = 0; // open hidden layer function mopen(id) { // cancel close timer mcancelclosetime(); // close old layer if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; // get new layer and show it ddmenuitem = document.getElementById(id); ddmenuitem.style.visibility = 'visible'; } // close showed layer function mclose() { if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; } // go close timer function mclosetime() { closetimer = window.setTimeout(mclose, timeout); } // cancel close timer function mcancelclosetime() { if(closetimer) { window.clearTimeout(closetimer); closetimer = null; } } // close layer when click-out document.onclick = mclose; </script> </head> <body> <div class='wrap'> <? include('logo.html') ?> <? include('announcements.html') ?> <? include('categories.html') ?> <div id="conTop"> <div id="content"> <h2><?=$gametitle;?></h2> <div id="playnowbtn"><a href='/PlayGame.php?gid=<?=$gid;?>'><img border="0" src="images/play.png"</a></div> <br /> <img src='<?=$imgsrc;?>' width="160px" height="125px" border="1px" /> <br /> <b><?=$gamedescription;?></b> <lb /> <p>Game Rating: <?=$gamerating;?></p> <p>Our Reviews: <?=$gamereview;?><p> <p>Date Added: <?=$dateadded;?></p> <p>Creator: <?=$gamecreator;?></p> <p><a href='<?=$gameurl;?>'>Visit Publishers Site</a></p> <br /> <a href="javascript:toggle('togglelink')">More Info</a> <div id="togglelink" style="display: none"> <div align="left" class="minfo"><p><?=$longdes;?></p></div> </div> <br /> <br /> <br /> <!-- AddThis Button BEGIN --> <div class="addthis_toolbox addthis_default_style"> <a class="addthis_button_facebook"></a> <a class="addthis_button_email"></a> <a class="addthis_button_favorites"></a> <a class="addthis_button_print"></a> <span class="addthis_separator">|</span> <a href="http://www.addthis.com/bookmark.php?v=250&username=xa-4bca9c9a41378345" class="addthis_button_expanded">More</a> <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4bca9c9a41378345"></script> <!-- AddThis Button END --> <br> <p>Wanna add this game in your website, your blog, or your page? You can! Just copy the code below!</p> <textarea rows="6" cols="70" class="texta" readonly="readonly"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="400" height="200"> <param name="movie" value="<?=$swf;?>"> <param name="quality" value="high"> <embed src="<?=$swf;?>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="400" height="200"></embed> <a href='http://flash-planet.co.cc/ViewGame.php?gid=<?=$gid;?>'>View Game Info</a> <a href='http://flash-planet.co.cc/FullScreen.php?gid=<?=$gid;?>'>Go Full Screen!</a> <a href='<?=$gameurl;?>'><?=$gamecreator?></a> </object></textarea> <br> <b><i>Disclaimer:</b> We do not own or create this game in any way. The creator URL is used so we can give them credit and hard work that they put in this game. If your going to put the game in your website, please do <b><u>NOT</u></b> remove the links below including the creator's URL. If we find that the links are removed, we WILL report you to DMCA and they will shut down your website.</i> <p><a href='AddComment.php?gid=<?=$gid;?>'>Add Comment</a> <h4>User Comments</h4> <? // find out how many rows are in the table $sql = "SELECT COUNT(*) FROM game_comments WHERE gid='$gid'"; $result = mysql_query($sql, $con) or trigger_error("SQL", E_USER_ERROR); $r = mysql_fetch_row($result); $numrows = $r[0]; // number of rows to show per page $rowsperpage = 5; // find out total pages $totalpages = ceil($numrows / $rowsperpage); // get the current page or set a default if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage'])) { // cast var as int $currentpage = (int) $_GET['currentpage']; } else { // default page num $currentpage = 1; } // end if // if current page is greater than total pages... if ($currentpage > $totalpages) { // set current page to last page $currentpage = $totalpages; } // end if // if current page is less than first page... if ($currentpage < 1) { // set current page to first page $currentpage = 1; } // end if // the offset of the list, based on current page $offset = ($currentpage - 1) * $rowsperpage; // get the info from the db $sql = "SELECT gid, title FROM game_comments WHERE gid='$gid' LIMIT $offset, $rowsperpage"; $result = mysql_query($sql, $con) or trigger_error("SQL", E_USER_ERROR); // while there are rows to be fetched... while ($list = mysql_fetch_assoc($result)) { $user = $list['user']; $title = $list['title']; $comments = $list['comment']; // echo data echo "<div class='ComBoxIn'><div class='contentCom'><p>From: <b>$user</b></p>"; echo "<h3>$title</h3>"; echo "<div class='ComBox'><p>$comments</p></div></div></div>"; } // end while /****** build the pagination links ******/ // range of num links to show $range = 3; // if not on page 1, don't show back links if ($currentpage > 1) { // show << link to go back to page 1 echo " <a href='{$_SERVER['PHP_SELF']}?gid={$gid}&currentpage=1'><<</a> "; // get previous page num $prevpage = $currentpage - 1; // show < link to go back to 1 page echo " <a href='{$_SERVER['PHP_SELF']}?gid={$gid}&currentpage={$prevpage}'><</a> "; } // end if // loop to show links to range of pages around current page for ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) { // if it's a valid page number... if (($x > 0) && ($x <= $totalpages)) { // if we're on current page... if ($x == $currentpage) { // 'highlight' it but don't make a link echo " [<b>$x</b>] "; // if not current page... } else { // make it a link echo " <a href='{$_SERVER['PHP_SELF']}?gid={$gid}&currentpage=$x'>$x</a> "; } // end else } // end if } // end for // if not on last page, show forward and last page links if ($currentpage != $totalpages) { // get next page $nextpage = $currentpage + 1; // echo forward link for next page echo " <a href='{$_SERVER['PHP_SELF']}?gid={$gid}&currentpage=$nextpage'>></a> "; // echo forward link for lastpage echo " <a href='{$_SERVER['PHP_SELF']}?gid={$gid}&currentpage=$totalpages'>>></a> "; } // end if /****** end build pagination links ******/ /* $user = $info['user']; $title = $info['title']; $comments = $info['comment']; echo "<div class='ComBoxIn'><div class='contentCom'><p>From: <b>$user</b></p>"; echo "<h3>$title</h3>"; echo "<div class='ComBox'><p>$comments</p></div></div></div>"; */ ?> </div> <? include ('footer.html'); ?> </div> </div> </body>
  19. ^ It still shows same result >.<
  20. I just implemented a new comment system when one of the testers noticed a bug. When you go to page 2 of the comments, the gid and its information is ignored. And page 2 of the comments is not displayed. If you don't know what im talking about, look at this. http://flash-planet.co.cc/ViewGame.php?gid=93823&pagenum=2 How do I fix that. <?php require_once("mysql.php"); mysql_select_db("ruko_fp", $con); $thispage = $_SERVER["REQUEST_URI"]; $gid = strstr("$thispage","="); $gid = substr($gid, 1); $result = mysql_query("SELECT * FROM games WHERE gid='$gid'"); $num_rows = mysql_num_rows($result); if($num_rows == 0) { echo "Sorry! You reached a page or a game that doesn't exist. Please check your URL and try again. If the problem continues, then contact the webmaster or use the report us system."; } else { while($row = mysql_fetch_array($result)) { $imgsrc = $row['imgsrc']; $gid = $row['gid']; $gametitle = $row['gametitle']; $gamedescription = $row['gamedescription']; $gamerating = $row['gamerating']; $gamereview = $row['gamereview']; $gamecreator = $row['gamecreator']; $swf = $row['gameswf']; $longdes = $row['longdescription']; $dateadded = $row['dateadded']; $gameurl = $row['gameurl']; } } /* Counter goes below these lines <!-----------------> <!-----------------> <!-----------------> */ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Now Playing - <?=$gametitle;?></title> <meta name="description" content="<?=$gamedescription;?>" /> <meta name="keywords" content="Game, Fun, Flash, <?=$gametitle;?>" /> <meta name="author" content="Luigi R." /> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" /> <link rel="icon" type="image/png" href="images/favi.png" /> <link rel="stylesheet" href="style.css" type="text/css" media="screen" /> <link rel="stylesheet" href="style.css" type="text/css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js" type="text/javascript"></script> <script src="common.js" type="text/javascript"></script> <script language="javascript"> // Copyright 2006-2007 javascript-array.com var timeout = 500; var closetimer = 0; var ddmenuitem = 0; // open hidden layer function mopen(id) { // cancel close timer mcancelclosetime(); // close old layer if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; // get new layer and show it ddmenuitem = document.getElementById(id); ddmenuitem.style.visibility = 'visible'; } // close showed layer function mclose() { if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; } // go close timer function mclosetime() { closetimer = window.setTimeout(mclose, timeout); } // cancel close timer function mcancelclosetime() { if(closetimer) { window.clearTimeout(closetimer); closetimer = null; } } // close layer when click-out document.onclick = mclose; </script> </head> <body> <div class='wrap'> <? include('logo.html') ?> <? include('announcements.html') ?> <? include('categories.html') ?> <div id="conTop"> <div id="content"> <h2><?=$gametitle;?></h2> <div id="playnowbtn"><a href='/PlayGame.php?gid=<?=$gid;?>'><img border="0" src="images/play.png"</a></div> <br /> <img src='<?=$imgsrc;?>' width="160px" height="125px" border="1px" /> <br /> <b><?=$gamedescription;?></b> <lb /> <p>Game Rating: <?=$gamerating;?></p> <p>Our Reviews: <?=$gamereview;?><p> <p>Date Added: <?=$dateadded;?></p> <p>Creator: <?=$gamecreator;?></p> <p><a href='<?=$gameurl;?>'>Visit Publishers Site</a></p> <br /> <a href="javascript:toggle('togglelink')">More Info</a> <div id="togglelink" style="display: none"> <div align="left" class="minfo"><p><?=$longdes;?></p></div> </div> <br /> <br /> <br /> <!-- AddThis Button BEGIN --> <div class="addthis_toolbox addthis_default_style"> <a class="addthis_button_facebook"></a> <a class="addthis_button_email"></a> <a class="addthis_button_favorites"></a> <a class="addthis_button_print"></a> <span class="addthis_separator">|</span> <a href="http://www.addthis.com/bookmark.php?v=250&username=xa-4bca9c9a41378345" class="addthis_button_expanded">More</a> <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4bca9c9a41378345"></script> <!-- AddThis Button END --> <br> <p>Wanna add this game in your website, your blog, or your page? You can! Just copy the code below!</p> <textarea rows="6" cols="70" class="texta" readonly="readonly"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="400" height="200"> <param name="movie" value="<?=$swf;?>"> <param name="quality" value="high"> <embed src="<?=$swf;?>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="400" height="200"></embed> <a href='http://flash-planet.co.cc/ViewGame.php?gid=<?=$gid;?>'>View Game Info</a> <a href='http://flash-planet.co.cc/FullScreen.php?gid=<?=$gid;?>'>Go Full Screen!</a> <a href='<?=$gameurl;?>'><?=$gamecreator?></a> </object></textarea> <br> <b><i>Disclaimer:</b> We do not own or create this game in any way. The creator URL is used so we can give them credit and hard work that they put in this game. If your going to put the game in your website, please do <b><u>NOT</u></b> remove the links below including the creator's URL. If we find that the links are removed, we WILL report you to DMCA and they will shut down your website.</i> <p><a href='AddComment.php?gid=<?=$gid;?>'>Add Comment</a> <h4>User Comments</h4> <? //This checks to see if there is a page number. If not, it will set it to page 1 if (!(isset($pagenum))) { $pagenum = 1; } //Here we count the number of results //Edit $data to be your query $data = mysql_query("SELECT * FROM game_comments WHERE gid='$gid'") or die(mysql_error()); $rows = mysql_num_rows($data); //This is the number of results displayed per page $page_rows = 4; // We get the comments information //This tells us the page number of our last page $last = ceil($rows/$page_rows); //this makes sure the page number isn't below one, or more than our maximum pages if ($pagenum < 1) { $pagenum = 1; } elseif ($pagenum > $last) { $pagenum = $last; } //This sets the range to display in our query $max = 'limit ' .($pagenum - 1) * $page_rows .',' .$page_rows; //This is your query again, the same one... the only difference is we add $max into it $data_p = mysql_query("SELECT * FROM game_comments WHERE gid='$gid' $max") or die(mysql_error()); //This is where you display your query results while($info = mysql_fetch_array( $data_p )) { $user = $info['user']; $title = $info['title']; $comments = $info['comment']; echo "<div class='ComBoxIn'><div class='contentCom'><p>From: <b>$user</b></p>"; echo "<h3>$title</h3>"; echo "<div class='ComBox'><p>$comments</p></div></div></div>"; } // This shows the user what page they are on, and the total number of pages echo " --Page $pagenum of $last-- <p>"; // First we check if we are on page one. If we are then we don't need a link to the previous page or the first page so we do nothing. If we aren't then we generate links to the first page, and to the previous page. if ($pagenum == 1) { } else { echo " <a href='{$_SERVER['PHP_SELF']}?&pagenum=1'> <<-First</a> "; echo " "; $previous = $pagenum-1; echo " <a href='{$_SERVER['PHP_SELF']}?&pagenum=$previous'> <-Previous</a> "; } //just a spacer //This does the same as above, only checking if we are on the last page, and then generating the Next and Last links if ($pagenum == $last) { } else { $next = $pagenum+1; echo " <a href='{$_SERVER['PHP_SELF']}?&pagenum=$next'>Next -></a> "; echo " "; echo " <a href='{$_SERVER['PHP_SELF']}?&pagenum=$last'>Last ->></a> "; } ?> </div> <? include ('footer.html'); ?> </div> </div> </body>
×
×
  • 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.