Jump to content

Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\index.php on line 248


Anudeep

Recommended Posts

hello php masters please help me on this code

i dont know what im missing

<?php
 include "top.php"; 
 include_once('pagination.php');
 $where = "1";
 //print_r($_REQUEST);
 if($_SESSION[admin] != 'admin')
	{
 		$where .= " AND lnk_status = '1' ";
 	}
 	if(isset($category) && $category != 'home'){
			//if(array_search($_GET[category], array_keys($cat))<5)
				$where .= ' AND category in ('.$category.')';
			//else
				//$where .= ' AND category ='.$category;
		}
	
			//$where .= " AND showhome = '1'";
		
	if(isset($_SESSION[admin]) && $_SESSION[admin] == 'admin')
	{
		if(isset($_GET['linktype']) && $_GET['linktype']== "pending")
			$where .= " AND lnk_status ='0'";
		else if(isset($_GET['linktype']) && $_GET['linktype'] == "homelinks")
			$where .= " AND showhome = '1'";
		
	}
		if($category == 'home')	
		$sql = "SELECT * FROM sitelinks where $where ORDER BY showhome desc,add_date DESC"; 
		else		
		$sql = "SELECT * FROM sitelinks where $where ORDER BY add_date DESC";
		//$rsid = mysql_query($select);
		//$rows = mysql_num_rows($rsid);
		$paging = new paging(12,4, "«&laquo Prev" , "Next »&raquo" , "%%number%%");
		//$paging->db(HOST,USER,PASSWORD,DBASE);
		 //$paging->db("localhost","root","","sur");
		 $paging->query($sql);
		 $records=$paging->print_info(); 
		//$records[total];
		 $page=$paging->print_link();

?>
<link href="style.css" rel="stylesheet" type="text/css" />
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        			<td align="left" valign="top"><table width="100%" border="0">
	  <?php
			if($records[total] > 0)
			{
				$i=1;
				while($links = $paging->result())
				{ 
					preg_match("/^(http:\/\/)?([^\/]+)/i",$links->url, $matches);
					$host = $matches[2]; 
					preg_match("/[^\.\/]+\.[^\.\/]+$/", $host, $matches);
					$url_title = replaceurls(trim(stripslashes($links->title)));
					if($i%2 != 0)
					{
					?>
          <tr>
            <td class="lightgray"><table width="98%" border="0" align="center" cellpadding="2" cellspacing="2">
              <tr>
                <td width="66%"><a href="viewdetails.php?linkid=<?=$links->lnkid?>&title=<?=$url_title?>" title="<?=$url_title?>"><img src="<?=$links->image?>" alt="<?=$url_title?>" width="225" border="0" /></a></td>
                <td width="34%" rowspan="2" align="left" valign="top"><table width="75" border="0" align="left">
                  <tr>
                    <td align="center" valign="middle" width="60" class="graybg text18 darkgraytxt">
					<?
						$sqlc = "SELECT clicks FROM linkclicks WHERE lnkid='".$links->lnkid."' limit 1";
						$res = mysql_query($sqlc);
						$clicks = mysql_num_rows($res);
						if($clicks <= 0){
							echo '0';
						}else{
							echo mysql_fetch_object($res)->clicks;;
						}
						?>
						</td>
                  </tr>
                  <tr>
                    <td align="center" valign="middle" class="darkgraybg text14">Views</td>
                  </tr>
                  <tr>
                     <td align="center" valign="middle" class="green whitetxt text18" id="VTX<?=$links->lnkid?>"><? $cok = "_CVote".$links->lnkid; if(!isset($_COOKIE[$cok])) { ?> <a href="javascript:void(0)" class="votelink"  onclick="javascript:voteForIt('<?php echo $links->lnkid ?>',<?=$links->votes?>)">VOTE</a><? } else {?>VOTE <? } ?></td>
                  </tr>
                  <tr>
                    <td align="center" valign="middle" class="maroon whitetxt text14"><span id='VT<?=$links->lnkid?>'><?=$links->votes?></span></td>
                  </tr>
				  <tr>
                    <td align="center" height="5" valign="middle" class=""></td>
                  </tr>
				  <?
				if(isset($_SESSION[admin]) && $_SESSION[admin] == 'admin')
				{
				  if($links->lnk_status == '0') { ?>
				   <tr>
                    <td align="center" valign="middle" class="darkgraybg text14"><a href="adminaction.php?linkid=<?=$links->lnkid?>&action=approve&category=<?=$_REQUEST[category]?>&linktype=<?=$_REQUEST[linktype]?>">Approve</a></td>
                  </tr>
				  <? }
				  if($links->lnk_status == '0' || $links->showhome != '1') { ?>
				   <tr>
                    <td align="center" valign="middle" class="darkgraybg text14"><a href="javascript:void(0);" onClick="javascript: if(confirm('Are you Sure, Do you want to Show this in Home page?')) location.href='adminaction.php?linkid=<?=$links->lnkid?>&action=showhome&category=<?=$_REQUEST[category]?>&linktype=<?=$_REQUEST[linktype]?>';">Stick YES</a></td>
                  </tr>
				  <? }
				  if($links->showhome == '1') { ?>
				  <tr>
                    <td align="center" valign="middle" class="darkgraybg text14"><a href="javascript:void(0);" onClick="javascript: if(confirm('Are you Sure, Do you want to remove this from Home page?')) location.href='adminaction.php?linkid=<?=$links->lnkid?>&action=dontshowhome&category=<?=$_REQUEST[category]?>&linktype=<?=$_REQUEST[linktype]?>'; ">Stick NO</a></td>
                  </tr>
				  <? } 
				 ?>
				  <tr>
                    <td align="center" valign="middle" class="darkgraybg text14"><a href="javascript:void(0);" onClick="javascript: if(confirm('Are you Sure, Do you want to delete?')) location.href='adminaction.php?linkid=<?=$links->lnkid?>&action=delete&category=<?=$_REQUEST[category]?>&linktype=<?=$_REQUEST[linktype]?>'; ">Delete</a></td>
                  </tr>
				  <? }//if Admin
				 ?>
                </table></td>
              </tr>
              <tr></tr>
              <tr>
                <td colspan="2" align="left" valign="top" class="browntxt">
		<a href="viewdetails.php?linkid=<?=$links->lnkid?>&title=<?=$url_title?>" class="titlelink" title="<?=$url_title?>"><?=stripslashes($links->title)?></a></td>
              </tr>
              <tr>
                <td colspan="2" align="left" valign="top" class="text12 darkgraytxt"><span class="text14 darkgraytxt"><?=stripslashes(substr($links->description,0,250))?>...</span></td>
              </tr>
              <tr>
                <td colspan="2" align="left" valign="top" class="text12 darkgraytxt"><span class="text12 graytext"><span class="redtxt">Tags:</span> <em><?=preg_replace('/(?<!\d),|,(?!\d{3})/', ', ', stripslashes(substr($links->tags,0,250)))?>...</em></span></td>
              </tr>
              <tr>
                <td colspan="2" align="right" valign="top" class="text12 darkgraytxt"><?=formatdate($links->add_date)?></td>
              </tr>
            </table></td>
          </tr>
  		<?
		}//if($i%2 != 0)
	else
		{
		 $admindt = "";
		$sqlc = "SELECT clicks FROM linkclicks WHERE lnkid='".$links->lnkid."' limit 1";
						$res = mysql_query($sqlc);
						$clicks = mysql_num_rows($res);
						if($clicks <= 0){
							$vie =  '0';
						}else{
							$vie =  mysql_fetch_object($res)->clicks;;
						}
$cok = '_CVote'.$links->lnkid;
if(!isset($_COOKIE[$cok])) { 
$votxt = '<a href="javascript:void(0)" class="votelink"  onclick="javascript:voteForIt(\''.$links->lnkid.'\','.$links->votes.')">VOTE</a>';
 //$votxt = " <a href='javascript:void(0)' class='votelink'  onclick='javascript:voteForIt('".$links->lnkid."',".$links->votes.")'>VOTE</a>";
} else {$votxt = "VOTE"; }

if(isset($_SESSION[admin]) && $_SESSION[admin] == 'admin')
{
	  if($links->lnk_status == '0') {
	   $admindt .= '<tr>
		<td align="center" valign="middle" class="darkgraybg text14"><a href="adminaction.php?linkid='.$links->lnkid.'&action=approve&category='.$_REQUEST[category].'&linktype='.$_REQUEST[linktype].'">Approve</a></td>
	  </tr>';
	  }
	  
	  if($links->lnk_status == '0' || $links->showhome != '1') {
	   $admindt .= '<tr>
		<td align="center" valign="middle" class="darkgraybg text14"><a href="javascript:void(0);" onClick="javascript: if(confirm(\'Are you Sure, Do you want to Show this in Home page?\')) location.href=\'adminaction.php?linkid='.$links->lnkid.'&action=showhome&category='.$_REQUEST[category].'&linktype='.$_REQUEST[linktype].'\';">Stick YES</a></td>
	  </tr>';
		}
		
	  if($links->showhome == '1') { 
	 $admindt .= '<tr>
		<td align="center" valign="middle" class="darkgraybg text14"><a href="javascript:void(0);" onClick="javascript: if(confirm(\'Are you Sure, Do you want to remove this from Home page?\')) location.href=\'adminaction.php?linkid='.$links->lnkid.'&action=dontshowhome&category='.$_REQUEST[category].'&linktype='.$_REQUEST[linktype].'\'; ">Stick NO</a></td>
	  </tr>';
		} 
 
	   $admindt .= '<tr>
		<td align="center" valign="middle" class="darkgraybg text14"><a href="javascript:void(0);" onClick="javascript: if(confirm(\'Are you Sure, Do you want to delete?\')) location.href=\'adminaction.php?linkid='.$links->lnkid.'&action=delete&category='.$_REQUEST[category].'&linktype='.$_REQUEST[linktype].'\'; ">Delete</a></td>
	  </tr>';
   }//if Admin


$nexttddata .= "<tr>
            <td class='lightgray'><table width='98%' border='0' align='center' cellpadding='2' cellspacing='2'>
              <tr>
                <td width='66%'><a href='viewdetails.php?linkid=".$links->lnkid."&title=".$url_title."' title='".$url_title."'><img src='".$links->image."' alt='".$url_title."' width='225' border='0' /></a></td>
                <td width='34%' rowspan='2' align='left' valign='top'><table width='75' border='0' align='left'>
                  <tr>
                    <td align='center' valign='middle' width='60' class='graybg text18 darkgraytxt'>
					".$vie."
						</td>
                  </tr>
                  <tr>
                    <td align='center' valign='middle' class='darkgraybg text14'>Views</td>
                  </tr>
                  <tr>
                     <td align='center' valign='middle' class='green whitetxt text18' id='VTX".$links->lnkid."'>".$votxt."</td>
                  </tr>
                  <tr>
                    <td align='center' valign='middle' class='maroon whitetxt text14'><span id='VT".$links->lnkid."'>".$links->votes."</span></td>
                  </tr>
				  <tr>
                    <td align='center' height='5' valign='middle' class=''></td>
                  </tr>
				".$admindt."
                </table></td>
              </tr>
              <tr></tr>
              <tr>
                <td colspan='2' align='left' valign='top' class='browntxt'>
		<a href='viewdetails.php?linkid=".$links->lnkid."&title=".$url_title."' class='titlelink' title='".$url_title."'>".stripslashes($links->title)."</a></td>
              </tr>
              <tr>
                <td colspan='2' align='left' valign='top' class='text12 darkgraytxt'><span class='text14 darkgraytxt'>".stripslashes(substr($links->description,0,250))."...</span></td>
              </tr>
              <tr>
                <td colspan='2' align='left' valign='top' class='text12 darkgraytxt'><span class='text12 graytext'><span class='redtxt'>Tags:</span> <em>".preg_replace('/(?<!\d),|,(?!\d{3})/', ', ', stripslashes(substr($links->tags,0,250)))."...</em></span></td>
              </tr>
              <tr>
                <td colspan='2' align='right' valign='top' class='text12 darkgraytxt'>".formatdate($links->add_date)."</td>
              </tr>
            </table></td>
          </tr>";
			} 
			$i++;
			}//while
		}//if(numrows)
		else { 
		?>
		<tr>
            <td class="text18">
			<strong>NO Links Found</strong>
			</td>
		</tr>
		<?
		}
		?></table></td>
        <td align="left" valign="top"><table width="100%" border="0"><?=$nexttddata?></table></td>
         
        <? include "rightpanel.php"; ?>
      </tr>
      <tr>
        <td colspan="2" align="center" valign="top">
        <div id="tnt_pagination"><?=$page?></div>
        
        </td>
		<td></td>
      </tr>
    </table></td>
  </tr>
</table>
<? include "footer.php"; ?>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.