Application.cfm on root
___________________________________________

<cfset appName = "galleonForums">
<cfset prefix = getCurrentTemplatePath()>
<cfset prefix = reReplace(prefix, "[^a-zA-Z]","","all")>
<cfset prefix = right(prefix, 64 - len(appName))>

<cfapplication name="#prefix##appName#" sessionManagement=true
loginstorage="session">

<!---
BD wants error.cfm to be relative when the app.cfm is run inside the
admin
folder. See:
http://ray.camdenfamily.com/index.cfm/2005/9/21/Galleon-Issue-with-BlueD
ragon
--->
        <!---cferror type="exception" template="forum/error.cfm"--->


<cfif not isDefined("application.init") or isDefined("url.reinit")>

        <cfset structDelete(application, "userCache")>

        <!--- get user CFC --->
        <cfset application.factory =
createObject("component","forum.cfcs.objectfactory").init()>
        
        <!--- Get main settings --->
        <cfset application.settings =
application.factory.get('galleonSettings').getSettings()>

        <cfset application.settings.attachmentdir =
getDirectoryFromPath(getCurrentTemplatePath()) & "attachments">

        <cfif not directoryExists(application.settings.attachmentdir)>
                <cfdirectory action="create"
directory="#application.settings.attachmentdir#">
        </cfif>
        
        <!--- get user CFC --->
        <cfset application.user = application.factory.get('user')>

        <!--- get utils CFC --->
        <cfset application.utils = application.factory.get('utils')>
                
        <!--- get conference CFC --->
        <cfset application.conference =
application.factory.get('conference')>
        
        <!--- get forum CFC --->
        <cfset application.forum = application.factory.get('forum')>

        <!--- get thread CFC --->
        <cfset application.thread = application.factory.get('thread')>

        <!--- get message CFC --->
        <cfset application.message = application.factory.get('message')>

        <!--- get rank CFC --->
        <cfset application.rank = application.factory.get('rank')>

        <cfset application.init = true>
        
</cfif>

<!--- include UDFs --->
<cfinclude template="forum/includes/udf.cfm">

<cfif isDefined("url.logout")>
        <cfset structDelete(session, "user")>
        <cflogout>
</cfif>

<!--- handle security --->
<cflogin>

        <!--- are we trying to logon? --->
        <cfif isDefined("form.logon")>
                <cfif isDefined("form.username") and
isDefined("form.password")>
                        <cfif
application.user.authenticate(trim(form.username), trim(form.password))>
                                <!--- good logon, grab their groups --->
                                <cfset mygroups =
application.user.getGroupsForUser(trim(form.username))>
                                <cfset session.user =
application.user.getUser(trim(form.username))>          
                                <cfloginuser
name="#trim(form.username)#" password="#trim(form.password)#"
roles="#mygroups#">
                        </cfif>
                </cfif>
        </cfif>
        
</cflogin>

<!--- Used by index, forums, and threads ---->
<!--- however, if threads, default to lastpost --->
<!--- however, don't do this in the admin ;) --->
<cfif not structKeyExists(variables, "isAdmin")>
        <cfif findNoCase("threads.cfm", cgi.script_name)>
                <cfparam name="url.sort" default="lastpost">
                <cfparam name="url.sortdir" default="desc">
        <cfelse>
                <cfparam name="url.sort" default="name">
                <cfparam name="url.sortdir" default="asc">
        </cfif>
</cfif>


______________________________________

Application.cfm in the /forum folder:
______________________________________

<cfinclude template="../application.cfm">










------------------------------------------------
Michael Appenzellar

Mirame Interactive
http://www.mirameinteractive.com
301-663-5672 x6413
-----Original Message-----
From: James Holmes [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 27, 2007 8:34 PM
To: CF-Talk
Subject: Re: galleon forum question

It think we're going to need to see some code. Something strange is
happening.

On 9/28/07, Michael Appenzellar <[EMAIL PROTECTED]>
wrote:
> Technically there is only one application name throughout. In the
/forum
> folder I am just including the application.cfm on the root which has
the
> udf, cfc's and application name.

-- 
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289739
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