frankms
Posts: 2
|
| Posted: 12/17/2004, 12:37 PM |
|
i'm new at ccs; just started a site called www.stanfordentrepreneurs.com based on the portal example.
now would like to expand site to other universities, but keep maintaining one codebase.
I would like to accomplish this by setting a session variable based on the site URL that was used (eg stanfordentrepreneurs or harvardentrepreneurs) and subsequently pull different content out of the database based on this session variable.
this must be relatively easy to do (?!); could anyone point me to an example?
also would like to change the logo on the header html page based on this session variable.
would this variable stay the same even if browing the site and coming back to the default.php site from a link within the site? (i.e. through a cookie or so?)
thanks for your help,
Frank
|
 |
 |
peterr
Posts: 5971
|
| Posted: 12/17/2004, 3:30 PM |
|
You can place some code in Common.php where you can read the PHP variable that contains the domain name (I think its 'SERVER_NAME', see http://www.php.net/manual/en/reserved.variables.php ), then create a session variable based on that. The session variable will stay unchanged on all pages, especially if set in Common.php. You can also use that PHP variable since it's there at all times.
You can then easily filter grids by creating a parameter in the Data Source that specifies that some field in the database must be equal the new session variable. The parameter type would need to be set to "Session".
You can implement the logo as a label and use the CCDLookUp function to retrieve the correct image link from the database based on the value of that session or 'SERVER_NAME' variable.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
frankms
Posts: 2
|
| Posted: 12/17/2004, 6:13 PM |
|
Thanks!!
That was helpful,
Frank
|
 |
 |
|