This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function extract_thumb($video_url){ | |
$video_platform = parse_url($video_url, PHP_URL_HOST); | |
if (isset($video_url) && $video_platform == 'vimeo.com') { | |
if (preg_match("/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)/uim", $video_url, $id)) { | |
$video_id = $id[3]; | |
} | |
$hash = unserialize(wp_remote_fopen("http://vimeo.com/api/v2/video/$video_id.php")); | |
$src = $hash[0]['thumbnail_large']; | |
} elseif (isset($video_url) && $video_platform == 'www.youtube.com') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sort Items depending on jQuery data | |
* @param {Object} $container : items container class or id | |
* @param {Object} $selector single item class | |
* @param {Object} $sortAttr single item data attribute | |
* @param {Object} $direction sort direction( asc by default) | |
*/ | |
var itemsSort = function($container,$selector,$sortAttr,$direction='asc'){ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* convert pdf page to image (BLOB) | |
**/ | |
function generate_pdf_image($pdf_file,$page_index) { | |
if(class_exists('Imagick') && file_exists($pdf_file)){ | |
$im = new Imagick(); | |
$im->setCompressionQuality(50);//reduce image quality*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Split pdf file given by url (realpath) | |
**/ | |
function split_pdf($pdf_url,$offset,$nbpages){ | |
require_once(get_stylesheet_directory() .'/libs/fpdf.php'); | |
require_once(get_stylesheet_directory() .'/libs/fpdi.php'); | |
if( file_exists($pdf_url) : | |
$pdf = new FPDI(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach($order->getAllVisibleItems() as $value) { | |
echo $value->getName(); | |
echo $value->getSku(); | |
echo $value->getPrice(); | |
echo $value->getQtyOrdered(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET FOREIGN_KEY_CHECKS=0; | |
TRUNCATE `sales_flat_creditmemo`; | |
TRUNCATE `sales_flat_creditmemo_comment`; | |
TRUNCATE `sales_flat_creditmemo_grid`; | |
TRUNCATE `sales_flat_creditmemo_item`; | |
TRUNCATE `sales_flat_invoice`; | |
TRUNCATE `sales_flat_invoice_comment`; | |
TRUNCATE `sales_flat_invoice_grid`; | |
TRUNCATE `sales_flat_invoice_item`; | |
TRUNCATE `sales_flat_order`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<customer_account> | |
<reference name="left"> | |
<reference name="customer_account_navigation"> | |
<action method="addLink" translate="label" module="customer"> | |
<name>logout</name> | |
<path>customer/account/logout/</path> | |
<label>Log Out</label> | |
</action> | |
</reference> | |
</reference> |