earthone Posted November 6, 2009 Share Posted November 6, 2009 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. 0 Quote Link to comment Share on other sites More sharing options...
thehost5968 Posted November 7, 2009 Share Posted November 7, 2009 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 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted November 7, 2009 Share Posted November 7, 2009 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} 0 Quote Link to comment Share on other sites More sharing options...
earthone Posted November 7, 2009 Author Share Posted November 7, 2009 Well this sounds good but im a little lost on how to implement it. Any advise? 0 Quote Link to comment Share on other sites More sharing options...
thehost5968 Posted November 7, 2009 Share Posted November 7, 2009 add your client to a group and the 1 = the group id that is show in the admin then the info you want to show that client input it in the code where This is group is. then place the above code where you need it. if you still need help let us now what you have got/ done. 0 Quote Link to comment Share on other sites More sharing options...
earthone Posted November 7, 2009 Author Share Posted November 7, 2009 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? 0 Quote Link to comment Share on other sites More sharing options...
earthone Posted November 7, 2009 Author Share Posted November 7, 2009 Also when I add this it shows that Im getting unencrypted areas while the rest shows it encrypted. Why might this be? 0 Quote Link to comment Share on other sites More sharing options...
thehost5968 Posted November 7, 2009 Share Posted November 7, 2009 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. 0 Quote Link to comment Share on other sites More sharing options...
earthone Posted November 8, 2009 Author Share Posted November 8, 2009 Where can I download this plugin or buy it? 0 Quote Link to comment Share on other sites More sharing options...
thehost5968 Posted November 8, 2009 Share Posted November 8, 2009 (edited) 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 November 8, 2009 by thehost5968 0 Quote Link to comment Share on other sites More sharing options...
earthone Posted November 8, 2009 Author Share Posted November 8, 2009 (edited) 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 November 8, 2009 by earthone 0 Quote Link to comment Share on other sites More sharing options...
earthone Posted November 8, 2009 Author Share Posted November 8, 2009 Its weird because the logic in the above makes since, it seems all im doing is parsing a simple number from the group id and adding it to the .html to get 1.htm, but it don't seem to be working that way. 0 Quote Link to comment Share on other sites More sharing options...
earthone Posted November 8, 2009 Author Share Posted November 8, 2009 Ok so I use an ssl in the area where the script installed. I noticed that when the url is https the code changes to index.php?page=1 or the page doesnt display as 1.html so now I need to figure out how to fix this as I think this is the problem 0 Quote Link to comment Share on other sites More sharing options...
earthone Posted November 8, 2009 Author Share Posted November 8, 2009 Alright Ive been working on this more than 4 hours now and I can see the problem but just cant get to it. If anyone can help id really appreciate it. Thank you. 0 Quote Link to comment Share on other sites More sharing options...
earthone Posted November 8, 2009 Author Share Posted November 8, 2009 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. 0 Quote Link to comment Share on other sites More sharing options...
earthone Posted November 8, 2009 Author Share Posted November 8, 2009 Ok I figured this out, please close this thread as I will create a how to on how to do this. 0 Quote Link to comment Share on other sites More sharing options...
columbusgeek Posted December 30, 2009 Share Posted December 30, 2009 thanks Sparky. Your bit of code was perfect for something I needed. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.