Jump to content

[SOLVED] Fitting java formats into PHP, 2 specific questions


theresa79

Recommended Posts

Hello - after struggling for hours, I thought perhaps someone might be able to help me here. Still working on my blog site. Two questions:

1) I'm trying to get the date to fit into the text box with the purple background. As you can see in the code (where I am painfully entering in and out of PHP), the date in the text box is manually entered, and the date right below it is a php code (which is what I need for the first date). Is there a way to pair php so that it can be formatted inside that purple class cell?

2) The link at the bottom right ("more") is also manual - it is a hover-over class format. Is there a way I can fuse the two so that I can get the permalink results to link to that without compromising the style/format?

 

Also, is there a way to actually format the ENTIRE box as shown into php, without having to go in and out?

 

Any clarification would be very much appreciated. Thank you!!

 

 

help-vi.jpg

<table width="363" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="38"><img src="images/trans.gif" width="38" height="1"></td>
            <td class="divline01"><img src="images/trans.gif" width="1" height="5"></td>
            <td width="5"><img src="images/trans.gif" width="5" height="8"></td>
          </tr>
          <tr>
            <td> </td>
            <td class="cellBg02"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td class="hdr_Ttl"><div align="left">NEWS & UPDATES </div></td>
              </tr>
              <tr>
                <td class="cellDivision"><p><span class="hiliteText"> + 12.05.05 + </span><br>
                  

<?php
require_once "../_etc/header.php";
echo "	
              \n";
$sql = "SELECT * FROM eggblog_articles WHERE flag='1' ORDER BY date DESC LIMIT 1,1";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
  $date = date("+ n. d. y +",$row['date']);
  $time = date("g:i a",$row['date']);
  $details = $row['details'];

  if(strlen($details) > 11) {
      $details = substr(trim($details),0,144); 
      $details = substr($details,0,strlen($details)-strpos(strrev($details)," "));
      $details .= "...";}
if (strpos($row['details'],"</p>")) {
    $details = $row['details'];
  }
  else {
    $details = str_replace("\r","",$row['details']);
    $details = str_replace("\n\n","</p><p>",$details);
    $details = str_replace("\n","<br />",$details);
      $details = substr(trim($details),0,144); 
       $details .= "...";}
  
$count_comments = mysql_result(mysql_query("SELECT count(*) FROM eggblog_comments WHERE article_id='$row[id]' AND flag='1'"),0);
  echo "\n		<div class=\"article\">$date
		<b>$row[title]</b>
		<br>$details

	</div>\n";
}
?>


<?php
require_once "../_etc/header.php";
echo "	\n";	
$sql = "SELECT * FROM eggblog_articles WHERE flag='1' ORDER BY date DESC LIMIT $eggblog_home";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
  $date = date("D jS F Y",$row['date']);
  $time = date("g:i a",$row['date']);
$count_comments = mysql_result(mysql_query("SELECT count(*) FROM eggblog_comments WHERE article_id='$row[id]' AND flag='1'"),0);
  echo "\n;		
<ul class=\"articleextras\">
		<li class=\"permalink\"><a href=\"../home/blog.php?id=$row[id]\">$lang130</a></li>\n";

                   }
?>



<table border="0" align="right" cellpadding="0" cellspacing="0">
                    <tr>
                      <td class="more_butBg03"><a href="#" class="moreLink">more</a> 
                      <img src="images/bullet01.gif" align="absmiddle" width="28" height="6"></td>
                    </tr>
                  </table>                  <p> </p></td>
              </tr>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.