Avatars on Board and/or MessageIndex

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

Previous topic - Next topic

cuongvttt

This is a beautiful mod and it makes website look very lively, bro Pipke.
It' more than perfect if avatars appear on Recent Topic/Post also, can you help me? Thank you so much.



Pipke

Quote from: cuongvttt on June 13, 2019, 04:29:29 AM
It' more than perfect if avatars appear on Recent Topic/Post also, can you help me? Thank you so much.

thx glad you like it,
The answer to your question will be no, because i no longer update the version for smf2.0.x, currently working on a mod update for smf2.1.x, maybe I will add this part to 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! ☕

shadav

I was wondering if you could help me make this mod work with the Default Avatar mod
so that it will show the default avatars on the boards/child boards, instead of the "blank" default avatar
thank you

Pipke

#183
Quote from: shadav on August 30, 2019, 09:16:07 AM
I was wondering if you could help me make this mod work with the Default Avatar mod
so that it will show the default avatars on the boards/child boards, instead of the "blank" default avatar
thank you

ok here we go, open Sources/abm_code.php

find:

$avatar = preg_replace($find[2], ' src="'.$settings['images_url']. '/abm_avatar.gif"', $avatar);

replace with:

if(!empty($modSettings['enable_default_avatar']) && !empty($modSettings['default_avatar_url']))
$avatar = preg_replace($find[2], ' src="'.$modSettings['default_avatar_url'].'"', $avatar);
else // No costum url set
$avatar = preg_replace($find[2], ' src="'.$settings['default_images_url'] . '/default_avatar.png"', $avatar);


find:

SELECT mem.id_member,

replace with:

SELECT mem.id_member, mem.gender,


find:

if (empty($avatar))
$avatar = $settings['images_url']. '/abm_avatar.gif';

replace with:

if (empty($avatar))
{
// Default
if(!empty($modSettings['enable_default_avatar']) && ($row['gender'] == 0) && !empty($modSettings['default_avatar_url']))
$avatar = $modSettings['default_avatar_url'];
else // No costum url set
$avatar = $settings['default_images_url'] . '/default_avatar.png';
// Male
if(!empty($modSettings['enable_default_avatar']) && ($row['gender'] == 1) && !empty($modSettings['default_male_avatar_url']))
$avatar = $modSettings['default_male_avatar_url'];
// Female
if(!empty($modSettings['enable_default_avatar']) && ($row['gender'] == 2) && !empty($modSettings['default_female_avatar_url']))
$avatar = $modSettings['default_female_avatar_url'];
}


see attached image for result.

uncheck the admin setting from Default Avatar Mod: Makes default avatars transparent when user logs out, as that would need more db queries and will slow down your site, and not really needed anyway.
"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! ☕

shadav

thank you, works perfectly and thanks for the tip about the transparent log off setting

maglix04

Hello everyone and happy new year! Since I updated the forum to version 2.0.16 and also this morning to 2.0.17 the mod don't integrate well the image proxy function linking to images with http.
Solutions?
Sorry for my bad english

Pipke

Quote from: maglix04 on January 01, 2020, 06:18:12 AM
Hello everyone and happy new year! Since I updated the forum to version 2.0.16 and also this morning to 2.0.17 the mod don't integrate well the image proxy function linking to images with http.
Solutions?
Sorry for my bad english

Mod updated:

Version 2.0.17 - Jan 3, 2020
- Fixed: Script proxy for external avatar urls
"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! ☕

maglix04


Pipke

"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

Quote from: pocttopus on February 16, 2020, 05:31:47 PM
What's today update changelog?  ???

Nothing i just added comment where to find same mod for SMF 2.1
"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


jsx

Hi Pipke,

Your modification causes errors in the forum. When I enter a topic and when I want to search the word through the search engine in this topic, an error appears. How to fix it?



Error log:






Pipke

@jsx to me i wonder how you get these errors on the search page as the mod isn't suppose to run on that action, as my code has 3 conditions wich must be passed:

if ($context['current_action'] == 'forum' ||  $context['current_action'] == 'unreadreplies' || $context['current_action'] == 'unread')

and

if (isset($context['topics']) && !empty($context['topics']))

and

if (!empty($context['abm_user_id']))

At this moment i have no clue and on my test site i'm not getting errors on the search page/results, maybe some other mod conflict with it?
i have a hard fix for you:

in .../Sources/abm_code.php

Code (find line 137) Select

if (isset($context['current_action']) && $context['current_action'] == 'credits')


Code (add before) Select

if (isset($context['current_action']) && $context['current_action'] == 'search2')
return;





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

jsx

@Pipke

I understand, but after uninstalling your modification, the search engine works properly. This error does not appear:



After adding this code, the search engine still does not work properly.

Critical Error:

(...)index.php?action=search2

Wrong value type sent to the database. Array of integers expected. (id)

Function: abm_mod_setup

File: /home(...)Sources/abm_code.php

Line: 183

I can uninstall all other modifications and install only your modification and then check if this error still occurs.

jsx

@Pipke

I installed a clean forum and uploaded all the modifications that are used in the official forum and this error is not there. So what can cause this error? Do you have any idea?

Wrong value type sent to the database. Array of integers expected. (id)

As I wrote earlier. When I uninstall the Avatars on Board and/or MessageIndex modification, the search engine works properly.

Pipke

@jsx next try to fix your error

in .../Sources/abm_code.php

Code (find ) Select

foreach(array($abm_topics['id']) as $context['abm_user_id'][]) {}


Code (replace by) Select

if (isset($abm_topics['id']))
foreach(array($abm_topics['id']) as $context['abm_user_id'][]) {}


let me know if that works.
"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! ☕

jsx

@Pipke

Now this solution has fixed the problem. The search engine works and no errors are generated. Thanks for the help. :) 8)

This solution is only for me, will you make this change for modification?



Pipke

Quote from: jsx on March 27, 2020, 03:15:33 AM
@Pipke

Now this solution has fixed the problem. The search engine works and no errors are generated. Thanks for the help. :) 8)
Glad it's been sorted now ;)

Quote from: jsx on March 27, 2020, 03:15:33 AM
This solution is only for me, will you make this change for modification?
Hmmm, not sure where the problem is, i still think it comes from another mod wich you have installed, on a clean smf install with only my mod no errors. Ill wait if more users report this issue.
"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! ☕

jsx

@Pipke

I understand, but a new error occurred after moving the thread to another board.

index.php?action=movetopic;topic=1370.0
2: array_filter() expects parameter 1 to be array, null given
File: .../Sources/abm_code.php
Line: 316


Advertisement: