1
limecity
Theme Hack : greeting (help)
  • 2008/6/8 16:38

  • limecity

  • Friend of XOOPS

  • Posts: 1602

  • Since: 2003/7/6 0


I wanted to put something on the front page through hacking the theme.

I want to display a message when the user logs in

Hello USERNAME, Your Last Login: xxxx, You have 1 Message

The username was shown with this code:
<{if $xoops_isuser}>Hello <a href="<{$xoops_url}>/user.php"><{$xoops_uname}>a> (<a style="color:#666; font-weight: normal;" href="<{$xoops_url}>/user.php?op=logout"><{$smarty.const._LOGOUT}>a>)<{else}>&nbsp;<{/if}>


but how do i do the login and inbox message ?
hhttp://www.mounthiking.com
all your hiking gears and gadgets


2
Anonymous
Re: Theme Hack : greeting (help)
  • 2008/6/8 18:22

  • Anonymous

  • Posts: 0

  • Since:


Hi limecity

Edit your theme.html and add :

<{if $xoops_isuser}>
<{
php}>
GLOBAL 
$xoopsUser;
$pm_handler =& xoops_gethandler('privmessage');
$uid $xoopsUser->getVar('uid');
$last_login $xoopsUser->getVar('last_login');
if (!empty(
$last_login)) {
$GLOBALS['xoopsTpl']->assign('last_login'formatTimestamp($last_login,'m'));
}
$criteria = new CriteriaCompo(new Criteria('read_msg'0));
$criteria->add(new Criteria('to_userid'$uid));
$msgcount $pm_handler->getCount($criteria);
$GLOBALS['xoopsTpl']->assign('msgcount'$msgcount);
<{/
php}>
Hello <a href="<{$xoops_url}>/user.php"><{$xoops_uname}>a>, Your Last Login: <{$last_login}>
<{if 
$msgcount 0}>
<
class="highlight" href="<{$xoops_url}>/viewpmsg.php">, You have <span style="color:#ff0000; font-weight: bold;"><{$msgcount}>spanMessagea>
<{/if}>
<{/if}>

3
limecity
Re: Theme Hack : greeting (help)
  • 2008/6/9 3:25

  • limecity

  • Friend of XOOPS

  • Posts: 1602

  • Since: 2003/7/6 0


that is so quick and wicked ! test and it runs ! thanks Mowaffak !
hhttp://www.mounthiking.com
all your hiking gears and gadgets


4
Anonymous
Re: Theme Hack : greeting (help)
  • 2008/6/9 3:44

  • Anonymous

  • Posts: 0

  • Since:


you are welcome any time limecity

Login

Who's Online

321 user(s) are online (209 user(s) are browsing Support Forums)


Members: 0


Guests: 321


more...

Donat-O-Meter

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

Latest GitHub Commits