News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Avatars Display Integration

Started by Pipke, February 15, 2020, 07:43:21 PM

Previous topic - Next topic

gevv

Hi,

last post view is broken on mobile



ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

Pipke

Quote from: gevv on February 01, 2021, 11:57:17 AM
Hi,

There are some problems smf 2.1 rc3 I found the solution will disable some features

some topic give white page 503 error;

in settings; Display avatar when using bbc @mention member in posts...   
I chose " please do not" problem solved




recent post page give white page 503 error;

in settings; Display avatar poster on the Recent posts index
I uncheck the box problem solved


sorry i can't reproduce your errors, in my test environment everything looks fine on RC3 to help you more i need more info, perhaps from a live example?
"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

Quote from: gevv on February 04, 2021, 06:08:36 AM
Hi,

last post view is broken on mobile





uhh what is broken..your both screenshots looks fine to me?
"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! ☕

Delimavi123

Merhaba Mobil de sistem çalışmıyor.


Pipke

Quote from: Delimavi123 on February 09, 2021, 01:53:34 PM
Merhaba Mobil de sistem çalışmıyor.



what is wrong on mobile then? If you ask for on mobile doesn't work isn't a good way to ask for help....and please reply in english.
"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! ☕

Delimavi123

The mod works very well on the computer. But it doesn't work on the cell phone. Many people now use the internet from their mobile phones. For this reason, can you help the mod to work on the mobile phone.

Pipke

Quote from: Delimavi123 on February 09, 2021, 03:10:27 PM
The mod works very well on the computer. But it doesn't work on the cell phone. Many people now use the internet from their mobile phones. For this reason, can you help the mod to work on the mobile phone.

The mod is intended to function that way, the mod does not display the avatar on mobile because the screen is too small.
"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! ☕

Delimavi123

Yes it sounds great for the home page. But it is not big for the page where the topics are listed. on the contrary, it makes it look smoother by opening the subject spaces on the subject pages. Other kinds of issues seem too intertwined. Can't there be at least one option? within the topics section

gevv

Hi,

@Pipke

Can avatar be added to Info Center / Recent posts section  ?  feature request :)
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

Pipke

Quote from: gevv on February 11, 2021, 02:23:57 PM
Hi,

@Pipke

Can avatar be added to Info Center / Recent posts section  ?  feature request :)


Recent posts section <- this feature already exists in the mod, check it out at yoursite/index.php?action=recent

Info Center <- hmm i have to code that if more users want it. for now you can use the easy way with the build in code
do this at the BoardIndex.template.php there is the Info Center

*Other costum places:
How to add user avatar anywhere in your template file from mods maybe, simple type:
data-adi-id="{userid}"

How to example in template file:
Code (find) Select

<div class="most_downloaded"><a href="'.$last['href'].'"><b>'.$last['name'].'</b></a></div>

Code (replace by) Select

<div class="most_downloaded">data-adi-id="'.$last['user']['id'].'"<a href="'.$last['href'].'"><b>'.$last['name'].'</b></a></div>


How to style your costum output element:
<span class="{whatever}">data-adi-id="{userid}"</span>
"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! ☕

gevv

Thanks  @Pipke

I did not understand, I tried but I was not successful



ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

Pipke

#51
@gevv

in .../Sources/AvatarsDisplayIntegration.php

Code (find) Select

// This option true...then we need this css ## titlebar 'user' 
if ($modSettings['adi_wholist'])
addInlineCss('.action_who th:nth-child(1) {padding-left: 52px;} #mlist span.member {line-height: 38px;}');


Code (add after) Select

addInlineCss('#ic_recentposts td, #ic_recentposts td span {vertical-align: middle;}');
addInlineCss('#ic_recentposts th:first-child {padding-left: 42px;}');



Code (find) Select

// Avatars categories (board)index (aka main/home page)
if ((isset($context['categories']) && !empty($context['categories'])) && in_array('boardindex_outer', $context['template_layers'], true) && $modSettings['adi_boardindex'])
{

Code (add after) Select

if (!empty($context['latest_posts'])) {
foreach ($context['latest_posts'] as $id_post => $post) {
// Guests
if ($modSettings['adi_initials'] && $context['latest_posts'][$id_post]['poster']['id'] == 0)
{
// Build overlay status
adi_status_data(null, $context['latest_posts'][$id_post]['poster']['name'], null, 'costum');

// Hook in context
$context['latest_posts'][$id_post]['link'] = '<span class="adi_item_costum"><span class="avatar" '.adi_name2hex2rgb($context['latest_posts'][$id_post]['poster']['name']).' '.adi_avatar_data(true).'>'.mb_strtoupper(mb_substr($context['latest_posts'][$id_post]['poster']['name'], 0, 1), 'UTF-8').'</span>'.$context['adi']['iconstatus'].'</span>'. $post['link'];
}
else
$context['latest_posts'][$id_post]['link'] = '<span>data-adi-id="'.$context['latest_posts'][$id_post]['poster']['id'].'"<span>'. $post['link'];
}
}



then you get Avatars recent posts in Info Center (if theme option is set) see attachment, good luck with the edit ;)
"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! ☕

gevv

ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

pocttopus

After updating the mod for v2.1 rc4 still needs to emulate to rc3.


Pipke

Quote from: pocttopus on July 19, 2021, 10:14:10 AM
After updating the mod for v2.1 rc4 still needs to emulate to rc3.



thx for finding that, i forgot to update the install package for RC4.
Mod is updated, latest version now 1.3
"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! ☕

pocttopus

Thanks but after updating on rc4 with 1.3 I have these errors:

Type of error
Undefined_vars
Error message
8: Undefined index: profile_of
File
/home/xxx/public_html/Sources/AvatarsDisplayIntegration.php
Line
178
URL of page causing the error
https://xxxx/index.php?action=admin;area=manageattachments;sa=avatars
Backtrace information
#0: smf_error_handler()
Called from /home/xxx/public_html/Sources/AvatarsDisplayIntegration.php on line 178
#1: adi_status_data()
Called from /home/xxx/public_html/Sources/AvatarsDisplayIntegration.php on line 481
#2: adi_integrate_member_context()
Called from /home/xxx/public_html/Sources/Subs.php on line 5102
#3: call_integration_hook()
Called from /home/xxx/public_html/Sources/Load.php on line 1826
#4: loadMemberContext()
Called from /home/xxx/public_html/Sources/LightPortal/addons/TopPosters/TopPosters.php on line 144
#5: getData()
Called from /home/xxxx/public_html/Sources/LightPortal/utils/Cache.php on line 48
#6: __invoke()
Called from /home/xxx/public_html/Sources/LightPortal/Helpers.php on line 38
#7: cache()
Called from /home/xxx/public_html/Sources/LightPortal/addons/TopPosters/TopPosters.php on line 175
#8: prepareContent()
Called from /home/xxx/public_html/Sources/LightPortal/Subs.php on line 281
#9: runAddons()
Called from /home/xxx/public_html/Sources/LightPortal/Helpers.php on line 609
#10: prepareContent()
Called from /home/xxx/public_html/Sources/LightPortal/Block.php on line 50
#11: show()
Called from /home/xxx/public_html/Sources/LightPortal/Integration.php on line 242
#12: menuButtons()
Called from /home/xxx/public_html/Sources/Subs.php on line 5102
#13: call_integration_hook()
Called from /home/xxx/public_html/Sources/Subs.php on line 4902
#14: setupMenuContext()
Called from /home/xxx/public_html/Sources/Subs.php on line 3715
#15: setupThemeContext()
Called from /home/xxx/public_html/Sources/Subs.php on line 3872
#16: template_header()
Called from /home/xxx/public_html/Sources/Subs.php on line 3495
#17: obExit()
Called from /home/xxx/public_html/index.php on line 190

Pipke

on my test environment all works ok at... ?action=admin;area=manageattachments;sa=avatars
and not getting:
Undefined index: profile_of

thats a txt string very weird, to me it seems your forum is not loading the txt file?

...\Themes\default\languages\index.english.php
line 102: $txt['profile_of'] = 'View the profile of';
"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! ☕

pocttopus

@Pipke so what do you suggest? Where to look into my problem to solve it? How can I find what is causing my issue?  :-[
These a lot of errors inside error log such as:

/home/xxxx/public_html/Sources/AvatarsDisplayIntegration.php (Line 164)
Backtrace information

Type of error: General
Error message Select
8: Trying to access array offset on value of type null

THanks!  :)

marcosbr

My hundreds of errors
(2: Undefined array key "profile of") I edited AvatarsDisplayIntegration.php
profile_of by profile.
Nothing in life is absolute. We are always learning... Did you know that?
https://amigosdaeletronica.com.br

Pipke

Quote from: marcosbr on July 29, 2021, 10:05:34 PM
My hundreds of errors
(2: Undefined array key "profile of") I edited AvatarsDisplayIntegration.php
profile_of by profile.

question: wich code part dit you edit?
"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: