Пренаписване на код

Gamerz

Registered
Някой може ли да ми пренапише и оправи кода ?

Код:
	</td>
	<td style="width: 290px;" valign="top"><?php

	if ($ads == "Yes") {

		if ($uads == '1') {
     
			$adspot = mysql_query("SELECT * from ccms_ads where location='Right' and groupname='$adgroup_name' order by rand() limit 1");
			while ($row = mysql_fetch_assoc($adspot)) {
?>

		<table cellpadding="5" cellspacing="0" border="0" width="90%">
		<tr>
			<td>
<?

				if ($row[code_img] == 'code') {
				// Display custom code
echo "				$row[code]";
				}
				if ($row[code_img] == 'img') {
				// Display an image or a link
echo "				<a href=\"ad_out.php?id=$row[id]\" target=\"_new\"><img border=0 src=\"$row[imgurl]\"></a>";
				}

				if ($row[groupname]) {
				// ASSIGN GROUP
					$adgroup = '1';
					$adgroup_name = $row[groupname];
				}
?>
			</td>
		</tr>
		</table>
<?
			}
		}
	}

	if ($_REQUEST[page] == "FAQ" || $_REQUEST[page] == "Cheats" || $_REQUEST[page] == "Games" || $_REQUEST[page] == "Top Games" || $_REQUEST[page] == "Upcoming Games") {
		include "includes/right_games.php";
	}

	if ($_REQUEST[page] == "Files") {
		include "includes/right_files.php";
	}

	if ($_REQUEST[page] == "Video") {
		include "includes/right_video.php";
	}

	//if ($_REQUEST[page] == "Cheats") {
	//	include "includes/right_cheats.php";
	//}

	if ($_REQUEST[page] == "Articles") {
		include "includes/right_articles.php";
	}

	if ($_REQUEST[page] == "Story" || $_REQUEST[page] == "Archive") {
		include "includes/right_news.php";
	}

	if ($_REQUEST[page] == "Media") {
		include "includes/right_media.php";
	}

	if ($_REQUEST[page] == "Console") {
		include "includes/right_console.php";
	}

	if ($_REQUEST[page] == "Logout"
	|| $_REQUEST[page] == "User CP"
	|| $_REQUEST[page] == "Members"
	|| $_REQUEST[page] == "User Profile"
	|| $_REQUEST[page] == "Edit Profile"
	|| $_REQUEST[page] == "Page"
	|| $_REQUEST[page] == "Login"
	|| $_REQUEST[page] == "Register"
	|| $_REQUEST[page] == "Submit"
	|| $_REQUEST[page] == "Submit News"
	|| $_REQUEST[page] == "Online"
	|| $_REQUEST[page] == "Poll"
	|| $_REQUEST[page] == "Links"
	|| $_REQUEST[page] == "Search"
	|| $_REQUEST[page] == "Password"
	|| $_REQUEST[page] == "Vote"
	|| $_REQUEST[page] == "Blogs"
	|| $_REQUEST[page] == "Companies"
	|| $_REQUEST[page] == "Contact"
	|| !$_REQUEST[page]) {

?>
		<table cellpadding="0" cellspacing="0" border="0" align="center">
<?
		if ($nowplaying == "Yes" && !$_REQUEST[page]) {

			$nowplay = mysql_query("SELECT * from ccms_nowplaying order by id desc limit 1");
			while ($row = mysql_fetch_assoc($nowplay)) {

				$url = $row[url]; // URL to flv video
?>
		<tr>
			<td><center><html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
      <title>Hover</title>   
   
      <script type="text/javascript">
         function onOver(el)
         {
            el.src = el.src.replace(".png", "Over.png");
         }
         
         function onOut(el)
         {
            el.src = el.src.replace("Over.png", ".png");
         }         
      
      </script>
   
   
   </head>
   
   

       
            

                 
                    
                    <a href="http://www.fsafsabg.com/view.php?id=44"><img align="absmiddle" src="test/hero1.png" alt="index" border="0" onmouseover="onOver(this);" onmouseout="onOut(this);"></a><a href="http://www.fsafsabg.com/view.php?id=23"><img align="absmiddle" src="test/hero2.png" alt="Games" border="0" onmouseover="onOver(this);" onmouseout="onOut(this);"></a><a href="http://www.fsafasg.com/view.php?id=83"><img align="absmiddle" src="test/hero3.png" alt="news" border="0" onmouseover="onOver(this);" onmouseout="onOut(this);"></a>
 


</html></center></td>
		</tr>
		<tr>
			<td height="26" background="images/np_title.jpg" width="280">

				<table width="280" cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td width="33" align="center" style="padding-left: 0px;"></td>
					<td width="277" style="padding-left: 8px;"><SPAN class="nowplaying"><?echo "$row[title]"?></SPAN></td>


				</tr>
				</table>

			</td>
		</tr>

		<tr>
			<td>
				<?if($url) {?>
				<object type="application/x-shockwave-flash" width="280" height="200" wmode="transparent" data="flvplayer.swf?file=<?echo "$url"?>"> 
					<param name="movie" value="?file=<?echo "$url"?>"/> <param name="wmode" value="transparent" />
				</object>
				<?}?>
				
				<?include "includes/twitter.php"?>
				
				
<br>
<a href="http://www.fsafa.com/page-4-Zero-Punctuation.html"<img src="banners/zeropunct.jpg" border="0"</a>
<br>
<img src="images/random screenshots.png">
<br>
<SCRIPT LANGUAGE="Javascript">
function image() {
};

image = new image();
number = 0;


image[number++] = "<img src='images/uploads/20100220_00331473.jpg' border='0' width='290px' height='240px'>"
image[number++] = "<img src='images/uploads/20100220_00331474.jpg' border='0' width='300px' height='240px'>"
image[number++] = "<img src='images/uploads/20090605_928005_20090601_790screen004.jpg' border='0' width='290px' height='240px'>"
image[number++] = "<img src='images/uploads/20090703_955367_20090224_790screen009.jpg' border='0' width='290px' height='240px'>"
image[number++] = "<img src='images/uploads/20090606_960429_20090603_790screen011.jpg' border='0' width='290px' height='240px'>"
image[number++] = "<img src='images/uploads/20090606_960429_20090603_790screen008.jpg' border='0' width='290px' height='240px'>"


increment = Math.floor(Math.random() * number);

document.write(image[increment]);

</SCRIPT>     
			</object>


</td>
		</tr>
		<tr>
			<td><img src="images/spacer.gif"></td>
		</tr>

<?
			}
		}
?>

		<tr>
			<td><img src="images/div_recent.jpg"></td>
		</tr>
		<tr>
			<td>
				<table width="290" cellpadding="0" cellspacing="0" border="0" align="center">
<?
		$latestnews = mysql_query("SELECT * from ccms_news order by id desc limit 20");
		while ($row = mysql_fetch_assoc($latestnews)) {

			$gamet = preg_replace('/[^a-zA-Z0-9 *]/', '', $row[title]);
			$gameturl = str_replace(' ', '-', $gamet);
?>
				<tr>
					<td height="25" >

						<table width="90%" cellpadding="0" cellspacing="0" border="0" align="center">
						<tr>
							<td height="25" width="233" style="padding-left: 8px;"> <a class="rating" href="story-<?echo "$row[id]-$gameturl"?>.html"><?

			$MAX_LENGTH = 25;
			$str = strlen($row[title]);

			if ($str <= $MAX_LENGTH) {
				echo "$row[title]";
			} else {

				$s2 = substr($row[title], 0, $MAX_LENGTH - 3);
				echo "$s2";
				echo "...";
			}
			
?>
							</SPAN></td>
							<td height="25" width="77" align="center"><SPAN class="rating_small"><?php

//===================================================
// DATE & TIME DISPLAY
//-----------------------------------------------------------------

			if (!$row[timestamp] || $row[timestamp] == "0") {
				echo "$row[date]\n";
			} else {
				echo timedisplay($row[timestamp]);
			}

//===================================================
?>
							</td>
						</tr>
						</table>

					</td>
				</tr>
<?
		}
?>
				</table>
			</td>
		</tr>
		<tr>
			<td><img src="images/div_right_foot.jpg"></td>
		</tr>
		<tr>
			<td><img src="images/spacer.gif"></td>
		</tr>
		<tr>
			<td><img src="images/div_topgames.png"></td>
		</tr>
		<tr>
			<td width="290">

				<table width="280" cellpadding="0" cellspacing="1" bgcolor="#B6B6B6" border="0" align="center">
<?php
		$topgames = mysql_query("SELECT * from ccms_gameindex order by rank asc limit 5");
		$c = 1;
		while ($row = mysql_fetch_assoc($topgames)) {

			$gamet = preg_replace('/[^a-zA-Z0-9 *]/', '', $row[title]);
			$gameturl = str_replace(' ', '-', $gamet);
?>
				<tr>
					<td height="37" width="31" background="images/right_rank_1.jpg" align="center" valign="center"><SPAN class="rating_large"><?echo "$c"?></SPAN></td>
					<td height="37" width="217" background="images/right_rank_2.jpg" valign="center">

						<table width="92%" cellpadding="6" cellspacing="0"  border="0" align="center">
						<tr>
							<td height="37" width="94%" style="padding-left: 5px;"><a class="rating" href="game-<?echo "$row[id]-$gameturl"?>.html"><?

			$MAX_LENGTH = 25;
			$str = strlen($row[title]);

			if ($str <= $MAX_LENGTH) {
				echo "$row[title]";
			} else {

				$s2 = substr($row[title], 0, $MAX_LENGTH - 3);
				echo "$s2";
				echo "...";
			}
			
?></SPAN></td>
							<td height="37" width="1%" align="right"><img src="images/consoles/<?echo "$row[category].gif"?>"></td>
						</tr>
						</table>

					</td>
					<td height="37" width="58" background="images/right_rank_3.jpg" align="center" valign="center"><a class="rating_small">Score:</a><br /><a class="rating_large"><?echo "$row[rating]"?></a></td>
				</tr>
<?php
		$c++;
		}
?>
				</table>
			</td>
		</tr>
		<tr>
			<td><img src="images/div_right_foot.jpg"></td>
		</tr>
		<tr>
			<td><img src="images/spacer.gif"></td>
		</tr>
		<tr>
			<td><img src="images/div_rpoll.png"></td>
		</tr>
			<td width="290">

				<table width="280" cellpadding="0" cellspacing="1" bgcolor="#B6B6B6" align="center">
<?php
		include "poll.php";
?>
				</table>
			</td>
		</tr>
		<tr>
			<td><img src="images/div_right_foot.jpg"></td>
		</tr>
		<tr>
			<td><img src="images/spacer.gif"></td>
		</tr>
		<tr>
			<td><img src="images/div_cheats.png"></td>
		</tr>
		<tr>
			<td>
				<table width="290" cellpadding="0" cellspacing="0" border="0" align="center">
<?
		$latestcheats = mysql_query("SELECT * from ccms_cheat where approved='1' order by id desc limit 5");
		while ($row = mysql_fetch_assoc($latestcheats)) {

			$gtitle = $row[game];
			$gplatform = $row[platform];

			$gid = mysql_query("SELECT * from ccms_gameindex where title=\"$gtitle\" and category='$gplatform'");
			while ($r = mysql_fetch_assoc($gid)) {
				$gamesid = $r[id];
			}
?>
				<tr>
					<td height="25" background="images/right_listbg.jpg">

						<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
						<tr>
							<td height="25" width="33" align="center"><img src="images/consoles/<?echo "$row[platform]"?>.gif"></td>
							<td height="25" width="200" style="padding-left: 8px;"><a class="rating" href="cheat-<?echo "$gamesid-$row[platform]"?>.html"><?

			$MAX_LENGTH = 25;
			$str = strlen($row[game]);

			if ($str <= $MAX_LENGTH) {
				echo "$row[game]";
			} else {

				$s2 = substr($row[game], 0, $MAX_LENGTH - 3);
				echo "$s2";
				echo "...";
			}
			
?></SPAN></td>
							<td width="77" align="center"><SPAN class="rating_small"><?php

//===================================================
// DATE & TIME DISPLAY
//-----------------------------------------------------------------

			if (!$row[timestamp] || $row[timestamp] == "0") {
				echo "$row[date]\n";
			} else {
				echo timedisplay($row[timestamp]);
			}

//===================================================
?>
							</td>
						</tr>
						</table>

					</td>
				</tr>
<?
		}
?>
				</table>
			</td>
		</tr>
		<tr>
			<td><img src="images/div_right_foot.jpg"></td>
		</tr>
		<tr>
			<td><img src="images/spacer.gif"></td>
		</tr>
		</table>
<?
	}
?>

	</td>
</tr>
</table>
[/code]
 
А ти били ни казал какво точно му има на кода (къде е грешката защото е бая дълъг) ?
 
Ами не знам валидатора ми дава адски много грешки в кода и не зная как да ги оправя....
 
Ти разбраш ли поне малко от това което е написано. Няма как ние само като ни покажеш този код и без да ни какжеш какви са грешките от валидатора да ти дадем отговор най-малко защото има mysql заявки и неможе да бухнем кода в валидатора.
Или дай генерирания код или няма как да получиш отговор.
 

Back
Горе