How to call the current user's subject, points and other information in Discuz discuz.htm

Source: Internet
Author: User
How to call the current user's subject, points and other information in Discuz discuz.htm
Currently known only: $_g[' member '][credits] is the current user's integral


Reply to discussion (solution)

\source\module\forum\forum_index.php
Add the following code to this page, which can be called directly in the template discuz.htm.

Prestige, money and the like can call Echo directly "
";p Rint_r ($_g[' setting '] [' extcredits ']); echo"
";///Current user's topic information list $threadlist = C::t (' Forum_thread ')->fetch_all_by_authorid_displayorder ($_g[' uid ']); echo"
";p Rint_r ($threadList); echo"
";

\source\module\forum\forum_index.php
Add the following code to this page, which can be called directly in the template discuz.htm.

Prestige, money and the like can call Echo directly "
";p Rint_r ($_g[' setting '] [' extcredits ']); echo"
";///Current user's topic information list $threadlist = C::t (' Forum_thread ')->fetch_all_by_authorid_displayorder ($_g[' uid ']); echo"
";p Rint_r ($threadList); echo"
";



I can't.

Why not?


Why not?




and the output value of the call variable output is empty.

Prestige, money, and the like. You can call foreach directly ($_g[' setting ' [' extcredits '] as $extcreditid = =) {//num is the value you want to display $_g[' setting '] [' Extcredits ' [$extcreditid] [' num '] = getuserprofile (' extcredits '. $extcreditid);} Print_r ($_g[' setting ' [' extcredits ']);

Array
(
[1] = = Array
(
[img] =
[Title] = Prestige
[Unit] =
[ratio] = 0
[Showinthread] =
[Allowexchangein] =
[Allowexchangeout] =
[num] = 0
)

[2] = = Array
(
[img] =
[Title] = Money
[Unit] =
[ratio] = 0
[Showinthread] =
[Allowexchangein] =
[Allowexchangeout] =
[num] = 25
)

[3] = = Array
(
[img] =
[Title] = contribution
[Unit] =
[ratio] = 0
[Showinthread] =
[Allowexchangein] =
[Allowexchangeout] =
[num] = 0
)

)

Prestige, money, and the like. You can call foreach directly ($_g[' setting ' [' extcredits '] as $extcreditid = =) {//num is the value you want to display $_g[' setting '] [' Extcredits ' [$extcreditid] [' num '] = getuserprofile (' extcredits '. $extcreditid);} Print_r ($_g[' setting ' [' extcredits ']);

Array
(
[1] = = Array
(
[img] =
[Title] = Prestige
[Unit] =
[ratio] = 0
[Showinthread] =
[Allowexchangein] =
[Allowexchangeout] =
[num] = 0
)

[2] = = Array
(
[img] =
[Title] = Money
[Unit] =
[ratio] = 0
[Showinthread] =
[Allowexchangein] =
[Allowexchangeout] =
[num] = 25
)

[3] = = Array
(
[img] =
[Title] = contribution
[Unit] =
[ratio] = 0
[Showinthread] =
[Allowexchangein] =
[Allowexchangeout] =
[num] = 0
)

)



What about the variables in that template? is $_g[' setting ' [' extcredits '][1]? Display value is empty

The data is showing, you loop.

$extcredits [' title ']-$extcredits [' Num ']


Prestige-0
Money-25
Contribution-0

The data is showing, you loop.

$extcredits [' title ']-$extcredits [' Num ']


Prestige-0
Money-25
Contribution-0



I want to call each item separately. Because there is a label for each item.

The data is showing, you loop.

$extcredits [' title ']-$extcredits [' Num ']


Prestige-0
Money-25
Contribution-0



And the code overflows, and the contents of the head tag are spilled into the body tag.

$_g[' Setting ' [' extcredits '][1][' num ']
$_g[' Setting ' [' extcredits '][2][' num ']
...

$_g[' Setting ' [' extcredits '][1][' num ']
$_g[' Setting ' [' extcredits '][2][' num ']
...


The call came out, but the code overflowed

Then you get rid of the output, Print_r.
You should read more manuals.

You should read more manuals.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.