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
https://forums.phpfreaks.com/topic/43690-only-on-one-thing/
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
https://forums.phpfreaks.com/topic/43690-only-on-one-thing/#findComment-212922
Share on other sites

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.