1
Shiva
<{$xoops_userid}> in custom block?
  • 2008/6/10 21:23

  • Shiva

  • Quite a regular

  • Posts: 280

  • Since: 2006/7/9 1


Can anyone tell me the tag for <{$xoops_userid}> in custom blocks and if possible any other tags that are available to custom blocks.

Thank you in Advance.

2
trabis
Re: <{$xoops_userid}> in custom block?
  • 2008/6/10 22:49

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


X_SITEURL

I believe that just one available.

Check class/xoopsblock.php function getContent()

You could hack it to add extra vars if you want.

This is what goes fo html custom block
if ( $c_type == 'H' ) {
                return 
str_replace('{X_SITEURL}'XOOPS_URL.'/'$this->getVar('content''N'));
            }


You could use something like this to add vars
if ( $c_type == 'H' ) {
                
$content $this->getVar('content''N');
                
$content str_replace('{X_SITEURL}'XOOPS_URL.'/'$content);
                if (
is_object($xoopsUser) && $xoopsUser->getVar('uid') > 0){
                    
$content str_replace('{X_USERURL}'XOOPS_URL.'/userinfo.php?uid='.$xoopsUser->getVar('uid'), $content);
                    
$content str_replace('{X_USERID}'$xoopsUser->getVar('uid'), $content);
                } else {
                    
$content str_replace('{X_USERURL}'''$content);
                    
$content str_replace('{X_USERID}'0$content);
                }
                return 
$content;
            }

3
Shiva
Re: <{$xoops_userid}> in custom block?
  • 2008/6/10 22:52

  • Shiva

  • Quite a regular

  • Posts: 280

  • Since: 2006/7/9 1


Nice one, I really appreciate that. Saves me hacking about.

4
44444
Re: <{$xoops_userid}> in custom block?
  • 2008/9/13 15:30

  • 44444

  • Just popping in

  • Posts: 15

  • Since: 2008/4/16


Hm.
Amazing! But this code doesn't working!
When I made all the changes, I've got results by else {
$content str_replace('{X_USERURL}'''$content); 
$content str_replace('{X_USERID}'0$content);

only!

Help to make it clear and working!!!
TNX!

Login

Who's Online

484 user(s) are online (316 user(s) are browsing Support Forums)


Members: 0


Guests: 484


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