Page 2 of 2

Re: phpBB 3.1.1 Style Changes

Posted: Tue Nov 04, 2014 12:19 pm
by marcovo
A + indeed means a line is added, a - means a line is removed. A ! means a line has changed (although not every type of diff might use a !). Similarly, a > means a line has been added, and < means a line has been removed, they're more or less the same as + and -.

A .diff file really isn't very different from the 'open/find/edit' files phpBB used to provide. The only thing is that these phpBB update files were made with in mind that those files are all about updating. If you see a diff-file made with < and > markups, you see it's all about difference, and not necessarily about updating. It's just 'This is present in file 1, and not in file 2', and that's it. What you'll be doing with that information is up to you.
The - and + markup already has a notion of updating, although technically it is entirely the same as a markup with < and >.

Of course, you can update an installation with .diff-files, if you think of them as update-files. But you can do more with with diff-files than just updating, if you think of them in the broader sense as difference-files. Unfortunately, this broad applicability does make diff-files more cryptical then they need to be if you're just updating. These observations might be essential in understanding the difference between phpBB update files and .diff files.

To illustrate the similarities between the two methods, I'll provide some equivalent parts of patch files below, taken from two phpBB3.0 mods.

Equivalent set #1:

Code: Select all

				<open src="includes/mcp/mcp_pm_reports.php">
					<edit>
						<find><![CDATA[				close_report($report_id_list, $mode, $action, true);]]></find>
						<action type="before-add"><![CDATA[				// BEGIN Moderator Needed Mod
				$cache->purge('_reported_pms');
				// END Moderator Needed Mod]]></action>
					</edit>
				</open>

Code: Select all

diff -wru /phpBB3/includes/mcp/mcp_pm_reports.php /phpBB3-mod/includes/mcp/mcp_pm_reports.php
--- /phpBB3/includes/mcp/mcp_pm_reports.php	2013-12-05 13:57:00.000000000 +0100
+++ /phpBB3-mod/includes/mcp/mcp_pm_reports.php	2013-12-20 13:16:15.000000000 +0100
@@ -61,6 +61,10 @@
 					include($phpbb_root_path . 'includes/mcp/mcp_reports.' . $phpEx);
 				}
 
+				// BEGIN Moderator Needed Mod
+				$cache->purge('_reported_pms');
+				// END Moderator Needed Mod
+				
 				close_report($report_id_list, $mode, $action, true);
 
 			break;

Equivalent set #2:

Code: Select all

    <open src="includes/constants.php">
      <edit>
        <find>// Additional constants</find>
        <action type="after-add">define('HIDE_BBCODE_ID', 1000);</action>
      </edit>
    </open>

Code: Select all

diff -wru /phpBB3/includes/constants.php /phpBB3-mod/includes/constants.php
--- /phpBB3/includes/constants.php	2013-12-05 13:56:59.000000000 +0100
+++ /phpBB3-mod/includes/constants.php	2013-12-20 13:16:15.000000000 +0100
@@ -211,6 +211,7 @@
 
 // Additional constants
+define('HIDE_BBCODE_ID', 1000);
 
 // Table names
 define('ACL_GROUPS_TABLE',			$table_prefix . 'acl_groups');
Equivalent set #3:

Code: Select all

    <open src="includes/message_parser.php">
      <edit>
        <find>	function decode_message($custom_bbcode_uid = '', $update_this_message = true)</find>
        <inline-edit>
          <inline-find>, $update_this_message = true</inline-find>
          <inline-action type="after-add">, $unhide = true</inline-action>
        </inline-edit>
      </edit>
    </open>

Code: Select all

diff -wru /phpBB3/includes/message_parser.php /phpBB3-mod/includes/message_parser.php
--- /phpBB3/includes/message_parser.php	2013-12-05 13:57:00.000000000 +0100
+++ /phpBB3-mod/includes/message_parser.php	2013-12-05 13:37:37.000000000 +0100
@@ -1246,7 +1246,7 @@
 	/**
 	* Decode message to be placed back into form box
 	*/
-	function decode_message($custom_bbcode_uid = '', $update_this_message = true)
+	function decode_message($custom_bbcode_uid = '', $update_this_message = true, $unhide = true)
 	{
 		// If false, then the parsed message get returned but internal message not processed.
 		if (!$update_this_message)
Hope it helps :P .

Re: phpBB 3.1.1 Style Changes

Posted: Tue Nov 04, 2014 3:38 pm
by Lumpy Burgertushie
thanks, what does @@ -61,6 +61,10 @@ mean?


robert

Re: phpBB 3.1.1 Style Changes

Posted: Tue Nov 04, 2014 5:27 pm
by marcovo
Yeah that's a tricky one... The following is what I think is the case, it might be I'm wrong on some subtle points, but I guess it's pretty accurate.

I reckon the 61 is the line number of the first line thats shown, in this case include($phpbb_root_path . 'includes/mcp/mcp_reports.' . $phpEx); (*). The -61 refers to where this line was in the old file, the +61 refers to where it is in the new file. In this case, the position hasn't moved. However, if there was a patch in the same file before this one, which adds 1 line, then this line will (of course) move down 1 line, so it will become @@ -61,6 +62,10 @@. (See (**) for a clarifying example.)

Furthermore, I guess the 6 and 10 refer to the number of lines that are shown by the diff before and after editting, respectively. (There are 10 lines, of which 4 are flagged with a +, so there were 6 lines before the update.)

As far as I know, these numbers are mainly present to help a patch-program identify the correct piece of code, in case a piece of code is present multiple times in the same file.

*= It might be nice to know that when using the patch application, a notice may be shown if the lines that are to be patched are found in your file, but on a different line-number than mentioned in the diff-file. Especially in modded applications (phpBB 3.0) these notices are not uncommon. They don't mess up your upgrade (they're only notices), but they do remind you of the fact that the files have changed with respect to a clean installation.

**= Below I include an example showing a more complicated case. There are two patches here, in the same file. The first patch adds 8 lines, and as such the second patch gains an offset of 8, moving from line 1846 to line 1854.

Code: Select all

diff -wru /phpBB3/includes/functions_privmsgs.php /phpBB3-mod/includes/functions_privmsgs.php
--- /phpBB3/includes/functions_privmsgs.php	2013-12-05 13:57:00.000000000 +0100
+++ /phpBB3-mod/includes/functions_privmsgs.php	2013-12-20 13:16:15.000000000 +0100
@@ -1798,6 +1798,14 @@
 	$db->sql_transaction('commit');
 
 	// Send Notifications
+	
+	// BEGIN mobiquo Mod push service
+	if(file_exists($phpbb_root_path.(!empty($config['tapatalkdir']) ? $config['tapatalkdir'] : 'mobiquo').'/hook/functions_privmsgs_hook.php'))
+    {
+        include  $phpbb_root_path.(!empty($config['tapatalkdir']) ? $config['tapatalkdir'] : 'mobiquo').'/hook/functions_privmsgs_hook.php';
+    }
+	// END mobiquo Mod
+
 	if ($mode != 'edit')
 	{
 		pm_notification($mode, $data['from_username'], $recipients, $subject, $data['message'], $data['msg_id']);
@@ -1846,6 +1854,7 @@
 		if ($row['user_notify_pm'] == 1 && trim($row['user_email']))
 		{
 			$msg_list_ary[] = array(
+				'user_id'	=> $row['user_id'],
 				'method'	=> $row['user_notify_type'],
 				'email'		=> $row['user_email'],
 				'jabber'	=> $row['user_jabber'],

Re: phpBB 3.1.1 Style Changes

Posted: Tue Nov 04, 2014 11:20 pm
by dskloet
The fact that there is a diff for subsilver2 from 3.1 to 3.1.1 suggests that there is a subsilver2 for 3.1. But where do I find it? It's not included in phpBB3.1 and when I search on Google I only find subsilver2 for 3.0.x and a discussion about removing subsilver2 from 3.1. So what am I missing?

Re: phpBB 3.1.1 Style Changes

Posted: Tue Nov 04, 2014 11:33 pm
by bonelifer
dskloet wrote:The fact that there is a diff for subsilver2 from 3.1 to 3.1.1 suggests that there is a subsilver2 for 3.1. But where do I find it? It's not included in phpBB3.1 and when I search on Google I only find subsilver2 for 3.0.x and a discussion about removing subsilver2 from 3.1. So what am I missing?
https://download.phpbb.com/pub/release/ ... _3.1.0.zip

Re: phpBB 3.1.1 Style Changes

Posted: Wed Nov 05, 2014 8:08 am
by dskloet
Thanks bonelifer!

Re: phpBB 3.1.1 Style Changes

Posted: Wed Nov 05, 2014 8:24 pm
by mandrake88
Lumpy Burgertushie wrote:I bow to your superior knowledge about this but all the research I did yesterday pointed to .diff files being related to being used from git and that all related to unix stuff.
Git is a version control system, is not related to linux. It was initialy created by Linus Toldvars (the guy that created the linux kernel), but is not related at all with the linux operative system. Git is the most popular version control system and is used worldwide for all type of developers. Github, the "social network" for developers where phpBB proyect is hosted, use git, that's why he posted a gitt diff file generated from the proyect repository.

There are a lot of Git GUI for windows and mac.

Re: phpBB 3.1.1 Style Changes

Posted: Fri Nov 28, 2014 3:27 pm
by wilf_t
Just a styles code change text file would do just like we've had previously, I don't mind cutting and pasting Ive always done it this way

Re: phpBB 3.1.1 Style Changes

Posted: Wed Dec 03, 2014 4:24 am
by Stoker 4.0
No codechanges in a txt file sucks bigtime!
At the moment I dont have time to look into the use of this shit, sorry.

Re: phpBB 3.1.1 Style Changes

Posted: Wed Dec 03, 2014 7:27 am
by Peter77sx

Re: phpBB 3.1.1 Style Changes

Posted: Wed Dec 03, 2014 10:53 am
by Stoker 4.0
Peter77sx wrote:Stoker, maybe this can help https://area51.phpbb.com/code-changes/3 ... -prosilver
Thanks Peter, much better ;)

Re: phpBB 3.1.1 Style Changes

Posted: Wed Dec 03, 2014 3:34 pm
by Lumpy Burgertushie
I would swear that the other day I saw a post about the actual code changes from 3.0.12 to 3.0
however, I can't find it now. I see the article about creating styles but it is not very helpful for converting.

this would help a lot towards converting 3.0 styles over.

robert