Showing posts with label web authoring. Show all posts
Showing posts with label web authoring. Show all posts

Sunday, July 10, 2011

Four reasons to use a CMS

I get a lot of traffic on this blog from people searching for help with Joomla issues. So I thought this might be relevant to some of my readers.

Question: Should you really use a content management system for your web project?

Some advantages involve ease of setup, ease of administration, adding new posts etc. Which are often a key selling point, especially when developing a website for users who deem themselves to be non-technical and don't want to mess around editing HTML and the likes.

Anyway, I just read this in something I was reading and would like to share it here:


Four Reasons to Use a Content Management System
  • 1. Do you need to update your website's content more than once a month?
  • 2. Do you plan to have a regularly updated blog on the site? (Note: Regularly updated = someone will be responsible for it. Blog posts don't come out of nowhere.)
  • 3. Will non-technical/non-web developers be writing posts, updating the site, etc?
  • 4. Will you need the ability to update/manage/maintain the site from any location, without using special software like an FTP client etc?

If you answered 'Yes' to any of those questions, then you're likely to need one. If you didn't, then why not consider just making a static website?

Saturday, March 26, 2011

Unsafe JavaScript attempt to access frame with URL

Getting a "Unsafe JavaScript attempt to access frame with URL" message in Chrome when trying something dodgy across domains or subdomains with iframes?

It is pretty much a browser security feature. So there's no way it is going to work.

Eventually I settled for doing everything from within an iframe.

Sunday, March 20, 2011

Cannot access empty property PHP

Don't use the '$' when accessing a member variable. i.e.:

Wrong:
$MYTHING->$dbhost = 'localhost';

Correct:
$MYTHING->dbhost = 'localhost';

Sunday, March 13, 2011

ReplaceAll in Javascript Example

ReplaceAll in Javascript Example:

Instead of:

mynicestring = mynicestring.replace("find","replacement");

Use:

mynicestring = mynicestring.replace(/find/g,"replacement");

Wednesday, March 02, 2011

jQuery modal not working when inside click function

It seems that every time I want to do something new, I am faced with learning/figuring out a new library or technology. This time it was jQuery and boy I was having some problems with it.

One of the issues I was facing was with this code, where I wanted to show a modal 'pop up' when an image was clicked. The 'modal' command worked fine, except that it refused to work when called from inside a 'click' function.

If anyone knows how to make this work I'd love to know.

//works on its own
jQuery('#takeidphoto').modal({position: [160,160]});

//totally doesn't work
jQuery('#takephotoimg').click(function() {
jQuery('#takeidphoto').modal({position: [160,160]});
});


In the end I resorted to plain old javascript and used this decent library from Matt Kruse called 'DIV Popups' which served my purpose: http://www.javascripttoolbox.com/lib/popup/example.php

Wednesday, February 23, 2011

Transparent PNG Illustrator Export

To make/export a PNG with transparency from Illustrator. Don't use the usual 'Export' feature in the file menu.

Use 'File' -> 'Save for Web and Devices'

From there, you can select 'transparency' from the options at the right of the dialog box.

Thursday, January 27, 2011

Wordpress "The requested document was not found on this server"

The error message "The requested document was not found on this server" was happening after I moved a Wordpress blog to another directory. I followed all the correct steps here but the error was still coming.

So it turns out, my .htaccess file was missing all along. To fix this:

You need to create a file called ".htaccess" (yes including the . at the start) and copy it, via ftp or whatever you use, it in the root folder of your Wordpress blog on your server.

Inside that file, enter the following and upload it. That should do the trick:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Monday, December 13, 2010

Warning: include() [function.include]: URL file-access is disabled in the server configuration

I too, was getting the error:

Warning: include() [function.include]: URL file-access is disabled in the server configuration

For my include file.

Using "Allow_url_include = On" in my php.ini file was not an option for me, since I was using a cpanel on some third part web host. (Allow_url_include is kind of a bad thing to do anyway, since it means other hosts can link to your file and steal your code).

However, this site taught me how to solve it: http://blog.everymanhosting.com/php-coding/warning-include-functioninclude-url-file-access-is-disabled-in-the-server-configuration/

The option that worked for me was:

require_once($_SERVER['DOCUMENT_ROOT'].'/file.php');

Monday, May 18, 2009

New Menu Not Showing in Joomla

So you made a menu in Joomla 1.5 and it didn't show on your front page?

Don't forget to go to 'extensions' -> 'module manager' and enable the menu there.


Sunday, May 10, 2009

Tuesday, March 10, 2009

Invoking a JSP From a Cron Job

To invoke a JSP page from a cron job. Simply use wget:


wget http://mynicesite.com/mynicejsp.jsp



Tuesday, February 17, 2009

Paint.Net

Okay so, for anyone that knows me well, it is no big secret that I am a complete graphics Luddite. After stints with Paint Shop Pro in the 90s; since 2000 onwards I've been using MS Paint to do really primitive stuff and Gimp (via painfully reading HowTos) for anything that's a bit complicated. Today, I realized it is about time I took a step forward or else I'll soon be classified as a Quaker or something.

Enter Paint.Net in to my life, downloadable from:

http://www.getpaint.net/index.html


What's great is that the software is DonationWare which means you can download the entire thing for free.. and donate once the tool starts making money for you (or at least that's how I translate the licensing model for DonationwWare :). Ahem... bash me if you disagree. ).

Sunday, January 27, 2008

How to dynamically change the height of an IFRAME in both Firefox and IE

Based on various code snippets that I found on the Internet, here is how to do it:

(Please contact me if you are the original author of the functions)



function getDocHeight(doc) {
var docHt = 0, sh, oh;
if (doc.height) {
docHt = doc.height;
}
else if (doc.body) {

if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;

if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;

if (sh && oh) docHt = Math.max(sh, oh);
}

return docHt;
}

function fnResizeIframe(sIFrameName) {

var iframeWin = window.frames[sIFrameName];

var iframeEl = window.document.getElementById? window.document.getElementById(sIFrameName): document.all? document.all[sIFrameName]: null;

if ( iframeEl && iframeWin ) {
iframeEl.style.height = "auto";
var docHt = getDocHeight(iframeWin.document);

if (docHt) iframeEl.style.height = docHt + "px";

}
else { //firefox
var docHt = window.document.getElementById(iframeName).contentDocument.height;
window.document.getElementById(iframeName).style.height = docHt + "px";
}


} //end of function getDocHeight(doc)



Sunday, July 22, 2007

CSS. Right Aligning a Background Image

background-repeat: no-repeat;

background-attachment: fixed;

background-position: top right;