Jump to content

Wrap PHP code in CSS Style - Help PLEASE!


mmtv

Recommended Posts

I have uploaded a comment script that I need help with. You can view what the script looks like at http://www.mymarketingtv.com

 

As you can see, there is 3 comment entries (unless someone has add more) at the top of the white area. I would like to have all those entries put into my .scroll css style however I do not want the form wrapped in the style.

 

Here is the code. Please reply back and tell me where I should place the beggining and ending style code. <div class="head"> </div>

 

<?

// Please don't modify or delete the copyright notice. Doing that is a violation of GPL.

print<<<EOF
<style type="text/css">
div#usernotes {
background-color: transparent;
}
div#usernotes div.head, div#usernotes div.foot {
background-color: transparent;
padding: 4px;
}
div#usernotes div.foot {
text-align: right;
}
div#usernotes div.foot a, div#usernotes div.head a {
background-color: transparent;
}
div#usernotes span.action {
float: right;
}
div#usernotes div.note {
margin-left: 2em; 
margin-right: 2em; 
border-bottom:1px dashed;
padding: 4px;
}
div#usernotes div.text {
padding: 2px;
margin-top: 4px;
}
div.scroll {
height: 35px;
width: 550px;
overflow: auto;
border: 1px solid #666;
background-color: #F9F9F9;
padding: 8px;
margin-top: 5px;
margin-right: 5px;
margin-bottom: 5px;
margin-left: 5px;
}
</style>

<div id="usernotes">
<div class="head">
<H3>{$COM_LANG['header']}</H3>
</div>
EOF;

if ($comments_count) {
  for($i=0; $i<$comments_count; $i++) {
   if ($dont_show_email[$i] != '1' && $email != '') { $author[$i] = "<a href=\"mailto:{$email[$i]}\">{$author[$i]}</a>"; }
   $text[$i] = str_replace(chr(13), '<br />', $text[$i]);
   
   
   print<<<EOF
<div class="note">
  <strong>{$author[$i]}</strong><br />
  <small>{$time[$i]}</small>
  <div class="text">
  {$text[$i]}
  </div>
</div>

EOF;
  
  }
}
else {
   print<<<EOF
<div class="note">
  <div class="text">
  {$COM_LANG['no_comments_yet']}
  </div>
</div>
EOF;
}

print<<<EOF
<div class="foot">
	<form method=POST action='{$COM_CONF['script_url']}'>
              <input type=hidden name="action" value="add">
	      <input type=hidden name="href" value="{$_SERVER['REQUEST_URI']}">
	  <table width="290" border="0" cellspacing="1" cellpadding="2" align="center">
	    <tr> 
	      <td width="83" align="right"><font color="red">*</font>{$COM_LANG['Name']}: 
	        </td>
	      <td width="196" align="left">
	        <input type=text name="disc_name" maxlength=40 size=30>
	        <input type=hidden name="r_disc_name" value="{$COM_LANG['r_disc_name']}">
	        </td>
	    </tr>
	    <tr> 
	      <td width="83" align="right">{$COM_LANG['E-mail']}:</font></td>
	      <td width="196" align="left">
	        <input type="Text" name="disc_email" size="30" maxlength="70">
	        </td>
	    </tr>
	    <tr> 
	      <td width="83"></td>
	      <td width="196" align="left">
		<input type="checkbox" name="email_me"><font size=2><nobr>{$COM_LANG['Notify']}</nobr></font><br>
		<input type="checkbox" name="dont_show_email" CHECKED><font size=2><nobr>{$COM_LANG['Dont_show_email']}</nobr></font><br>
	        </td>
	    </tr>
	    <tr> 
	      <td valign="top" width="83" align="right"> 
	        <font color="red">*</font>{$COM_LANG['Text']}:
	      </td>
	      <td valign="top" width="196" align="left">
	        <textarea name="disc_body" cols="40" rows="13" wrap="VIRTUAL"></textarea>
	        <input type=hidden name="r_disc_body" value="{$COM_LANG['r_disc_text']}">
	        </td>
	    </tr>
	    <tr> 
	      <td valign="top" width="83" align="right">  </td>
	      <td valign="top" width="196">
	        <div align="center">
	          <input type="submit" name="Submit" value="{$COM_LANG['Submit']}">
	          </div>
	      </td>
	    </tr>
	  </table>
	</form>
</div>
</div>
EOF;

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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