Thanks for the feedback, Isaac...

I was actually planning to use url's like "agent.c21ar.com"
and create subdomains (A records in the DNS manager) and then
point those subdomains to the main agents' folder and use
cfif statements to setup the variables for
a particular agent's version of the site.

If a visitor is coming to an agent's site from a page on the
main website, then I can pick up a url variable to id the agent.

If a visitor is coming to an agent's site from their domain,
I can use the cgi.server_name variable to id the domain and get
the agent info that way.

Then I can convert the data into session variables that will be changed
only if the cgi.server_name is not the same as the session.subdomain
or if a url.agent_id variable is present...  (I don't know if this
approach is without problems or not... I guess I need to go ahead
and do some testing to see if it breaks down in practice.)

Do you see any problems with this approach?

<cfif (isdefined('session.subdomain') and session.subdomain is not 
'#cgi.server_name#')
   or isdefined('url.agent_id')>

   <cfquery name='get_agent_info' datasource='#dsn#'>

      select *
        from hmls_agents

      <cfif isdefined('url.agent_id')>
       where hmls_agent_id = '#url.agent_id#'
      <cfelse>
       where domain_name = '#cgi.server_name#'
      </cfif>

   </cfquery>

   <cfoutput query='get_agent_info'>

      <cfset session.agent_first_name = '#first_name#'>
      <cfset session.agent_last_name = '#last_name#'>
      <cfset session.agent_phone = '#phone#'>
      etc...

   </cfoutput>

</cfif>



> 
> Umm... no my original thinking was just to have the one Application.cfm
> in the root /agents/ folder to include the root app.cfm from the parent
> app, so that one app.cfm in agents would run all the agents... however...
> if you're planning to give them urls like /c21ar.com/agents/[agent]/
> then it's conceivable you could use an application.cfm in each directory
> to identify the agent and set up the environment for their page. I
> wouldn't put all the code in their individual application.cfm however if
> you're going to do that, I would create a function (or maybe even a CFC
> :) in the parent application.cfm and then in the app.cfm for the
> individual agent, you can just call that function to set up the
> environment like
> 
> /agents/Application.cfm
> <cfinclude template="../Application.cfm">
> <cfset agentEnv = CreateObject("component","agentEnv").init() />
> 
> /agents/[agent]/Application.cfm
> <cfinclude template="../Application.cfm">
> <cfset agentEnv.setup("[agent]") />
> 
> if that makes sense. ;)
> 
> but no originally I was just thinking you would have just the
> /agents/Application.cfm and it would perform whatever variable
> testing it needed to perform to identify the agent. I suppose
> actually rather than another Appication.cfm in each directory
> you could just have an /index.cfm that includes "../index.cfm"
> or the like - that way you've still got just the one application.cfm
> and really just the one page template too... unless you wanted
> to cache some custom layout for them in their index template.
> 
> --
> s. isaac dealey  ^  new epoch
>  isn't it time for a change?
>      ph: 617.365.5732
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307071
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to