Jump to content

Individual Membership pages


earthone

Recommended Posts

How would I go about creating different pages for different members?

 

What we would like to do is when member 1 logs in he has a page he can go to gather certain information, when member 2 logs in he also has a page but it has different information?

 

We only need 1 page like this and we will control the information that is on it.

 

If there is something like this as an addon already please let us know. Otherwise please point us in the direction of how to do this. Thank you.

Link to comment
Share on other sites

I do not now the coding you need at this time but use the groups and put each client in a group call x then with in you page do like if group == x then "this text or code" elseif this group == y then "this text or code"

 

I now the above is not code nor is it right but it will point you in the right direction.

 

it would need to be in smarty as you would have group tag within the template.

 

hope this helps

Link to comment
Share on other sites

I quickly wipped this up for you

{php}

$userid=$_SESSION["uid"];

$result=select_query("tblclients","groupid",array("id"=>$userid));

$data = mysql_fetch_array($result);

$groupid = $data["groupid"];

$this->assign('groupid',$groupid);

{/php}

 

{if $groupid == "1"}

This is group 1

{elseif $groupid == "2"}

This is group 2

{elseif $groupid == "3"}

This is group 3

{elseif $groupid == "4"}

This is group 4

{/if}

Link to comment
Share on other sites

I seem to have it working but it seems I don't need to change anything in the above code. It seems all I need to do is add a client group assign it to a client then its done.

 

What I dont get is if I have say 600 clients how am I to keep track of the numbers?

Link to comment
Share on other sites

1, are you saying that each and every client will have a different bit of info?

 

if so you would of had to have 600+ bit of info so sorry you would also have to have 600+ groups but the group part will not be the hard part but if you needed 600+ bits of info that will be any way you do it.

 

you could install the page manager mod and then name each page the group id then dynamically call the right page

 

2, would need screen shot to see what you mean.

Link to comment
Share on other sites

http://forum.whmcs.com/showthread.php?t=19827&highlight=page+manager

 

then make one STD page in whmcs and then add like:

 

{php}

$userid=$_SESSION["uid"];

$result=select_query("tblclients","groupid",array( "id"=>$userid));

$data = mysql_fetch_array($result);

$groupid = $data["groupid"];

$this->assign('groupid',$groupid);

{/php}

 

{include file="$groupid.html"}

 

 

this should auto include the file you set-up for the client in page manager called like 1.html ie 1 = the group ID

 

I have not tested this so it may need to be played with to get it working.

 

P.s Thanks sparky for helping out with the code, would the above work?

Edited by thehost5968
Link to comment
Share on other sites

Ok so I kept the page I already created but added the code you mentioned above to it rather than sparkies code.

 

so my .tpl file now has this

 

{php}
$userid=$_SESSION["uid"];
$result=select_query("tblclients","groupid",array( "id"=>$userid));
$data = mysql_fetch_array($result);
$groupid = $data["groupid"];
$this->assign('groupid',$groupid);
{/php}

{include file="$groupid.html"}

I go to the page manager plugin and create a page with title as 1 which is the only client group I have.

 

It did not work :( any ideas?

 

By the way thank you very much for your time and efforts with this, I really appreciate it.

Edited by earthone
Link to comment
Share on other sites

Ok so ive made a little progress, I figured out that if I add

{if $groupid == "1"}
testing
{/if}

To the page manager and

{php}
$userid=$_SESSION["uid"];
$result=select_query("tblclients","groupid",array( "id"=>$userid));
$data = mysql_fetch_array($result);
$groupid = $data["groupid"];
$this->assign('groupid',$groupid);
{/php}

to the pagemanager index.tpl I can get it to show the content only for that group. So now this works great.

 

Now figure out how to make a link to each. I want to use the $groupid in the link to change to their group when they click the link, but I haven't figured that much out yes.

 

Any ideas?

 

Thanks again.

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated