Tech Tidbits

Joes Tech Tidbits

iTunes Compilation Mess Fixed!

No comments
multi-images

3 pictures for this album

Got tired of all those individual “Cover Art” for every track. Knew there had to be a fix,so searched around. Seems that for some reason, when you import an album from CD, iTunes does not group the tracks, but puts them in very strange places. Not only that, each song has to have it’s own art. While it is true that you can select all the pieces in an album and do a  “multi-item” action and apply one art, you still end up with multiple album covers.multi-item window

The Fix – select all the pieces in the album (click on the first item, and either ctrl-click each additional or shift-click). Then right-click and select “Get Info”, which will take you to the “Multiple Item Information” window. Simply check “Part of Compilation” and change the dropdown to “Yes”.

That’s it, and now you will have one piece of artwork for all the selections! Much nicer looking.

Slow Zen Cart – No More!

No comments

Tried everything that I could find to patch up Zen Cart and make it put up pages faster, but none of that worked. Even did the phpMyAdmin thing and tried to clean up the datafiles. phpMyAdmin gave me the sad story that there were things not enabled in configuration, so that did not work. Logged on to MySQL with HeidiSQL (kind of like phpMyAdmin) and ran a couple of tests on the DB, but nothing.
I had run across an article about “mysql query cache“, and the difference having cache enabled when there are repeated requests for the same data (the same “select” statement).

After trying to get everything fixed, I did a search for “mysql query cache” with Google, and ended up at a MySQL developers page where they explained everything in elegant form. The MySQL page even explained how you could enable cache for a sql statement, without having to shutdown MySQL. I followed the instructions, and now pages that used to take 20-50 seconds to load pop up in 3-5 seconds.

Now comes the fun – let’s see if any other pages load faster!

Yes! Other pages (that depend on MySQL) definitely load faster.

Remember those long and ugly URLs that show up sometime when you click on a link – like

http://yourfamousdomain.com/index.php?page=new_products
The URL shows the question mark and all the code that has to follow, especially when you may have multiple layers or very long page names. That can be solved by turning on “mod_rewrite” in config.php in your CMSMS root directory. It also involves copying the htaccess.txt file from the CMS “doc” folder to the CMS root directory. Using “pretty URLs” will leave this in your browser location bar…
http://www.yourfamousdomain.com/new_products/

Let’s begin by opening “config.php” and making our changes. In the “URL Settings” section, find the following line
$config['url_rewriting'] = 'none';
and change “none” to “mod_rewrite”
Then where $config['page_extension'] = '/'; is, change the '' to '/'. This will add a forward slash at the end of your URL. Save and close your editor.

Now, copy /Doc/htaccess.txt to your root directory and rename the file “.htaccess” Note the DOT before htaccess. It has to be that way for Apache to find it. It is no longer htaccess.txt! In .htaccess, make sure that if you have installed CMS in a subdirectory, to find
RewriteBase /

and change the / to something like this:
RewriteBase /mycmsdirectory
Do not follow the directory name with a forward slash – leave it open!

Make sure that in your Apache “httpd-vhosts.conf” that the entry for your DocumentRoot looks like this:

<Directory "/users/myfabulousdomain/htdocs">
Options FollowSymLinks
AllowOverride All
Order deny,allow
allow from all
Satisfy all
</Directory>

the “FollowSymLinks” is very important for “Pretty URLs”, as is “allow from all”

Even though the theme had been imported properly, I kept getting an error “string(82) “Smarty error: unable to read resource: “module_db_tpl:MenuManager;Freshmedia Main”". Problem turned out to be easily remedied. Seems that what was in the import file gave a name of “Freshmedia : Freshmedia Main”. The answer was to go in to Menu Manager and delete “Freshmedia : ” (note the spaces before and after the colon!) Had to do this for “Main” and “Sub”, then the page works as it should. You can see the whole thing here

Found this bit of information for adding additional content blocks. When you add this to your template, it will create an additional window when you edit a page, and the copy will be placed where you happen to have it in the template.

Example Lines From Template:

<h3>Commentary</h3>

{content block="sb_content_block" label="Sidebar Content Block"}
So, it is possible to have additional content blocks on any page, you just have to define them. The stylesheet CSS for “content” will still apply. In essence, you have created a “block” which is now saved in the database as whatever you happened to name it.

Started getting this error on my Apache server after updating some css/php pages with some errant program. Still have not found which program was causing the error, but big as life, this was in the code for a multitude of pages…

<code><link href=”*” rel=”stylesheet” type=”text/css”></code>

I was looking everywhere for what could be causing the error. Even tried moving html and php pages over from other sites that were not showing the error in the Apache error log. They seemed to work, so then the fact that it kept referring to “can’t map something to a file” got me started looking line by line for all file references.