All pastes #582385 Raw Edit

jkj

public html v1 · immutable
·published 2007-06-21 23:00 UTC
rendered paste body
<script language="JavaScript">function checkifvalid33(){		if (window.document.myform33.title.value=="")	{	alert("Please enter the title!");	window.document.myform33.title.focus();	return false;	}	if (window.document.myform33.description.value=="")	{	alert("Please enter the description!");	window.document.myform33.description.focus();	return false;	}				document.myform33.submit();}function setVote(id, numVote){	//alert(document["rate"+id].vote.value);	document["rate"+id].vote.value = numVote;	document["rate"+id].submit();}</script> <html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><meta http-equiv="Content-Language" content="en-us"><meta name="GENERATOR" content="Microsoft FrontPage 5.0"><meta name="ProgId" content="FrontPage.Editor.Document"><link rel="stylesheet" href="../images/stylesheet.css" type="text/css"><title>Linker</title><style type="text/css"><!--.style2 {color: #0000CC}--></style><link href="images/stylesheet.css" rel="stylesheet" type="text/css"></head><body leftmargin="0" rightmargin="0" bottommargin="0" topmargin="0" marginwidth="0" marginheight="0" ><table width="100%" border="0" cellpadding="0" cellspacing="0">  <tr>    <td align="center">      <table width="100%" height="10" border="0" align="center" cellpadding="0" cellspacing="0" class="mytable">        <tr>           <td valign="top"> <div align="center"> 	                <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" class="bg_table">                <form name="myform33" action="index.php?cmd=26" method="post">				 <input type="hidden" name="linkit" value="<? print $linkit;?>">                  <!--<input type="hidden" name="phid" value="<? //print $phid; ?>">-->                  <tr >                     <td width="7" height="20" class="header">&nbsp;</td>                    <td width="148" class="header" ><div align="left">Submit a Link </div></td>                    <td height="20" colspan="2" class="header" style="padding:  0 0 0 10;">&nbsp;</td>                  </tr>				  <tr >                     <td colspan="4" class="normal"><div align="right">&nbsp;</div>                    </td>                  <tr >				    <td height="13" colspan="2" class="normal"><div align="right"><strong>Title</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></td>			        <td width="362" height="30" align="left" valign="middle" class="normal"><input name="title" type="text"  class="mytext" id="title2" size="40" maxlength="50"/></td>				    <td width="474" align="left" valign="middle" class="normal">&nbsp;</td>                  <tr >                     <td height="25" colspan="2" class="normal"><div align="right"><strong>URL</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></td>                    <td width="362" height="30" align="left" valign="middle" class="normal">                      <input name="url" type="text"  class="mytext" id="url" size="50" maxlength="500" />                    </td>                    <td width="474" align="left" valign="middle" class="normal">&nbsp;</td>                  </tr>                  <tr >                     <td height="25" colspan="2" class="normal"><div align="right"><strong>Description</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></td>                    <td height="25" colspan="2" align="left" class="normal"><br>                      <textarea name="description" cols="75" rows="5" class="mytext" id="description"></textarea>                     </td>                  </tr>                  <tr align="center" >                     <td height="12" colspan="2" class="normal">&nbsp;</td>                    <td height="12" colspan="2" class="normal">					<div align="left">                      <input name="image" type="image" onClick="return checkifvalid33();" src="/images/submit.gif"  border="0">                    </div></td>                  </tr>                  <tr align="center" >                    <td height="30" colspan="4" class="normal">Please read <a href="../index.php?cmd=24"><strong><span class="style2">User Agreement</span></strong></a> before using <strong>Linker</strong> </td>                  </tr>                </form>              </table>            </div></td>        </tr>      </table></td>  </tr>  <tr>  	<td align="center"><span class="normal"><?php if (isset($alert)) { echo "<br>".$alert; } ?></span></td>  </tr>  <tr>    <td><br>      <table width="100%" height="10" border="0" align="center" cellpadding="0" cellspacing="0" class="mytable">        <tr>           <td valign="top"> <div align="center"> 	                <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" class="bg_table">                  <tr >                     		  <td colspan="4" class="header" >		    <div align="center">Linker</div></td>                  </tr>				  <?php				  $count = 0;				  if(!isset($start))				  {				  	$start = 0;				  }				  $sql = "SELECT * FROM linkerlinks ORDER BY id DESC LIMIT $start, 10";				  $res = mysql_query($sql) or die(mysql_error());				  while ($row = mysql_fetch_object($res))				  {				  														$avg = round(($row->rating / $row->votes),2); 						if($row->votes == 0) 						{ 							$rating = "Not Yet Rated"; 						} 						else						{												/*if($avg < 7.5)						{							$rated = "AVERAGE";							if($avg < 2.5)								$rated = "BAD";						}						else							$rated = "GOOD";*/							$pos = round(($avg / 2),2);																												$rating = "";							//$rating = $pos;							for($i = 0; $i < 5; $i++)							{								if( $pos >= ($i + 1) )								{									$rating = $rating."<img src=\"images/starp.gif\">";								}								else								{									if( $pos >= ($i + .5) )									{										$rating = $rating."<img src=\"images/starm.gif\">";									}									else									{										$rating = $rating."<img src=\"images/starn.gif\">";									}								}							}																											}						 echo "<script type=\"text/javascript\">function doCheck(id,rating) { if(document.getElementById(id).style.visibility == 'hidden') {document.getElementById(id).style.visibility='visible';} else {setVote(id,rating);}}</script>";				  ?>				  <tr >                     <td height="20" colspan="4"><div align="left" class="smallgap mainfont"><strong>					<?php if(!empty($row->url)) { ?>					<a href="<? echo $row->url; ?>" target="_blank"><?php echo $row->title; ?></a>					<? } else { ?>										<?php echo $row->title; ?>					<? } ?></strong>					-                       <?php  echo "$rating"; ?>                    </div></td>                  </tr>                  <tr >                     <td height="25" colspan="3"  align="left"><table width="100%" >                      <tr>                        <div class="linkerfont smallgap"><? print strip_tags($row->description); ?></div><div class="smallgap mainfont"><strong><? if (!empty($row->contr)) {echo "Provided by:</strong> <a href=\"index.php?cmd=16&username=".$row->contr."\"> ". $row->contr."</a>";} ?>						<?php if(empty($ses_username)) { $baby = $row->id;						   echo "<div id=\"".$row->id."\" style=\"text-align: right; visibility:hidden;\"><img src=\"random.php\" width=\"60\" height=\"20\" vspace=\"1\" align=\"top\" /><input type=\"text\" name=\"validator\" id=\"validator\" size=\"4\" /></div>"; }							?>					<?php if(!empty($ses_username)) { ?>					<div align="right"><a href="javascript:setVote(<?php echo $row->id; ?>, 0);">Bad</a> &nbsp;&nbsp;&nbsp;&nbsp<a href="javascript:setVote(<?php echo $row->id; ?>, 5);">Average</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:setVote(<?php echo $row->id; ?>, 10);">Good</a>&nbsp;&nbsp;&nbsp;&nbsp;</div></td>					<? } else { ?>					<div align="right"><a id="vote<?php echo $baby; ?>A" href="javascript:doCheck(<?php echo $baby; ?>,0)">Bad</a> &nbsp;&nbsp;&nbsp;&nbsp<a href="javascript:doCheck(<?php echo $baby; ?>,5);" id="vote<?php echo $baby; ?>B">Average</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:doCheck(<?php echo $baby; ?>,10);" id="vote<?php echo $baby; ?>C">Good</a>&nbsp;&nbsp;&nbsp;&nbsp;</div></td>					<? } ?>																		</div>                      </tr>                    </table></td>                    					<td width:150px height="25"  align="left">										</td>                </tr>                  <tr align="center" >				  <form name="rate<?php echo $row->id; ?>" id="rate<?php echo $row->id; ?>" action="../index.php?cmd=27" method="post"> 				  <input type="hidden" name="id" value="<?php echo $row->id; ?>" />				  <input type="hidden" name="vote" value="5" />					<td height="10" colspan="4"  ><hr width="94%"></td>					</form>                  </tr>				  <?php				  $count++;				  }				  ?>				  <tr><td width="125" align="left" class="normal" style="padding:0 0 10 10;">				  <?				  $result=mysql_query("select * from linkerlinks");				  $num=mysql_num_rows($result) or die(mysql_error());				  				  if ($num > 10)				  {					if($start != 0)				 	{						$next = $start - 10;				   		echo "<a href=\"index.php?catid=96&start=$next\">Previous 10 Links</a>";				 	}					if($start != 0 && ($start + 10  < $num))					{						echo " | ";					}					if($start + 10 < $num)					{						$next = $start + 10;				   		echo "<a href=\"index.php?catid=96&start=$next\">Next 10 Links</a>";					}				  }				  ?>				  </td>				  <td colspan="3" align="right" class="normal" style="padding:0 10 0 10;">				  <?php				  $add = $start + $count;				  echo "$start - $add of $num";				  ?>				  </td></tr>              </table>            </div></td>        </tr>      </table></td>  </tr></table></body></html>