Posts filed under ‘Programming’

WordPress IIS7 IUSR File Permissions on Windows 2003

Been having some issues with WordPress on IIS7 windows 2003 for a while now and think I finally got it solved, thought I’d post the info here for others to see, as I had a hard time finding this info myself anywhere else, not even the WordPress website.

This is what I found after a lot of playing around, if you see any issues with this or have any feedback please let me know below.

On the wp-content folder I applied the following permissions.

C:\inetpub\wwwroot\wordpress\wp-content
– IUSR with following permissions

  • Traverse folder / execute file
  • List folder / read data
  • Read attributes
  • Read extended attributes
  • Create files / write data
  • Create folders / append data
  • Write attributes
  • Write extended attributes
  • Delete subfolders and files
  • Delete
  • Read permissions

I also have the following groups and users on there

  • IIS_IUSRS
  • Trustedinstaller
  • SYSTEM
  • Administrators
  • Users
  • CREATOR OWNER

Here are the steps I followed

  • Right click wp-content
  • Properties
  • Security tab
  • Advanced button
  • Change permissions button
  • Add button
  • Advanced button
  • Find now button
  • Locate IUSR and double click
  • OK button
  • Check box Allow Full control
  • Uncheck the boxes; Full control, Take ownership, Change permissions
  • Click OK button
  • Check box “Replace all child object permissions with inheritable permissions from this object”
  • Click OK button
  • Click Yes when asked if you want to continue
  • Click OK button
  • Click OK button

I’m not making anything in the root writable, like wp-config etc. I change that manually or as a one off.

April 6, 2011 at 12:59 am 1 comment

CF9.0.1 CFLOCATION onRequestEnd problems…

Quick heads up! This has caused me serious headache.

The way onRequestEnd works in ColdFusion 9.0.1 has changed, it now executes the onRequestend method in the application.cfc after a redirect… This can seriously mess up some code like it did mine.

February 21, 2011 at 5:10 am Leave a comment

Show PHP errors

By default PHP does not show you the errors or debugging, you need to enable this in the config or add the following code to your page to display the PHP errors.

<?php
error_reporting(E_ALL);
ini_set(‘display_errors’, ‘1’);
?>

January 26, 2011 at 4:11 am Leave a comment

cfhttp I/O Exception: peer not authenticated Error

cfhttp I/O Exception: peer not authenticated Error

Continue Reading January 19, 2011 at 7:50 am 1 comment

Replace tab in MS SQL

Replacing a tab with something else in MS SQL is easy peasy, following is the code

update [table name]
set [column name] = REPLACE( [column name], CHAR(9), ' ')

July 14, 2010 at 4:53 am Leave a comment

YouTube Video infront of other content – CSS Z-Index

If you have YouTube videos that appear infront of your other website content and giving it a lower z-index does not seem to do the trick then try adding the wmode parameter to the embedded movie.

<object width='425' height='344'> 
    <param name='movie' value='http://www.youtube.com/v/Wj_JNwNbETA&hl=en&fs=1'> 
    <param name='type' value='application/x-shockwave-flash'> 
    <param name='allowfullscreen' value='true'> 
    <param name='allowscriptaccess' value='always'> 
    <param name="wmode" value="opaque" />
    <embed width='425' height='344'
            src='http://www.youtube.com/v/Wj_JNwNbETA&hl=en&fs=1'
            type='application/x-shockwave-flash'
            allowfullscreen='true'
            allowscriptaccess='always'
            wmode="opaque"
    ></embed> 
    </object>
 

June 19, 2010 at 7:57 am 16 comments

EWay ColdFusion Component CFC – Payment Gateway

I’ve invested some time a while ago in creating a ColdFusion Component to integrate with Eway Payment Gateway. I’m not using them anymore and giving the Component away in return for a text link. If you want a copy of the component just leave a comment with the URL where I can find a link to any page of the following sites:

http://www.executiveresults.com.au
http://www.clickfind.com.au
pacificfox.com
http://www.thetoughspot.com.au
http://www.glovesboxing.com.au
http://www.cavemantraining.com.au

Following is bit of the CFC

<cfcomponent 
 displayname="Eway" 
 hint="Eway" 
 output="false" 
 author="Taco Fleur (taco.fleur@clickfind.com.au)" 
 version="1">

 <!--- Set instance variables --->
 <!---
 // http://www.eway.com.au/Support/Developer/PaymentsRebill.aspx
 --->
 <cfscript>
 this.constant.LIVE_GATEWAY_URI = "https://www.eway.com.au/gateway/rebill/manageRebill.asmx";
 this.constant.TEST_GATEWAY_URI = "https://www.eway.com.au/gateway/rebill/test/manageRebill_test.asmx";
 this.constant.GATEWAY = "TEST";                 // TEST or LIVE
 this.constant.LIVE_EWAY_CUSTOMER_ID = "";     // required, customer id assigned to you by eWay
 this.constant.TEST_EWAY_CUSTOMER_ID = "";
 
 variables.instance.userIdentity = 0;
 variables.instance.customerFirstName = "";             // required
 variables.instance.customerLastName = "";             // required
 variables.instance.ewayTotalAmount = 0;             // total amount in cents for the transaction, eg $1.00 = 100, maximum length 12
 // the test Total Amount should end in 00 or 08 to get a successful response (e.g. $10.00 or $10.08) - all other amounts will return a failed response
 variables.instance.ewayCustomerInvoiceRef = 0;         // reference to your own invoice system for the purchase
 variables.instance.rebillCCName = "";                 // required, customer's credit card number
 variables.instance.rebillCCNumber = "";             // required, customer's credit card number
 variables.instance.rebillCCExpMonth = "";             // required, expiry month of customer's credit card
 variables.instance.rebillCCExpYear = "";             // required, expiry year of customer's credit card. Format must be either (yy or yyyy) eg. 06 or 2006.
 variables.instance.rebillInitAmt = 0;                 // required, initial payment amount of the reBILL event. Enter 0 if initial payment is not required.
 variables.instance.rebillInitDate = lsDateFormat( now(), "dd/mm/yyyy" ); // required, date of the initial payment of the reBILL event. Enter today's date if no initial payment is required. Format dd/mm/yyyy.
 variables.instance.rebillRecurAmt = 0;                 // required, recurring payment amount of the reBILL. The value must be greater than 0.
 variables.instance.rebillStartDate = lsDateFormat( now(), "dd/mm/yyyy" ); // required, date of the first recurring payment. Format must of  dd/mm/yyyy
 variables.instance.rebillInterval = 1;                 // required, size of the interval between recurring payments (used in conjunction with RebillIntervalType). The value must be 1 to 31 only.
 variables.instance.rebillIntervalType = "Months";     // required, type of Interval. (1 = Days, 2 = Weeks, 3 = Months, 4 = Years). The value must be only 1 or 2 or 3 or 4. eg. Payments every 3 weeks, enter 3 in the RebillInterval field, and 2 in the RebillIntervalType field. 
 variables.instance.rebillEndDate = lsDateFormat( dateAdd( "y", 10, now() ), "dd/mm/yyyy" ); // required, date that recurring payments are to stop. Format must of  dd/mm/yyyy. This date must be after RebillStartDate.
 variables.instance.requestXML = xmlNew();
 variables.instance.responseXML = xmlNew();
 </cfscript>

…………..

You’ll get the component in return for a simple text link, the link needs to stay up for at least a year, once I send the component I’ll trust you’ll do the honorable thing 🙂

June 12, 2010 at 12:52 am Leave a comment

What is utm? utm_

UTM stands for Urchin Traffic Monitor and is originally part of Urchin 4, and was specifically designed to provide the most accurate measurements of unique website visitors. For businesses looking to get a deeper understanding of their online visitor behavior.

http://www.google.com/support/urchin45/bin/answer.py?hl=en&answer=28710

This extra information appears in the Google Analytics reports under Traffic Sources.

Campaign Source (utm_source) Required. Use utm_source to identify a search engine, newsletter name or other source.
Example: utm_source=google
Campaign Medium (utm_medium) Required. Use utm_medium to identify a medium such as email or cost-per- click.
Example: utm_medium=cpc
Campaign Term (utm_term) Used for paid search. Use utm_term to note the keywords for this ad.
Example: utm_term=running+shoes
Campaign Content (utm_content) Used for A/B testing and content-targeted ads. Use utm_content to differentiate between ads or links that point to the same URL.
Examples: utm_content=logolink or utm_content=textlink
Campaign Name (utm_campaign) Used for keyword analysis. Use utm_campaign to identify a specific product promotion or strategic campaign.
Example: utm_campaign=spring_sale

Following is a ColdFusion CFC to get the values passed in the URM variables.

<cfcomponent
 displayname="UrchinTrafficMonitor"
 hint=""
 output="false"
 author="Taco Fleur (taco.fleur@clickfind.com.au)"
 version="1">

 <!--- Set instance variables --->
 <cfscript>
 variables.instance.referrer = "";
 variables.instance.campaignSource = ""; // referrer: google, citysearch, newsletter4
 variables.instance.campaignMedium = ""; // marketing medium: cpc, banner, email
 variables.instance.campaignTerm = ""; // identify the paid keywords
 variables.instance.campaignContent = ""; // use to differentiate ads
 variables.instance.campaignName = ""; // product, promo code or slogan
 </cfscript>

 <cffunction
 access="public"
 name="init"
 output="false"
 returntype="UrchinTrafficMonitor">

 <cfargument
 name="referrer"
 type="string"
 required="yes">

 <cfscript>
 setReferrer( arguments.referrer );
 doInitialize();
 return this;
 </cfscript>

 </cffunction>

 <cffunction
 access="public"
 name="setReferrer"
 output="false"
 returntype="void">

 <cfargument
 name="referrer"
 required="yes"
 type="string">

 <cfscript>
 variables.instance.referrer = arguments.referrer;
 </cfscript>

 </cffunction>

 <cffunction
 access="public"
 name="getReferrer"
 output="false"
 returntype="string">

 <cfscript>
 return variables.instance.referrer;
 </cfscript>

 </cffunction>

 <cffunction
 access="public"
 name="setCampaignSource"
 output="false"
 returntype="void">

 <cfargument
 name="campaignSource"
 required="yes"
 type="string">

 <cfscript>
 variables.instance.campaignSource = arguments.campaignSource;
 </cfscript>

 </cffunction>

 <cffunction
 access="public"
 name="getCampaignSource"
 output="false"
 returntype="string">

 <cfscript>
 return variables.instance.campaignSource;
 </cfscript>

 </cffunction>

 <cffunction
 access="public"
 name="setCampaignMedium"
 output="false"
 returntype="void">

 <cfargument
 name="campaignMedium"
 required="yes"
 type="string">

 <cfscript>
 variables.instance.campaignMedium = arguments.campaignMedium;
 </cfscript>

 </cffunction>

 <cffunction
 access="public"
 name="getCampaignMedium"
 output="false"
 returntype="string">

 <cfscript>
 return variables.instance.campaignMedium;
 </cfscript>

 </cffunction>

 <cffunction
 access="public"
 name="setCampaignTerm"
 output="false"
 returntype="void">

 <cfargument
 name="campaignTerm"
 required="yes"
 type="string">

 <cfscript>
 variables.instance.campaignTerm = arguments.campaignTerm;
 </cfscript>

 </cffunction>

 <cffunction
 access="public"
 name="getCampaignTerm"
 output="false"
 returntype="string">

 <cfscript>
 return variables.instance.campaignTerm;
 </cfscript>

 </cffunction>

 <cffunction
 access="public"
 name="setCampaignContent"
 output="false"
 returntype="void">

 <cfargument
 name="campaignContent"
 required="yes"
 type="string">

 <cfscript>
 variables.instance.campaignContent = arguments.campaignContent;
 </cfscript>

 </cffunction>

 <cffunction
 access="public"
 name="getCampaignContent"
 output="false"
 returntype="string">

 <cfscript>
 return variables.instance.campaignContent;
 </cfscript>

 </cffunction>

 <cffunction
 access="public"
 name="setCampaignName"
 output="false"
 returntype="void">

 <cfargument
 name="campaignName"
 required="yes"
 type="string">

 <cfscript>
 variables.instance.campaignName = arguments.campaignName;
 </cfscript>

 </cffunction>

 <cffunction
 access="public"
 name="getCampaignName"
 output="false"
 returntype="string">

 <cfscript>
 return variables.instance.campaignName;
 </cfscript>

 </cffunction>

 <cffunction
 access="private"
 name="doInitialize"
 output="false"
 returntype="void">

 <cfscript>
 variables.queryString = listLast( getReferrer(), "?" );
 variables.url = structNew();
 </cfscript>
 <cfloop
 index="item"
 list="#variables.queryString#"
 delimiters="&">
 <cfscript>
 variables.key = listFirst( item, "=" );
 variables.value = listLast( item, "=" );
 if ( not structKeyExists( variables.url, variables.key ) ) {
 structInsert( variables.url, variables.key, urlDecode( variables.value ) );
 }
 else {
 listAppend( variables.url[ variables.key], urlDecode( variables.value ) );
 }
 </cfscript>
 </cfloop>

 <cfscript>
 if ( structKeyExists( variables.url, "utm_source" ) ) {
 setCampaignSource( variables.url[ "utm_source" ] );
 }
 if ( structKeyExists( variables.url, "utm_medium" ) ) {
 setCampaignMedium( variables.url[ "utm_medium" ] );
 }
 if ( structKeyExists( variables.url, "utm_term" ) ) {
 setCampaignTerm( variables.url[ "utm_term" ] );
 }
 if ( structKeyExists( variables.url, "utm_content" ) ) {
 setCampaignContent( variables.url[ "utm_content" ] );
 }
 if ( structKeyExists( variables.url, "utm_campaign" ) ) {
 setCampaignName( variables.url[ "utm_campaign" ] );
 }
 </cfscript>

 </cffunction>

</cfcomponent>

Code to call the CFC.

<cfscript>
 variables.UrchinTrafficMonitor = createObject( "component", "UrchinTrafficMonitor" ).init( referrer = "http://www.clickfind.com.au/?utm_source=clickfind&utm_medium=cpc&utm_term=advertising&utm_content=ad1&utm_campaign=online+promo");
</cfscript>
<cfdump var="#variables.UrchinTrafficMonitor.getCampaignMedium()#">
<cfabort>

Source
Every referral to a web site has an origin, or source. Examples of sources are the Google search engine, the AOL search engine, the name of a newsletter, or the name of a referring web site.

Medium
The medium helps to qualify the source; together, the source and medium provide specific information about the origin of a referral. For example, in the case of a Google search engine source, the medium might be “cost-per-click”, indicating a sponsored link for which the advertiser paid, or “organic”, indicating a link in the unpaid search engine results. In the case of a newsletter source, examples of medium include “email” and “print”.

Term
The term or keyword is the word or phrase that a user types into a search engine.

Content
The content dimension describes the version of an advertisement on which a visitor clicked. It is used in content-targeted advertising and Content (A/B) Testing to determine which version of an advertisement is most effective at attracting profitable leads.

Campaign
The campaign dimension differentiates product promotions such as “Spring Ski Sale” or slogan campaigns such as “Get Fit For Summer”.

May 31, 2010 at 4:47 am Leave a comment

encodeURIComponent ColdFusion

JavaScript encodeURIComponent converted to ColdFusion. This is used for OAuth.

			
 <cffunction 
 access="private" 
 name="doPercentEncode" 
 output="false" 
 returntype="string">

 <cfargument 
 name="stringToEncode" 
 type="string" 
 required="yes">

 <cfscript>
 variables.encodedString = arguments.stringToEncode;
 variables.encodedString = replace( variables.encodedString, "!", "%21", "all" );
 variables.encodedString = replace( variables.encodedString, "*", "%2A", "all" );
 variables.encodedString = replace( variables.encodedString, "##", "%23", "all" );
 variables.encodedString = replace( variables.encodedString, "$", "%24", "all" );
 variables.encodedString = replace( variables.encodedString, "%", "%25", "all" );
 variables.encodedString = replace( variables.encodedString, "&", "%26", "all" );
 variables.encodedString = replace( variables.encodedString, "'", "%27", "all" );
 variables.encodedString = replace( variables.encodedString, "(", "%28", "all" );
 variables.encodedString = replace( variables.encodedString, ")", "%29", "all" );
 variables.encodedString = replace( variables.encodedString, "@", "%40", "all" );
 variables.encodedString = replace( variables.encodedString, "/", "%2F", "all" );
 variables.encodedString = replace( variables.encodedString, "^", "%5E", "all" );
 variables.encodedString = replace( variables.encodedString, "~", "%7E", "all" );
 variables.encodedString = replace( variables.encodedString, "{", "%7B", "all" );
 variables.encodedString = replace( variables.encodedString, "}", "%7D", "all" );
 variables.encodedString = replace( variables.encodedString, "[", "%5B", "all" );
 variables.encodedString = replace( variables.encodedString, "]", "%5D", "all" );
 variables.encodedString = replace( variables.encodedString, "=", "%3D", "all" );
 variables.encodedString = replace( variables.encodedString, ":", "%3A", "all" );
 variables.encodedString = replace( variables.encodedString, ",", "%2C", "all" );
 variables.encodedString = replace( variables.encodedString, ";", "%3B", "all" );
 variables.encodedString = replace( variables.encodedString, "?", "%3F", "all" );
 variables.encodedString = replace( variables.encodedString, "+", "%2B", "all" );
 variables.encodedString = replace( variables.encodedString, "\", "%5C", "all" );
 variables.encodedString = replace( variables.encodedString, '"', "%22", "all" );
 return variables.encodedString;
 </cfscript>

 </cffunction>

May 17, 2010 at 1:01 am Leave a comment

Password Value as Text

I was working on a design the other day that only had text fields with no labels, the label was in the text field and would disappear when clicked on

Continue Reading November 17, 2009 at 1:53 am Leave a comment

Older Posts


Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 22 other followers

Archives

Top Rated

Top Clicks

  • None

Blog Stats

  • 173,942 hits

RSS Start Listing

  • An error has occurred; the feed is probably down. Try again later.

%d bloggers like this: