Portfolio
Php

[VPS] Cài đặt Memcached đầy đủ trên CentOS

September 28, 2016Category : Code/Web IT & Network

Memcached là một hệ thống cache hoạt động bằng cách lưu tạm thông tin những dữ liệu bạn hay sử dụng vào bộ nhớ RAM. Do tốc độ đọc ghi của bộ nhớ bao giờ cũng cao hơn so với lưu trữ file nên việc sử dụng memcached giúp cho hệ thống của bạn tăng tốc lên một cách..

Read more
01.

Direct sql quiries in magento

September 1, 2016Category : Code/Web

Database Connections In Magento By default, Magento will automatically connect to it’s database and provide two separate resources which you can use to access data: core_read and core_write. As you can probably guess, core_read is for reading from the database while core_write is for writing to the database. It is important to ensure that you..

Read more
02.

Magento import produdct – fix product not show

September 1, 2016Category : Code/Web

SQL <?php /** * @author Linhdh * @website http://181988.xyz * @project update price and specialPrice */ error_reporting(E_ALL | E_STRICT); define(‘MAGENTO_ROOT’, getcwd()); $mageFilename = MAGENTO_ROOT . ‘/app/Mage.php’; require_once $mageFilename; Mage::app(); $ids = Mage::getModel(‘catalog/product’)->getCollection()->getAllIds(); Mage::getSingleton(‘catalog/product_action’)->updateAttributes( $ids, array(‘status’=>1, ‘visibility’=>4), 0 );  

Read more
03.

Magento remove duplicate img

September 1, 2016Category : Code/Web

SQL <?php /** * @author Linhdh * @website http://181988.xyz * @project update price and specialPrice */ include(‘app/Mage.php’); //Mage::App(‘default’); Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); error_reporting(E_ALL | E_STRICT); Mage::setIsDeveloperMode(true); ini_set(‘display_errors’, 1); ob_implicit_flush (1); $mediaApi = Mage::getModel(“catalog/product_attribute_media_api”); $_products = Mage::getModel(‘catalog/product’)->getCollection(); $i =0; $total = count($_products); $count = 0; foreach($_products as $_prod) { $_product = Mage::getModel(‘catalog/product’)->load($_prod->getId()); $_md5_values = array(); //protected base image $base_image..

Read more
04.

Magento SQL update price and special price form csv

September 1, 2016Category : Code/Web

SQL <?php /** * @author Linhdh * @website http://181988.xyz * @project update price and specialPrice */ $mageFilename = ‘app/Mage.php’; require_once $mageFilename; Mage::setIsDeveloperMode(true); ini_set(‘display_errors’, 1); umask(0); Mage::app(‘admin’); Mage::register(‘isSecureArea’, 1); Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); set_time_limit(0); ini_set(‘memory_limit’,’1024M’); /***************** UTILITY FUNCTIONS ********************/ function _getConnection($type = ‘core_read’){ return Mage::getSingleton(‘core/resource’)->getConnection($type); } function _getTableName($tableName){ return Mage::getSingleton(‘core/resource’)->getTableName($tableName); } function _getAttributeId($attribute_code = ‘price’){ $connection = _getConnection(‘core_read’); $sql..

Read more
05.

Magento bulk product import with images

August 30, 2016Category : Code/Web

I recently had to transfer the inventory of an old Shop Factory site into Magento 1.7. Magento offers a powerful facility to do this via CSV using its DataFlow profiles but this is not without its quirks and pitfalls so I thought I’d share my experiences. Importing product data First, you will need to know..

Read more
06.

PHP7 mysql lib to mysqli convert

July 2, 2016Category : Code/Web

Đây là thư viện để các bạn không phải sửa từng chút một trong code nữa thêm include hoặc require trong config.php là được <?php namespace { if (!function_exists(‘\mysql_connect’)) { define (‘MYSQL_ASSOC’, 1); define (‘MYSQL_NUM’, 2); define (‘MYSQL_BOTH’, 3); define (‘MYSQL_CLIENT_COMPRESS’, 32); define (‘MYSQL_CLIENT_SSL’, 2048); define (‘MYSQL_CLIENT_INTERACTIVE’, 1024); define (‘MYSQL_CLIENT_IGNORE_SPACE’, 256); function mysql_connect( $hostname =..

Read more
07.

Facebook Messenger Chatbot Setup in PHP

May 5, 2016Category : Code/Web

Here is a step by step guide to make your first chatbot. Widely anticipated, Facebook has announced their messenger platform enabling businesses to build their own chat bots — automated response tools within Messenger which will be able to handle increasingly complex customer queries. Official Facebook Getting started guide https://developers.facebook.com/docs/messenger-platform/quickstart for Messenger Platform https://developers.facebook.com/products/messenger/ only have examples for..

Read more
08.

PHP Auto create XML playlist file

December 5, 2015Category : Code/Web

List file create order by abc <?php // *** requires PHP5 *** // search for jpg files $filter = “.mp3”; // path to the directory you want to scan $directory = ‘./audio’; $it = new RecursiveDirectoryIterator(“$directory”); foreach( new RecursiveIteratorIterator($it) as $file) { if (!((strpos(strtolower($file), $filter)) === false)) { $items[] = preg_replace(“#\\\#”, “/”, $file); } }..

Read more
09.

Add videojs player html5 with javascript

November 18, 2015Category : Code/Web

index.php <div id=”video”><p> Restart or F5 browser to view this content.</p></div> <link href=”<?php echo get_template_directory_uri(); ?>/css/video-js.min.css” rel=”stylesheet”> <script src=”<?php echo get_template_directory_uri(); ?>/js/videojs.min.js”></script> <script src=”<?php echo get_template_directory_uri(); ?>/js/jquery.min.videojs.js”></script> <script type=’text/javascript’> var obj, source; obj = document.createElement(‘video’); $(obj).attr(‘id’, ‘example_video_test’); $(obj).attr(‘class’, ‘video-js vjs-default-skin’); $(obj).attr(‘controls’, ‘ ‘); $(obj).attr(‘poster’, ‘http://todaytv.club/movie_night_image.jpg’); $(obj).attr(‘preload’, ‘auto’); $(obj).attr(‘data-setup’, ‘{“inactivityTimeout”: 0}’); $(obj).attr(‘autoplay’, ‘true’); source = document.createElement(‘source’);..

Read more
010.

[WP] Hide My WP XSS vulnerability

November 2, 2015Category : Code/Web

Exploit Title: Hide My WP XSS vulnerability Date: 20-07-2015 Software Link: http://codecanyon.net/item/hide-my-wp-no-one-can-know-you-use-wordpress/4177158 Version 4.51.1 Google dork: ff957fea/includes/css/style.css Fix: turn off IDS logging

Read more
012.

[WP] W3 Total Cache settings with Cloudflare GUIDE

October 12, 2015Category : Code/Web

W3 Total cache is a WordPress Performance Optimization framework that is designed to improve user experience and page speed.  It is recommended by many web hosting providers, and used by countless major websites such as mashable.com as well as many others. W3TC  improves the user experience of your site by increasing web server performance by reducing..

Read more
013.

Jumping Game

September 22, 2015Category : Code/Web

  HTML code: <!DOCTYPE HTML> <html lang=”en-US”> <head> <title>Jump</title> </head> <body> <div class=”container”> <canvas id=”canvas”> Aww, your browser doesn’t support HTML5! </canvas> <div id=”mainMenu”> <h1>Milo Jump</h1> <h3>using HTML5,</h3> <h3>…by <a href=”http://twitter.com/solitarydesigns/” target=”_blank”>Kushagra Agarwal</a></h3> <h3>and <a href=”http://cssdeck.com” target=”_blank”>CSSDeck</a></h3> <p class=”info”> use <span class=”key left”>←</span> <span class=”key right”>→</span> to move and space to (re) start… </p> <a..

Read more
014.

Ajax Username Validation with PHP and MySQL

August 20, 2015Category : Code/Web

Tutorial for ajax username validation using jquery and php to check if the username is available in the mysql database. Requirements jQuery Library Database and table First create a database in mysql and create a table called members in it.

Read more
015.

Điều cần phải làm trước khi ra mắt trang web Magento

August 20, 2015Category : Code/Web

1. Thay đổi Base URLs Những URL này được lưu trữ trong cơ sở dữ liệu của Magento, khoá core_config_data. Bạn cũng có thể thay đổi nó trong Admin của Magento bằng cách vào System > Configuration > Web. Bạn chỉ thay đổi cái này khi bạn chuyển domain hoặc đổi kiểu domain, ví dụ khi bạn cài SSL cho trang web..

Read more
016.
© Oliver / All rights reserved.
To top