[XenConcept] Hide BBCode

[XenConcept] Hide BBCode [Paid] 2.0.9 Patch 1

No permission to buy ($40.00)
Thank you, i wanted to ask a presale question, would it be possible to hide the content again after the user has unlocked it. Like if i update the thread with something new and hide it then i will want the user to like or comment again to view the updated hidden content of the thread. Is that possible?
 
Thank you, i wanted to ask a presale question, would it be possible to hide the content again after the user has unlocked it. Like if i update the thread with something new and hide it then i will want the user to like or comment again to view the updated hidden content of the thread. Is that possible?
Currently it is not possible to do so.

I will study your request
 
having issues;

PHP:
$posts = $db->fetchAll("SELECT post_id, message FROM xf_post WHERE post_id IN(" . $db->quote($firstPostIds) . ")");


            $db->beginTransaction();


            foreach ($posts AS $post)
            {
                $message = $post['message'];


                foreach ($this->getHideBbCodeRepo()->getLegacyHideBbCodes() AS $oldHide => $newHide)
                {
                    $regex = "#\[({$oldHide})[^\]]*\](.*)\[/\\1\]#siU";


                    $message = preg_replace_callback($regex, function ($matches) use ($oldHide, $newHide)
                    {
                        $fullBBCode = $matches[0];


                        if (in_array($oldHide, ['HIDE-THANKS', 'HIDETHANKS', 'HIDE-REPLY-THANKS', 'HIDEREPLYTHANKS']))
                        {
                            return "[{$newHide}=1]{$matches[2]}[/{$newHide}]";
                        }
                        else
                        {
                            return str_replace($oldHide, $newHide, $fullBBCode);
                        }


                    }, $message);
                }


                $db->update('xf_post', ['message' => $message], 'post_id = ?', [$post['post_id']]);
            }


            $db->commitAll();


this wont work well on a table with 10m posts.
 
Last edited:
having issues;

PHP:
$posts = $db->fetchAll("SELECT post_id, message FROM xf_post WHERE post_id IN(" . $db->quote($firstPostIds) . ")");


            $db->beginTransaction();


            foreach ($posts AS $post)
            {
                $message = $post['message'];


                foreach ($this->getHideBbCodeRepo()->getLegacyHideBbCodes() AS $oldHide => $newHide)
                {
                    $regex = "#\[({$oldHide})[^\]]*\](.*)\[/\\1\]#siU";


                    $message = preg_replace_callback($regex, function ($matches) use ($oldHide, $newHide)
                    {
                        $fullBBCode = $matches[0];


                        if (in_array($oldHide, ['HIDE-THANKS', 'HIDETHANKS', 'HIDE-REPLY-THANKS', 'HIDEREPLYTHANKS']))
                        {
                            return "[{$newHide}=1]{$matches[2]}[/{$newHide}]";
                        }
                        else
                        {
                            return str_replace($oldHide, $newHide, $fullBBCode);
                        }


                    }, $message);
                }


                $db->update('xf_post', ['message' => $message], 'post_id = ?', [$post['post_id']]);
            }


            $db->commitAll();


this wont work well on a table with 10m posts.
Hello,

I have contacted you privately
 
typo/phrasing error.

"You must be registered for see links"

phrase: xc_hide_links_from_guests_guests_error_hide_link​


changed to

You must be registered to see links.
 
Top Bottom