Saturday, 24 March 2012

How to install vQmod on OpenCart?

What is vQmod?
"vQmod™" (aka Virtual Quick Mod) is an override system designed to avoid having to change core files. The concept is quite simple... Instead of making changes to the core files directly, the changes are created as xml search/replace script files. 

For example instead to change the template's header file catalog/view/theme/default/template/common/header.tpl,

it's much more safer to create script that will do the change.

The main benefit of using vQmod is that you can safely update opencart and you don't need to worry about all HTML/PHP patches and hacks that you have done on it. They are safely stored as xml scripts in /vqmod/xml folder. If there is any difference in the new OpenCart version you just have to set correct searching and replacing string in the xml script and it will work the same as before.


How to install using Autoinstaller - (Didn't work for me)

  1. Download the latest version that has "opencart" in the title from
  2. Using FTP, upload the "vqmod" folder from the zip to the root of your opencart store.
  3. Be sure the vqmod folder and the vqmod/vqcache folders are writable (either 755 or 777).
    • Also be sure index.php and admin/index.php are writable.
      • If not sure which you need, first try 755.
      • If you get errors about permissions, then try 777.
  4. Goto http://www.yoursite.com/vqmod/install
  5. You should get a success message. If not, check permissions above and try again
  6. Load your store homepage and verify it works.
  7. Using FTP, verify that there are new "vq" files in the "vqmod/vqcache" folder.
  8. If yes, then you are ready to start downloading or creating vQmod scripts, otherwise ask for assistance.
Done!


Well NOT DONE. 
This method didn't work for me, I deleted .htaccess file in the vqmod folder, but still wasn't able to access http://www.yoursite.com/vqmod/install. The browser kept saying Internal server error. 




How to install Manually - (worked for me)

Backup your main site / index.php and admin/index.php before continue.
  1. Download the latest version that has "opencart" in the title from
  2. Using FTP, upload the "vqmod" folder from the zip to the root of your opencart store.
  3. Be sure the vqmod folder and the vqmod/vqcache folders are writable (either 755 or 777).
    • Also be sure index.php and admin/index.php are writable.
      • If not sure which you need, first try 755.
      • If you get errors about permissions, then try 777.
  4. Edit your index.php file
  5. FIND:
  6. // Startup
    require_once(DIR_SYSTEM . 'startup.php');
    // Application Classes
    require_once(DIR_SYSTEM . 'library/customer.php');
    require_once(DIR_SYSTEM . 'library/currency.php');
    require_once(DIR_SYSTEM . 'library/tax.php');
    require_once(DIR_SYSTEM . 'library/weight.php');
    require_once(DIR_SYSTEM . 'library/length.php');
    require_once(DIR_SYSTEM . 'library/cart.php');
    require_once(DIR_SYSTEM . 'library/affiliate.php');
  7. REPLACE WITH:
  8. // vQmod
    require_once('./vqmod/vqmod.php');
    $vqmod = new VQMod();
    // VQMODDED Startup
    require_once($vqmod->modCheck(DIR_SYSTEM . 'startup.php'));
    // Application Classes
    require_once($vqmod->modCheck(DIR_SYSTEM . 'library/customer.php'));
    require_once($vqmod->modCheck(DIR_SYSTEM . 'library/currency.php'));
    require_once($vqmod->modCheck(DIR_SYSTEM . 'library/tax.php'));
    require_once($vqmod->modCheck(DIR_SYSTEM . 'library/weight.php'));
    require_once($vqmod->modCheck(DIR_SYSTEM . 'library/length.php'));
    require_once($vqmod->modCheck(DIR_SYSTEM . 'library/cart.php'));
    require_once($vqmod->modCheck(DIR_SYSTEM . 'library/affiliate.php'));
Note the affiliate library file may not exist on older systems. Basically any require_once(DIR_SYSTEM . 'library/xxxxxxxx.php');needs to be changed to use the vqmod->modCheck above in the same format. This also applies to any additional require_once files in the next step
  1. Edit your admin/index.php file
  2. FIND:
  3. // Startup
    require_once(DIR_SYSTEM . 'startup.php');
    // Application Classes
    require_once(DIR_SYSTEM . 'library/currency.php');
    require_once(DIR_SYSTEM . 'library/user.php'));
    require_once(DIR_SYSTEM . 'library/weight.php');
    require_once(DIR_SYSTEM . 'library/length.php');
  4. REPLACE WITH:
  5. // vQmod
    require_once('../vqmod/vqmod.php');
    $vqmod = new VQMod();
    // VQMODDED Startup
    require_once($vqmod->modCheck(DIR_SYSTEM . 'startup.php'));
    // Application Classes
    require_once($vqmod->modCheck(DIR_SYSTEM . 'library/currency.php'));
    require_once($vqmod->modCheck(DIR_SYSTEM . 'library/user.php'));
    require_once($vqmod->modCheck(DIR_SYSTEM . 'library/weight.php'));
    require_once($vqmod->modCheck(DIR_SYSTEM . 'library/length.php'));
  6. Load your store homepage and verify it works.
  7. Using FTP, verify that there are new "vq" files in the "vqmod/vqcache" folder.
  8. If yes, then you are ready to start downloading or creating vQmod scripts.
Done!

This method worked. The only warning to this method is that every time u upgrade your opencart you have to modify manually these 2 index.php files.


The next post I will publish some useful vQMod scripts

Monday, 12 September 2011

Web2Py - How to create custom view for register form, login form, profile form and even reset password form?

How to create custom view for register form, login form, profile form and even reset password form in Web2Py?

If you want to manage and customize the authentication forms in web2py.

Let's say you wanna add more fields and make the profile more complete.
You need to overload the default user table and to add more fields to it. After that you have to create, controllers and views for login, register, profile , password reset.

Sunday, 26 June 2011

Simple SVG driven Radar using Raphael JS graphic library

I was playing with Raphael last month and decided to share what I have done.
It's Animated Radar
the source code is on github
I did the SVG part in Inkscape. exported to plain SVG format and after that had look at SVG file.
For more info, docs,examples -> rahpael and SVG


   
   

Sunday, 20 March 2011

The simplest way to use GitHub on Windows 7 with GUI

I tried some git clients, I read loads tutorials. Now I am going to write about simpliest and easiest way to commit, pull, push and clone code files using Git respository and particularly GitHub.com.

I tryed these 4:
Cygwin + git + ssh. It worked. But Its console based.
msysgit + putty stuff. Partly worked. Issue with ssh certificates
TortoiseGit - Tortoise didnt work for me too. Only  clone function.
GitExtensions - It's using msysgit  + Kdiff external programs. Its GUI based interface. But I couldn't make it work.


After these trials. I removed all software. Deleted all folders and C:\users\username\.ssh folder where rsa keys are stored. 


Monday, 10 January 2011

C# useful Shell functions

Get current user's StartUp folder path:

Environment.GetFolderPath(Environment.SpecialFolder.Startup) - returns string with startup path

Get list of StartUp processes started from the Register and StartUp folder:

ManagementClass mangnmt = new ManagementClass("Win32_StartupCommand");
ManagementObjectCollection mcol = mangnmt.GetInstances();
foreach (ManagementObject strt in mcol)
{
string[] lv = new String[4];
lv[0] = strt["Caption"].ToString();
lv[1] = strt["Location"].ToString();
lv[2] = strt["Command"].ToString();
lv[3] = strt["Description"].ToString();
listView1.Items.Add(new ListViewItem(lv, 0));
}

Thursday, 16 December 2010

How to get list of Windows 7 Startup programs from Registry using C#?

I was googling and digging into windows Startup apps running from registry keys and the whole startup order proccess. Here is what I found out.


Startup apps order list. 
(I am using Windows 7 HomePremium 64 bit.)


  • Boot execute HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\BootExecute
  • Run Services

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices

  • Logon Prompt - user enter username and password
  • UserInit HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\UserInit
  • Start Shell HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell
  • LocalMachine Run keys

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx

Sunday, 12 December 2010

NaskoShell - my custom windows desktop replacement app

UPDATE: 

This is discontinued project :(
I don't need custom shell for Windows anymore, because I switched to linux. OpenBox+PyTyle+Conky
Source is on my github have a look I you are intersted in Custom windows desktop shell in C#.


I have got 12.1" ASUS UL20a laptop and because of the size of the screen I wanted to optimize my desktop for better experience. I tried to simplify my default Windows 7 desktop, removed all icons, made Taskbar autohide, couldn’t completely remove it though.Finally I decided to write my own Windows desktop replacement.
So what I am working on is clear Desktop with:
  • my daily to do tasks,
  • time,
  • reminder,
  • simple background changer,
  • some nice motivational or inspirational quotes.
  • multiscreen (work, design, surf, chat, book reading, video )
  • launchy-like app launcher
  • fully keyboard control

Monday, 1 November 2010

AIR app socket connection to Socket.IO-node server using Web-socket-js flash library

UPDATE 2012 - This article is outdated  please use https://github.com/simb/FlashSocket.IO for connecting Socket IO and Flash/Flex/AS3

Socket.IO is an awesome library for NodeJS for making  games and chat apps relying on WebSocket protocol. Web browsers supporting WebSockets at the time of this writing are Chrome, Safari and Firefox 4 beta, and Opera 10.70 beta Other browsers can use WebSocket over Flash or other methods (XHR Pooling, XHR Streaming, forever IFrame). In this article I will show you how I connected AIR app to Socket.IO-Node chat demo using WebSocket over Flash library made by Hiroshi Ichikawa.
Requirements:
- for the Server
UPDATE - github source -> here

Sunday, 31 October 2010

How to make simple clean vertical image rotator without arrows using jQuery and jcarousel

I wanted to make simple carousel for a construction company but without arrows without additional images and effects, just simple image rotator (scroller) with anchor links to different products. Here is how i did it.

1 - get required libs:
http://sorgalla.com/projects/jcarousel/
http://jquery.com/

2 - write simple HTML file and add your images in list: