The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Last Threads in my php page. I have the code but..
spadez
post Oct 5 2006, 11:36 AM
Post #1


Newbie
*

Group: Members
Posts: 16
Joined: 30-September 06
Member No.: 295



It looks horrible! This is the code:

QUOTE
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
<title>MOTD</title>
<style type="text/css" media="screen"><!--
body
{
color: white;
background-image:url('http://www.hiven.net/files/background.jpg')
}

#content
{
font-family: Verdana, Geneva, Arial, sans-serif;
background-color: #FFFFFF;
position: absolute;
top: 50%;
left: 50%;
display: table-cell;
visibility: visible
border-width: 1px;
border-color: black;
}

.bodytext
{
font-size: 14px
}

.headline
{
font-weight: bold;
font-size: 24px
}

a:link, a:visited
{
color: #06f;
text-decoration: none
}

a:hover
{
color: red;
text-decoration: none
}

.captions
{
color: white;
font-size: 10px;
line-height: 14px;
font-family: Verdana, Geneva, Arial, sans-serif;
text-align: left
}

#header { background: #000000 url(http://www.hiven.net/forums/images/gradients/gradient_tcat.gif) no-repat;
height: 25px }
</style>
</head>
<body>
<div id="header"><img src="http://www.hiven.net/files/motdhg.gif" /></div>
<div id="content">
<div class="bodytext">
<?php
$db_host = "****"; // Change this if your MySQL database host is different.
$db_name = "****"; // Change this to the name of your database.
$db_user = "****"; // Change this to your database username.
$db_pw = "****"; // Change this to your database password.
$db_prefix = ""; //Change this to the prefix of the forum database.

$forum_url = "http://www.hiven.net/forums"; // Change this to reflect to your forum's URL.
$limit = "10"; // Number of posts displayed.
$txtlimit = "25"; // This is the character limit.

// Connecting to your database
mysql_connect($db_host, $db_user, $db_pw)
OR die ("Cannot connect to your database");
mysql_select_db($db_name) OR die("Cannot connect to your database");

if ($limit) {
$limited = "LIMIT $limit";
}

$thread_sql = mysql_query("select threadid,title,lastpost,firstpostid from $db_prefix thread where visible=1 $wheresql and open=1 $forumid order by lastpost desc $limited");

while($thread_get = mysql_fetch_array($thread_sql))
{
$lastpost = $thread_get['lastpost'];
$tid = $thread_get['threadid'];
$psql = mysql_query("SELECT postid from $db_prefix post where threadid=$tid order by postid desc");
$getp = mysql_fetch_array($psql);
$pid = $getp['postid'];
$title = $thread_get['title'];
$title = substr($title,0,$txtlimit);

echo "<li class=\"item\"><a href=\"$forum_url/showthread.php?p=$pid#post$pid\"><span>$title</span></a></li>";
}
?>
</div>
</div>
</body>
</html>


This is what it loos like:

http://www.hiven.net/files/motd2.php

What i would like is to have a top header to the table, an image that tiles across the width of the table, what code do i need for that? I would also like to know if it is possible to have the text in the box as a custom font, i have the font file but i dont know what i need to do to display the text in that font.

Can you give me a helping hand doing this please?

James

This post has been edited by spadez: Oct 5 2006, 11:49 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Oct 6 2006, 02:29 AM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



QUOTE(spadez @ Oct 5 2006, 06:36 PM) *

What i would like is to have a top header to the table, an image that tiles across the width of the table, what code do i need for that?

There isn't any table there. Where do you mean? At the top of the list or at the top of the page? Anyway, you do that with CSS and a background image set to repeat only along the x-axis.
http://www.htmlhelp.com/reference/css/colo...und-repeat.html
http://www.w3.org/TR/REC-CSS2/colors.html#...ckground-repeat
In case you are new to CSS, you probably want to start at the beginning.
http://www.htmlhelp.com/reference/css/


QUOTE
I would also like to know if it is possible to have the text in the box as a custom font, i have the font file but i dont know what i need to do to display the text in that font.

No, not really.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
jimlongo
post Oct 6 2006, 10:38 AM
Post #3


This is My Life
*******

Group: Members
Posts: 1,128
Joined: 24-August 06
From: t-dot
Member No.: 16



QUOTE
QUOTE

I would also like to know if it is possible to have the text in the box as a custom font, i have the font file but i dont know what i need to do to display the text in that font.

No, not really.


to expand on that, you are limited to the fonts on the User's computer. That's why you can't ever be 100% certain what a page looks like somewhere else.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Oct 6 2006, 11:16 AM
Post #4


.
********

Group: WDG Moderators
Posts: 9,653
Joined: 10-August 06
Member No.: 7



To expand further, IE lets you embed custom fonts but other browsers don't support it: http://www.microsoft.com/typography/web/em...ing/default.htm

You can also create images with text on, but then ALT text becomes essential. PHP lets you create such images from plain text on the fly.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Oct 6 2006, 02:20 PM
Post #5


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



QUOTE(Christian J @ Oct 6 2006, 09:16 AM) *
To expand further, IE lets you embed custom fonts but other browsers don't support it
But MSIE also lets the user disable font downloading (which I always do, since I'm in the preferences disabling ActiveX anyway).

QUOTE(Christian J @ Oct 6 2006, 09:16 AM) *
You can also create images with text on, but then ALT text becomes essential.
And of course, even then some users won't see your image, so they won't see your font.

See also Web Pages aren't Printed on Paper
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 03:42 AM