+ Reply to Thread (include dating software, release, and patch number!)
Page 1 of 3 1 2 ... LastLast
Results 1 to 10 of 27

Thread: Inbox, Outbox, Reply problems

  1. #1
    elusuario's Avatar
    Join Date
    Sep 2006
    Posts
    173

    Question Inbox, Outbox, Reply problems

    Problems :

    - When deleting a message from the inbox it is also deleted from the sender's outbox.
    - A person is not able to delete messages from his/her outbox.
    - If the sender opens the message he/she sent at his/her outbox it becomes as "not new" in the inbox of the recipient.
    - If a persons click reply to send a response to a message you receive a blank compose form, intead of a compose form that includes the content of the message you are going to reply to.

    Can somebody give specific instruction about how to fix this???

    I think that if a person deletes a message at his/her inbox it should not be deleted from the sender's outbox and vice versa, taking on account, of course, that persons should be able to delete messages from their outbox too.

    Also, it is extremely bad that if a person checks a message at his outbox the message change to "not new" at the recipients inbox.

    Also, if you click reply you should end up with the compose message form, but with the content of the message you are replying to already included, this is basic.

    Can anybody help with modifications that include what I mentioned above for this to function as normal and at least basic communication system??? Please.
    Using modified Dolphin 5.6.0002 hosted at shared server

  2. #2
    lodlock's Avatar
    Join Date
    May 2006
    Posts
    284

    Default

    To remove the "new" problem from the outbox open up messages_outbox.php and find:
    Code:
    db_res("UPDATE `Messages` SET `New` = '0' WHERE `ID` = '" . ((int)$_GET['message']) . "'");
    and comment it out like so:

    Code:
    //db_res("UPDATE `Messages` SET `New` = '0' WHERE `ID` = '" . ((int)$_GET['message']) . "'");
    --------------------------

    To reply with replied message code included you should open up compose.php and find some commented code that looks like this:

    Code:
            /*if( $_REQUEST['messageID'] > 0 )
            {
                    $messageID = (int)$_REQUEST['messageID'];
    
                    $original_mes_query = "SELECT `Text`, `Subject` FROM `Messages` WHERE `ID` = '$messageID'";
                    $original_mes_arr = db_arr("$original_mes_query");
    
                    $ret .= '<div style="position:relative; border:1px solid #F8DAA8; padding:5px 0px;">';
                            $ret .= '<div><strong>'. _t('_Original letter') .'</strong></div>';
                            $ret .= '<div style="position:relative; margin:3px; padding:5px; border:0px solid silver; text-align:left; background-color:#F8F8E7; border:1px dotted #F8DAA8;">';
                                    $ret .= process_smiles( process_line_output($original_mes_arr['Subject']) );
                            $ret .= '</div>';
                            $ret .= '<div style="position:relative; margin:3px; padding:3px; border:0px solid silver; text-align:left; font-style:italic; background-color:#F8F8E7; border:1px dotted #F8DAA8;">';
                                    $ret .= process_smiles( process_text_withlinks_output($original_mes_arr['Text']) );
                            $ret .= '</div>';
                    $ret .= '</div>';
    
            }*/
    Just uncomment this code by removing the /* and */. If you want there to be a "Re:" in the subject you should look for the following code also in compose.php:

    Code:
                    $ret .= '<div class="divInpSubj">';
                            $ret .= '<input class="inpSubj" name="mes_subject" type="text"/>';
                    $ret .= '</div>';
    and replace it with:

    Code:
                    $ret .= '<div class="divInpSubj">';
                    if ($original_mes_arr['Subject'])
                            $ret .= '<input class="inpSubj" id="inpSubj" name="mes_subject" type="text" value="Re:'. process_smiles( process_line_output($original_mes_arr['Subject'])) .'"/>';
                    else
                            $ret .= '<input class="inpSubj" id="inpSubj" name="mes_subject" type="text" />';
                    $ret .= '</div>';
    The ability to remove message from the outbox would require a new field of whether the message exists for both people. That way when someone deletes the message from their outbox or inbox it just deletes their entry in the field of "ob" or "ib" or whatever. And just set up a check that if both are removed then actually physically remove the entry from the db. Something like that could work just fine. This would allow for both the deletion of a mail message form the outbox and it will also cure the issue of the message being deleted from the outbox if removed from inbox.
    -Lodlock

  3. #3
    elusuario's Avatar
    Join Date
    Sep 2006
    Posts
    173

    Default

    Hi.

    It seems that you are the one solving most of my problems here, jajaja, if I ever make money from my site I will have to remember you for sure, jaja, thanks.

    About the las part of your response, about the option to be able to delete at the outbox, without deleting at the inbox, and deleting at the inbox without deleting at the outbox, while checking if both users deleted the message to physically delete it from the database, I understand the concept, but I really don't know how to apply it, maybe you already did that at your site and you can post exact instructions about every change (at database and code) that have to be done.

    If you post instructions for these I will be able to do all the changes exactly as you indicate, please. Thank you for all your help with this and all other issues up to now.
    Using modified Dolphin 5.6.0002 hosted at shared server

  4. #4
    lodlock's Avatar
    Join Date
    May 2006
    Posts
    284

    Default

    I have done everything but the last part actually. Let me play around with it on my test system and and i'll post the code when I have it down. Hopefully it should be tonight unless something comes up.
    -Lodlock

  5. #5
    elusuario's Avatar
    Join Date
    Sep 2006
    Posts
    173

    Default

    Ok, thanks, I'll wait.
    Using modified Dolphin 5.6.0002 hosted at shared server

  6. #6
    lodlock's Avatar
    Join Date
    May 2006
    Posts
    284

    Default

    Got the outbox deleting and was about to have the inbox deleting seperate and something has come up. gotta go pick up a friend from the hospital. I've lost track of my changes anyways so i'll either toss up a diff or maybe just post my outbox.php and inbox.php when i get the chance. If you dont hear from me by tonight then just post here again and it will remind me.
    -Lodlock

  7. #7
    lodlock's Avatar
    Join Date
    May 2006
    Posts
    284

    Default

    Ok here we go... this will add deletion support for the outbox and individual inbox/outbox deleting capablities.

    First off open up phpmyadmin, click on sql and paste in this:

    Code:
    ALTER TABLE `Messages` ADD `ob` ENUM( '0', '1' ) NOT NULL DEFAULT '1',
    ADD `ib` ENUM( '0', '1' ) NOT NULL DEFAULT '1';
    Then open up inbox.php and find this:

    Code:
    		switch( $_POST['msg_form_submit'] )
    			{
    				case _t( "_Delete" ): $query = "DELETE FROM `Messages`"; break;
    				case _t( "_Mark as New" ): $query = "UPDATE `Messages` SET New = '1'"; break;
    				case _t( "_Mark as old" ): $query = "UPDATE `Messages` SET New = '0'"; break;
    			}
    and replace it with this:

    Code:
    		switch( $_POST['msg_form_submit'] )
    			{
    				case _t( "_Delete" ): 
    					$ib_ob_arr = db_arr( "SELECT `ib`, `ob` FROM `Messages` WHERE `ID` = ".((int)$val) );
    					if (!$ib_ob_arr['ob']) 
    						$query = "DELETE FROM `Messages`";
    					else	
    						$query = "UPDATE `Messages` SET `ib` = '0'"; 
    					break;
    				case _t( "_Mark as New" ): $query = "UPDATE `Messages` SET New = '1'"; break;
    				case _t( "_Mark as old" ): $query = "UPDATE `Messages` SET New = '0'"; break;
    			}
    FIND:
    Code:
    $m_arr = fill_array( db_res( "SELECT
    								`Messages`.`ID`,
    								`Messages`.`Sender`,
    								`Messages`.`Subject`,
    								DATE_FORMAT( `Messages`.`Date`, '$date_format' ) AS Date,
    								LEFT( `Messages`.`Text`, {$preview_length} ) AS Preview,
    								`Messages`.`New`,
    								`Profiles`.`NickName`,
    								`Profiles`.`RealName`,
    								`Profiles`.`Status`,
    								`Profiles`.`ID` as pID
    							FROM `Messages`
    							LEFT JOIN Profiles ON Messages.Sender = Profiles.ID
    							WHERE Recipient = ".((int)$member['ID'])." ORDER BY $sort_by $sort_order" ) );
    REPLACE WITH:
    Code:
    $m_arr = fill_array( db_res( "SELECT
    								`Messages`.`ID`,
    								`Messages`.`Sender`,
    								`Messages`.`Subject`,
    								DATE_FORMAT( `Messages`.`Date`, '$date_format' ) AS Date,
    								LEFT( `Messages`.`Text`, {$preview_length} ) AS Preview,
    								`Messages`.`New`,
    								`Messages`.`ib`,
    								`Profiles`.`NickName`,
    								`Profiles`.`RealName`,
    								`Profiles`.`Status`,
    								`Profiles`.`ID` as pID
    							FROM `Messages`
    							LEFT JOIN Profiles ON Messages.Sender = Profiles.ID
    							WHERE Recipient = ".((int)$member['ID'])." 
    							AND `ib` = '1'
    							ORDER BY $sort_by $sort_order" ) );
    Open up outbox.php and find:

    Code:
    	$sort_order = $_POST['sort_order'] ? $_POST['sort_order'] : "DESC";
    	$sort_by = $_POST['sort_by'] ? $_POST['sort_by'] : " `Date`";
    
    	$preview_length = '45';
    REPLACE WITH:

    Code:
    	$sort_order = $_POST['sort_order'] ? $_POST['sort_order'] : "DESC";
    	$sort_by = $_POST['sort_by'] ? $_POST['sort_by'] : " `Date`";
    
    if ( $_POST['msg_form_submit'] )
            {
                    $sel_str = "";
                    while( list( $key, $val ) = each( $_POST ) )
                    if ( (int)$key && $val )
                    $sel_str .= ",$key";
                    $sel_str = substr( $sel_str, 1 );
                    $sel_arr = explode( ",", $sel_str );
    
                    while( list( $key, $val ) = each( $sel_arr ) )
                    {
                    switch( $_POST['msg_form_submit'] )
                            {
                                    case _t( "_Delete" ): 
    					$ib_ob_arr = db_arr( "SELECT `ib`, `ob` FROM `Messages` WHERE `ID` = ".((int)$val) );
                                            if (!$ib_ob_arr['ib'])
                                                    $query = "DELETE FROM `Messages`";
                                            else
                                                    $query = "UPDATE `Messages` SET `ob` = '0'";
                                            break;
                            }
                    if ( strlen($query) )
                            db_res( "$query WHERE ID = ".((int)$val)." AND `Sender` = ".(int)$member['ID'] );
                    }
            }
    		
    
    	$preview_length = '45';
    FIND:
    Code:
    $sql = "SELECT `Messages`.`ID`,
    				`Messages`.`Recipient`,
    				DATE_FORMAT( `Messages`.`Date`, '$date_format' ) AS Date,
    				LEFT( `Messages`.`Text`, $preview_length ) AS Preview,
    				`Messages`.`New`,
    				`Profiles`.`NickName`,
    				`Profiles`.`RealName`,
    				`Profiles`.`ID` AS pID,
    				`Messages`.`Subject`
    
    			FROM
    				`Messages`
    				LEFT JOIN `Profiles` ON `Messages`.`Recipient` = `Profiles`.`ID`
    				WHERE `Sender` = '".((int)$member['ID'])."'
    				ORDER BY $sort_by $sort_order
    				";
    REPLACE WITH:

    Code:
    $message = ((int)$_GET['message']);
    
    $sql = "SELECT `Messages`.`ID`,
    				`Messages`.`Recipient`,
    				DATE_FORMAT( `Messages`.`Date`, '$date_format' ) AS Date,
    				LEFT( `Messages`.`Text`, $preview_length ) AS Preview,
    				`Messages`.`New`,
    				`Messages`.`ob`,
    				`Profiles`.`NickName`,
    				`Profiles`.`RealName`,
    				`Profiles`.`ID` AS pID,
    				`Messages`.`Subject`
    
    			FROM
    				`Messages`
    				LEFT JOIN `Profiles` ON `Messages`.`Recipient` = `Profiles`.`ID`
    				WHERE `Sender` = '".((int)$member['ID'])."'
    				AND `ob` = '1'
    				ORDER BY $sort_by $sort_order
    				";
    FIND:

    Code:
    <table cellspacing="1" cellpadding="1" width="100%" border="0" bgcolor="#CCCCCC">
    <tr bgcolor="#FFFFFF">
        <td rowspan="2" colspan="2" align="center" valign="center"><img src="<? getTemplateIcon('outbox.gif') ?>" /></td>
        <td colspan="3" align="center" height="35">&nbsp;<? echo _t( "_Messages in Outbox" ); ?>: <strong><? echo $m_num; ?></strong> <? echo _t( "_total" ); ?>, <strong><? echo $m_new; ?></strong> <? echo _t( "_not read" ); ?></td>
    </tr>
    REPLACE WITH:

    Code:
    <table cellspacing="1" cellpadding="1" width="100%" border="0" bgcolor="#CCCCCC">
    <tr bgcolor="#FFFFFF">
        <td rowspan="2" colspan="3" align="center" valign="center"><img src="<? getTemplateIcon('outbox.gif') ?>" /></td>
        <td colspan="3" align="center" height="35">&nbsp;<? echo _t( "_Messages in Outbox" ); ?>: <strong><? echo $m_num; ?></strong> <? echo _t( "_total" ); ?>, <strong><? echo $m_new; ?></strong> <? echo _t( "_not read" ); ?></td>
    </tr>
    FIND:

    Code:
        { $sel_l = ""; $sel_r = ""; }
    
        echo "<td align=\"left\" $style_add>&nbsp;<a href=\"profile.php?ID=" . $m_arr[$i]['Recipient'] . "\" title=\"Click here to view profile\">$sel_l" . $m_arr[$i]['NickName'] . "$sel_r</a>&nbsp;</td>";
        echo "<td align=\"left\" $style_add>&nbsp;$sel_l" . $m_arr[$i]['Date'] . "$sel_r&nbsp;</td>";
        echo "<td align=\"left\" $style_add>&nbsp;<a href=\"messages_outbox.php?message=" . $m_arr[$i]['ID'] . "\" title=\"Click here to view message to " . $m_arr[$i]['NickName'] . "\">$sel_l";
        echo  process_line_output(html2txt( $subject ));
        echo '</a>';
        echo '</td>';
        echo "</tr>";
    REPLACE WITH:

    Code:
        { $sel_l = ""; $sel_r = ""; }
    
        echo '<td align="center"><input type="checkbox" name="' . $m_arr[$i]['ID'] . '" /></td>';
        echo "<td align=\"left\" $style_add>&nbsp;<a href=\"profile.php?ID=" . $m_arr[$i]['Recipient'] . "\" title=\"Click here to view profile\">$sel_l" . $m_arr[$i]['NickName'] . "$sel_r</a>&nbsp;</td>";
        echo "<td align=\"left\" $style_add>&nbsp;$sel_l" . $m_arr[$i]['Date'] . "$sel_r&nbsp;</td>";
        echo "<td align=\"left\" $style_add>&nbsp;<a href=\"messages_outbox.php?message=" . $m_arr[$i]['ID'] . "\" title=\"Click here to view message to " . $m_arr[$i]['NickName'] . "\">$sel_l";
        echo  process_line_output(html2txt( $subject ));
        echo '</a>';
        echo '</td>';
        echo "</tr>";
    FIND:

    Code:
        $j++;
    }
    ?>
    </table>
    </form>
    <?
    REPLACE WITH:

    Code:
        $j++;
    }
    	echo '<tr bgcolor="#ffffff">';
            echo '<td colspan="6">';
     	        echo '<table cellspacing="3" cellpadding="0" border="0">';
            		echo '<tr>';
                    	        echo '<td>' . _t( "_Selected messages" ) . ':&nbsp;</td>';
                                    echo '<td><input name="msg_form_submit" type="submit" value="' . _t( "_Delete" ) . '" /></td>';
                                    echo '<td>&nbsp;</td>';
                                    echo '<td>&nbsp;</td>';
                                    echo '<td>&nbsp;</td>';
                                    echo '<td>&nbsp;</td>';
                            echo '</tr>';
                    echo '</table>';
             echo '</td>';
             echo '</tr>';
    echo '</table>';
    echo '</form>';
    And that should do it. *whew* Works for me, let me know if it works for you.
    -Lodlock

  8. #8
    elusuario's Avatar
    Join Date
    Sep 2006
    Posts
    173

    Cool

    Wow, that was fast or I lost sense of time because of been working in other stuff about Dolphin jajaja.

    Ok I will test it and post results here, thank you again
    Using modified Dolphin 5.6.0002 hosted at shared server

  9. #9
    Prometheus
    Guest

    Default

    Great hack lodlock.
    I, of course, had to change it up a bit for 4.1.2 but it works fantastic...
    Thanks.
    Been meaning to get around to this.
    I had been using Smoges

    // ModMySite QuickMod 12 - Delete Outbox Messages hack

    http://modmysite.com/showthread.php?...te+QuickMod+12

    But it was based on the same old crap code. Meaning...when one email is deleted the other end (sender or receivers) email was deleted also.

    Its amazing that these guys would think that you would never want to delete you outbox????? Even after all this time they have not fixed something as VITAL and simple as this...
    Morons...

    Anyway...

    Again..MANY THANKS.

    Prometheus

  10. #10
    lodlock's Avatar
    Join Date
    May 2006
    Posts
    284

    Default

    Think i should go sell this as a mod on expertzzz?
    -Lodlock

+ Reply to Thread (include dating software, release, and patch number!)
Page 1 of 3 1 2 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. combine inbox and outbox
    By makenoize in forum FAQ & HOWTO
    Replies: 2
    Last Post: 06-15-2007, 02:59 AM
  2. Inbox/Outbox need improvement
    By Smoge in forum Wishlist
    Replies: 4
    Last Post: 03-14-2007, 12:47 AM
  3. time in inbox-outbox
    By raeyo in forum General Issues, Comments, Questions
    Replies: 3
    Last Post: 02-19-2007, 01:25 AM
  4. Inbox.php & outbox.php hacks.
    By Prometheus in forum Free Mod Exchange
    Replies: 0
    Last Post: 02-06-2007, 09:14 PM
  5. Problems with Reply
    By Smoge in forum Feedback and Suggestions
    Replies: 1
    Last Post: 08-27-2005, 09:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts