News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Avatars on Board and/or MessageIndex

Started by Pipke, April 05, 2016, 06:27:00 PM

Previous topic - Next topic

aegersz

That's a little better.

it only happens every time I select the "Forum" app/button to view all the boards from my Simple portal front-end ... it then generates the 2 errors.

It's not a big deal and I can live with it so don't waste too much of your time on it.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

I think that has worked as I get no more new errors.

Thanks for your help.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Pipke

Quote from: aegersz on May 10, 2021, 06:43:53 PM
I think that has worked as I get no more new errors.

Thanks for your help.

"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

aegersz

Oh no ! for some reason, the same problem has come back again every time i select "Forum" from Simple Portal.

Any more thoughts on this odd issue ?
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

#224
here is a clue: it only happens when a post on a child of a child board has a date of Today or Yesterday and only when starting at the forum's root board (as you do when selecting "Forum").

Apart from that same couple of errors, it works properly.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Pipke

Quote from: aegersz on May 03, 2021, 05:10:25 AM
Getting lots of these errors in 2.0.17 and the latest version of this mod

8: Undefined index: time
File: /var/www/html/Sources/abm_code.php
Line: 353


8: Undefined offset: 32
File: /var/www/html/Sources/abm_code.php
Line: 348


The mod is working fine though. Any ideas ?

does it still generate these two errors, or only one of it?
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

aegersz

It generates both at a time.

I cannot reproduce it on a fresh test system with a few mods but on my "fully moded" systems, it doesn't matter how may posts fit the criteria I mentioned before, only two messages occur at a time.

I don't want to waste your time but if you can think of something easy then that's great.

Remember that I have over 150 mods on so it could be anything really (and not your logic) !

I have been dumping variables to the log but I either get too much data back in the form of huge arrays or very little.

Damn php, it's a tricky language for me.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

#227
Can you think of any mods that would interact with your fabulous mod ?

So far I have tried:

1. SimplePortal 2.3.6 Uninstall ]
2. Global Topics 2.2 Uninstall ]
3. Avatars on Board/MessageIndex 2.0.17 Uninstall ]
4. DevCenter 0.4.1 Uninstall ]
5. Tidy Child Boards 2.0 Uninstall ]
6. SA Chat 1.0b1 Rev120 Uninstall ]
7. EmailValidator 1.1 Uninstall ]
8. Topic Rating Bar 1.4.1 Uninstall ]


Check my signature for the full list of mods that I run, if you wish ...

I have attached the errors in more detail:
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Pipke

try this:
Code (find) Select

$context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['time'] = $context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['time'].'</div><p><!---->';


Code (replace by) Select

if (isset($context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['time']))
$context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['time'] = $context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['time'].'</div><p><!---->';


"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

aegersz

#229
Thanks Pipke,

That got rid of one of the errors but this one still persists:

https://forum.drugs-and-users.org/index.php?8: Undefined offset: 31 File: /var/www/html/Sources/abm_code.php
Line: 350


The offset 31 is the parent and first-level child board, as you probably already know. So I made the following code change to get rid of this:

Find:
                                                if ($context['abm_avatars_value'][$row['id_board']]['last_id_member']) //member
                                                        $context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['member']['link'] = 'abm<!----></p><div style="padding-left: '. $abm_avatar_size.'px; position: relative;"><a href="' . $scripturl . '?action=profile;u=' . $context['abm_avatars_value'][$row['id_board']]['last_id_member'] . '"><img class="abm_avatar_board" alt="abm_id='.$context['abm_avatars_value'][$row['id_board']]['last_id_member'].'" /></a><b>'. $txt['last_post']. '</b>  '. $txt['by']. ' '.$context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['member']['link'];
                                                else //guest or deleted account
                                                        $context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['member']['link'] = 'abm<!----></p><div style="padding-left: '. $abm_avatar_size.'px; position: relative;"><img class="abm_avatar_board" alt="abm_id='.$context['abm_avatars_value'][$row['id_board']]['last_id_member'].'" /><b>'. $txt['last_post']. '</b>  '. $txt['by']. ' '.$context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['member']['link'];


Replace with:
                                                if ($context['abm_avatars_value'][$row['id_board']]['last_id_member']) //member
                                                        if (isset($context['categories'][$row['id_cat']]['boards'][$row['id_parent']]))
                                                                $context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['member']['link'] = 'abm<!----></p><div style="padding-left: '. $abm_avatar_size.'px; position: relative;"><a href="' . $scripturl . '?action=profile;u=' . $context['abm_avatars_value'][$row['id_board']]['last_id_member'] . '"><img class="abm_avatar_board" alt="abm_id='.$context['abm_avatars_value'][$row['id_board']]['last_id_member'].'" /></a><b>'. $txt['last_post']. '</b>  '. $txt['by']. ' '.$context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['member']['link'];
                                                else //guest or deleted account
                                                        if (isset($context['categories'][$row['id_cat']]['boards'][$row['id_parent']]))
                                                                $context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['member']['link'] = 'abm<!----></p><div style="padding-left: '. $abm_avatar_size.'px; position: relative;"><img class="abm_avatar_board" alt="abm_id='.$context['abm_avatars_value'][$row['id_board']]['last_id_member'].'" /><b>'. $txt['last_post']. '</b>  '. $txt['by']. ' '.$context['categories'][$row['id_cat']]['boards'][$row['id_parent']]['last_post']['member']['link'];


I was able to adapt your fix logic to the above. The only side effect of this odd error with my system is that there is no avatar displayed on the parent board for the most recent entry on it's child's child board - which is no problem as SMF vanilla (with your mod) doesn't even display the details of it at all.

We are done finally. Thanks again for your guidance.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

#230
This is what I mean ... as I said, my "vanilla" SMF 2.0.18 system with your mod doesn't even show the item i have circled, so i guess that it's a bonus  :).

The parent of the child of the child board is rectangled and it's contents are in the second attachment.

Both refer to the latest post in the "Cautions" board.

I know that this is not your bad logic as I have a bug in my "boards" logic and have had it for a for a fair while -  I had an empty board somehow (?)
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

BTW, I made a 2.0.18 version to incorporate all these fixes if you are interested ...
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Pipke

Quote from: aegersz on June 11, 2021, 04:45:32 AM
BTW, I made a 2.0.18 version to incorporate all these fixes if you are interested ...

no thanks for the offer, then you would have to make a change for every 'own setup change' and that is not an option
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

aegersz

Quote from: Pipke on June 11, 2021, 02:21:36 PM
Quote from: aegersz on June 11, 2021, 04:45:32 AM
BTW, I made a 2.0.18 version to incorporate all these fixes if you are interested ...

no thanks for the offer, then you would have to make a change for every 'own setup change' and that is not an option

Fair enough.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Advertisement: