Blog Category: Teaching Technology

Two Geeks Teaching – Brand Mapping

View the Brand Map Herezies.

What the heck is a Brand Map?

The version of the brand map we are working with shown to us from Bertz Rosa. It is a hybrid version of the lean module start-up geared towards designers and creatives. It is a template to learn more about client product’s and expectations for your campaign or website build.
[Read more…]

OSCommerce Blank Admin Login

I was given the task to upgrade some old oscommerce stores, when I did I noticed an error when trying to reach the admin panel. Here are items I did to fix all the different errors so I could finally sign into the account.


PHP Fatal error: require() [function.require]: Failed opening required '/catalog/includes/classes/action_recorder.php' (include_path='.:') in /catalog/admin/includes/classes/action_recorder.php on line 13

The first error I ran into was a PHP Fatal error because of action_recorder.php, to fix this error make sure your configure.php files are correct. If they are then simply download /catalog/admin/includes/classes/action_recorder.php and /catalog/includes/classes/action_recorder.php from the package, then re-upload them, this got the error to go away for me.

The next error I was receiving was that there wasn’t an administrators table. So I login to phpmyadmin and execute the following…


-- phpMyAdmin SQL Dump
-- version 2.11.9.6
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Apr 10, 2014 at 02:20 PM
-- Server version: 5.0.77
-- PHP Version: 5.2.6

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `coslair_db1`
--

-- --------------------------------------------------------

--
-- Table structure for table `administrators`
--

CREATE TABLE IF NOT EXISTS `administrators` (
`id` int(11) NOT NULL auto_increment,
`user_name` varchar(255) character set utf8 collate utf8_bin NOT NULL,
`user_password` varchar(60) collate utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;

--
-- Dumping data for table `administrators`
--

INSERT INTO `administrators` (`id`, `user_name`, `user_password`) VALUES
(1, 'admin', '121212121212');

Once this is done, go to the administrators table in phpmyadmin. Now empty the table. This will make it so that you can add a new username and password, now go to the admin page and create your user and password.

Finally I was getting a too many attempts to login error, to fix this error go to /catalog/admin/includes/login.php

Change this

if ($actionRecorder->canPerform())

To this:

if ($actionRecorder->canPerform() || !tep_not_null($actionRecorder->_module))

This should fix your issues 🙂

Parse Event Time From String Javascript

I am working on some code to parse event times from messy input use strings. The idea is to find the time and output the start and end time.

I have developed some code, that needs more tweaks, but I am trying to develop it so it can look for various types of user inputs for example:

7-8am
7:00 till 8:00 p.m.
Even starts at 8:00 a.m. and ends at 7:00 p.m.

Please feel free to use the code or give suggestions on how to tweak my javascript to make faster. I am sure I over-engineered it in more than one way.


var re = /(a.m.|p.m.|pm|am)/g, // Filter By
str = "String blab la bla $22.99 event starts at 12:41 a.m. ends at 10:00 p.m. asdfasdfas"; // String To Test

var timeArray = new Array();
var timeStamp = new Array();

while ((matcher = re.exec(str)) != null) {
timeArray.push(matcher.index);
timeStamp.push(matcher[0]);
}

// Get Start And End Time
startTime = str.substring(timeArray[0] - 6, timeArray[0]);
finishTime = str.substring(timeArray[1] - 13, timeArray[1]);

if (startTime.length == 2) {
finishTime = startTime.substr(1,2);
startTime = startTime.slice(0,1);
} else {
// console.log(finishTime);
// console.log(startTime);

var matches = /(-|to|till)/g;

if (finishTime.match(matches) != null) {

var splitTime = startTime.split( matches );
var slpitTimeFinish = finishTime.split( matches );

if (timeStamp.length > 1) {
finishTime = slpitTimeFinish[2].replace(/[A-Za-z$.]/g, "");
startTime = splitTime[0].replace(/[A-Za-z$.]/g, "");
startTime = startTime.replace(/[0-9]{1,3}\s/g, "");

} else {

finishTime = slpitTimeFinish[2].replace(/[A-Za-z$.]/g, "");
startTime = slpitTimeFinish[0].replace(/[A-Za-z$.]/g, "");

var breakTime = startTime.split(':')
hours = breakTime[0].replace(/[0-9]{1,4}\s/g, "");
minutes = breakTime[1];

if (minutes == null) {
startTime = hours + ":00";
} else {
startTime = hours + ":" + minutes;
}

}

startTime = startTime.replace(/\s+/g, ''); // Remove Spaces
finishTime = finishTime.replace(/\s+/g, ''); // Remove Spaces

} else {
finishTime = finishTime.replace(/[A-Za-z$.]/g, "");
// console.log(finishTime);

var breakTime = finishTime.split(':')
hours = breakTime[0].replace(/[0-9]{1,4}\s/g, "");
minutes = breakTime[1];

if (minutes == null) {
finishTime = hours + ":00";
} else {
finishTime = hours + ":" + minutes;
}

finishTime = finishTime.replace(/\s+/g, ''); // Remove Spaces
// console.log(finishTime);

startTime = startTime.replace(/[A-Za-z$.]/g, "");

var breakTime = startTime.split(':')
hours = breakTime[0].replace(/[0-9]{1,4}\s/g, "");
minutes = breakTime[1];

if (minutes == null) {
startTime = hours + ":00";
} else {
startTime = hours + ":" + minutes;
}

startTime = startTime.replace(/\s+/g, ''); // Remove Spaces

}
}

// Get Time Stamp

if (timeStamp.length > 1) {
eventStartStamp = timeStamp[0];
eventEndStamp = timeStamp[1];
} else {
eventStartStamp = timeStamp[0];
eventEndStamp = timeStamp[0];
}

console.log ("Event Starts At "+ startTime + " " + eventStartStamp +" Ends At "+ finishTime + " " + eventEndStamp );

Magento MP Survey Change Default Page Layout

I purchased and downloaded MagePage’s MP Survey. I had a client that need more than the default Magento page and survey system. I stumbled upon MagePage.com, which developed MP Survey. This Survey is awesome and did the trick. I might do a review about it at a later date.

Anyway, I ran into an issue where the default page layout was not what I wanted. By default it was 2 column, I just wanted one. After about 30 mins of messing around I was able to make this to my 1-column layout.

Here is what you do. Go to /app/design/frontend/puroast/default/layout

There back up the file survey.xml.

Now open up and edit this file and look for the following:

Add the following right after this tag.







That should fix the issue. You can also apply this after survey_category_view and survey_index_index if you would like.

That sohuld fix it.

Website Design Hanford

website design hanford infographic image enlarged

I love the central valley and with that, I adore Hanford, California. I have many clients that work and live in Hanford. I greatly enjoy bringing the latest and greatest websites to Hanford. Since, I am from Visalia, I think Hanford water is a bit gross but that doesn’t mean I don’t like the people!

My websites focus on increasing sales and leads. With my SEO experience I will design your website to break into new markets. I focus on providing my clients with easy to use websites. All my sites are based on content management systems (CMS). This gives you the ability to update your website without getting charged. If you have a eCommerce store, or need a custom software solution, I can do it ALL! Even, phone applications and mobile design. I enjoy learning about new companies that Hanford has to offer and provide them with a great websites.

My sites are designed to increase sales and take the worry about online marketing off of the companies. It is hard maintaining a well run online marketing strategy, this is why I suggest hiring a professional like me! I have been working as a professional UX Designer and programmer for 7 years.

What does your local Hanford company get my website design?

First I give you an easy to use and maintain web site. I have tons of experience creating content management systems from scratch or using opensource systems like WordPress, Drupal, and Joomla. I avidly code for Magento’s eCommerce System. Check out my blog and you can see all the code I post.

An amazing design to maximize sales and leads.

Whether you are selling to local Hanford clients, or all over the world, I create a design that is wonderful for your clients. I base all my decisions on stastics, feedback, and user data. I believe your success reflects mine.

Great local customer support in Hanford

Being in Visalia, I am only a phone call away. You will never get a foreigner, and will be working with a local professional in Hanford. I enjoy visiting my clients.

If you are in Hanford and want an affordable, professional, website design contact me. I would love to give you a direct quote.

Bxslide Links and Side Navigation

Here is a way to create a dynamic sidebar. The system will count the list items and associate it with the proper slider.

Here is the javascript code.

$.each($('.side-nav li'), function(index, value) {
console.log(index + ':' + value);
$(".story-nav li a").eq(index).addClass('slide-'+index);
});

$('.side-nav li a').click(function(){
var num_id = $(this).attr('class').match(/\d+/); //
event.preventDefault();
slider.goToSlide(num_id);
});

You can then add this html code on your page:

By adding these items, you can create a side navigation that will scroll to the proper slide. You can name the link what ever you want.

Photoshop To CSS | CSS Hat Review

CSS Hat Interface

Costs: $34.99

I am a professional web site developer, mainly a front-end user interface engineer. Most of my day is spent bouncing around photoshop files and sublime text editor, trying to match pixels and recreate mock-up photoshop web sites into working html and css. As most front end developers know, is that this task, without a proper work flow and set of tools, can be daunting, frustrating, and slow. Going from photoshop to css can be a major pain.
[Read more…]

Pages: 1 2

Magento JQuery Product Fade in On Scroll

Want to add a fade in effect through jQuery when users are scrolling to the bottom of the page.

Add the following code to the header of your pages.




Create a code in the js file called script.js. Add the following code.

var $j = jQuery.noConflict();
$j(document).ready(function() {
$j(function() { // when the DOM is ready...
// Fade In function
// Hide Stuff
$j('.products-grid, #products-list li').hide();
tiles = $j(".products-grid, #products-list li").fadeTo(0, 0);
$j('.first').fadeTo(0, 1);

$j(window).scroll(function(d,h) {
tiles.each(function(i) {
a = $j(this).offset().top ;
b = $j(window).scrollTop() + $j(window).height() -100;
if (a < b) $j(this).fadeTo(700,1); }); });}); });

This will make it so that when the bottom of your browser hits the next product it will "fade in" the content. This works best for the products-grid layout.

Catalog Url Rewrites Index Process Unknown Error Solved!

Having problems with Magento and the Category Reindexer?

Are you getting a “Cannot initialize the indexer process” error when trying to run the Reindex from Index Management in Magento?

If you are getting an error like this then I have the solution for you! You will have the “Cannot initialize the indexer process” or “Catalog Url Rewrites index process unknown error” fixed in four steps!

Catalog Url Rewrites index process unknown error:
exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry

Step 1 to fix the Catalog Url Rewrites Error: Turn of your Magento Cache

Login to your Magento backend and go to System > Cache Management. On this page turn off your cache.

Step 2 to solve the Catalog Url Rewrites Error: Make core_url_rewrite Translucent

Login to your phpmyadmin, or your MySQL database using your method of choice. Here find the following table “core_url_rewrite” make it translucent.

Step 3 to correct the Catalog Url Rewrites Error: Rebuild your Data

Login to your Magento backend and go to System > Index Management. On this page check all the boxes and re-index all your data. You should now not get an error.

*Note: You can also login to ssh and go to the “shell” directory. In here you can type:

php indexer.php -reindexall

Step 4 to resolve the Catalog Url Rewrites Error: Clear your Magento Cache

Login to your Magento backend and go to System > Cache Management. On this page flush your Magento cache. Or login via ftp\ssh and delete files in your yourmagentoinstall/var/cache directory.

SSH Create MYSQL Database, UserName, and Password

I always forget the syntax so this is a quick post to remind myself how to create a mysql database, username, and password on a Linux Machine.


create database databasename;
create user 'username'@'%' identified by 'password';
grant all on username.* to 'databasename'@'%';
grant usage on *.* to 'databasename'@'%';
flush privileges;