Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
pnUserGetVar() - can't figure it out...
  • Posted: 13.02.2006, 22:22
     
    dnahoward
    rank:
    Freshman Freshman
    registered:
     February 2006
    Status:
    offline
    last visit:
    09.03.06
    Posts:
    10
    I am working on building my first module for PN. I have printed a copy of the PN API Guide, and have found it very valuable. I am now at a point where I cannot go on due to the function I want to use not returning any data.
    I need to get a users id and pass it to a SQL query. I've used pnUserGetVar('uid'), but nothing is returned. I'm sure I'm missing something,and I was hoping someone here could show me.
    Here's the relevant code:

    Code

    function cellname_user_view(){
        $content=new pnHTML();
        $content->Title(_VIEWTITLE);
        list($dbconn)=pnDBGetConn();
       
        $pntable=pnDBGetTables();

        $uid=pnUserGetVar('uid');
        $content->Text("Your UID: ".$uid);
       
        return $content->GetOutput();
    }

    Fairly straightforward, but nothing is displayed (other than the static "Your UID:"). Any suggestions?

    Thanks
  • Posted: 13.02.2006, 22:32
     
    dnahoward
    rank:
    Freshman Freshman
    registered:
     February 2006
    Status:
    offline
    last visit:
    09.03.06
    Posts:
    10
    Never mind...I'm a tard...I wasn't logged in when viewing the page. Therefore, I wouldn't have a uid...
  • Posted: 14.02.2006, 01:04
     
    ainigma32
    rank:
    Professional Professional
    registered:
     January 2004
    Status:
    offline
    last visit:
    22.03.06
    Posts:
    958
    Glad you sorted that out. Just one suggestion though: please start developing using templating and try to forget about the pnHTML class.

    The Example module and jbirchett's mod development docs should get you on your way.

    Good luck!

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula