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

Kindred

That is not the default/Curve theme...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Pipke

#121
Quote from: Argon3000 on February 14, 2017, 07:09:02 AM
Quote from: Pipke on February 13, 2017, 02:20:29 PM
...last column is setup different then its default, ...., this way i can watch how it is setup in the last columns elements.

Theme - default.
In advance thank you.


Ok i have inspected the code without the mod it seems that it is the same as the deffault theme also i have installed the russian language pack to see if it has todo with that but no and i cannot figure out why the avatars are not showing, did you turned on the checkbox setting "Show avatar of last poster on the BoardIndex" it must be turned on?
Maybe it could be have someting todo with the pretty urls mod? Sorry i dont have any clue how to solve this at the moment, can you post or attach your index.template.php file.
"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! ☕

Argon3000

Quote from: Pipke on February 14, 2017, 10:13:59 AM
Quote from: Argon3000 on February 14, 2017, 07:09:02 AM
Quote from: Pipke on February 13, 2017, 02:20:29 PM
...last column is setup different then its default, ...., this way i can watch how it is setup in the last columns elements.

Theme - default.
In advance thank you.

Maybe it could be have someting todo with the pretty urls mod? Sorry i dont have any clue how to solve this at the moment, can you post or attach your index.template.php file.

index.template.php
SMF 2.0.15, PortaMx-SEF 1.54

Pipke

sorry i dont need the index.template.php my fault  :-\  but the boardindex.template.php
"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! ☕

Argon3000

Quote from: Pipke on February 14, 2017, 01:56:19 PM
sorry i dont need the index.template.php my fault  :-\  but the boardindex.template.php

OK. BoardIndex.template.php
SMF 2.0.15, PortaMx-SEF 1.54

Rosss

Hello. Thanks so much for the mod, and also for keeping this thread alive to help us newbs :).

So I am having a problem, hxxp:prntscr.com/e92gsc [nonactive]

It works for like 10%, or if you newly post something. The profile id's are off on the broken image ones i click, which i believe is the problem.

Now, this forum was just migrated to SMF though i'm not sure if that is the reason it is messing up, because all the "posted by" links and stuff work to the correct profile.

Thanks for any input!

Pipke

Quote from: Argon3000 on February 14, 2017, 06:52:18 PM
Quote from: Pipke on February 14, 2017, 01:56:19 PM
sorry i dont need the index.template.php my fault  :-\  but the boardindex.template.php

OK. BoardIndex.template.php

I dont see problems on the boardindex.template file, last try can be to look at the BoardIndex.php file in Sources folder can you attach that file.
"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! ☕

Pipke

@ Rosss can you post your forum url with mod installed so i can take a look and maybe solve it for you.
"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! ☕

Argon3000

Quote from: Pipke on February 15, 2017, 02:55:40 PM
I dont see problems on the boardindex.template file, last try can be to look at the BoardIndex.php file in Sources folder can you attach that file.

ОК.
SMF 2.0.15, PortaMx-SEF 1.54

Pipke

@Argon3000
On BoardIndex.php i cant find any wrong things? very weird.

ok install the mod then see if the checkbox of the setting "Show avatar of last poster on the BoardIndex" is turned on, it must be turned on, then go to your BoardIndex.template.php and find around line 86:


echo '
<div id="boardindex_table">


then add above it:

echo'<pre>';
print_r($context['categories']);
echo'</pre>';


then reload boardindex page you will see an array, can you post that complete array here between bbc code tags.

you must see something like this:


Array
(
    [1] => Array
        (
            [id] => 1
            [name] => General Category
            [is_collapsed] =>
            [can_collapse] => 1
            [collapse_href] => http://localhost/smf11/index.php?action=collapse;c=1;sa=collapse;fb6d5c29c71=81649c7f70f21bf634bca2b0dfdf9ef3#c1
            [collapse_image] => -
            [href] => http://localhost/smf11/index.php#c1
            [boards] => Array
                (
                    [1] => Array
                        (
                            [new] =>
                            [id] => 1
                            [name] => General Discussion
                            [description] => Feel free to talk about anything and everything in this board.
                            [moderators] => Array
                                (
                                )

                            [link_moderators] => Array
                                (
                                )

                            [children] => Array
                                (
                                )

                            [link_children] => Array
                                (
                                )

                            [children_new] =>
                            [topics] => 20
                            [posts] => 29
                            [is_redirect] => 0
                            [unapproved_topics] => 0
                            [unapproved_posts] => 0
                            [can_approve_posts] => 1
                            [href] => http://localhost/smf11/index.php?board=1.0
                            [link] => General Discussion
                            [last_post] => Array
                                (
                                    [id] => 29
                                    [time] => March 20, 2016, 12:11:15 pm
[timestamp] => 1458472275 [subject] => Re: Welcome to SMF! [member] => Array ( [id] => 1 [username] => admin [name] => admin [href] => http://localhost/smf11/index.php?action=profile;u=1 [link] => abm
abm_id=1Last post by admin ) [start] => msg31 [topic] => 1 [href] => http://localhost/smf11/index.php?topic=1.msg31#new [link] => Re: Welcome to SMF! ) ) [2] => Array ( [new] => [id] => 2 [name] => New Board [description] => [moderators] => Array ( ) [link_moderators] => Array ( ) [children] => Array ( ) [link_children] => Array ( ) [children_new] => [topics] => 2 [posts] => 2 [is_redirect] => 0 [unapproved_topics] => 0 [unapproved_posts] => 0 [can_approve_posts] => 1 [href] => http://localhost/smf11/index.php?board=2.0 [link] => New Board [last_post] => Array ( [id] => 31 [time] => October 26, 2016, 07:45:52 pm
[timestamp] => 1477507552 [subject] => dwdwdwd [member] => Array ( [id] => 2 [username] => test [name] => test [href] => http://localhost/smf11/index.php?action=profile;u=2 [link] => abm
abm_id=2Last post by test ) [start] => msg32 [topic] => 22 [href] => http://localhost/smf11/index.php?topic=22.msg32#new [link] => dwdwdwd ) ) ) [new] => 0 [link] => General Category [show_unread] => 1 ) )


if posted the code you can remove the edit from BoardIndex.template.php, so the page looks normal agian.


"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! ☕

Yarik1980

Log
https://yarik-sat.ru/index.php?board=31.0
8: Undefined offset: 104
Файл: /home/admin/web/yarik-sat.ru/public_html/Sources/abm_code.php
Строка: 274

273: // close div p
==>274: if ($context['boards'][$row['id_board']])
275: $context['boards'][$row['id_board']]['last_post']['time'] = $context['boards'][$row['id_board']]['last_post']['time'].'</div><p><!---->';
276:
277: if (isset($context['boards'][$row['id_parent']]))
278: $context['boards'][$row['id_parent']]['last_post']['time'] = $context['boards'][$row['id_parent']]['last_post']['time'].'</div><p><!---->';
279: }
280:
281: $smcFunc['db_free_result']($request);
282: }
283: }
284:

https://yarik-sat.ru/index.php?board=31.0
8: Undefined offset: 104
/home/admin/web/yarik-sat.ru/public_html/Sources/abm_code.php
Строка: 258

243: if (!empty($abm_topic_ids))
244: {
245: $request = $smcFunc['db_query']('','
246: SELECT t.id_member_updated, t.id_topic, t.id_board, b.id_parent
247: FROM {db_prefix}topics AS t
248: LEFT JOIN {db_prefix}boards AS b ON (t.id_board = b.id_board)
249: WHERE id_topic IN ({array_int:ids})',
250: array(
251: 'ids' => $abm_topic_ids,
252: )
253: );
254: while ($row = $smcFunc['db_fetch_assoc']($request))
255: {
256: if ($row['id_member_updated']) //member   
257: {
==>258: if ($context['boards'][$row['id_board']])
259: $context['boards'][$row['id_board']]['last_post']['member']['link'] = 'abm<!----></p><div style="padding-left: '. $abm_avatar_size.'px; position: relative;"><a href="' . $scripturl . '?action=profile;u=' . $row['id_member_updated'] . '"><img style="width: 38px; height: 38px; left: 0; position: absolute; top: 50%; margin-top: -19px; padding: 0px; border-radius: 50%;" alt="abm_id='.$row['id_member_updated'].'" /></a><b>'. $txt['last_post']. '</b>  '. $txt['by']. ' '.$context['boards'][$row['id_board']]['last_post']['member']['link'];
260:
261: if (isset($context['boards'][$row['id_parent']]))
262: $context['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=' . $row['id_member_updated'] . '"><img style="width: 38px; height: 38px; left: 0; position: absolute; top: 50%; margin-top: -19px; padding: 0px; border-radius: 50%;" alt="abm_id='.$row['id_member_updated'].'" /></a><b>'. $txt['last_post']. '</b>  '. $txt['by']. ' '.$context['boards'][$row['id_parent']]['last_post']['member']['link'];
263: }
264: else //guest or deleted account
265: {
266: if ($context['boards'][$row['id_board']])
267: $context['boards'][$row['id_board']]['last_post']['member']['link'] = 'abm<!----></p><div style="padding-left: '. $abm_avatar_size.'px; position: relative;"><img style="width: 38px; height: 38px; left: 0; position: absolute; top: 50%; margin-top: -19px; padding: 0px; border-radius: 50%;" alt="abm_id='. $row['id_member_updated'] .'" /><b>'. $txt['last_post']. '</b>  '. $txt['by']. ' '.$context['boards'][$row['id_board']]['last_post']['member']['link'];
268:
269: if (isset($context['boards'][$row['id_parent']]))
270: $context['boards'][$row['id_parent']]['last_post']['member']['link'] = 'abm<!----></p><div style="padding-left: '. $abm_avatar_size.'px; position: relative;"><img style="width: 38px; height: 38px; left: 0; position: absolute; top: 50%; margin-top: -19px; padding: 0px; border-radius: 50%;" alt="abm_id='. $row['id_member_updated'] .'" /><b>'. $txt['last_post']. '</b>  '. $txt['by']. ' '.$context['boards'][$row['id_parent']]['last_post']['member']['link'];
271: }
272:

Pipke

@Yariksat

change line 274
from

if ($context['boards'][$row['id_board']])

to

if (isset($context['boards'][$row['id_board']]))


and line 258
from

if ($context['boards'][$row['id_board']])

to

if (isset($context['boards'][$row['id_board']]))
"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! ☕

Yarik1980

 @Pipke
I immediately corrected the error
This is for you . For a fix in a future release

MartiMedia

Hi @Pipke ,

Still loving this mod, again thanks for creating it!
I'm seeing a lot of these errors in my SMF 2.0.14 logs (also saw that in SMF 2.0.13, but had no time yet to dive in deeper):

8: Undefined index: last_post File: forum/Sources/abm_code.php
Line: 308

That only seems to be happening to guests , not to members.
Do you, or any others using this great mod, have any idea? Do I have to give more rights to guests? Or is that solvable by a code change?

Cheers, Marti





Pipke

Quote from: MartiMedia on May 16, 2017, 06:20:30 PM
Hi @Pipke ,

Still loving this mod, again thanks for creating it!
I'm seeing a lot of these errors in my SMF 2.0.14 logs (also saw that in SMF 2.0.13, but had no time yet to dive in deeper):

8: Undefined index: last_post File: forum/Sources/abm_code.php
Line: 308

That only seems to be happening to guests , not to members.
Do you, or any others using this great mod, have any idea? Do I have to give more rights to guests? Or is that solvable by a code change?

Cheers, Marti


It is solvable by code. I will update mod soon with the fixes.
"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! ☕

MartiMedia

Aaah that's great @Pipke, looking forward to it!
Cheers, Marti

Pipke

Mod updated to v1.9

Quote
Version 1.9 - May 18, 2017
- Fixed: More Undefined index and Undefined offset errors
"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! ☕

MartiMedia

You're a hero @pipke, thanks a lot! Tested it locally first and then uploaded to the server. Now all those 'undefined' errors are gone! Yes! Thank you!
Cheers, Marti

dansal

Hi great mod!!,

I want to adapt to me theme, ¿how i can remove the name of user? Only want to see avatar and post link

Pipke

Quote from: dansal on July 31, 2017, 05:36:25 AM
Hi great mod!!,

I want to adapt to me theme, ¿how i can remove the name of user? Only want to see avatar and post link

thx that you like my mod.
about your question why you want to hide the username, i think its a bad idea cos when users dont have avatar set then you see default avatar and then you cant see the difference who is who, but if you want i need to know where you want to hide it, on board and/or on message index.
"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! ☕

Advertisement: