[text]p=/author/location/[/text] [include file=/includes/header.tpl&title=Add a Location to the Kanu Hawaii Community&h=author][function name=do] --set form vars [formvariables][hideif [url][name][/url]^filename=%22][text scope=global][middle startAfter=name="&endBefore="][name][/middle]=[value][/text][/hideif][/formvariables] [showif [process]=t] [math scope=global]error=0[/math] [math scope=global]onechallenge=0[/math] [math scope=global]errortext=0[/math] [math scope=global]errorzip=0[/math] [math scope=global]errorurl=0[/math] [math scope=global]erroraddress=0[/math] [text scope=global]hasLogo=[/text] [text scope=global]lat=[middle startAfter=(&endBefore=,][thislatlong][/middle][/text] [text scope=global]long=[middle startAfter=, &endBefore=)][thislatlong][/middle][/text] [showif [url][thisLatLong][/url]=] [math scope=global]error=1[/math][math scope=global]erroraddress=1[/math] [/showif] [showif [url][locations.locname][/url]=] [math scope=global]error=1[/math][math scope=global]errortext=1[/math] [/showif] [showif [url][locations.locZip][/url]=] [math scope=global]error=1[/math][math scope=global]errortext=1[/math] [/showif] -- zip valid? [text scope=global]thisZip=[getChars start=1&end=5][middle startAfter= HI &endBefore=,][address][/middle][/getChars][/text] [text]temp=[middle endBefore=, HI [thiszip]][address][/middle][/text] [listwords words=[temp]&delimeters= ] [text scope=global]thisCity=[word][/text] [/listwords] [search db=/db/zipcodes.db&eqZIPCODEdatarq=[thiszip]&eqABBRdatarq=HI] [hideif [numfound]=1] [math scope=global]error=1[/math][math scope=global]erroraddress=1[/math] [/hideif] [/search] [showif [url][locations.locurl][/url]!] [hideif [url][locations.locurl][/url]~http] [math scope=global]error=1[/math][math scope=global]errorurl=1[/math] [/hideif] [/showif] [text]c=locAloha,locBuyLocal,locEatLocal,locWaste,locEnergy,locCitizen[/text] [listwords words=[c]&delimeters=,] [showif [? locations.[word]]=1] [math scope=global]onechallenge=1[/math] [/showif] [/listwords] [showif [onechallenge]=0] [math scope=global]error=1[/math] [/showif] [if [error]=0] [then] ------------------------------ -- begin grab logo if added -- ------------------------------ [function name=getFileExtension] [showif [url][name][/url]^.jpg] [return]jpg[/return] [/showif] [showif [url][name][/url]^.gif] [return]gif[/return] [/showif] [showif [url][name][/url]^.png] [return]png[/return] [/showif] [/function] [function name=convertImages] [writefile file=z/[cart].[fileExt]&secure=F][value][/writefile] [waitforfile file=z/[cart].[fileExt]] [text show=f]imcommands=-resize 400x400 "z/[cart].[fileExt]" "../../images/locations/[cart].jpg"[/text] [shell scriptid=ImageMagickConvert][/shell] [text show=f]imcommands=-define jpeg:size=200x200 "z/[cart].[fileExt]" -thumbnail 100x100> -background white -gravity center -extent 100x100 "../../images/locations/t/[cart].jpg"[/text] [shell scriptid=ImageMagickConvert][/shell] [/waitforfile] [movefile from=z/[cart].[fileExt]&to=archive/[cart].[fileExt]] [text scope=global]hasLogo=T[/text] [/function] [formvariables] [showif [url][name][/url]^[url]FileToUpload[/url]] [text]fileExt=[getFileExtension][/text] [switch value=[fileExt]] [case value=jpg] [convertImages] [/case] [case value=gif] [convertImages] [/case] [case value=png] [convertImages] [/case] [/switch] [/showif] [/formvariables] ------------------------------ -- end grab logo if added -- ------------------------------ -- for multiple locations, replace ALL locations with this logo [search db=/db/locations.db&eqlocnamedatarq=[locations.locname]] [replaceFoundItems]hasLogo=T[/replaceFoundItems] [/search] [search db=/db/locations.db&eqlocnamedatarq=[locations.locname]] [foundItems] [copyfile from=/images/locations/[cart].jpg&to=/images/locations/[locid].jpg] [copyfile from=/images/locations/t/[cart].jpg&to=/images/locations/t/[locid].jpg] [/foundItems] [/search] [append db=/db/locations.db]locid=[cart]&locname=[url][locations.locname][/url]&locaddress=[url][middle endBefore=, USA][address][/middle][/url]&locurl=[url][locations.locurl][/url]&locphone=[url][locations.locphone][/url]&loccity=[lookup db=/db/zipcodes.db&value=[getChars start=1&end=5][thiszip][/getChars]&lookinfield=zipcode&returnfield=city]&locstate=HI&loczip=[thiszip]&locadded=[date]T[time][showif [? locations.locCitizen]=1]&locCitizen=T[/showif][showif [? locations.locEnergy]=1]&locEnergy=T[/showif][showif [? locations.locWaste]=1]&locWaste=T[/showif][showif [? locations.locEatLocal]=1]&locEatLocal=T[/showif][showif [? locations.locAloha]=1]&locAloha=T[/showif][showif [? locations.locBuyLocal]=1]&locBuyLocal=T[/showif]&locAddedBy=[thisuid]&locNumPics=0&locNumReviews=0&locLastUpdate=[date]T[time]&locLat=[lat]&locLong=[long]&loctype=[locations.loctype]&locIsland=[lookup db=/db/zipext.db&value=[getChars start=1&end=5][thiszip][/getChars]&lookinfield=zip&returnfield=island]&hasLogo=[hasLogo]&popularity=0[/append] --update master table [append db=/db/master.db&autonumber=masterid]itemid=[cart]&content=[url][locations.locname] [middle endBefore=, USA][address][/middle][/url]&title=[url][locations.locname][/url]&type=location&lastupdate=[date]T[time]&itemurl=/location/?id=[cart][showif [lookup db=/db/members.db&value=[thisuid]&lookinfield=useruid&returnfield=profileImage]=t]&authorimage=profile/t/[thisuid].jpg[/showif]&useruid_key=[thisuid][/append] [redirect /location/?id=[cart]&a=new] [/then] [else] [/showif] [return][/return] [/function][do]

Share a Location


[if "[loggedin]"="T"] [then] [getInclude f=author.location.inc]
[showif [process]=t]
Sorry we had a problem adding your location. Please complete all required fields marked with a red asterick.
[/showif]
[/then] [else]

Please login or join to share a location.

[/else] [/if]
[include /includes/footer.tpl]