Jump to content

[SOLVED] Parse error: syntax error, unexpected $end


love_bug

Recommended Posts

Looking at your code, I'm not surprised you're getting the error.

 

Also if statements do not always need to have an ending else statement, example

	if ($thetype > 2 )
{
echo "selected";
}
else
{
echo "";
}

Drop the else statement if you're not going to do anything. The above can written as a one liner using a ternary operator

echo ($thetype > 2) ? 'selected' : null;

Come to think of it the majority of your if/else statements can be changed to this.

Link to comment
Share on other sites

as i said, i can't duplicate the unexpected end error using your code. maybe try copy/paste this into a new file:

 

<?php 
$curdir = getcwd ();
@chdir('/domains/3615/web');
@require_once('/domains/3615/web/global.php');
@chdir ($curdir);

$vbglobal = '
<script type="text/javascript" language="javascript">
var xmlHttp

function showHint(str)
{
if (str.length==0)
  { 
  document.getElementById("txtHint").innerHTML="";
  return;
  }
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajax_recprocial_checker.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
</script> 


<script type="text/javascript">
<!--
function log_out()
{
        ht = document.getElementsByTagName("html");
        ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
        if (confirm("Are you sure you want to log out?"))
        {
                return true;
        }
        else
        {
                ht[0].style.filter = "";
                return false;
        }
}
//-->
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function confirmation() {
var answer = confirm("Are you sure you want to delete this site? It can not be undone!")
if (answer){
	window.location = "link_suggest.php?modaction=delete&id='.$_GET["id"].'";
}
else{
}
}

function changeMenu(sel)
{
	var f = sel.form;
	var opt = sel.options[sel.selectedIndex].value;
	if(opt=="1")
	{
		document.getElementById("reclinkbox").style.display = "inline";
		document.getElementById("reclinkbox1").style.display = "none";
	}
	else if(opt=="0")
	{
		document.getElementById("reclinkbox").style.display = "none";
		document.getElementById("reclinkbox1").style.display = "inline";

	}
	else
	{
	document.getElementById("reclinkbox1").style.display = "none";
	document.getElementById("reclinkbox").style.display = "none";
	}
	return true;
}
//-->
</script>

<style type="text/css">
<!--
.thegap {
padding-bottom: 30px;
padding-left: 30px;
}
.submitsite h4 {
font: 16px "Trebuchet MS";
margin: 0px 0px 10px;
}
.level {
font: 14px Arial, Helvetica, sans-serif;
}
#sponserclass {
background: #FFFFCC;
padding: 5px;
margin-bottom: 20px;
margin-left: 20px;
}
.money {
color: #990000;
font-style: italic;
font-weight: bold;
}
.notes {
font: 11px Verdana, Arial, Helvetica, sans-serif;
color: #666666;
margin-bottom: 5px;
}
.submitsite h2 {
font: 16px "Trebuchet MS";
margin: 0px 0px 10px;
color: #006699;
}
ul {
margin-top: 0px;
margin-right: 0px;
margin-bottom: 10px;
}
#wholerecbox {
background: #FFFF99;
width: 400px;
padding: 10px;
margin-bottom: 10px;
padding-bottom: 15px;
margin-left: 20px;
}
.topliner {
border-top: 1px solid #666666;
margin-top: 5px;
padding-top: 5px;
}
.rednotes {
color: #990000;
font-size: 12px;
font-weight: bold;
}
.level {
font-size: 12px;
font-weight: bold;
margin-bottom: 3px;
}
.submitsite {
margin-top: 20px;
width: 500px;
}
.thegap .error {
color: #FF0000;
font-weight: bold;
margin-left: 20px;
background: url(error.gif) no-repeat;
padding-left: 20px;
}
.thetitle {
font: 24px Arial, Helvetica, sans-serif;
border-bottom: 1px dashed #666666;
background: #FFFFCC;
padding: 2px 2px 5px 5px;
margin-bottom: 10px;
}
-->
</style>

<noscript>
<meta http-equiv="refresh" content="0;url=http://www.sikkimonline.info/noscript.php" />
</noscript>

';

/*
if($vbulletin->userinfo['userid'] == "0")
{
	$navbits[$parent] = 'Member\'s Area';
	$ErrorHeader = "Member's Area!";
	$ErrorBody = "<br /><br />Only members of our community are allowed to submit their site on the <a href='http://directory.sikkimonline.info'><strong>directory</strong></a>.<br />You must be <a href='http://www.sikkimonline.info/register.php'><strong>registered</strong></a> and logged in to perform this action. <br /><br /><br />";			
	$navbits = construct_navbits($navbits);
	eval('$navbar = "' . fetch_template('navbar') . '";');
	eval('$slambook_nice_error = "' . fetch_template('slambook_nice_error') . '";');
	eval('print_output("' . fetch_template('slambook_nice_error') . '");'); 
}
*/

//It it is comming for deletion!

if(isset($_GET["modaction"]) AND isset($_GET["id"]))
{
if($_GET["modaction"]=="delete")
{
$theid = $_GET["id"];
$db->query_read("DELETE FROM dir_links WHERE id=".$theid."");
header('Location: link_list.php');
}
else
{
	$navbits[$parent] = 'Error!';
	$ErrorHeader = "Error!";
	$ErrorBody = '<div align="center"><h1>Could not delete the site! </h1>
	Could not perform the required action, this could be due to some internal error!<br /><a href="link_sugges.php?id='.$theid.'>Back to Site Link</a>';			
	$navbits = construct_navbits($navbits);
	eval('$navbar = "' . fetch_template('navbar') . '";');
	eval('$slambook_nice_error = "' . fetch_template('slambook_nice_error') . '";');
	eval('print_output("' . fetch_template('slambook_nice_error') . '");'); 
}
}

if($_REQUEST["do"] == "thank")
{

	$navbits[$parent] = 'Thank you!';
	$ErrorHeader = "You url site been received!";
	$ErrorBody = '<div align="center"><h1>Thank you for your site site submission! </h1><img src="http://www.sikkimonline.info/ecards/images/mailbox.gif" alt="" /><br /><br />It could take from few minutes to several months to appear on sikkimonline directory. Have patience and keep the faith!<br /><a href="http://directory.sikkimonline.info">Back to Directory</a><br /><a href="http://www.sikkimonline.info">Back to Homepage</a></div>';			
	$navbits = construct_navbits($navbits);
	eval('$navbar = "' . fetch_template('navbar') . '";');
	eval('$slambook_nice_error = "' . fetch_template('slambook_nice_error') . '";');
	eval('print_output("' . fetch_template('slambook_nice_error') . '");'); 
}



if(isset($_REQUEST["v"]))
{

if(!isset($_POST['i']))
{
	if($vbulletin->userinfo['userid'] == "0")
	{
		if (isset($_POST['usernamex']))
		{
		$m_username 	= strip_tags($_POST['usernamex']);
		$m_userid 		= '0';
		$m_email 		= strip_tags($_POST['emailx']);
		}else{
		$m_username 	= 'Unregistered';
		$m_userid 		= '0';
		$m_email 		= 'saaraan@gmail.com';
		}

	}else{
	$m_username 	= $vbulletin->userinfo['username'];
	$m_userid 		= $vbulletin->userinfo['userid'];
	$m_email 		= $vbulletin->userinfo['email'];
	}

}else{
$m_approver 		= $vbulletin->userinfo['username'];
$m_approverid 		= $vbulletin->userinfo['userid'];
}

if(isset($_POST['cnew'])) //if theres new category
{
$m_cat 			= strip_tags($_POST['cnew']);
}
else
{
$m_cat 			= strip_tags($_POST['cat']);
}

if(isset($_POST['thestatus'])) //if theres new category
{
$m_status 			= strip_tags($_POST['thestatus']);
}
if(isset($_POST['edit_note'])) //if theres new category
{
$m_enote 			= strip_tags($_POST['edit_note']);
}

$m_title 		= strip_tags($_POST['ulr_title']);
$m_url 			= strip_tags($_POST['ulr']); 
$m_type 		= strip_tags($_POST['ulr_type']);
$m_desc 		= strip_tags($_POST['ulr_desc']);
$m_date 		= vbdate(TIMENOW);

if (isset($_POST["linkback"]))
{
$m_linkback = strip_tags_except($_POST['ulr_desc'], "", FALSE);
}
else
{
$m_linkback = "none";
}

//Php Validation
$errorx = 0;

if (strlen($m_title) < 
{
$errorx = $errorx + 1;
$error1 = rawurlencode('<div class="error">Too short title!</div>');
}else{
$error1 = '';
}

if ($m_type >2 )
{
$errorx = $errorx + 1;
$error5 = rawurlencode('<div class="error">Select a listing type!</div>');
}else{
$error5 = '';
}

if (!isset($m_url) OR $m_url == "http://")
{
$errorx = $errorx + 1;
$error2 = rawurlencode('<div class="error">Please enter URL of your website!</div>');
}else{
$error2 = '';
}


if ($m_type == "1" AND strlen($m_linkback) < 8 )
{
$errorx = $errorx + 1;
$error3 = rawurlencode('<div class="error">You have selected PARTNER listing, but you haven\'t entered backlink URL!</div>');
}else{
$error3 = '';
}


if (strlen($m_desc) < 20)
{
$errorx = $errorx + 1;
$error4 = rawurlencode('<div class="error">Too short Description!</div>');
}else{
$error4 = '';
}

if ($errorx > 0 )
{
header('Location: link_suggest.php?sel='.$m_type.'&wh='.$m_cat.'&tl='.$m_title.'&ul='.$m_url.'&tm='.$m_desc.'&err5='.$error5.'&err1='.$error1.'&err2='.$error2.'&err3='.$error3.'&err4='.$error4.'#a');
}else{

if (isset($_POST["u"]) AND isset($_POST["i"]))
{
$theid = strip_tags($_POST["i"]);
$updateSlamBook = $db->query_read("UPDATE dir_links SET 
link_title=". GetSQLValueString($m_title , "text") . ",
link_desc=". GetSQLValueString($m_desc , "text") . ",
link_url=". GetSQLValueString($m_url , "text") . ",
link_cat=". GetSQLValueString($m_cat , "text") . ",
link_type=". GetSQLValueString($m_type , "int") . ",
link_status=". GetSQLValueString($m_status , "text") . ",
link_back=". GetSQLValueString($m_linkback , "text") . ",
approverid=". GetSQLValueString($m_approverid , "int"). ",
approvername=". GetSQLValueString($m_approver , "text"). ",
edit_notes=". GetSQLValueString($m_enote , "text") . ",
edit_date=". GetSQLValueString($m_date , "int") . " 
WHERE id=".$theid."");
}
else
{
$updateSlamBook = $db->query_write("INSERT INTO dir_links (username,userid,link_email,link_title,link_desc,link_url,link_cat,link_date,link_type,link_back) 
VALUES (". GetSQLValueString($m_username, "text") . ",". GetSQLValueString($m_userid, "int") . ",
". GetSQLValueString($m_email , "text") . ",". GetSQLValueString($m_title , "text") . ",
". GetSQLValueString($m_desc , "text") . ",". GetSQLValueString($m_url , "text") . ",
". GetSQLValueString($m_cat  , "text") . ",". GetSQLValueString($m_date, "int") . ",
". GetSQLValueString($m_type  , "text") . ",". GetSQLValueString($m_linkback  , "text") . "
)");

//Notify other user about the friendship request
$to = $m_email;
$subject = "Thankyou for submitting your site at Sikkimonline Directory";
$message = "Dear ". $m_username. ", 
Thank you for submitting your site at Sikkimonline Directory. Below is your site information:
-----------------------------------
Site Name 	: ". $m_title ."
Description : ". $m_desc ."
URL			: ". $m_url ."
Category	: ". $m_cat ."
Category	: ". $m_type ."
Recriprocal	: ". $m_linkback ."
Date		: ". $m_date ."
------------------------------------

We don't accept all sites, so please don't take it personally should your site not be accepted. Our goal is to make the directory as useful as possible for our users, not to have the directory include all (or even most) of the sites that could possibly be listed or serve as a promotional tool for the entities listed.
---------------------------------------------------
SPONSOR LISTING : You could choose to update your lising as an sponsor on category!
Benefits : Sponsers are listed boldly above all other sites and given 2 category to list a site.
https://www.ccavenue.com/shopzone/custcart/sendtocart.jsp?M_saran_8_4842,1,continue%20-page
---------------------------------------------------


Regards
Sikkimonline Directory Team
An India information directory. Enhanced by Dmoz.org
http://directory.sikkimonline.info";
// To send HTML mail, the Content-type header must be set
$headers .= 'From: Sikkimonline Directory <noreply@sikkimonline.info>' . "\r\n";

mail($to, $subject, $message, $headers);
// Mail should be sent!

}

header('Location: link_suggest.php?do=thank');
}
}
@include("head.php"); 

?>

<div class="submitsite">

<?php
//If id is passed and someone's trying to edit!
if (isset($_GET["id"]))
{
$query  = $db->query_read("SELECT * FROM dir_links WHERE id=" . clean($_GET["id"]) ."");
if($slambook = mysql_fetch_array($query)) 
$thecat = $slambook['link_cat'];
$theusername = $slambook['username'];
$theuserid = $slambook['userid'];
$thetitle = $slambook['link_title'];
$theurl = $slambook['link_url'];
$thedesc = $slambook['link_desc'];
$thebacklink = $slambook['link_back'];
$thestatus = $slambook['link_status'];
$thetype = $slambook['link_type'];
$thedate = $slambook['link_date'];
$theapproverid = $slambook['approverid'];
$theapprovername = $slambook['approvername'];
$edit_notes = $slambook['edit_notes'];
$edit_date = $slambook['edit_date'];
}
?>
<form action="link_suggest.php" method="post" enctype="multipart/form-data" >
<input type="hidden" name="cat" value="<?php 
if (isset($thecat))
{
echo $thecat;
}
else
{
if (isset($_REQUEST["where"]))
{
echo $_REQUEST["where"];
}
elseif(isset($_REQUEST["wh"]))
{
echo $_REQUEST["wh"];
}
}
?>" />
<input type="hidden" name="v" value="go" />
<?php
if (isset($_GET["id"]))
{
echo '<input type="hidden" name="u" value="go" />';
}

if (isset($_GET["id"]))
{
echo '<input type="hidden" name="i" value="'.$_GET["id"].'" />';
}

?> 

<div class="thetitle">
<?php if (isset($_GET["id"]))
{
echo "Review a Site";
}else{
echo "Suggest a Site";
}
?>
</div>

<ul>
<?php 
if (!isset($_GET["id"]))
{
echo "<li>Note : You are about to suggest your site in sikkimonline directory, Not Dmoz Directory!</li>";
}else{
echo "<li>Note : Managers are allowed to review and modify title and description of new sites here! but please follow guidelines before editing.</li>";
}
?>

<?php 
if (isset($thedate))
{
echo "<li>Site Submitted Date : " . vbdate($vbulletin->options['dateformat'], $thedate) ."</li>";
}else{
echo "<li>Date : " . vbdate($vbulletin->options['dateformat'], TIMENOW) ."</li>";
}

if (isset($theusername))
{
echo '<li>Submitted by : <a href="member.php?u='.$theuserid.'">'.$theusername.'</a></li>';
}
else
{
echo '<li>Submitting as :<a href="member.php?u='.$vbulletin->userinfo['userid'].'">'.$vbulletin->userinfo['username'].'</a></li>';
}
?>
<li>Category : <?php 
if (isset($thecat))
{
echo $thecat;
}
else
{
if (isset($_REQUEST["where"]))
{
echo $_REQUEST["where"];
}elseif(isset($_REQUEST["wh"]))
{
echo $_REQUEST["wh"];
}
}
?></li>
<?php

if (isset($theapprovername) AND $theapproverid > 0)
{
$posttime = vbdate($vbulletin->options['dateformat'], $edit_date);
echo '<li>Last edited by <a href="member.php?'.$theapproverid.'"><strong>'.$theapprovername.'</strong></a>, on '.$posttime.'</li>';
}
?>
</ul>


<?php
if (!isset($_GET["id"]))
{
echo '
<div id="sponserclass">
<div class="level">Sponser Listing</div>
You may want to get listed as <span class="money">sponser</span> in this category.
Lifetime sponsership in this category is only <span class="money">Rs.1000</span> (Pay easily via online banking)
<div><strong>Benefits</strong> : Sponsers are listed boldly above all other sites and given 2 category to list one site.</div>
<div><a href="https://www.ccavenue.com/shopzone/custcart/sendtocart.jsp?M_saran_8_4842,1,continue -page"><strong>Click here for sponsership listing</strong></a>.
</div>
</div>';
}
?>

<div class="thegap">
<div class="level">NOTE:</div>
<div class="notes">1. Site must be in English or have an accessible English version.</div>
<div class="notes">2. No adult content sites.</div>
<div class="notes">3. No gambling content sites.</div>
<div class="notes">4. You accept that we may edit your site title or description.</div>
<div class="notes">5. Submit your website to the most suitable category.</div>
<div class="notes">6. We may move your website to a different category at any time without prior notice.</div> 
</div>
<a name="a"></a>
<div class="thegap">
<?php
if (isset($_REQUEST["err1"]))
{
echo $_REQUEST["err1"];
}
if (isset($_REQUEST["err2"]))
{
echo $_REQUEST["err2"];
}
if (isset($_REQUEST["err3"]))
{
echo $_REQUEST["err3"];
}
if (isset($_REQUEST["err4"]))
{
echo $_REQUEST["err4"];
}
if (isset($_REQUEST["err5"]))
{
echo $_REQUEST["err5"];
}
?>
</div>

<?php

if (isset($theapprovername) AND $theapproverid > 0)
{
$posttime = vbdate($vbulletin->options['dateformat'], $edit_date);
echo '<div class="thegap">
<div class="level">Editor Info</div>
<div class="notes">Last edited by <a href="member.php?'.$theapproverid.'"><strong>'.$theapprovername.'</strong></a>, on '.$posttime.'</div>
<hr size="1" noshade/>
</div>';
}
?>


<?php
if($vbulletin->userinfo['userid'] == "0")
{
echo '
<div class="thegap">
<div class="level">Your Name</div>
<div class="notes">Enter your full Name.</div>
<input name="usernamex" type="text" value=""  size="40" maxlength="60"/>
</div>
<div class="thegap">
<div class="level">Email</div>
<div class="notes">Enter Email Address.</div>
<input name="emailx" type="text" value=""  size="40" maxlength="60"/>
</div>';
}
?>


<?php
if (isset($_GET["id"]))
{

if (isset($thecat))
{
$val = str_replace("!$#$#!", "'",$thecat);
}
else
{
if (isset($_REQUEST["where"]))
{
$val =$_REQUEST["where"];
}elseif(isset($_REQUEST["wh"]))
{
$val = $_REQUEST["wh"];
}
}
echo '<div class="thegap"><div class="level">Category</div><div class="notes">If you wish to change category of current site, enter the value below!</div><div class="error">
Note: Do not modify if unsure!</div>';
echo '<input type="text" name="cnew" size="40" maxlength="60" value="'.$val.'" /></div>';


}
?>
<div class="thegap">
<div class="level">Site Title</div>
<div class="notes">Use short title for your site. Avoid long description of your title.</div>
<input name="ulr_title" type="text" value="
<?php 
if (isset($thetitle))
{
echo str_replace("!$#$#!", "'",$thetitle);
}
else
{
if (isset($_REQUEST["tl"]))
{
echo $_REQUEST["tl"];
} 
}
?>
"  size="40" maxlength="60"/>
</div>

<div class="thegap">
<div class="level">URL</div>
<input name="ulr" type="text" value="<?php 
if (isset($theurl))
{
echo str_replace("!$#$#!", "'",$theurl);
}
else
{
if (isset($_REQUEST["ul"]))
{
echo $_REQUEST["ul"];
}else{
echo "http://";
}
}
?>"  size="40" maxlength="60" />
</div>

<div id="wholerecbox">

<div class="level" >Choose a listing type</div>

<select name="ulr_type" onChange="return changeMenu(this)">
<?php
//allow only administrator to change type
if ($vbulletin->userinfo['usergroupid'] != "6" AND $thetype=="2")
{
echo '<option value="2">Sponser (Can not change sponser type)</option>';
}else{
?>

  <option value="9" 
  <?php
if (isset($thetype))
{
if ($thetype > 2 )
{
echo "selected";
}
else
{
echo "";
}
}
else
{
  if (isset($_REQUEST["sel"]))
  {
  if($_REQUEST["sel"] == "9")
  {
  echo "selected";
  }
  }else{
  echo "selected";
  }
}
  ?>
  >---------------------</option>
  <option value="1"   <?php
  if (isset($thetype))
{
if ($thetype == "1" )
{
echo "selected";
}
else
{
echo "";
}
}
else
{
  if (isset($_REQUEST["sel"]))
  {
  if($_REQUEST["sel"] == "1")
  {
  echo "selected";
  }
  }
}
  ?>>Link Partner (Needs Reciprocal Link)</option>
  <option value="0" 
   <?php
if (isset($thetype))
{
if ($thetype == "0" )
{
echo "selected";
}
else
{
echo "";
}
}
else
{
   if (isset($_REQUEST["sel"]))
  {
  if($_REQUEST["sel"] == "0")
  {
  echo "selected";
  }
  }
}
  ?>
  >Normal (Below everyone's Link)</option>
  

<?php
//allow only administrator to change type
if ($vbulletin->userinfo['usergroupid'] == "6")
{
?>
  <option value="2" <?php
if (isset($thetype))
{
if ($thetype == "2" )
{
echo "selected";
}
else
{
echo "";
}
}
else
{
   if (isset($_REQUEST["sel"]))
  {
  if($_REQUEST["sel"] == "2")
  {
  echo "selected";
  }
  }
}
  ?>>Sponser - Who paid to get Listed.</option>
<?
}
}
?>

</select>


<div id="reclinkbox1" <?php
if (isset($thetype))
{
if ($thetype == "0" )
{
echo 'style="display:inline;"';
}
else
{
echo 'style="display:none;"';
}
}
else
{
  if (isset($_REQUEST["sel"]))
  {
  if($_REQUEST["sel"] == "0")
  {
  echo 'style="display:inline;"';
  }
  }else{
  echo 'style="display:none;"';
  }
}
  ?>>
<div class="topliner">
<div class="rednotes">Regular listing with nofollow relation!, which appears below sponsor and dmoz links! Can take several months to appear and not guaranteed. </div>
</div>
</div>

<div id="reclinkbox" class="topline" <?php
if (isset($thetype))
{
if ($thetype == "1" )
{
echo 'style="display:inline;"';
}
else
{
echo 'style="display:none;"';
}
}
else
{
  if (isset($_REQUEST["sel"]))
  {
  if($_REQUEST["sel"] == "1")
  {
  		echo 'style="display:inline;"';
  }
  }else{
  echo 'style="display:none;"';
  }
}
  ?>>
<div class="topliner">
<div class="rednotes">Copy and paste code below on the homepage! or on a page accessible from your homepage!</div>
<textarea name="directory" cols="50" rows="4">
<a href="http://directory.sikkimonline.info">Sikkimonline Directory</a> - An India Information Directory.
</textarea>
<br />
<div class="level">Reciprocal URL</div>
<div class="notes">Tell us the address of the page holding the link back to this site.</div>
<input name="linkback"  id="valx" size="40" type="text" value="
<?php 
if (isset($thebacklink))
{
if (strlen($thebacklink) < 10)
{
echo "http://";
}
else
{
echo str_replace("!$#$#!", "'",$thebacklink);
}
}
else
{
echo "http://";
}
?>
" />
<div id="txtHint" style="float:right;margin-left:20px;margin-top:10px;font-weight:bold;"></div>
<div style="margin-top:10px;"><input type="Button" name="Submit" onclick="showHint(document.getElementById('valx').value)"  value="Check Sikkimonline Link" /></div>

</div>
</div>
</div>

<div class="thegap">
<div class="level">Site Description!</div>
<div class="notes">Remmember not to use "we", "us" obvious hype in descriptions. Remove spelling errors. </div>
<textarea name="ulr_desc" cols="50" rows="5"><?php 
if (isset($thedesc))
{
echo str_replace("!$#$#!", "'",$thedesc);
}
else
{

if (isset($_REQUEST["tm"]))
{
echo $_REQUEST["tm"];
} 
}
?></textarea>

</div>

<?php
if ($vbulletin->userinfo['usergroupid'] == "6" || $vbulletin->userinfo['usergroupid'] == "7" || $vbulletin->userinfo['usergroupid'] == "17")
{

if (isset($_GET["id"]))
{
echo '<div class="thegap"><div class="level">Approve / Disapprove!</div>
<div class="notes">Before approving make sure it meets the minimum requirements! We strongly support Dmoz Editing <a href="http://www.dmoz.org/guidelines/include.html" target="_blank">Guidelines</a>!</div>
';

if (isset($thestatus))
{
	if ($thestatus == "unapproved" )
	{
	$und = "selected";
	$und2 = "";
	}
	else
	{
	$und = "";
	$und2 = "selected";
	}
}

echo '<select name="thestatus">
  <option value="unapproved" '.$und.'>No Approve</option>
  <option value="approved" '.$und2.'>Approve</option>
</select>';
echo '</div>';
}

//show edit notes and date..
if (isset($edit_notes))
{
$thenote = $edit_notes;
}else{
$thenote = "";
}
if (isset($_GET["id"]))
{
echo' <div class="thegap"><div class="level">Edit Notes!</div>
<div class="notes">Editorial Notes! only visible to other editors. Modify if necessary.</div>
<textarea name="edit_note" cols="50" rows="4">'.str_replace("!$#$#!", "'",$thenote).'
</textarea>
</div>';
}
}
?>
<div class="thegap">
<?php

if (isset($_GET["id"]))
{
echo '<input type="Submit" name="Submit" value="Update and Save!" />';
echo '<input type="button" onclick="confirmation()" name="Submit" value="Delete this link" />';
}
else
{
echo '<input type="Submit" name="Submit" value="Suggest this website!" />';
}

?> 

</div>

</form>
</div>
<?php
@include("foot.php");
//functions allow tags========================================================
function strip_tags_except($text, $allowed_tags, $strip=TRUE) {
  if (!is_array($allowed_tags))

    return $text;

  if (!count($allowed_tags))
    return $text;

  $open = $strip ? '' : '<';
  $close = $strip ? '' : '>';

  preg_match_all('!<\s*(/)?\s*([a-zA-Z]+)[^>]*>!',
    $text, $all_tags);
  array_shift($all_tags);
  $slashes = $all_tags[0];
  $all_tags = $all_tags[1];
  foreach ($all_tags as $i => $tag) {
    if (in_array($tag, $allowed_tags))
      continue;
    $text =
      preg_replace('!<(\s*' . $slashes[$i] . '\s*' .
        $tag . '[^>]*)>!', $open . '$1' . $close,
        $text);
  }

  return $text;
}

function url_to_link($text) {
  $text =
    preg_replace('!(^|([^\'"]\s*))' .
      '([hf][tps]{2,4}:\/\/[^\s<>"\'()]{4,})!mi',
      '$2<a href="$3">$3</a>', $text);
  $text =
    preg_replace('!<a href="([^"]+)[\.:,\]]">!',
    '<a href="$1">', $text);
  $text = preg_replace('!([\.:,\]])</a>!', '</a>$1',
    $text);
  return $text;
}
//================function sql strings
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

  switch ($theType) 
  {
    case "text":
      $theValue = ($theValue != "") ? "'" . str_replace("'", "!$#$#!",$theValue) . "'" : "''";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}

function clean($s) 
{
if (get_magic_quotes_gpc())
$s = stripslashes($s);
return $s;
} 

?>

Link to comment
Share on other sites

i run the file like any other PHP file. i get no errors except missing required()'s and functions. PHP Version 5.2.6, if it makes a diff. if i comment out the chdir, require, chdir, i get this output:

 

<div class="submitsite">

<form action="link_suggest.php" method="post" enctype="multipart/form-data" >
<input type="hidden" name="cat" value="" />
<input type="hidden" name="v" value="go" />


<div class="thetitle">
Suggest a Site</div>

<ul>
<li>Note : You are about to suggest your site in sikkimonline directory, Not Dmoz Directory!</li>
<br />
<b>Fatal error</b>:  Call to undefined function vbdate() in <b>/Users/lesbrown/Sites/site1/comountainrider.com/public_html/link_suggest.php</b> on line <b>508</b><br />

 

but it wouldn't even show that if it wasn't parsed okay first. that's what lead me to guess it's the require()d file that is hosing.

Link to comment
Share on other sites

thank you guys,  i am looking really hard to find that error... , 

it worked fine.. just before I added few codes in it!! Now it's not working..it's really strange!!! uploading file in binary mode could do this? I uploaded on the server and re-downloaded it.. after that it's not working.. I am testing it in localhost and in my web server.

Link to comment
Share on other sites

uploading file in binary mode could do this?

 

probably, yes. you should upload as plain text, ascii, or whatever your text option is. i use bbedit, which provides a 'zap gremlins' function to get rid of any non-text characters. maybe your editor has similar? at least see if you can turn on 'invisibles'

Link to comment
Share on other sites

ugh. i have tried dreamweaver many times over the many years i have been programming php and have never been satisfied due to stuff like this. you might want to work on at least this one script in a plain text editor, bbedit i you're on a mac. i would separate design from functionality.

Link to comment
Share on other sites

did you try pasting my code into a new text file and uploading that to the server (without dreamweaver)? that should determine whether the problem is in the code or in the file. the code parses without error here, therefore i believe the problem is not the code, but the file.

 

<?php 
$curdir = getcwd ();
@chdir('/domains/3615/web');
@require_once('/domains/3615/web/global.php');
@chdir ($curdir);

$vbglobal = '
<script type="text/javascript" language="javascript">
var xmlHttp

function showHint(str)
{
if (str.length==0)
  { 
  document.getElementById("txtHint").innerHTML="";
  return;
  }
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajax_recprocial_checker.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
</script> 


<script type="text/javascript">
<!--
function log_out()
{
        ht = document.getElementsByTagName("html");
        ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
        if (confirm("Are you sure you want to log out?"))
        {
                return true;
        }
        else
        {
                ht[0].style.filter = "";
                return false;
        }
}
//-->
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function confirmation() {
var answer = confirm("Are you sure you want to delete this site? It can not be undone!")
if (answer){
	window.location = "link_suggest.php?modaction=delete&id='.$_GET["id"].'";
}
else{
}
}

function changeMenu(sel)
{
	var f = sel.form;
	var opt = sel.options[sel.selectedIndex].value;
	if(opt=="1")
	{
		document.getElementById("reclinkbox").style.display = "inline";
		document.getElementById("reclinkbox1").style.display = "none";
	}
	else if(opt=="0")
	{
		document.getElementById("reclinkbox").style.display = "none";
		document.getElementById("reclinkbox1").style.display = "inline";

	}
	else
	{
	document.getElementById("reclinkbox1").style.display = "none";
	document.getElementById("reclinkbox").style.display = "none";
	}
	return true;
}
//-->
</script>

<style type="text/css">
<!--
.thegap {
padding-bottom: 30px;
padding-left: 30px;
}
.submitsite h4 {
font: 16px "Trebuchet MS";
margin: 0px 0px 10px;
}
.level {
font: 14px Arial, Helvetica, sans-serif;
}
#sponserclass {
background: #FFFFCC;
padding: 5px;
margin-bottom: 20px;
margin-left: 20px;
}
.money {
color: #990000;
font-style: italic;
font-weight: bold;
}
.notes {
font: 11px Verdana, Arial, Helvetica, sans-serif;
color: #666666;
margin-bottom: 5px;
}
.submitsite h2 {
font: 16px "Trebuchet MS";
margin: 0px 0px 10px;
color: #006699;
}
ul {
margin-top: 0px;
margin-right: 0px;
margin-bottom: 10px;
}
#wholerecbox {
background: #FFFF99;
width: 400px;
padding: 10px;
margin-bottom: 10px;
padding-bottom: 15px;
margin-left: 20px;
}
.topliner {
border-top: 1px solid #666666;
margin-top: 5px;
padding-top: 5px;
}
.rednotes {
color: #990000;
font-size: 12px;
font-weight: bold;
}
.level {
font-size: 12px;
font-weight: bold;
margin-bottom: 3px;
}
.submitsite {
margin-top: 20px;
width: 500px;
}
.thegap .error {
color: #FF0000;
font-weight: bold;
margin-left: 20px;
background: url(error.gif) no-repeat;
padding-left: 20px;
}
.thetitle {
font: 24px Arial, Helvetica, sans-serif;
border-bottom: 1px dashed #666666;
background: #FFFFCC;
padding: 2px 2px 5px 5px;
margin-bottom: 10px;
}
-->
</style>

<noscript>
<meta http-equiv="refresh" content="0;url=http://www.sikkimonline.info/noscript.php" />
</noscript>

';

/*
if($vbulletin->userinfo['userid'] == "0")
{
	$navbits[$parent] = 'Member\'s Area';
	$ErrorHeader = "Member's Area!";
	$ErrorBody = "<br /><br />Only members of our community are allowed to submit their site on the <a href='http://directory.sikkimonline.info'><strong>directory</strong></a>.<br />You must be <a href='http://www.sikkimonline.info/register.php'><strong>registered</strong></a> and logged in to perform this action. <br /><br /><br />";			
	$navbits = construct_navbits($navbits);
	eval('$navbar = "' . fetch_template('navbar') . '";');
	eval('$slambook_nice_error = "' . fetch_template('slambook_nice_error') . '";');
	eval('print_output("' . fetch_template('slambook_nice_error') . '");'); 
}
*/

//It it is comming for deletion!

if(isset($_GET["modaction"]) AND isset($_GET["id"]))
{
if($_GET["modaction"]=="delete")
{
$theid = $_GET["id"];
$db->query_read("DELETE FROM dir_links WHERE id=".$theid."");
header('Location: link_list.php');
}
else
{
	$navbits[$parent] = 'Error!';
	$ErrorHeader = "Error!";
	$ErrorBody = '<div align="center"><h1>Could not delete the site! </h1>
	Could not perform the required action, this could be due to some internal error!<br /><a href="link_sugges.php?id='.$theid.'>Back to Site Link</a>';			
	$navbits = construct_navbits($navbits);
	eval('$navbar = "' . fetch_template('navbar') . '";');
	eval('$slambook_nice_error = "' . fetch_template('slambook_nice_error') . '";');
	eval('print_output("' . fetch_template('slambook_nice_error') . '");'); 
}
}

if($_REQUEST["do"] == "thank")
{

	$navbits[$parent] = 'Thank you!';
	$ErrorHeader = "You url site been received!";
	$ErrorBody = '<div align="center"><h1>Thank you for your site site submission! </h1><img src="http://www.sikkimonline.info/ecards/images/mailbox.gif" alt="" /><br /><br />It could take from few minutes to several months to appear on sikkimonline directory. Have patience and keep the faith!<br /><a href="http://directory.sikkimonline.info">Back to Directory</a><br /><a href="http://www.sikkimonline.info">Back to Homepage</a></div>';			
	$navbits = construct_navbits($navbits);
	eval('$navbar = "' . fetch_template('navbar') . '";');
	eval('$slambook_nice_error = "' . fetch_template('slambook_nice_error') . '";');
	eval('print_output("' . fetch_template('slambook_nice_error') . '");'); 
}



if(isset($_REQUEST["v"]))
{

if(!isset($_POST['i']))
{
	if($vbulletin->userinfo['userid'] == "0")
	{
		if (isset($_POST['usernamex']))
		{
		$m_username 	= strip_tags($_POST['usernamex']);
		$m_userid 		= '0';
		$m_email 		= strip_tags($_POST['emailx']);
		}else{
		$m_username 	= 'Unregistered';
		$m_userid 		= '0';
		$m_email 		= 'saaraan@gmail.com';
		}

	}else{
	$m_username 	= $vbulletin->userinfo['username'];
	$m_userid 		= $vbulletin->userinfo['userid'];
	$m_email 		= $vbulletin->userinfo['email'];
	}

}else{
$m_approver 		= $vbulletin->userinfo['username'];
$m_approverid 		= $vbulletin->userinfo['userid'];
}

if(isset($_POST['cnew'])) //if theres new category
{
$m_cat 			= strip_tags($_POST['cnew']);
}
else
{
$m_cat 			= strip_tags($_POST['cat']);
}

if(isset($_POST['thestatus'])) //if theres new category
{
$m_status 			= strip_tags($_POST['thestatus']);
}
if(isset($_POST['edit_note'])) //if theres new category
{
$m_enote 			= strip_tags($_POST['edit_note']);
}

$m_title 		= strip_tags($_POST['ulr_title']);
$m_url 			= strip_tags($_POST['ulr']); 
$m_type 		= strip_tags($_POST['ulr_type']);
$m_desc 		= strip_tags($_POST['ulr_desc']);
$m_date 		= vbdate(TIMENOW);

if (isset($_POST["linkback"]))
{
$m_linkback = strip_tags_except($_POST['ulr_desc'], "", FALSE);
}
else
{
$m_linkback = "none";
}

//Php Validation
$errorx = 0;

if (strlen($m_title) < 
{
$errorx = $errorx + 1;
$error1 = rawurlencode('<div class="error">Too short title!</div>');
}else{
$error1 = '';
}

if ($m_type >2 )
{
$errorx = $errorx + 1;
$error5 = rawurlencode('<div class="error">Select a listing type!</div>');
}else{
$error5 = '';
}

if (!isset($m_url) OR $m_url == "http://")
{
$errorx = $errorx + 1;
$error2 = rawurlencode('<div class="error">Please enter URL of your website!</div>');
}else{
$error2 = '';
}


if ($m_type == "1" AND strlen($m_linkback) < 8 )
{
$errorx = $errorx + 1;
$error3 = rawurlencode('<div class="error">You have selected PARTNER listing, but you haven\'t entered backlink URL!</div>');
}else{
$error3 = '';
}


if (strlen($m_desc) < 20)
{
$errorx = $errorx + 1;
$error4 = rawurlencode('<div class="error">Too short Description!</div>');
}else{
$error4 = '';
}

if ($errorx > 0 )
{
header('Location: link_suggest.php?sel='.$m_type.'&wh='.$m_cat.'&tl='.$m_title.'&ul='.$m_url.'&tm='.$m_desc.'&err5='.$error5.'&err1='.$error1.'&err2='.$error2.'&err3='.$error3.'&err4='.$error4.'#a');
}else{

if (isset($_POST["u"]) AND isset($_POST["i"]))
{
$theid = strip_tags($_POST["i"]);
$updateSlamBook = $db->query_read("UPDATE dir_links SET 
link_title=". GetSQLValueString($m_title , "text") . ",
link_desc=". GetSQLValueString($m_desc , "text") . ",
link_url=". GetSQLValueString($m_url , "text") . ",
link_cat=". GetSQLValueString($m_cat , "text") . ",
link_type=". GetSQLValueString($m_type , "int") . ",
link_status=". GetSQLValueString($m_status , "text") . ",
link_back=". GetSQLValueString($m_linkback , "text") . ",
approverid=". GetSQLValueString($m_approverid , "int"). ",
approvername=". GetSQLValueString($m_approver , "text"). ",
edit_notes=". GetSQLValueString($m_enote , "text") . ",
edit_date=". GetSQLValueString($m_date , "int") . " 
WHERE id=".$theid."");
}
else
{
$updateSlamBook = $db->query_write("INSERT INTO dir_links (username,userid,link_email,link_title,link_desc,link_url,link_cat,link_date,link_type,link_back) 
VALUES (". GetSQLValueString($m_username, "text") . ",". GetSQLValueString($m_userid, "int") . ",
". GetSQLValueString($m_email , "text") . ",". GetSQLValueString($m_title , "text") . ",
". GetSQLValueString($m_desc , "text") . ",". GetSQLValueString($m_url , "text") . ",
". GetSQLValueString($m_cat  , "text") . ",". GetSQLValueString($m_date, "int") . ",
". GetSQLValueString($m_type  , "text") . ",". GetSQLValueString($m_linkback  , "text") . "
)");

//Notify other user about the friendship request
$to = $m_email;
$subject = "Thankyou for submitting your site at Sikkimonline Directory";
$message = "Dear ". $m_username. ", 
Thank you for submitting your site at Sikkimonline Directory. Below is your site information:
-----------------------------------
Site Name 	: ". $m_title ."
Description : ". $m_desc ."
URL			: ". $m_url ."
Category	: ". $m_cat ."
Category	: ". $m_type ."
Recriprocal	: ". $m_linkback ."
Date		: ". $m_date ."
------------------------------------

We don't accept all sites, so please don't take it personally should your site not be accepted. Our goal is to make the directory as useful as possible for our users, not to have the directory include all (or even most) of the sites that could possibly be listed or serve as a promotional tool for the entities listed.
---------------------------------------------------
SPONSOR LISTING : You could choose to update your lising as an sponsor on category!
Benefits : Sponsers are listed boldly above all other sites and given 2 category to list a site.
https://www.ccavenue.com/shopzone/custcart/sendtocart.jsp?M_saran_8_4842,1,continue%20-page
---------------------------------------------------


Regards
Sikkimonline Directory Team
An India information directory. Enhanced by Dmoz.org
http://directory.sikkimonline.info";
// To send HTML mail, the Content-type header must be set
$headers .= 'From: Sikkimonline Directory <noreply@sikkimonline.info>' . "\r\n";

mail($to, $subject, $message, $headers);
// Mail should be sent!

}

header('Location: link_suggest.php?do=thank');
}
}
@include("head.php"); 

?>

<div class="submitsite">

<?php
//If id is passed and someone's trying to edit!
if (isset($_GET["id"]))
{
$query  = $db->query_read("SELECT * FROM dir_links WHERE id=" . clean($_GET["id"]) ."");
if($slambook = mysql_fetch_array($query)) 
$thecat = $slambook['link_cat'];
$theusername = $slambook['username'];
$theuserid = $slambook['userid'];
$thetitle = $slambook['link_title'];
$theurl = $slambook['link_url'];
$thedesc = $slambook['link_desc'];
$thebacklink = $slambook['link_back'];
$thestatus = $slambook['link_status'];
$thetype = $slambook['link_type'];
$thedate = $slambook['link_date'];
$theapproverid = $slambook['approverid'];
$theapprovername = $slambook['approvername'];
$edit_notes = $slambook['edit_notes'];
$edit_date = $slambook['edit_date'];
}
?>
<form action="link_suggest.php" method="post" enctype="multipart/form-data" >
<input type="hidden" name="cat" value="<?php 
if (isset($thecat))
{
echo $thecat;
}
else
{
if (isset($_REQUEST["where"]))
{
echo $_REQUEST["where"];
}
elseif(isset($_REQUEST["wh"]))
{
echo $_REQUEST["wh"];
}
}
?>" />
<input type="hidden" name="v" value="go" />
<?php
if (isset($_GET["id"]))
{
echo '<input type="hidden" name="u" value="go" />';
}

if (isset($_GET["id"]))
{
echo '<input type="hidden" name="i" value="'.$_GET["id"].'" />';
}

?> 

<div class="thetitle">
<?php if (isset($_GET["id"]))
{
echo "Review a Site";
}else{
echo "Suggest a Site";
}
?>
</div>

<ul>
<?php 
if (!isset($_GET["id"]))
{
echo "<li>Note : You are about to suggest your site in sikkimonline directory, Not Dmoz Directory!</li>";
}else{
echo "<li>Note : Managers are allowed to review and modify title and description of new sites here! but please follow guidelines before editing.</li>";
}
?>

<?php 
if (isset($thedate))
{
echo "<li>Site Submitted Date : " . vbdate($vbulletin->options['dateformat'], $thedate) ."</li>";
}else{
echo "<li>Date : " . vbdate($vbulletin->options['dateformat'], TIMENOW) ."</li>";
}

if (isset($theusername))
{
echo '<li>Submitted by : <a href="member.php?u='.$theuserid.'">'.$theusername.'</a></li>';
}
else
{
echo '<li>Submitting as :<a href="member.php?u='.$vbulletin->userinfo['userid'].'">'.$vbulletin->userinfo['username'].'</a></li>';
}
?>
<li>Category : <?php 
if (isset($thecat))
{
echo $thecat;
}
else
{
if (isset($_REQUEST["where"]))
{
echo $_REQUEST["where"];
}elseif(isset($_REQUEST["wh"]))
{
echo $_REQUEST["wh"];
}
}
?></li>
<?php

if (isset($theapprovername) AND $theapproverid > 0)
{
$posttime = vbdate($vbulletin->options['dateformat'], $edit_date);
echo '<li>Last edited by <a href="member.php?'.$theapproverid.'"><strong>'.$theapprovername.'</strong></a>, on '.$posttime.'</li>';
}
?>
</ul>


<?php
if (!isset($_GET["id"]))
{
echo '
<div id="sponserclass">
<div class="level">Sponser Listing</div>
You may want to get listed as <span class="money">sponser</span> in this category.
Lifetime sponsership in this category is only <span class="money">Rs.1000</span> (Pay easily via online banking)
<div><strong>Benefits</strong> : Sponsers are listed boldly above all other sites and given 2 category to list one site.</div>
<div><a href="https://www.ccavenue.com/shopzone/custcart/sendtocart.jsp?M_saran_8_4842,1,continue -page"><strong>Click here for sponsership listing</strong></a>.
</div>
</div>';
}
?>

<div class="thegap">
<div class="level">NOTE:</div>
<div class="notes">1. Site must be in English or have an accessible English version.</div>
<div class="notes">2. No adult content sites.</div>
<div class="notes">3. No gambling content sites.</div>
<div class="notes">4. You accept that we may edit your site title or description.</div>
<div class="notes">5. Submit your website to the most suitable category.</div>
<div class="notes">6. We may move your website to a different category at any time without prior notice.</div> 
</div>
<a name="a"></a>
<div class="thegap">
<?php
if (isset($_REQUEST["err1"]))
{
echo $_REQUEST["err1"];
}
if (isset($_REQUEST["err2"]))
{
echo $_REQUEST["err2"];
}
if (isset($_REQUEST["err3"]))
{
echo $_REQUEST["err3"];
}
if (isset($_REQUEST["err4"]))
{
echo $_REQUEST["err4"];
}
if (isset($_REQUEST["err5"]))
{
echo $_REQUEST["err5"];
}
?>
</div>

<?php

if (isset($theapprovername) AND $theapproverid > 0)
{
$posttime = vbdate($vbulletin->options['dateformat'], $edit_date);
echo '<div class="thegap">
<div class="level">Editor Info</div>
<div class="notes">Last edited by <a href="member.php?'.$theapproverid.'"><strong>'.$theapprovername.'</strong></a>, on '.$posttime.'</div>
<hr size="1" noshade/>
</div>';
}
?>


<?php
if($vbulletin->userinfo['userid'] == "0")
{
echo '
<div class="thegap">
<div class="level">Your Name</div>
<div class="notes">Enter your full Name.</div>
<input name="usernamex" type="text" value=""  size="40" maxlength="60"/>
</div>
<div class="thegap">
<div class="level">Email</div>
<div class="notes">Enter Email Address.</div>
<input name="emailx" type="text" value=""  size="40" maxlength="60"/>
</div>';
}
?>


<?php
if (isset($_GET["id"]))
{

if (isset($thecat))
{
$val = str_replace("!$#$#!", "'",$thecat);
}
else
{
if (isset($_REQUEST["where"]))
{
$val =$_REQUEST["where"];
}elseif(isset($_REQUEST["wh"]))
{
$val = $_REQUEST["wh"];
}
}
echo '<div class="thegap"><div class="level">Category</div><div class="notes">If you wish to change category of current site, enter the value below!</div><div class="error">
Note: Do not modify if unsure!</div>';
echo '<input type="text" name="cnew" size="40" maxlength="60" value="'.$val.'" /></div>';


}
?>
<div class="thegap">
<div class="level">Site Title</div>
<div class="notes">Use short title for your site. Avoid long description of your title.</div>
<input name="ulr_title" type="text" value="
<?php 
if (isset($thetitle))
{
echo str_replace("!$#$#!", "'",$thetitle);
}
else
{
if (isset($_REQUEST["tl"]))
{
echo $_REQUEST["tl"];
} 
}
?>
"  size="40" maxlength="60"/>
</div>

<div class="thegap">
<div class="level">URL</div>
<input name="ulr" type="text" value="<?php 
if (isset($theurl))
{
echo str_replace("!$#$#!", "'",$theurl);
}
else
{
if (isset($_REQUEST["ul"]))
{
echo $_REQUEST["ul"];
}else{
echo "http://";
}
}
?>"  size="40" maxlength="60" />
</div>

<div id="wholerecbox">

<div class="level" >Choose a listing type</div>

<select name="ulr_type" onChange="return changeMenu(this)">
<?php
//allow only administrator to change type
if ($vbulletin->userinfo['usergroupid'] != "6" AND $thetype=="2")
{
echo '<option value="2">Sponser (Can not change sponser type)</option>';
}else{
?>

  <option value="9" 
  <?php
if (isset($thetype))
{
if ($thetype > 2 )
{
echo "selected";
}
else
{
echo "";
}
}
else
{
  if (isset($_REQUEST["sel"]))
  {
  if($_REQUEST["sel"] == "9")
  {
  echo "selected";
  }
  }else{
  echo "selected";
  }
}
  ?>
  >---------------------</option>
  <option value="1"   <?php
  if (isset($thetype))
{
if ($thetype == "1" )
{
echo "selected";
}
else
{
echo "";
}
}
else
{
  if (isset($_REQUEST["sel"]))
  {
  if($_REQUEST["sel"] == "1")
  {
  echo "selected";
  }
  }
}
  ?>>Link Partner (Needs Reciprocal Link)</option>
  <option value="0" 
   <?php
if (isset($thetype))
{
if ($thetype == "0" )
{
echo "selected";
}
else
{
echo "";
}
}
else
{
   if (isset($_REQUEST["sel"]))
  {
  if($_REQUEST["sel"] == "0")
  {
  echo "selected";
  }
  }
}
  ?>
  >Normal (Below everyone's Link)</option>
  

<?php
//allow only administrator to change type
if ($vbulletin->userinfo['usergroupid'] == "6")
{
?>
  <option value="2" <?php
if (isset($thetype))
{
if ($thetype == "2" )
{
echo "selected";
}
else
{
echo "";
}
}
else
{
   if (isset($_REQUEST["sel"]))
  {
  if($_REQUEST["sel"] == "2")
  {
  echo "selected";
  }
  }
}
  ?>>Sponser - Who paid to get Listed.</option>
<?
}
}
?>

</select>


<div id="reclinkbox1" <?php
if (isset($thetype))
{
if ($thetype == "0" )
{
echo 'style="display:inline;"';
}
else
{
echo 'style="display:none;"';
}
}
else
{
  if (isset($_REQUEST["sel"]))
  {
  if($_REQUEST["sel"] == "0")
  {
  echo 'style="display:inline;"';
  }
  }else{
  echo 'style="display:none;"';
  }
}
  ?>>
<div class="topliner">
<div class="rednotes">Regular listing with nofollow relation!, which appears below sponsor and dmoz links! Can take several months to appear and not guaranteed. </div>
</div>
</div>

<div id="reclinkbox" class="topline" <?php
if (isset($thetype))
{
if ($thetype == "1" )
{
echo 'style="display:inline;"';
}
else
{
echo 'style="display:none;"';
}
}
else
{
  if (isset($_REQUEST["sel"]))
  {
  if($_REQUEST["sel"] == "1")
  {
  		echo 'style="display:inline;"';
  }
  }else{
  echo 'style="display:none;"';
  }
}
  ?>>
<div class="topliner">
<div class="rednotes">Copy and paste code below on the homepage! or on a page accessible from your homepage!</div>
<textarea name="directory" cols="50" rows="4">
<a href="http://directory.sikkimonline.info">Sikkimonline Directory</a> - An India Information Directory.
</textarea>
<br />
<div class="level">Reciprocal URL</div>
<div class="notes">Tell us the address of the page holding the link back to this site.</div>
<input name="linkback"  id="valx" size="40" type="text" value="
<?php 
if (isset($thebacklink))
{
if (strlen($thebacklink) < 10)
{
echo "http://";
}
else
{
echo str_replace("!$#$#!", "'",$thebacklink);
}
}
else
{
echo "http://";
}
?>
" />
<div id="txtHint" style="float:right;margin-left:20px;margin-top:10px;font-weight:bold;"></div>
<div style="margin-top:10px;"><input type="Button" name="Submit" onclick="showHint(document.getElementById('valx').value)"  value="Check Sikkimonline Link" /></div>

</div>
</div>
</div>

<div class="thegap">
<div class="level">Site Description!</div>
<div class="notes">Remmember not to use "we", "us" obvious hype in descriptions. Remove spelling errors. </div>
<textarea name="ulr_desc" cols="50" rows="5"><?php 
if (isset($thedesc))
{
echo str_replace("!$#$#!", "'",$thedesc);
}
else
{

if (isset($_REQUEST["tm"]))
{
echo $_REQUEST["tm"];
} 
}
?></textarea>

</div>

<?php
if ($vbulletin->userinfo['usergroupid'] == "6" || $vbulletin->userinfo['usergroupid'] == "7" || $vbulletin->userinfo['usergroupid'] == "17")
{

if (isset($_GET["id"]))
{
echo '<div class="thegap"><div class="level">Approve / Disapprove!</div>
<div class="notes">Before approving make sure it meets the minimum requirements! We strongly support Dmoz Editing <a href="http://www.dmoz.org/guidelines/include.html" target="_blank">Guidelines</a>!</div>
';

if (isset($thestatus))
{
	if ($thestatus == "unapproved" )
	{
	$und = "selected";
	$und2 = "";
	}
	else
	{
	$und = "";
	$und2 = "selected";
	}
}

echo '<select name="thestatus">
  <option value="unapproved" '.$und.'>No Approve</option>
  <option value="approved" '.$und2.'>Approve</option>
</select>';
echo '</div>';
}

//show edit notes and date..
if (isset($edit_notes))
{
$thenote = $edit_notes;
}else{
$thenote = "";
}
if (isset($_GET["id"]))
{
echo' <div class="thegap"><div class="level">Edit Notes!</div>
<div class="notes">Editorial Notes! only visible to other editors. Modify if necessary.</div>
<textarea name="edit_note" cols="50" rows="4">'.str_replace("!$#$#!", "'",$thenote).'
</textarea>
</div>';
}
}
?>
<div class="thegap">
<?php

if (isset($_GET["id"]))
{
echo '<input type="Submit" name="Submit" value="Update and Save!" />';
echo '<input type="button" onclick="confirmation()" name="Submit" value="Delete this link" />';
}
else
{
echo '<input type="Submit" name="Submit" value="Suggest this website!" />';
}

?> 

</div>

</form>
</div>
<?php
@include("foot.php");
//functions allow tags========================================================
function strip_tags_except($text, $allowed_tags, $strip=TRUE) {
  if (!is_array($allowed_tags))

    return $text;

  if (!count($allowed_tags))
    return $text;

  $open = $strip ? '' : '<';
  $close = $strip ? '' : '>';

  preg_match_all('!<\s*(/)?\s*([a-zA-Z]+)[^>]*>!',
    $text, $all_tags);
  array_shift($all_tags);
  $slashes = $all_tags[0];
  $all_tags = $all_tags[1];
  foreach ($all_tags as $i => $tag) {
    if (in_array($tag, $allowed_tags))
      continue;
    $text =
      preg_replace('!<(\s*' . $slashes[$i] . '\s*' .
        $tag . '[^>]*)>!', $open . '$1' . $close,
        $text);
  }

  return $text;
}

function url_to_link($text) {
  $text =
    preg_replace('!(^|([^\'"]\s*))' .
      '([hf][tps]{2,4}:\/\/[^\s<>"\'()]{4,})!mi',
      '$2<a href="$3">$3</a>', $text);
  $text =
    preg_replace('!<a href="([^"]+)[\.:,\]]">!',
    '<a href="$1">', $text);
  $text = preg_replace('!([\.:,\]])</a>!', '</a>$1',
    $text);
  return $text;
}
//================function sql strings
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

  switch ($theType) 
  {
    case "text":
      $theValue = ($theValue != "") ? "'" . str_replace("'", "!$#$#!",$theValue) . "'" : "''";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}

function clean($s) 
{
if (get_magic_quotes_gpc())
$s = stripslashes($s);
return $s;
} 

?>

Link to comment
Share on other sites

Wait!!... it worked.. thanks BlueSkyIS.. I can not believe it.. I copied your code and uploaded it into my web server and it worked... (it is still showing error in my computer.. like i least care).. what the hell..!!

 

Thank you so much for your help.. no doubt.. the best php support forum in the world!!  ;D  ;D  ;D

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.