DeathStar Posted March 21, 2007 Share Posted March 21, 2007 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 More sharing options...
fenway Posted March 21, 2007 Share Posted March 21, 2007 Your script should be able to collapse any block element... Link to comment https://forums.phpfreaks.com/topic/43690-only-on-one-thing/#findComment-212230 Share on other sites More sharing options...
DeathStar Posted March 22, 2007 Author Share Posted March 22, 2007 Well.. No. Look at phpfreaks ^| where the banner is. You are able to callapse that part... Like that (about) Link to comment https://forums.phpfreaks.com/topic/43690-only-on-one-thing/#findComment-212605 Share on other sites More sharing options...
fenway Posted March 22, 2007 Share Posted March 22, 2007 What I mean is that the script simply changes the display attribute of a DOM element -- and that can be any DIV tag -- so just wrap each message in a dIV. Link to comment https://forums.phpfreaks.com/topic/43690-only-on-one-thing/#findComment-212776 Share on other sites More sharing options...
DeathStar Posted March 22, 2007 Author Share Posted March 22, 2007 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 More sharing options...
fenway Posted March 22, 2007 Share Posted March 22, 2007 So you should be able to hide the entire row that contains each message. Link to comment https://forums.phpfreaks.com/topic/43690-only-on-one-thing/#findComment-212982 Share on other sites More sharing options...
DeathStar Posted March 23, 2007 Author Share Posted March 23, 2007 Yes. Here is a picture: Closed Open Need them to be able to open and close individually. THere are about 25 mails per page. Link to comment https://forums.phpfreaks.com/topic/43690-only-on-one-thing/#findComment-213344 Share on other sites More sharing options...
fenway Posted March 23, 2007 Share Posted March 23, 2007 And that's not acceptable? Link to comment https://forums.phpfreaks.com/topic/43690-only-on-one-thing/#findComment-213426 Share on other sites More sharing options...
DeathStar Posted March 23, 2007 Author Share Posted March 23, 2007 I want them to be able to open and close individually. Right now if I click read on any message it will close the first one not the one you clicked read on! Link to comment https://forums.phpfreaks.com/topic/43690-only-on-one-thing/#findComment-213508 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.