Tuesday, 23 July 2013

Delete Directory and Contents using DOS Command Prompt

Open Command Prompt and enter the following, replacing path between quotes with path to folder to delete.
RD /S /Q "C:\Users\UserName\Desktop\Folder"
Switches:
/S Removes all directories and files in the specified directory in addition to the directory itself. Used to remove a directory tree.

/Q Quiet mode, do not ask if ok to remove a directory tree with /S

Thursday, 25 April 2013

Enable Table Controls in FCKeditor on OpenCart

ckeditor config js location:
admin/view/javascript/ckeditor/config.js

Change 

['Image','Table','HorizontalRule']
 


To

['Image','Table','HorizontalRule','Format']

Sunday, 3 February 2013

How to duplicate a row in MySQL

INSERT INTO table_name (field_name1, field_name2, field_name3, field_name4) SELECT field_name1, field_name2, field_name3, field_name4 FROM table_name WHERE id = 87

INSERT INTO table_name (field_name) SELECT field_name FROM table_name WHERE id = 87

Thursday, 13 December 2012

MODX 2.2.2 on IIS 7.5 - Authentication Required (Manager login)

On a recent install of MODX 2.2.2 attempting to login to the Manager threw a Windows Authentication dialogue box.  Selecting Cancel allowed access to the login screen on internal browsers (FF, Chrome and Opera) but could not be bypassed at the client's location.

Disabling Windows Authentication in IIS for the client's website prevents the Authentication box from being shown.

Interestingly Firebug showed that all the required files associated with the login page were sent to the browser even though the Authentication dialogue appeared.



Thursday, 6 December 2012

MODX Dashboard shows 500 Internal Server Error on Login

An issue occured with the MODX News and Security feeds today causing IIS to throw a 500 Internal Server Error on login.  If IIS is set up to show detailed errors the actual error is displayed:
Reserved XML Name at line 1, column 38

This error will appear twice if both News and Security feeds are enabled and will disappear if the feeds are disabled.

Disable MODX News and Security Feeds

To prevent the error you need to access the System Settings:
  • System > System Settings
  • Filter by Area > System and Server
  • Set MODX Security Feed Enabled and MODX News Feed Enabled to No
Accessing System Settings when the navigation does not appear means you need to know the URL or have any other manager URL in your browser history that can load a page where the navigation will display.  The System Settings URL is likely to be:
http://www.domain.co.uk/manager-location/index.php?a=70

Related settings

The following settings are usueful to know when working with the News and Security feeds:

 Changing Feed Headings

  • System > Lexicon Management
  • Topic > Dashboard from the dropdown
  • Set new values for modx_news and security_notices

Changing Feed URLs

  • System > System Settings
  • Filter by Area > System and Server from the dropdown
  • MODX Security Notices Feed URL
Note: this relates to MODX Revolution v2.2.4, some item names or locations may be different on other versions.

Thursday, 19 April 2012

Add new columns to table in MySQL

The ALTER TABLE command can be used to add new columns to an existing table in a MySQL database:
ALTER TABLE table_name
ADD column_name datatype (eg. tinytext)
To add the column after an specific existing column add:
AFTER existing_column
To add multiple columns with the same statement a number of ADD commands can be chained together and separated with commas:
ALTER TABLE table_name
ADD social_url_twitter tinytext,
ADD social_url_facebook tinytext,
ADD social_url_blogger tinytext

Saturday, 6 November 2010

Debugging Classic ASP on IIS7.5

By default IIS7 does not send detailed errors to the browser, instead sending a rather generic statement:
An error occurred on the server when processing the URL. Please contact the system administrator.
To enable detailed errors open the IIS Manager and navigate to the relevant website and double click on the ASP icon in the Features View tab.

Under the Compilation heading expand Debugging Properties and change Send Errors to Browser to True