954,604 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Font Size Problem

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?>

<?=$Categories?>


Here is the code of my includes.php file:


[php]
<?

$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 = "\n";

if(mysql_num_rows($ri) > '0')
{
while($ai = mysql_fetch_array($ri))
{
$Categories .= "\n\t$ai[CategoryName]\n\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 .= "\n\t$as[SubcategoryName]\n\n";
}
}

}

if(empty($_SESSION[AgentID]))
{
echo ("");
}
else
{
if($_SESSION[AccountType] == '1')
{
$Account .= "\n\tEdit profile\n\n";
$Account .= "\n\tBanners\n\n";
}
else
{
$Account .= "\n\tEdit profile\n\n";


}

$Account .= "\n\tManage Listings\n\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 = "
Renew Account
";
}

$Account .= "\n\tLogout\n\n\n\tListings: $apl[0]/$_SESSION[MaxOffers]\n\n\n\tExpire Date:\n\n\n\t$ace\n\n\n\t$RenewAccount\n\n";
}

$Categories .= "\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 .= "\n\n\t$rimage[0]\"
$arand[address]
$arand[city]
\n\n\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 = "\n\t\n\t";

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

$SelectType .= "";
}

return $SelectType;

}

?>[/php]

n2ads
Newbie Poster
23 posts since May 2005
Reputation Points: 10
Solved Threads: 0
 

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

sarahk
Junior Poster
144 posts since Apr 2005
Reputation Points: 10
Solved Threads: 1
 

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?

n2ads
Newbie Poster
23 posts since May 2005
Reputation Points: 10
Solved Threads: 0
 

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!

zippee
Posting Whiz in Training
294 posts since Jan 2005
Reputation Points: 10
Solved Threads: 7
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You