Area51 @ 4seven.de

Mod Base and Testarea
It is currently 23 Feb 2025, 14:48

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: 17 May 2016, 14:29 
Offline
Tiptop
Tiptop
User avatar

Joined: 11 Feb 2008, 11:49
Posts: 241
Avatars in PM Inbox Outbox v.0.0.3 (en)

Snippet-Title: Avatars in PM Inbox / Outbox
Snippet-Version: 0.0.3
Snippet-Autor: 4seven

Request-Thread:
http://www.phpbb.com/community/viewtopi ... #p12842819
Request by: kiore

Request Thread (History-Addition): http://www.phpbb.com/community/viewtopi ... #p12855022
Request by (History-Addition): trickoff

Snippet-Description:
With this Snippet you can display the Avatars of Sender in PM 'Inbox' and Recipients in 'Outbox' and 'Sent Messages' Folder. Also u see Avatars in 'PM-History'. If no Avatar is present, a 'no-avatar-image' is shown..

Snippet-Version: phpBB 3.0.x
Snippet-Language: mutlilingual
Snippet-Styles: prosilver

Instruction

NOTE:
First you must install this snippet:
[Snippet] Avatar everywhere
viewtopic.php?f=12&t=117


After that...

copy

no_avatar.png to images/no_avatar.png

Image

rightclick on image > save target under...

open

includes/functions_privmsgs.php

find

Code:
                'SUBJECT'            => $subject

before add

Code:
                // Avatars in PM Inbox / Outbox / 4seven / 2010
                'HISTORY_AVATAR'            => (($user->optionget('viewavatars')) && (!empty($row['user_avatar']))) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']) : '<img src="' . $phpbb_root_path . 'images/no_avatar.png" alt="" />', 
                
// Avatars in PM Inbox / Outbox / 4seven / 2010                       

open

includes/ucp/ucp_pm_viewfolder.php

find

Code:
                    // Send vars to template                      

before add

Code:
                // Avatars in PM Inbox / Outbox / 4seven / 2010
                if ($folder_id !== PRIVMSGS_INBOX)
                {
                $sql2 = 'SELECT user_id, user_avatar, user_avatar_type, user_avatar_width, user_avatar_height
                        FROM '
 . USERS_TABLE . '
                        WHERE ' 
$db->sql_in_set('user_id'substr($row['to_address'],2));
                $result2 = $db->sql_query($sql2);
                $row2 = $db->sql_fetchrow($result2);
                $db->sql_freeresult($result2);
                }
                // Avatars in PM Inbox / Outbox / 4seven / 2010                       

find

Code:
                        'PM_CLASS'            => ($row_indicator) ? 'pm_' . $row_indicator . '_colour' : ''

after add

Code:
                        // Avatars in PM Inbox / Outbox / 4seven / 2010
                        'MESSAGE_AVATAR'            => (($folder_id == PRIVMSGS_INBOX) && ($user->optionget('viewavatars')) && (!empty($row['user_avatar']))) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']) : '<img src="' . $phpbb_root_path . 'images/no_avatar.png" alt="" />',
                        
                        
'RECIPIENTS_AVATAR'         => (($folder_id !== PRIVMSGS_INBOX) && ($user->optionget('viewavatars')) && (!empty($row2['user_avatar']))) ? get_user_avatar($row2['user_avatar'], $row2['user_avatar_type'], $row2['user_avatar_width'], $row2['user_avatar_height']) : '<img src="' . $phpbb_root_path . 'images/no_avatar.png" alt="" />',
                        // Avatars in PM Inbox / Outbox / 4seven / 2010                    

find

Code:
p.bcc_address, u.username, u.username_clean, u.user_colour, p.message_reported

replace with

Code:
p.bcc_address, u.username, u.username_clean, u.user_colour, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, p.message_reported


open

styles/prosilver/template/ucp_pm_history.html

find

Code:
<h3><a href="{history_row.U_VIEW_MESSAGE}" 

before add

Code:
                    <dl class="postprofile" style="position:relative;left:20px;right:20px;">
                    <dt style="position:relative;top:10px;left:-10px;text-align:center;">
                    {history_row.HISTORY_AVATAR}
                    </dt>
                    <dd>&nbsp;</dd>
                    <dd>&nbsp;</dd>
                    <dd>&nbsp;</dd>
                    </dl


open

styles/prosilver/template/ucp_pm_viewfolder.html

find

Code:
                            <!-- IF messagerow.S_PM_DELETED --> 

before add

Code:
    <!-- IF not S_SHOW_RECIPIENTS --><dd class="mark_avatar">{messagerow.MESSAGE_AVATAR}</dd><!-- ELSE --><dd class="mark_avatar">{messagerow.RECIPIENTS_AVATAR}</dd><!-- ENDIF --> 


open

styles/prosilver/theme/content.css

find

Code:
    dd.info 

before add

Code:
dd.mark_avatar {
        width: 230px;
        text-align: center;
        line-height: 200%;
    


clear all board- and browser-caches

enjoy



Additional Links

[Snippet] Avatar everywhere: viewtopic.php?f=12&t=117

"get_user_avatar_thumb" Resize-Addition by trickoff: http://www.phpbb.com/community/viewtopi ... #p12885481

_________________
Mod-Bot / Service-Team


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
[ Time : 0.010s | 21 Queries | GZIP : Off ]