Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change size of numbers In cgi script

Status
Not open for further replies.

lostdogs

Technical User
Apr 23, 2002
3
AU
Hi

I hope I am posting this to the right area of the forum, I really don't understand cgi scripts at all and wanted to change the size of some numbers that appear on my website.

I have been told the numbers are in this piece of script.

Thankyou for any help.



sub display_frontpage
{
my %numbers = ();
my $output = "";

open (DATABASE, "$data_file_path") || &file_open_error
("$data_file_path", "Display Frontpage", __FILE__, __LINE__);

while (<DATABASE>)
{
$line = $_;
chop $line;
@fields = split (/\|/, $line);
if ($fields[$index_of_status] eq &quot;ok&quot;) {
$category = $fields[$index_of_category];
$numbers{$category}++;
}
}
close (DATABASE);

print qq~
<p>
<table border=0 width=100% cellpadding=2 cellspacing=2>
<tr>~;
$end_of_row = &quot;off&quot;;

open (DATA, &quot;$category_file_path&quot;);
@categorylines = <DATA>;
close DATA;

foreach $categoryline (@categorylines) {

@categoryfields = split(/\|/,$categoryline);

if ($categoryfields[6]) {

$category_shortname = $categoryfields[0];
$category = $categoryfields[1];
$description = $categoryfields[2];
$image = $categoryfields[3];

$category_link = $category;
$category_link =~ s/\+/plussign/g;
$category_link =~ s/ /\+/g;
$category_link =~ s/&/ampersand/g;
$category_link =~ s/=/equalsign/g;

if ($numbers{$category} eq &quot;&quot;) {
$numbers{$category} = 0;
}

print qq~

<td valign=top>
<a href=&quot;$script_url?session_key=$session_key&display_subcategories=on&category=$category_link&quot;><img src=&quot;$graphics_dir/$image&quot; border=0 alt=&quot;$category&quot;></a></td> <td valign=top><font face=arial size=3><a href=&quot;$script_url?session_key=$session_key&display_subcategories=on&category=$category_link&quot;><b>$category</b></a> <i>($numbers{$category})</i><br>
<font size=1>$description
</font></td>~;
if ($end_of_row eq &quot;off&quot;) {
$end_of_row = &quot;on&quot;;
}
else {
print qq~</tr>
<tr>~;
$end_of_row = &quot;off&quot;;
}
}
}

if ($end_of_row eq &quot;off&quot;) {
print qq~<td></td><td></td></tr>~;
}

print qq~
</table>
<P>
</form>
<P>~;
}

1;
 
What do you mean you want to change the size of some numbers? Do you mean the size of the values, or the size of the table cells they print in, or what?
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
tsdragon,

cool are reply thanks, appreciated.

my website is and people post messages about lost pets, beside each message their is a message number and data statistics, they are about 8 size font at the moment and hard to see, I have been able to change other fonts in the script with the admin controls and some through changing the script itself in areas I could understand, but these actual numbers don't seem to have any script text I am familiar with such as <font face=arial size=3> .

So to answer your question, I do want to change the actual size of the numbers whether they are in text or image form, maybe changing the cell values or whatever I don't know, not very knowledegable with cgi scripts at all.

if you get a chance go to the site, click on categories and just pick any listing, then click message details, you will see the small numbers under the photo on the left.

thanks.
 
print qq~

<td valign=top>
<a href=&quot;$script_url?session_key=$session_key&display_subcategories=on&category=$category_link&quot;><img src=&quot;$graphics_dir/$image&quot; border=0 alt=&quot;$category&quot;></a></td> <td valign=top><font face=arial size=3><a href=&quot;$script_url?session_key=$session_key&display_subcategories=on&category=$category_link&quot;><b>$category</b></a> <i>($numbers{$category})</i><br>
<font size=1>$description
</font></td>~;

Without being able to see the entire program I cant tell what affects what, but some where in the script the above high lighted region either here or somewhere else will control the size. open the scrit in a text editor and seach for font. Then manipulate them until you finde the one you want.

HTH
ekhaunter@hotmail.com
If you need more help I could probably knock this out in about 10min. I would need to see the whole program to find what subroutine is generating the output.
 
Haunter

I sent you the files as a zip file, if you have time I would appreciate some direction as now I have had three different areas to change the same font and two different ways to do it.

sent email to you with zip file attached.

thanks.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top