News: TinyPortal Release Schedule. Please read this update for More Info.

Login  |  Register
HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

October 16, 2019, 09:38:16 AM

Login with username, password and session length

Recent

Members
  • Total Members: 3756
  • Latest: Ocean
Stats
  • Total Posts: 189087
  • Total Topics: 20763
  • Online Today: 57
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 1
Guests: 39
Total: 40

Author Topic: TP 1.0 on SMF 2.0.7  (Read 16059 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Doena

  • Jr. Member
  • **
  • Posts: 5
TP 1.0 on SMF 2.0.7
« on: January 25, 2014, 11:36:35 AM »
Hi,

I just set up a new SMF 2.0.7

When I try to install TP 1.0 I get a test error in

Code: [Select]
/sources/querystring.php Test Failed
Why? Because it's looking for this:

Code: [Select]
// Let's do something special for session ids!
if (defined('SID') && SID != '')
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?(?:' . SID . '(?:;|&|&))((?:board|topic)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html?' . SID . '\$2\"'", $buffer);
else
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html\$2\"'", $buffer);

to be replaced with this

Code: [Select]
// Let's do something special for session ids!
if (defined('SID') && SID != '')
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?(?:' . SID . '(?:;|&|&))((?:board|topic|page|cat)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html?' . SID . '\$2\"'", $buffer);
else
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?((?:board|topic|page|cat)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html\$2\"'", $buffer);

The difference here seems to be the

Code: [Select]
|page|cat
in both lines

Problem is, in 2.0.7 the code in question looks like this

Code: [Select]
// Let's do something special for session ids!
if (defined('SID') && SID != '')
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?(?:' . SID . '(?:;|&|&))((?:board|topic)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html?' . SID . '\$2\"'", $buffer);
else
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html\$2\"'", $buffer);

I manually replaced it with this

Code: [Select]
// Let's do something special for session ids!
if (defined('SID') && SID != '')
$buffer = preg_replace_callback('~"' . preg_quote($scripturl, '/') . '\?(?:' . SID . '(?:;|&|&))((?:board|topic|page|cat)=[^#"]+?)(#[^"]*?)?"~', create_function('$m', 'global $scripturl; return \'"\' . $scripturl . "/" . strtr("$m[1]", \'&;=\', \'//,\') . ".html?" . SID . (isset($m[2]) ? $m[2] : "") . \'"\';'), $buffer);
else
$buffer = preg_replace_callback('~"' . preg_quote($scripturl, '/') . '\?((?:board|topic|page|cat)=[^#"]+?)(#[^"]*?)?"~', create_function('$m', 'global $scripturl; return \'"\' . $scripturl . "/" . strtr("$m[1]", \'&;=\', \'//,\') . ".html" . (isset($m[2]) ? $m[2] : "") . \'"\';'), $buffer);

This should be correct, shouldn't it?
« Last Edit: January 25, 2014, 01:12:24 PM by DJ Doena »

Offline IchBin™

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: TP 1.0 on SMF 2.0.7
« Reply #1 on: January 25, 2014, 12:53:26 PM »
I was wondering if this patch was going to make problems with the TP install. I'll have to take a look at the changes SMF has made to see what is happening.

From a quick look at your code, you are missing the page|cat parts that TP adds.

Offline DJ Doena

  • Jr. Member
  • **
  • Posts: 5
Re: TP 1.0 on SMF 2.0.7
« Reply #2 on: January 25, 2014, 01:13:10 PM »
From a quick look at your code, you are missing the page|cat parts that TP adds.

Err, yeah. I have them in the actual code. I just forgot them in the posting above. I've modified it now.

Offline lurkalot

  • Administrator
  • *
  • Posts: 6290
    • Camera Craniums
Re: TP 1.0 on SMF 2.0.7
« Reply #3 on: January 25, 2014, 02:22:16 PM »
@ DJ Doena

Just curious.  Was this a completely new install of SMF 2.0.7 ?  Or SMF upgraded using the 2.0.6 - 2.0.7 patch?

Offline DJ Doena

  • Jr. Member
  • **
  • Posts: 5
Re: TP 1.0 on SMF 2.0.7
« Reply #4 on: January 25, 2014, 02:35:09 PM »
@ DJ Doena

Just curious.  Was this a completely new install of SMF 2.0.7 ?  Or SMF upgraded using the 2.0.6 - 2.0.7 patch?

OK, "completely new" may have been an exaggeration. I upgraded from 1.1.19 to 2.0.7, removed all old themes and add-ons and then added TP 1.0 as the first add-on.

Offline IchBin™

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: TP 1.0 on SMF 2.0.7
« Reply #5 on: January 25, 2014, 02:50:00 PM »
You can replace the section in the install.xml file with this to finish the install if you'd like. With the changes they added in 2.0.7 it makes it so TP can't install in a new install. Looks like we need to push out a new version faster than planned.

Code: [Select]
<file name="$sourcedir/QueryString.php">
<operation>
<search position="replace"><![CDATA['\?(?:' . SID . '(?:;|&|&amp;))((?:board|topic)=[^#"]+?)(#[^"]*?)?"~']]></search>
<add><![CDATA['\?(?:' . SID . '(?:;|&|&amp;))((?:board|topic|page|cat)=[^#"]+?)(#[^"]*?)?"~']]></add>
</operation>
<operation>
<search position="replace"><![CDATA['\?((?:board|topic)=[^#"]+?)(#[^"]*?)?"~']]></search>
<add><![CDATA['\?((?:board|topic|page|cat)=[^#"]+?)(#[^"]*?)?"~']]></add>
</operation>
</file>

Offline lurkalot

  • Administrator
  • *
  • Posts: 6290
    • Camera Craniums
Re: TP 1.0 on SMF 2.0.7
« Reply #6 on: January 25, 2014, 02:54:04 PM »
Thanks for the reply.  I was just testing this on a new install a couple minutes ago.
 
Brad.  Annoyingly, they fixed the 2.0.7 patch so it will install when Tinyportal is already installed. (Which it does nicely) 

But after applying the 2.0.7 patch you can't uninstall Tinyportal without getting a test failed. The patch has to then be uninstalled before you can uninstall Tinyportal

Offline IchBin™

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: TP 1.0 on SMF 2.0.7
« Reply #7 on: January 25, 2014, 02:58:09 PM »
Ouch, I didn't even think about that. And the next TP version is going to require people to uninstall too. Since I added all the new hooks into the TP install, it now doesn't require a lot of the file edits. Which means people have to uninstall TP 1.0 to remove the code before they can install TP 1.1.....

Well, I guess this means we'll just have to try to tell people in advance and hopefully they won't have a big problem with it.

Offline lurkalot

  • Administrator
  • *
  • Posts: 6290
    • Camera Craniums
Re: TP 1.0 on SMF 2.0.7
« Reply #8 on: January 25, 2014, 03:03:47 PM »
I know they tried to make the patch play nicely with Tinyportal, and SP, I'm guessing they will have the same problem uninstalling SP.

Offline ZarPrime

  • Friends
  • *
  • Posts: 4653
Re: TP 1.0 on SMF 2.0.7
« Reply #9 on: January 25, 2014, 03:18:30 PM »
Yeah, ouch.  I hope we don't run into something similar when they release 2.1 to beta. :tickedoff:

ZarPrime