I have a script on my website that requires an includes.php file to work. I am trying to control the font size of the links that it provides but I do not know how to do that. Can someone help me?

Here is the code on my site that gets the links:

<?=$Account?><BR>
<?=$Categories?>


Here is the code of my includes.php file:

<font size="1" face="Arial, Helvetica, sans-serif">

<?

$q1 = "update re2_agents set AccountStatus = 'pending' where ExpDate <= '$t' and AccountStatus != 'pending' ";
mysql_query($q1) or die(mysql_error());

//get the settings
$qset = "select * from re2_settings";
$rset = mysql_query($qset) or die(mysql_error());
$aset = mysql_fetch_array($rset);

//get the categories 
$qi = "select * from re2_categories order by CategoryName";
$ri = mysql_query($qi) or die(mysql_error());

$Account = "<table width=120>\n";

if(mysql_num_rows($ri) > '0')
{
	while($ai = mysql_fetch_array($ri))
	{
		$Categories .= "<tr>\n\t<td bgcolor=#000000 font size=8><a class=BlackLinkC href=\"search.php?c=$ai[CategoryID]\">$ai[CategoryName]</a></td>\n</tr>\n";

		//get the subcategories
		$qs = "select * from re2_subcategories where CategoryID = '$ai[CategoryID]' order by SubcategoryName ";
		$rs = mysql_query($qs) or die(mysql_error());

		if(mysql_num_rows($rs) > '0')
		{
			while($as = mysql_fetch_array($rs))
			{
				$Categories .= "<tr>\n\t<td align=center\"><a class=SubCatLinksB href=\"search.php?c=$ai[CategoryID]&s=$as[SubcategoryID]\">$as[SubcategoryName]</a></td>\n</tr>\n";
			}
		}

	}

	if(empty($_SESSION[AgentID]))
	{
		echo ("");
	}
	else
	{
		if($_SESSION[AccountType] == '1')
		{
			$Account .= "<tr>\n\t<td bgcolor=#D6D5D5><a class=BlackLink href=\"profile.php\">Edit profile</a></td>\n</tr>\n";
		$Account .= "<tr>\n\t<td bgcolor=#D6D5D5><a class=BlackLink href=\"banners.php\">Banners</a></td>\n</tr>\n";
		}
		else
		{
			$Account .= "<tr>\n\t<td bgcolor=#D6D5D5><a class=BlackLink href=\"profile2.php\">Edit profile</a></td>\n</tr>\n";
			
		
		}

		$Account .= "<tr>\n\t<td bgcolor=#D6D5D5><a class=BlackLink href=\"manage.php\">Manage Listings</a></td>\n</tr>\n";		


		//get the number of posted listings
		$qpl = "select count(*) from re2_listings where AgentID = '$_SESSION[AgentID]' ";
		$rpl = mysql_query($qpl) or die(mysql_error());
		$apl = mysql_fetch_array($rpl);

		$ace = date('d M Y', $_SESSION[AccountExpireDate]);

		$after = ($_SESSION[AccountExpireDate] - $t)/(24*60*60);

		if($after <= '10')
		{
			$RenewAccount = "<br><a class=RedLink href=\"prices2.php\">Renew Account</a><br>";
		}

		$Account .= "<tr>\n\t<td bgcolor=#D6D5D5><a class=BlackLink href=\"logout.php\">Logout</a></td>\n</tr>\n<tr>\n\t<td>Listings: $apl[0]/$_SESSION[MaxOffers]</td>\n</tr>\n<tr>\n\t<td>Expire Date:</td>\n</tr>\n<tr>\n\t<td align=right>$ace</td>\n</tr>\n<tr>\n\t<td align=center>$RenewAccount</td>\n</tr>\n";		
	}

	$Categories .= "</table>\n";

}

if(ereg("index.php", $_SERVER[SCRIPT_NAME]))
{
	$qrand = "select * from re2_listings, re2_agents where re2_listings.AgentID = re2_agents.AgentID and  re2_listings.image != '' and re2_agents.AccountStatus = 'active' order by rand() limit 0,1 ";
	$rrand = mysql_query($qrand) or die(mysql_error());

	if(mysql_num_rows($rrand) > '0')
	{
		$arand = mysql_fetch_array($rrand);

		$rimage = explode("|", $arand[image]);

		$RandomProperty .= "<table width=150 align=center cellspacing=0 bordercolor=B0B0B0 border=1>\n<tr>\n\t<td  style=\"padding:5\" width=125 align=center valign=top><a class=BlackLink href=\"info.php?id=$arand[ListingID]\" class=BlueLink><img src=\"re_images/$rimage[0]\" width=100 height=100 border=0><br>$arand[address]<br>$arand[city]</a></td>\n</tr>\n</table>\n\n";
	}
}

//send emails to the expire agents

//			10 days to the Expire Date (ExpDate)
$ten1 = mktime(0,0,0,date(m),date(d) + 10,date(Y));
$ten2 = mktime(23,59,59,date(m),date(d) + 10,date(Y));

$qexp = "select * from re2_agents where ExpDate between '$ten1' and '$ten2' and days10 = 'n' ";
$rexp = mysql_query($qexp) or die(mysql_error());

if(mysql_num_rows($rexp) > '0')
{
	while($aexp = mysql_fetch_array($rexp))
	{
		//send an email
		$to = $aexp[email];
		$subject = "10 days to the expiration date!";
		$message = "Hello $aexp[FirstName] $aexp[LastName],\nyour account at $_SERVER[HTTP_HOST] will expire in 10 days!\n\nTo renew your account, login with your username and password and follow the \"Renew Account\" link.\n\nThank you!\n$_SERVER[HTTP_HOST]";

		$headers = "MIME-Version: 1.0\n"; 
		$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
		$headers .= "Content-Transfer-Encoding: 8bit\n"; 
		$headers .= "From: $_SERVER[HTTP_POST] <$aset[ContactEmail]>\n"; 
		$headers .= "X-Priority: 1\n"; 
		$headers .= "X-MSMail-Priority: High\n"; 
		$headers .= "X-Mailer: PHP/" . phpversion()."\n"; 

		mail($to, $subject, $message, $headers);

		mysql_query("update re2_agents set days10 = 'y' where AgentID = '$aexp[AgentID]' ") or die(mysql_error());
	}
}

//			5 days to the Expire Date (ExpDate)
$five1 = mktime(0,0,0,date(m),date(d) + 5,date(Y));
$five2 = mktime(23,59,59,date(m),date(d) + 5,date(Y));

$qexp = "select * from re2_agents where ExpDate between '$five1' and '$five2' and days5 = 'n' ";
$rexp = mysql_query($qexp) or die(mysql_error());

if(mysql_num_rows($rexp) > '0')
{
	while($aexp = mysql_fetch_array($rexp))
	{
		//send an email
		$to = $aexp[email];
		$subject = "5 days to the expiration date!";
		$message = "Hello $aexp[FirstName] $aexp[LastName],\nyour account at $_SERVER[HTTP_HOST] will expire in 5 days!\n\nTo renew your account, login with your username and password and follow the \"Renew Account\" link.\n\nThank you!\n$_SERVER[HTTP_HOST]";

		$headers = "MIME-Version: 1.0\n"; 
		$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
		$headers .= "Content-Transfer-Encoding: 8bit\n"; 
		$headers .= "From: $_SERVER[HTTP_POST] <$aset[ContactEmail]>\n"; 
		$headers .= "X-Priority: 1\n"; 
		$headers .= "X-MSMail-Priority: High\n"; 
		$headers .= "X-Mailer: PHP/" . phpversion()."\n"; 

		mail($to, $subject, $message, $headers);

		mysql_query("update re2_agents set days5 = 'y' where AgentID = '$aexp[AgentID]' ") or die(mysql_error());
	}
}

//			1 day to the Expire Date (ExpDate)
$one1 = mktime(0,0,0,date(m),date(d) + 1,date(Y));
$one2 = mktime(23,59,59,date(m),date(d) + 1,date(Y));

$qexp = "select * from re2_agents where ExpDate between '$one1' and '$one2' and days1 = 'n' ";
$rexp = mysql_query($qexp) or die(mysql_error());

if(mysql_num_rows($rexp) > '0')
{
	while($aexp = mysql_fetch_array($rexp))
	{
		//send an email
		$to = $aexp[email];
		$subject = "1 day to the expiration date!";
		$message = "Hello $aexp[FirstName] $aexp[LastName],\nyour account at $_SERVER[HTTP_HOST] will expire in 1 day!\n\nTo renew your account, login with your username and password and follow the \"Renew Account\" link.\n\nThank you!\n$_SERVER[HTTP_HOST]";

		$headers = "MIME-Version: 1.0\n"; 
		$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
		$headers .= "Content-Transfer-Encoding: 8bit\n"; 
		$headers .= "From: $_SERVER[HTTP_POST] <$aset[ContactEmail]>\n"; 
		$headers .= "X-Priority: 1\n"; 
		$headers .= "X-MSMail-Priority: High\n"; 
		$headers .= "X-Mailer: PHP/" . phpversion()."\n"; 

		mail($to, $subject, $message, $headers);

		mysql_query("update re2_agents set days1 = 'y' where AgentID = '$aexp[AgentID]' ") or die(mysql_error());
	}
}

//		1 day AFTER the Expire Date (ExpDate) WAS PASSED

//$qexp = "select * from re2_agents where ExpDate > ExpDate + 86400 and days1 = 'y' ";
$qexp = "select * from re2_agents where (($t - ExpDate) > 86400) and days1 = 'y' ";
$rexp = mysql_query($qexp) or die(mysql_error());

if(mysql_num_rows($rexp) > '0')
{
	while($aexp = mysql_fetch_array($rexp))
	{
		$DelAgents[] = $aexp[AgentID];

		//get the agent's listings with images
		$q2 = "select * from re2_listings where AgentID = '$aexp[AgentID]' and image != '' ";
		$r2 = mysql_query($q2) or die(mysql_error());

		if(mysql_num_rows($r2) > '0')
		{
			while($a2 = mysql_fetch_array($r2))
			{
				$DelImages[] = explode("|", $a2[image]);

				while(list(,$v) = each($DelImages))
				{
					//delete the images from our server
					unlink("re_images/$v");
				}
			}

			//delete the listings from our database
			$q3 = "delete from re2_listings where AgentID = '$aexp[AgentID]' ";
			mysql_query($q3) or die(mysql_error());

			//delete the agent's banners
			$q4 = "select * from re2_banners where ClientID = '$aexp[AgentID]' ";
			$r4 = mysql_query($q4) or die(mysql_error());

			if(mysql_num_rows($r4) > '0')
			{
				while($a4 = mysql_fetch_array($r4))
				{
					//delete the banners fromour server
					unlink("banners/$a4[BannerFile]");
					$BannerIDs[] = $a4[BannerID];
				}

				$DelBan = implode("', '", $BannerIDs);

				//delete banner info
				$q5 = "delete from re2_banners where ClientID = '$aexp[AgentID]' ";
				mysql_query($q5) or die(mysql_error());

				//delete stats
				$q6 = "delete from re2_stats where BannerID in ('$DelBan') ";
				mysql_query($q6) or die(mysql_error());

			}
		}

	}

	$DelStr = implode("', '", $DelAgents);
	mysql_query("delete from re2_agents where AgentID in ('$DelStr')") or die(mysql_error());
}

function ptypes($x) {

	$qt = "select * from re2_types order by TypeName";
	$rt = mysql_query($qt) or die(mysql_error());

	if(mysql_num_rows($rt) > '0')
	{
		$SelectType = "<select name=PropertyType>\n\t<option value=\"\"></option>\n\t";

		while($at = mysql_fetch_array($rt))
		{
			if($x != "0")
			{
				if($at[TypeName] == $x)
				{
					$SelectType .= "<option value=\"$at[TypeName]\" selected>$at[TypeName]</option>\n\t";
				}
				else
				{
					$SelectType .= "<option value=\"$at[TypeName]\">$at[TypeName]</option>\n\t";
				}
			}
			else
			{
				$SelectType .= "<option value=\"$at[TypeName]\">$at[TypeName]</option>\n\t";
			}
		}

		$SelectType .= "</select>";
	}

	return $SelectType;

}

?>

Recommended Answers

All 3 Replies

Oooh, that's a stack of code to wade through

You'd be better to have use a stylesheet and just control them that way

eg in your head section

<style>a {font-size: 12px;}
</style>

Only once you have it sorted the stylesheet should be in it's own file.

Have you used stylesheets before?

If not, someone maybe able to recommend a good intro tutorial

Sarah

i typed in the style code you gave me and the only thing it affects is my links size. how do i have it affect regular text?

Also, i do not know css. is there a quick lesson i could be told to make this work?

sarahk is right, the only way to control your font properties EFFECTIVELY is by using CSS style sheet or simply embedded css syle in each of your pages. Using CSS style sheet will also save your time in future modifications to your font size, type and background too. If you use dreamweaver or similar software, the software have handy tool to help you creating the style sheet.

I found this is the easiest to follow site to learn CSS: http://www.javascriptkit.com/dhtmltutors/css1.shtml

All the best!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.