phpBB 3.1.1 Style Changes

For support and discussion related to templates, themes, and imagesets in phpBB 3.1.
Scam Warning
marcovo
Registered User
Posts: 239
Joined: Fri Nov 16, 2012 12:19 pm
Location: The Netherlands
Name: Marco

Re: phpBB 3.1.1 Style Changes

Post by marcovo » Tue Nov 04, 2014 12:19 pm

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 .

User avatar
Lumpy Burgertushie
Registered User
Posts: 64862
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: phpBB 3.1.1 Style Changes

Post by Lumpy Burgertushie » Tue Nov 04, 2014 3:38 pm

thanks, what does @@ -61,6 +61,10 @@ mean?


robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

marcovo
Registered User
Posts: 239
Joined: Fri Nov 16, 2012 12:19 pm
Location: The Netherlands
Name: Marco

Re: phpBB 3.1.1 Style Changes

Post by marcovo » Tue Nov 04, 2014 5:27 pm

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'],

dskloet
Registered User
Posts: 20
Joined: Thu Dec 23, 2004 8:26 pm

Re: phpBB 3.1.1 Style Changes

Post by dskloet » Tue Nov 04, 2014 11:20 pm

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?

User avatar
bonelifer
Community Team Member
Community Team Member
Posts: 3394
Joined: Wed Oct 27, 2004 11:35 pm
Name: William
Contact:

Re: phpBB 3.1.1 Style Changes

Post by bonelifer » Tue Nov 04, 2014 11:33 pm

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
Knowledge Base | phpBB Board Rules | Search Customisation Database
Image
Please don't contact me via PM or email for phpBB support .

dskloet
Registered User
Posts: 20
Joined: Thu Dec 23, 2004 8:26 pm

Re: phpBB 3.1.1 Style Changes

Post by dskloet » Wed Nov 05, 2014 8:08 am

Thanks bonelifer!

mandrake88
Registered User
Posts: 91
Joined: Tue Jun 03, 2008 3:21 pm

Re: phpBB 3.1.1 Style Changes

Post by mandrake88 » Wed Nov 05, 2014 8:24 pm

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.

wilf_t
Registered User
Posts: 14
Joined: Wed Nov 05, 2014 3:44 pm

Re: phpBB 3.1.1 Style Changes

Post by wilf_t » Fri Nov 28, 2014 3:27 pm

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

User avatar
Stoker 4.0
Registered User
Posts: 1480
Joined: Sun Feb 13, 2011 1:33 pm
Location: Funen, Denmark
Name: Ulrik Christensen
Contact:

Re: phpBB 3.1.1 Style Changes

Post by Stoker 4.0 » Wed Dec 03, 2014 4:24 am

No codechanges in a txt file sucks bigtime!
At the moment I dont have time to look into the use of this shit, sorry.

Peter77sx
Registered User
Posts: 3249
Joined: Wed Nov 09, 2005 2:51 pm

Re: phpBB 3.1.1 Style Changes

Post by Peter77sx » Wed Dec 03, 2014 7:27 am


User avatar
Stoker 4.0
Registered User
Posts: 1480
Joined: Sun Feb 13, 2011 1:33 pm
Location: Funen, Denmark
Name: Ulrik Christensen
Contact:

Re: phpBB 3.1.1 Style Changes

Post by Stoker 4.0 » Wed Dec 03, 2014 10:53 am

Peter77sx wrote:Stoker, maybe this can help https://area51.phpbb.com/code-changes/3 ... -prosilver
Thanks Peter, much better ;)

User avatar
Lumpy Burgertushie
Registered User
Posts: 64862
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: phpBB 3.1.1 Style Changes

Post by Lumpy Burgertushie » Wed Dec 03, 2014 3:34 pm

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
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

Locked

Return to “[3.1.x] Styles Support & Discussion”

Who is online

Users browsing this forum: No registered users and 4 guests