Fork me on GitHub

Get name using pnModGetName of the my account part  Bottom

  • Hello.

    I'm adding some code to my site for only be shown on the main pages (calling to news module).

    I did a simple 'if (pnModGetName=='News'){ .. ]

    but i have problems when someone clicks on the "My Account" link (that calls to user.php). For postnuke, it is still on the News module and my code loads anyway.

    How can i know when an user is checking their user account?

    Doing a echo pnModGetName(); it shows "News" anyway he's on the "your account" place.

    Can anyone help me, please?

    Thank you.
  • Code

    if(pnModGetName() == 'News' AND !eregi('user',pnGetCurrentURI())){

    // do something

    }
  • Thank you very much for your response. I didn't see the pnGetCurrentURI on the API reference.

    going to put it on work.
  • pnGetCurrentURI() was added in .750 .. I probably should have mentioned that .. if you're running a lesser version you might want to try variations depending on your PHP version.. getenv(SCRIPT_NAME);, getenv(PATH_INFO);, $_SERVER['SCRIPT_NAME']; ..etc.

    good luck :)
  • anway Invalid, i'm running .750. You solution worked like a charm.

    Thanks again icon_wink

    BTW, what i wanted to run in front page was a news list from a SimpleMachines forum (getting news from an specific forum) on the frontpage of my site, implemented on postnuke. Works great. Have it working on Wolfspain.net

    Regards.
  • 0 users

This list is based on users active over the last 60 minutes.