Nitedula
|
| Posted: 11/14/2002, 4:40 AM |
|
Hi!
I just started CCS-ing with a small user-management (www.ressel-online/uv/index.php) in php as you can see ;)
now I want to make my header a little more dynamic:
I have 3 groups (1-3) user, moderator and admin
as long as the visitor is not logged in his CCGetSession("GroupID") is NULL (empty)
a link in my header should have the default value "LOGIN"
as soon as he logges in, this value should change to "LOGOUT" with parameters "Logout" and "True", and also according to the GroupID some links like "REGISTER" for GroupID=NULL should change to "MY ACCOUT" ,... and so on.
I used the following code in the header_OnInitializeView() function:
if(CCGetSession("GroupID")==1){
$this->Link5->Parameters = CCAddParam($this->Link5->Parameters, "Logout", "True");
$this->Link5->SetValue("LOGOUT");
$this->Link5->Page = "login.php";
}else{
$this->Link4 = new clsControl(ccsLink, "Link5", "Link5", ccsText, "", CCGetRequestParam("Link5", ccsGet));
$this->Link5->SetValue("LOGIN");
$this->Link5->Page = "login.php";
}
but I get a "Call to a member function on a non-object" in the ....->SetValue("XX"); lines
thx Nitedula
|
|
|
 |
Nitedula
|
| Posted: 11/14/2002, 5:00 AM |
|
OK SORRY: this line
$this->Link4 = new clsControl(ccsLink, "Link5", "Link5", ccsText, "", CCGetRequestParam("Link5", ccsGet));
should read
$this->Link5 = new clsControl(ccsLink, "Link5", "Link5", ccsText, "", CCGetRequestParam("Link5", ccsGet));
but the Value will not be set ??
SORRY again ;)
|
|
|
 |
Nitedula
|
| Posted: 11/14/2002, 6:06 AM |
|
.... I found the solution:
you have to change the SetValue(XXX) -parameters in the Initialize function of the page not in any event later on !!!
I just put the following code in the clsheader() function of my header.php:
if(!CCGetSession("GroupID")){
$this->Link5->SetValue("LOGIN");
}else{
$this->Link5->SetValue("LOGOUT");
}
and it work .. as soon as I have a "viewable" page, that meets my demands I will post the Link ;)
|
|
|
 |
|