The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

Webdevelopment help! SOLVED

SikarianSikarian Registered User regular
edited January 2007 in Help / Advice Forum
I'm hoping someone can help me sort this out painlessly...right now I've got a website setup and we are using Postnuke for our content management system. It's got the user login and everything... What I'd LIKE to be able to do, is have a link that basically changes depending on the username. I.E If the user who logs in has a username of "Sikarian", the link will link to "www.whatever.com/sikarian". Or if they are logged in as "mike123", the link will go to "www.whatever.com/mike123".


Google is no friend of mine and I can find nothing, maybe y'all can help me out.

Sikarian on

Posts

  • SeguerSeguer of the Void Sydney, AustraliaRegistered User regular
    edited January 2007
    Do you mean having a link somewhere on the page linking to this, or having a page linked AS this, and redirected somewhere?

    The first can be done with php by inserting the variable into a link (example)
    <? echo "[url='www.whatever.com/$usernamevariable']User Link[/url]"; ?>
    

    The second can be done I believe with apache and/or htaccess, and ModRewrite, but I've never done this myself.

    Seguer on
  • SikarianSikarian Registered User regular
    edited January 2007
    Seguer wrote:
    Do you mean having a link somewhere on the page linking to this, or having a page linked AS this, and redirected somewhere?

    The first can be done with php by inserting the variable into a link (example)
    <? echo "[url='www.whatever.com/$usernamevariable']User Link[/url]"; ?>
    

    The second can be done I believe with apache and/or htaccess, and ModRewrite, but I've never done this myself.


    Yeah, the link you provided is pretty much what we want to do. We tried digging into the postnuke php stuff, and there are so many pages and pages and pages of variables, and everything is just broken down more and more...so finding that $usernamevariable is harder than we thought :(

    Sikarian on
  • SikarianSikarian Registered User regular
    edited January 2007
    Nevermind! I got it solved :)


    Postnuke had a nice API pnGetUserVar('uname') to get the name, and I made that the user variable :)


    Solved!

    Sikarian on
This discussion has been closed.