Sunday, September 18, 2016

Facebook Open Graph for Osclass


My team of developer are upgrading our online market places which using osclass cms. After we are done, we found the the theme doesn't header dont have meta for facebook open graph to display title, description and image. I found solution here, which you need to open the \oc-content\themes\YOUR-THEME-NAME\common\head.php file and paste the code below
<meta property="og:title" content="<?php echo osc_item_title() ; ?>" />
<meta property="og:description" content="<?php echo osc_highlight(strip_tags(osc_item_description()), 140) ; ?>" />
<?php if( osc_count_item_resources() > 0 ) { ?>
<meta property="og:image" content="<?php echo osc_resource_url(); ?>" />
<?php } else { ?>
<meta property="og:image" content="PUT-YOUR-DEFAULT-IMAGE-HERE" />
<?php } ?>

Wednesday, August 31, 2016

MySQL - InnoDB Imports (Faster)

mysql> use database_Name
mysql> set autocommit=0; set unique_checks=0; set foreign_key_checks=0;
mysql> source /path/to/database_dump.sql
mysql> commit; set unique_checks=1; set foreign_key_checks=1;

Friday, August 26, 2016

MySQL - Case sensitive for database name in Windows

Hi there! I'm have problem on my windows machine with LAMP stack environment to maintenance existing web system that has been deploy on Linux server. I create a copy of database and import on my local MySQL. The original database consist of lowercase and uppercase letter database name but when after imported it convert to lowercase database name that causing stupid mess error and waste lot of time!

I about MySQL collation of insensitive case and sensitive case but it seem valid on tables only, not the database name itself. I figure a work around to force MySQL on windows to store it on disk with case sensitive names.

Open you MySQL location folder and open my.ini file, insert lower_case_table_names=2 and restart the MySQL service. Done!