1
karuna
How to show the pm icon besides the reply icon as well?
  • 2004/4/26 16:25

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


I think now it's a bit difficult for a newbie to XOOPS to find the pm icon~~

is the any way to show the pm icon besides the reply icon as well?

2
JackJ
Re: How to show the pm icon besides the reply icon as well?
  • 2004/4/26 16:40

  • JackJ

  • Community Support Member

  • Posts: 747

  • Since: 2003/8/31


newbbpro has this built into the topics view, this called from system admin/templates for newbb

Code is similar to this:




<{$topic_post.poster_sendpmtext}>




you would just need to position this where you want it, from previous posts I think you know about coding etc..might help to point you in the right direction..

or perhaps download newbbpro and study the templates?



3
Anonymous
Re: How to show the pm icon besides the reply icon as well?
  • 2004/4/26 16:52

  • Anonymous

  • Posts: 0

  • Since:


Using this way generates an empty windows if the poster is anonymous, better is to create link inside the viewtopic in the if else


$pm_link"javascript:openWithSelfMain('".XOOPS_URL."/pmlite.php?send2=1&to_userid=".$eachposter->getVar('uid')."''pmlite'450380);">/images/icons/pm.gif" alt="".sprintf(_SENDPMTO,$eachposter->getVar('uname'))."" />";

                
$posterarr =  array('poster_uid' => $eachposter->getVar('uid'), 'poster_uname' => '.XOOPS_URL.'/userinfo.php?uid='.$eachposter->getVar('uid').'">'.$eachposter->getVar('uname').'''poster_avatar' => $eachposter->getVar('user_avatar'), 'poster_from' => $eachposter->getVar('user_from'), 'poster_regdate' => formatTimestamp($eachposter->getVar('user_regdate'), 's'), 'poster_postnum' => $RPG .$RPG_HP .$RPG_MP .$RPG_EXP'poster_sendpmtext' => sprintf(_SENDPMTO,$eachposter->getVar('uname')), 'poster_rank_title' => $poster_rank['title'], 'poster_rank_image' => $poster_rank['image'], 'poster_groups' => GetGroupsNames($eachposter->getVar('uid')), 'poster_status' => $poster_status,

                
'user_pmlink' => $pm_link,'poster_group' => _MD_GROUP);



                if ( 
== $forumdata['allow_sig'] && $eachpost->attachsig() == && $eachposter->attachsig() == ) {

                    
$myts =& MytextSanitizer::getInstance();

                    
$post_text .= '

----------------'$myts->makeTareaData4Show($eachposter->getVar('user_sig''N'), 011).'

'
;

                }

            } else {

                
$posterarr = array('poster_uid' =>0'poster_uname' => $xoopsConfig['anonymous'], 'poster_avatar' => '''poster_from' => '''poster_regdate' => '''poster_postnum' => '''poster_sendpmtext' => '''poster_rank_title' => '''poster_rank_image' => '');



            }



        } else {

            
$posterarr = array('poster_uid' =>0'poster_uname' => $xoopsConfig['anonymous'], 'poster_avatar' => '''poster_from' => '''poster_regdate' => '''poster_postnum' => '''poster_sendpmtext' => '''poster_rank_title' => '''poster_rank_image' => '');





        }



        
$posticon $eachpost->icon();



This allowes showing the pm button if it is a user and doesn`t display the button when it is a anonymous.

4
karuna
Re: How to show the pm icon besides the reply icon as well?
  • 2004/4/26 17:04

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


thanks for your's quick response

JackJ's code works well

Added it to the template file newbb_thread.html

after
<{if $viewer_is_admin == true}>


and

<{elseif $xoops_isuser == true && $xoops_userid == $topic_post.poster_uid}>

and

<{elseif $viewer_can_post == true}>


Thanks again~~

5
karuna
Re: How to show the pm icon besides the reply icon as well?
  • 2004/4/26 17:28

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


and at first i tired assign a smarty variable like this

if (is_object($xoopsUser)) {
$xoopsTpl->assign('user_pmlink', "\"".sprintf(_SENDPMTO,$topic_post[poster_uname])."\"");
} else {
$xoopsTpl->assign('user_pmlink', '');
}

but failed
Maybe after change $topic_post[poster_uid] to $eachposter->getVar('uid') and change $topic_post[poster_uname] to $eachposter->getVar('uname') as Predator has posted the code will work~~ just guess

Login

Who's Online

177 user(s) are online (119 user(s) are browsing Support Forums)


Members: 0


Guests: 177


more...

Donat-O-Meter

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

Latest GitHub Commits