1371
alain01
Re: Re-Design the PM templates - Need smarty help
  • 2020/4/29 16:01

  • alain01

  • Just can't stay away

  • Posts: 530

  • Since: 2003/6/20


YESSSSSSSS !!!
Done !!!
Thank you,
I dont know why now it works with your new code but it works fine !



1372
luciorota
Re: Re-Design the PM templates - Need smarty help
  • 2020/4/29 15:55

  • luciorota

  • Module Developer

  • Posts: 216

  • Since: 2007/4/20


Trry this
More than dirty

<{if ($message.postername != "")}>
<{* 
what if user does not exist? *}>
<{
assign var="tempPosteruid" value=$message.posteruid}>
<
img src="<{$xoops_url}>/uploads/<{php}>
    
$user_handler = xoops_getHandler('user');
    if(
$posterObj = $user_handler->get($this->get_template_vars('tempPosteruid'))) {
        echo 
$posterObj->getVar('user_avatar');
    }
    <{/php}>" 
class="img-responsive img-rounded img-thumbnail">
<{/if}>



1373
alain01
Re: Re-Design the PM templates - Need smarty help
  • 2020/4/29 15:45

  • alain01

  • Just can't stay away

  • Posts: 530

  • Since: 2003/6/20


@Mamba
?
No, i dont want to modify the php code of the PM module,
i just want to add overloaded files for webmasters which use PM module.



1374
Mamba
Re: Re-Design the PM templates - Need smarty help
  • 2020/4/29 15:37

  • Mamba

  • Moderator

  • Posts: 11373

  • Since: 2004/4/23


Take a look at Yogurt - LioMJ leveraged work done by Alfred on his eProfile, and now Yogurt pretty much is able to replace the Profile using Preloads.

Maybe you could use Preloads to do something similar with PM?
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs



1375
alain01
Re: Re-Design the PM templates - Need smarty help
  • 2020/4/29 15:09

  • alain01

  • Just can't stay away

  • Posts: 530

  • Since: 2003/6/20


Thank you luciorota,
i'm so close...

<img src="<{$xoops_url}>/uploads/<{php}>
    
$user_handler = xoops_getHandler('user');
    
$posterObj = $user_handler->get($GLOBALS['message']['posteruid']);
    echo 
$posterObj->getVar('user_avatar');
<{/php}>" 
class="img-responsive img-rounded img-thumbnail">


It gives me an avatar image, but always same avatar...
I'm in the ...



1376
luciorota
Re: Re-Design the PM templates - Need smarty help
  • 2020/4/29 14:26

  • luciorota

  • Module Developer

  • Posts: 216

  • Since: 2007/4/20


To get user_avatar this way is a dirty way.. but it could run!

Insert in "viewpmsg.tpl" file
into the <{foreach item=message from=$messages}> loop
this Smarty code

<{php}>
    
$user_handler xoops_getHandler('user');
    
$posterObj $user_handler->get($GLOBALS['message']['posteruid']);
    echo 
$posterObj->getVar('user_avatar');
<{/
php}>


Good luck!



1377
luciorota
Re: Re-Design the PM templates - Need smarty help
  • 2020/4/29 14:10

  • luciorota

  • Module Developer

  • Posts: 216

  • Since: 2007/4/20


Hi Alain01

Is becouse $message.posteruid is the poster id and not a poster object



1378
alain01
Re: Re-Design the PM templates - Need smarty help
  • 2020/4/29 13:21

  • alain01

  • Just can't stay away

  • Posts: 530

  • Since: 2003/6/20


I tried :
<img src="<{$xoops_url}>/uploads/<{$message.posteruid->getVar('user_avatar')}>" alt="<{$message.posteruid->getVar('uname')}>" class="img-responsive img-rounded img-thumbnail">


but it doesn't work !



1379
alain01
Re-Design the PM templates - Need smarty help
  • 2020/4/29 12:45

  • alain01

  • Just can't stay away

  • Posts: 530

  • Since: 2003/6/20


Hi,
i want to redesign the PM templates,
- pm_readpmsg.tpl
- pm_viewpmsg.tpl
- pm_pmlite.tpl

I know there are yet the 2 first files in BT4 overloaded,
but i want to make a real responsive design in BT4.

I need a smarty variable which is avalaible in the readpmsg.tpl (defined in readpmsg.php file) in the viewpmsg.tpl file :

<{if ( $poster->getVar("user_avatar") != "")}>
                    <
img src="<{$xoops_url}>/uploads/<{$poster->getVar('user_avatar')}>" alt="<{$poster->getVar('uname')}>" class="img-responsive img-rounded img-thumbnail">
                <{/if}>


i need to use the avatar postername.
i know how to use
<img src="<{$xoops_url}>/uploads/<{$member_info.user_avatar}>" height="22px" class="align-top">

but it's not the good code, $member_info is for the member who is connected...

In the viewpmsg.tpl file, the smarty <{$message.posteruid}> is known.
So i want to get the avatar for this user



1380
kakos
Re: xoops preferences "site close" override
  • 2020/4/29 6:10

  • kakos

  • Friend of XOOPS

  • Posts: 78

  • Since: 2002/6/6 2


Thank you very much!!!

It seems to work perfectly...

The version that I applied the changes is 2.5.5, I'm stuck on it due to lack of some modules (Gijoe, formulize etc)

Perhaps a config file that override some of the system settings in future versions of xoops would help especially in multi-site cases.




TopTop
« 1 ... 135 136 137 (138) 139 140 141 ... 29425 »



Login

Who's Online

520 user(s) are online (295 user(s) are browsing Support Forums)


Members: 0


Guests: 520


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits