Blockgets with other extensions


User avatar
Leinad4Mind
 
Posts: 184
Joined: Thu Oct 15, 2015 10:10 pm
 Thu Jul 22, 2021 8:23 pm • via Web
IvanPF wrote:I'm working on the next version of the extension.

Found out another problem. The HotTopic block shows topics where people doesn't have permissions.

You mean the "top_topics" block?
I have reviewed it, but I do not find any problem with the permissions. Everything seems to work fine

The Login Block doesnt work with BBOauth extension.

I need the extension to test. Can you send it to me?


About top topics:
I do use https://github.com/brunoais/readOthersTopics extension, so maybe the topics I talked about where in a forum where I use that extension.

About BBOauth, I've sent you already.


Another question. I've modified a little the gallery block (Load the images from posts) to support phpBB Gallery extension:
Code: Select all
$sql = 'SELECT DISTINCT p.post_id, p.forum_id, p.topic_id, p.post_text, p.post_subject
               FROM ' . POSTS_TABLE . ' p
               WHERE (' . implode(' OR ', $sql_where) . ")
               AND p.bbcode_uid <> ''
               AND p.post_text " . $this->db->sql_like_expression($this->db->get_any_char() . '[album]' . $this->db->get_any_char()) . '
               ORDER BY p.post_time DESC';
            $result = $this->db->sql_query_limit($sql, $data['max_number']);

            while($row = $this->db->sql_fetchrow($result))
            {
               preg_match_all('#<ALBUM content="(.*?)">#i', $row['post_text'], $matches, PREG_SET_ORDER);

               foreach($matches as $match)
               {
                  $images[] = array(
                     'ACTION'   => '/forum/viewtopic.php?f='.$row['forum_id'].'&t='. $row['topic_id'],
                     'SRC'      => '/forum/gallery/image/'.$match[1].'/source',
                     'TITLE'      =>  $row['post_subject'],
                  );
               }
            }
            $this->db->sql_freeresult($result);


The thing is. I am using BBPrefix, and I wanted to grab the prefixes I've to then add a css ribbon on each image with the prefixes concat as text.
Code: Select all
      $sql = 'SELECT DISTINCT p.post_id, p.forum_id, p.topic_id, p.post_text, p.post_subject, b.name
               FROM ' . POSTS_TABLE . ' p, phpbb_bbprefix b, phpbb_bbprefix_instances i
               WHERE (' . implode(' OR ', $sql_where) . ")
               AND i.topic = p.topic_id
               AND b.id = i.prefix
               AND p.bbcode_uid <> ''
               AND p.post_text " . $this->db->sql_like_expression($this->db->get_any_char() . '[album]' . $this->db->get_any_char()) . '
               ORDER BY p.post_time DESC';
            $result = $this->db->sql_query_limit($sql, $data['max_number']);

            while($row = $this->db->sql_fetchrow($result))
            {
               preg_match_all('#<ALBUM content="(.*?)">#i', $row['post_text'], $matches, PREG_SET_ORDER);

               foreach($matches as $match)
               {
                  $images[] = array(
                     'ACTION'   => '/forum/viewtopic.php?f='.$row['forum_id'].'&t='. $row['topic_id'],
                     'SRC'      => '/forum/gallery/image/'.$match[1].'/source',
                     'TITLE'   =>  $row['post_subject'],
                     'RIBBON'   =>  $row['name'],
                  );
               }
            }
            $this->db->sql_freeresult($result);


I came up with this, but the sql I wrote outputs duplicates images, because of the multiple prefixes... how can I join all duplicates prefixes name (b.name)? Is it possible via sql?

best regards
User avatar
IvanPF
Site Admin
 
Posts: 1865
Joined: Fri Jun 17, 2011 12:15 am
Location: España (Spain)
 Fri Jul 23, 2021 11:09 am • via Web
I came up with this, but the sql I wrote outputs duplicates images, because of the multiple prefixes... how can I join all duplicates prefixes name (b.name)? Is it possible via sql?

To get all the prefixes for each topic, you will have to do two sql queries, one to get the posts info and topic ids and another for the prefixes. I had given you an answer using the functions of the bbprefix extension, but I realized that it did not work well, and I deleted it.
One question:
RIBBON, what format should it have? A string with all the prefixes joined or do you need it to be an array to use it in the style?
User avatar
Leinad4Mind
 
Posts: 184
Joined: Thu Oct 15, 2015 10:10 pm
 Sun Jul 25, 2021 10:47 am • via Web
IvanPF wrote:
I came up with this, but the sql I wrote outputs duplicates images, because of the multiple prefixes... how can I join all duplicates prefixes name (b.name)? Is it possible via sql?

To get all the prefixes for each topic, you will have to do two sql queries, one to get the posts info and topic ids and another for the prefixes. I had given you an answer using the functions of the bbprefix extension, but I realized that it did not work well, and I deleted it.
One question:
RIBBON, what format should it have? A string with all the prefixes joined or do you need it to be an array to use it in the style?


A string with all the prefixes joined.
EDIT: In fact, since it can be in some cases very big... let make an array instead, that way the frontend will have more power to style it.
Last edited by Leinad4Mind on Sat Aug 28, 2021 7:48 pm, edited 1 time in total.
User avatar
Leinad4Mind
 
Posts: 184
Joined: Thu Oct 15, 2015 10:10 pm
 Mon Jul 26, 2021 8:53 pm • via Web
Thank you for the new 2.0.3 version. A lot of improvements were made. Very appreciated.

But I do now have issues with javascript... with flatboots after updating. If I disable the Recent Topics, I only have 1 little JS bug on console (the 1st one of the img below). But if I enable it with at least 2 sections, then cbbTabs kicks in and it bugs out too:

Image

Before the update, ctrl+f5 solved the issue, but now, there is no way to the recent topics to appear.
User avatar
IvanPF
Site Admin
 
Posts: 1865
Joined: Fri Jun 17, 2011 12:15 am
Location: España (Spain)
 Mon Jul 26, 2021 9:21 pm • via Web
Leinad4Mind wrote:Thank you for the new 2.0.3 version. A lot of improvements were made. Very appreciated.

But I do now have issues with javascript... with flatboots after updating. If I disable the Recent Topics, I only have 1 little JS bug on console (the 1st one of the img below). But if I enable it with at least 2 sections, then cbbTabs kicks in and it bugs out too:

Image

Before the update, ctrl+f5 solved the issue, but now, there is no way to the recent topics to appear.

I tested the extension with phpBB 3.3.4 + FLATBOOT 3.3.0 and it does not give me any error and the tabs work fine.
Anotación 2021-07-26 231247.png
Anotación 2021-07-26 231247.png (148.25 KB) Viewed 299 times


The Sitesplat styles used an obsolete library called "headjs" which causes many errors when a javascript file depends on another (as is the case) since it does not always load them correctly (that's why hitting ctrl + f5 sometimes works for you and sometimes not).
With the current version I have not been able to replicate that error. It may be caused by something in your forum (or another extension). It's hard to know.

Make sure you are using the latest version of the FLATBOOTS adaptation (which I suppose so) and that you use the updated "core" of the latest version
User avatar
Leinad4Mind
 
Posts: 184
Joined: Thu Oct 15, 2015 10:10 pm
 Mon Jul 26, 2021 9:36 pm • via Web
I'll do more tests on my side. Thanks again.

Btw, what happened to chat_addon.php ?

EDIT: I still can't login with 2StepAuthentication on the portal login block

EDIT2: And BBPreview is not compatible either. I am able to make it almost to work. But the js from BBPreview is looking for a data id: var topicid = $(this).data('id');
And since it can't find it, since blockgets doesnt add that info, it doesnt open the topic information inside the modal.
Last edited by Leinad4Mind on Thu Jul 29, 2021 4:01 pm, edited 1 time in total.
User avatar
IvanPF
Site Admin
 
Posts: 1865
Joined: Fri Jun 17, 2011 12:15 am
Location: España (Spain)
 Sat Jul 31, 2021 8:30 am • via Web
Btw, what happened to chat_addon.php ?

The chat addon has not undergone changes, it remains the same
store/cbb-blockgets-addon-cbb-chat

EDIT: I still can't login with 2StepAuthentication on the portal login block
EDIT2: And BBPreview is not compatible either. I am able to make it almost to work. But the js from BBPreview is looking for a data id: var topicid = $(this).data('id');
And since it can't find it, since blockgets doesnt add that info, it doesnt open the topic information inside the modal.

I will do tests with those extensions to see if it is possible to improve compatibility
User avatar
Leinad4Mind
 
Posts: 184
Joined: Thu Oct 15, 2015 10:10 pm
 Sat Jul 31, 2021 10:50 am • via Web
Thanks, for some reason I wasnt able to find the addon page

I found out the issues I was having. Since I've a slightly modified version, I always do a diff version. I didnt do a proper diff this time, I miss 1 cbbcore.js, so the cbbTabs wasnt available on mine. I recheck all files, and now all runs smoothly and without problems.

And thanks again for taking care of compatibilities. Very appreciated.
User avatar
Leinad4Mind
 
Posts: 184
Joined: Thu Oct 15, 2015 10:10 pm
 Sat Jul 31, 2021 1:38 pm • via Web
On the Topic Index Block, with Flatboots, the Next button on pagination doesn't work. And on simple mode the bbemojis aren't parsed.

Something that I miss on topic index is a field on ACP where I could strip content inside [] {} (), the same as this ext do: https://www.phpbb.com/customise/db/exte ... pic_index/

And on the all blocks, the "Show parent forum" doesnt seem to do anything.

EDIT: I was able to solve the "strip content inside [] {} ()"

For those who want to do this, open canidev/blockgets/blocks/topic_index_block and find:
Code: Select all
case 'topic_title':
            if($first_char)
            {
               $sql_array['WHERE'] .= ' AND t.topic_title ' . $this->db->sql_like_expression(substr($first_char, 0, 1) . $this->db->get_any_char());
            }


Replace with
Code: Select all
if($first_char)
            {
               $sql_array['WHERE'] .= ' AND t.topic_title ' . $this->db->sql_like_expression('[' . $this->db->get_any_char() . '] ' . substr($first_char, 0, 1) . $this->db->get_any_char());
            }
            else {
               $sql_array['WHERE'] .= ' AND t.topic_title ' . $this->db->sql_like_expression('[' . $this->db->get_any_char() . '] ' . $this->db->get_any_char());
            }


This will strip only the [ ] tags, but it's enough for me.

EDIT2: About the permissions problem, I confirm, it was caused by the extension "readOthersTopics"

What I did to solve was to Replace
Code: Select all
if($this->auth->acl_get('f_read', $forum_id))

With:
Code: Select all
if($this->auth->acl_get('f_read', $forum_id) && $this->auth->acl_get('f_read_others_topics_brunoais', $forum_id))
User avatar
IvanPF
Site Admin
 
Posts: 1865
Joined: Fri Jun 17, 2011 12:15 am
Location: España (Spain)
 Mon Aug 02, 2021 10:07 am • via Web
EDIT2: And BBPreview is not compatible either. I am able to make it almost to work. But the js from BBPreview is looking for a data id: var topicid = $(this).data('id');
And since it can't find it, since blockgets doesnt add that info, it doesnt open the topic information inside the modal.

I thought it had that extension but the one I have is "bblivepreview". Can you send me bbpreview for testing?
PreviousNext

Who is online

Users browsing this forum: No registered users and 1 guest

cron