phpBB MODS
Bishopston.net phpBB MODS forum
  latestpostsLatest Posts   latesttopicsLatest Topics   unreadtopicsUnread Topics   Register   Profile   Memberlist   Usergroups   Search   Log in to check your private messages   FAQ      Log in  
Calendar 
Calendar eventCalendar
Thu 02 September 2010
Fri 03 September 2010
Sat 04 September 2010
Sun 05 September 2010
Mon 06 September 2010
Tue 07 September 2010
Wed 08 September 2010
Page 1 of 1
Post new topic   Reply to topic       phpBB MODS Forum Index -> phpBB2 MODS for Ptirhiik MODS-> [PATCH for mod-advanced_pm] : Stopping the subject line containing "Re: Re: Re:...&qu All times are GMT + 1 Hour
View previous topic :: View next topic  
Author Message
jamieOffline
Site Admin
Joined: 10 March 2005
Total posts: 27
Gender: Unknown
Karma: 1
Karma yesterday, day before: 1, 1

Last Listened on Thu Sep 02, 2010 6:09 pm : Various Artitsts - CD3 Whole CD Mix
Post: #1 (ID: 39)   PostPosted: Mon Jul 17, 2006 3:11 pm    Karma this post: (+0 -0)  
Post subject:  [PATCH for mod-advanced_pm] : Stopping the subject line containing "Re: Re: Re:...&qu
 Posted from: Wales Reply with quote

This patch fixes the constant addition of "Re:" to PM replies, or "Fwd: " to foward messages (it's compatible with foreign language alternatives, too)

Subjects are changed as follows:

Subject: test
Subject: Re: test
Subject: Re[2]: test
Subject: Re[3]: test

etc.

Please note, that this won't fix up any messages that already exist with long "Re: Re: Re:..." subjects, but will keep all new messages tidy. (I was going to add code to do that, but thought it was a waste of efficiency, as it's only a transitional problem)

Please test, and let me know!

Code:


#-----[ OPEN ]------------------------------------------
#
includes/functions_privmsga.php
#
#-----[ FIND ]------------------------------------------
#
        $userclass = 'name';
#
#-----[ AFTER, ADD ]------------------------------------------
#

// START Jamie's stuff  -- Jamie Jones <jamie@bishopston.net>
function catflap_tidy_subject($subject, $prefix)
  {
    $raw_prefix = preg_replace ('/ *: *$/', '', $prefix);
    $prefix_count = 0;
    if (strpos ($subject, $prefix)===0)
      {
        $prefix_count = 2;
        $subject = preg_replace ('/^' . $prefix . '/', '', $subject);
      }
      else
        if (preg_match( '/^' . $raw_prefix . '\[[1-9][0-9]*\]: /', $subject ))
          {
            $prefix_count = preg_replace ('/^' . $raw_prefix . '\[([1-9][0-9]*)\]: .*/', '\1', $subject) + 1;
            $subject = preg_replace ('/^' . $raw_prefix . '\[[1-9][0-9]*\]: /', '', $subject);
          }

     if ($prefix_count > 1) $subject = $raw_prefix . '[' . $prefix_count . ']: ' . $subject;
       else $subject = $prefix . $subject;

    return $subject;
  }
// End Jamies stuff

#-----[ OPEN ]------------------------------------------
#
includes/privmsga_post.php
#
#-----[ FIND ]------------------------------------------
#
        $subject = _lang('Short_reply') . $subject;
#
#-----[ REPLACE ]------------------------------------------
#
        $subject = catflap_tidy_subject ($subject, _lang('Short_reply'));
#
#-----[ FIND (yes, the same thing as above occurs again) ]----
#
        $subject = _lang('Short_reply') . $subject;
#
#-----[ REPLACE ]------------------------------------------
#
        $subject = catflap_tidy_subject ($subject, _lang('Short_reply'));
#
#-----[ FIND ]------------------------------------------
#
        $subject = _lang('Short_forward') . $subject;
#
#-----[ REPLACE ]------------------------------------------
#
        $subject = catflap_tidy_subject ($subject, _lang('Short_forward'));
#

#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------

Back to top
View user's profile                         Bookmark and Share
Display posts from previous:   
Post new topic   Reply to topic       phpBB MODS Forum Index -> phpBB2 MODS for Ptirhiik MODS-> [PATCH for mod-advanced_pm] : Stopping the subject line containing "Re: Re: Re:...&qu All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by phpBB 2 © 2001 - 2005 phpBB Group
* System Network Status *
* Catflap phpBB Changes *
Served by catflap.bishopston.net
Powered By FreeBSD

Page generation @ 03:53:33 - time: 0.1637s (PHP: 68% - SQL: 32%) - SQL queries: 28