- Moderated by:
- Support Team
-
- rank:
-
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 -
- rank:
-
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!
