Jump to content

only on one thing!


DeathStar

Recommended Posts

Hi there.

I have a Script that you can collapse the text, byt i ahve a problem.

It displays 25 or less messages and when i click on collapse only thr frt one will open and close(doesnt matter wic hone you clic kcollapse on) the first opens and closes but, I want them to be closed and opened individually.

example:

 

|------------------------------|

|____________________Colapse|

|        message1                    | \\ Able to collapse

|------------------------------|

 

 

|------------------------------|

|____________________Colapse|

|        message2                    | \\ Able to collapse

|------------------------------|

 

 

Link to comment
Share on other sites

its in a table:

 

<script language='JavaScript' type='text/javascript'><!-- // --><![CDATA[
	var current_header = false;

	function shrinkHeader(mode)
	{

		document.getElementById('upshrinkHeader').style.display = mode ? 'none' : '';
		document.getElementById('upshrinkHeader2').style.display = mode ? 'none' : '';

		current_header = mode;
	}
// ]]></script>

	<script language='JavaScript' type='text/javascript'><!-- // --><![CDATA[
		var current_header_ic = false;

		function shrinkHeaderIC(mode)
		{

			document.getElementById('upshrinkHeaderIC').style.display = mode ? 'none' : '';

			current_header_ic = mode;
		}
	// ]]></script>
print "Only the last 25 messages sent to you are visible.<br />
<table width=75% border=2><tr style='background:silver'><th>Mail</th></tr>";
$q=mysql_query("SELECT m.*,u.* FROM mail m LEFT JOIN users u ON m.mail_from=u.userid WHERE m.mail_to=$userid ORDER BY mail_time DESC LIMIT 25",$c);
while($r=mysql_fetch_array($q))
{
$sent=date('F j, Y, g:i:s a',$r['mail_time']);
print "<tr><td>";
if($r['userid'])
{
print " <table width='100%' cellpadding='0' cellspacing='0' border='0'>
        <tr height='32'>
          <td width='2%' align='left' bgcolor='#666666'><a href='viewuser.php?u={$r['userid']}'>{$r['username']}</a> [{$r['userid']}]";
}
else
{
print " <table width='100%' cellpadding='0' cellspacing='0' border='0'>
        <tr height='32'>
          <td width='2%' align='left' bgcolor='#666666'>SYSTEM";
}
$fm=urlencode($r['mail_text']);
print "</td>
          <td width='67%' align='center' bgcolor='#666666'>";
	  if ($r['mail_subject']){
	  print "{$r['mail_subject']}";}
	  else {
	  print "No subject";}
	  print "</td>
          <td width='10%' align='right' bgcolor='#666666'><a href='#' onclick='shrinkHeader(!current_header); return false;'>Read</a></td>
        </tr>
        <tr id='upshrinkHeader' hight='80'><td width='20%' valign='middle' bgcolor='#CCCCCC'>";
	if ($r['display_pic']){
	print "<img src='{$r['display_pic']}' hight='50' width='50'>";}
	else {
	print "<img src='nopic.jpg' hight='50' width='50'>";}
	print "<br>";
	if($r['laston'] >= time()-15*60) { print "<font color=green>Online</font>"; } else { print"<font color=red>Offline</font>"; }
	print "</td>
                <td width='60%' colspan='2' valign='top' align='center' bgcolor='#CCCCCC'>".$bbc->bbcode_parse($r['mail_text'])."</td>
              
		  </tr>
      </table>
  <table id='upshrinkHeader2' width='100%' cellpadding='4' cellspacing='0' border='0'>
		<tr>
			<td width='20%' bgcolor='#666666'>Details of Message: </td><td width='40%' bgcolor='#666666'><a href='mailbox.php?action=compose&ID={$r['userid']}'>Reply</a> <a href='mailbox.php?action=delete&ID={$r['mail_id']}'>Delete</a> <a href='preport.php?ID={$r['userid']}&report=Fradulent mail: {$fm}'>Report</a></td>
			<td width='40%' align='right' valign='top' nowrap='nowrap' bgcolor='#666666'>
	Sent at: $sent<</td>
		</tr>
  </table>";

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.