Open CristiOprea opened 9 years ago
Show me the URL of the thanks posts
The problem with thanks for post is still existing
A post link looks like that:
/post110010.html?thanks=110010&to_id=1212&from_id=534
That's my rewrite rule in Lighttpd which worked in phpbb 3.0
"^/post([0-9]+)\.html(\?(.*))?" => "/viewtopic.php?p=$1&$3",
The repository of this extension is here: Thanks for posts
I don't use Lighttpd but can you maybe use "^/post([0-9]+)\.html(?:\?(.*))?" => "/viewtopic.php?p=$1&$2",
I dislike to create RegEx groups that are not used. ;)
@cYbercOsmOnauT Thank you for your answer. JFYI
? (question) - match zero or one of the previous symbol
Anyway, the problem doesn't lie in the rewrite rule. There is something with parameter handling in the usu-class
(?:something) <- machtes a group of characters without creating a groupnumber ;) I just wanted to optimize your RegEx
A for me working variant with phpbb 3.1.8 and Thanks for Posts from 16.01.2016 and usu from 9.08.2015:
In /ext/phpbbseo/usu/event/listener.php
look for
if ($post_id && !$view && !$this->core->set_do_redir_post())
replace with
// Thanks for Posts extension
$to_id = request_var('to_id', 0);
$thanks = request_var('thanks', 0);
$rthanks = request_var('rthanks', 0);
// if ($post_id && !$view && !$this->core->set_do_redir_post())
if (($rthanks || $thanks || $post_id) && !$view && $this->core->set_do_redir_post())
// Thanks for Posts extension
Then look for
'hilit' => array('val' => (($highlight_match) ? $highlight : ''), 'keep' => !empty($highlight_match)),
And add after
// Thanks for Posts extension
'rthanks' => array('val' => $rthanks, 'keep' => $rthanks),
'to_id' => array('val' => $to_id, 'keep' => $to_id),
'thanks' => array('val' => $thanks, 'keep' => $thanks),
// Thanks for Posts extension
then look for $this->core->zero_dupe();
and replace with
// Thanks for Posts extension
// $this->core->zero_dupe();
if (!$to_id && !$thanks && !$rthanks) {
$this->core->zero_dupe();
}
// Thanks for Posts extension
Clean your cache and then it should work. Maybe a more talented one prepares a commit for the repository.
I have installed ext thanks for posts and Seo URL MOD on phpbb 3.1.x . When giving the thanksgiving redirects me back to the message and I do not appear as I pleased