xoops forums

alain01

Quite a regular
Posted on: 1/26 11:43
alain01
alain01 (Show more)
Quite a regular
Posts: 335
Since: 2003/6/20
#1

(More ?) Useful Tags in User Message Manager

Hi,
For the User Message Manager (page /modules/system/admin.php?fct=mailusers),
i noticed this :
Quote:
{X_UID} will print user id
{X_UNAME} will print user name
{X_UEMAIL} will print user email
{X_UACTLINK} will print user activation link
Is there another tags (in 2.5.10 / 2.5.111) ?
I'm thinking in particular of smarty variables.
Quote:
'uname|name|email|user_avatar|url|user_icq|user_aim|user_yim|user_msnm|posts|user_from|user_occ|user_intrest|bio|user_sig'
For mail, if the name is not empty, the name is more relevant than the user name.
If we can use these variables, is it possible to write smarty tests in the message?
like :
<{if $member_info.name}>
    <{
$member_info.name}>
<{else}>
    <{
$member_info.uname}>
<{/if}>

Mamba

Moderator
Posted on: 1/26 22:27
Mamba
Mamba (Show more)
Moderator
Posts: 10838
Since: 2004/4/23
#2

Re: (More ?) Useful Tags in User Message Manager

There are also few extra:
{X_ADMINMAIL}
{
X_SITENAME}
{
X_SITEURL}
{
X_ITEM_TYPE
{
X_ITEM_NAME}
{
X_ITEM_TITLE}
{
X_ITEM_URL}
{
X_MODULE}
{
X_COMMENT_URL}
{
X_UNSUBSCRIBE_URL}
{
X_NOTIFY_EVENT}
{
CATEGORY_TITLE}
{
EVENT_SUMMARY}
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

alain01

Quite a regular
Posted on: 1/26 22:42
alain01
alain01 (Show more)
Quite a regular
Posts: 335
Since: 2003/6/20
#3

Re: (More ?) Useful Tags in User Message Manager

Thank you , i will try !
In which files can I find theses informations ?

alain01

Quite a regular
Posted on: 1/26 23:25
alain01
alain01 (Show more)
Quite a regular
Posts: 335
Since: 2003/6/20
#4

Re: (More ?) Useful Tags in User Message Manager

Only
{X_ADMINMAIL}, {X_SITENAME}, {X_SITEURL} work on the user message manager.

Others, no.
May be cause contextual variables.

Mamba

Moderator
Posted on: 1/26 23:48
Mamba
Mamba (Show more)
Moderator
Posts: 10838
Since: 2004/4/23
#5

Re: (More ?) Useful Tags in User Message Manager

Some of them work in the mail manager, because they are defined there, in /class/xoopsmailer.php

foreach ($this->toUsers as $user) {
            
// set some user specific variables
            
$subject str_replace('{X_UNAME}'$user->getVar('uname'), $this->subject);
            
$text    str_replace('{X_UID}'$user->getVar('uid'), $this->body);
            
$text    str_replace('{X_UEMAIL}'$user->getVar('email'), $text);
            
$text    str_replace('{X_UNAME}'$user->getVar('uname'), $text);
            
$text    str_replace('{X_UACTLINK}'XOOPS_URL '/register.php?op=actv&id=' $user->getVar('uid') . '&actkey=' $user->getVar('actkey'), $text);


You can also define them yourself in your module, as it was done, for example in SmartObject :

public static function sanitizeForCommonTags($text)
    {
        global 
$xoopsConfig;
        
$text str_replace('{X_SITENAME}'$xoopsConfig['sitename'], $text);
        
$text str_replace('{X_ADMINMAIL}'$xoopsConfig['adminmail'], $text);

        return 
$text;
    }


or in tdmspot:

$body             str_replace('{X_NAME}'$user_name$body);
            
$body             str_replace('{X_UNAME}'$user_uname$body);
            
$body             str_replace('{X_UEMAIL}'$user_email$body);
            
$body             str_replace('{X_ADMINMAIL}'$xoopsConfig['adminmail'], $body);
            
$body             str_replace('{X_SITENAME}'$xoopsConfig['sitename'], $body);
            
$body             str_replace('{X_SITEURL}'XOOPS_URL$body);
            
$tpitem['text']   = $body;
            
$meta_keywords    .= $body;
            
$meta_description .= $body;


Just search in all you modules for "{X_" and you'll find many examples of how it is done.
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

alain01

Quite a regular
Posted on: 1/27 0:39
alain01
alain01 (Show more)
Quite a regular
Posts: 335
Since: 2003/6/20
#6

Re: (More ?) Useful Tags in User Message Manager

Haaaaa
Thank you Michael for this full anwser with examples !

I didnt know it !