Blockgets with other extensions


Avatar de Usuario
Leinad4Mind
 
Mensajes: 213
Registrado: Jue Oct 15, 2015 10:10 pm
 Jue Jul 22, 2021 8:23 pm • a través de Web
IvanPF escribió: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:
Código: Seleccionar todo
$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.
Código: Seleccionar todo
      $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
Avatar de Usuario
IvanPF
Administrador
 
Mensajes: 2029
Registrado: Vie Jun 17, 2011 12:15 am
Ubicación: España (Spain)
 Vie Jul 23, 2021 11:09 am • a través de 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?
Avatar de Usuario
Leinad4Mind
 
Mensajes: 213
Registrado: Jue Oct 15, 2015 10:10 pm
 Dom Jul 25, 2021 10:47 am • a través de Web
IvanPF escribió:
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.
Última edición por Leinad4Mind el Sab Ago 28, 2021 7:48 pm, editado 1 vez en total
Avatar de Usuario
Leinad4Mind
 
Mensajes: 213
Registrado: Jue Oct 15, 2015 10:10 pm
 Lun Jul 26, 2021 8:53 pm • a través de 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:

Imagen

Before the update, ctrl+f5 solved the issue, but now, there is no way to the recent topics to appear.
Avatar de Usuario
IvanPF
Administrador
 
Mensajes: 2029
Registrado: Vie Jun 17, 2011 12:15 am
Ubicación: España (Spain)
 Lun Jul 26, 2021 9:21 pm • a través de Web
Leinad4Mind escribió: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:

Imagen

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


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
Avatar de Usuario
Leinad4Mind
 
Mensajes: 213
Registrado: Jue Oct 15, 2015 10:10 pm
 Lun Jul 26, 2021 9:36 pm • a través de 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.
Última edición por Leinad4Mind el Jue Jul 29, 2021 4:01 pm, editado 1 vez en total
Avatar de Usuario
IvanPF
Administrador
 
Mensajes: 2029
Registrado: Vie Jun 17, 2011 12:15 am
Ubicación: España (Spain)
 Sab Jul 31, 2021 8:30 am • a través de 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
Avatar de Usuario
Leinad4Mind
 
Mensajes: 213
Registrado: Jue Oct 15, 2015 10:10 pm
 Sab Jul 31, 2021 10:50 am • a través de 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.
Avatar de Usuario
Leinad4Mind
 
Mensajes: 213
Registrado: Jue Oct 15, 2015 10:10 pm
 Sab Jul 31, 2021 1:38 pm • a través de 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:
Código: Seleccionar todo
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
Código: Seleccionar todo
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
Código: Seleccionar todo
if($this->auth->acl_get('f_read', $forum_id))

With:
Código: Seleccionar todo
if($this->auth->acl_get('f_read', $forum_id) && $this->auth->acl_get('f_read_others_topics_brunoais', $forum_id))
Avatar de Usuario
IvanPF
Administrador
 
Mensajes: 2029
Registrado: Vie Jun 17, 2011 12:15 am
Ubicación: España (Spain)
 Lun Ago 02, 2021 10:07 am • a través de 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?
Anterior Siguiente

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 0 invitados