Thứ Ba, 31 tháng 7, 2012

econtent


Lay noi dung tu 24h
/<div class="boxBaiViet-c">(.*?)<\/div>\s*<div class="boxDon-sub-b">/ismu

title
/<h1 class="baiviet-title">(.*?)<\/h1>\s*<div class="publication_date">/ismu

intro text
/<div class="baiviet-head-noidung">(.*?)<\/div>\s*<div class="cap2-boxtop-note">/ismu

huogn dan su dung
http://tunglinhonline.com/diendan/viewthread.php?tid=4434


lay tin vnexpress
chi tiet 1 bai viet
/<div id="content">\s*(.*?)\s*<\/div>\s*<div id="footer">/ism
/<div class="content">\s*(.*?)\s*<\/div>\s*<div class="folder-news">/ism

/<div class="content">\s*(.*?)\s*<\/div>\s*<div class="Div_OtherNews">/ism



thay the

/<h1\s*(.*?)\s*<\/h1>/ism<=>
/<script\s*(.*?)\s*<\/script>/ism<=>
/<br\s*(.*?)\s*>>\s*(.*?)\s*<\/a><\/h2>/ism<=></h2>
/<link\s*(.*?)\s*\/>/ism<=>
/<div class="likesubject fl">\s*(.*?)\s*/ismU<=>




lay tin tren http://www.diaoconline.vn/rss/
/<div class="chitiet">\s*(.*?)\s*<\/div>\s*<input/ism
thay the
/<p align="right">\s*(.*?)\s*<\/p>/ism<=>

Lay tin dan tri
/<div id="ctl00_IDContent_ctl00_divContent">\s*(.*?)\s*<\/div>\s*<div class="clearfix">/ism

thay the

/<div class="box26"\s*>\s*(.*?)\s*<\/div>\s*<p class="detail_subtitle"\s*>\s*(.*?)\s*<\/p>/ism<=>
/<div itemscope(.*)/ism<=>
/<script[^>]+>.*?<\/script>/i<=>
/\(D.+n\str.+\)\s*\-\s*/iU<=>
/<h1\s*(.*?)\s*<\/h1>/ism<=>
/<br\s*(.*?)\s*<\/h2>/ism<=>





Thứ Sáu, 27 tháng 7, 2012

Dung Session joomla luu url truoc do

$currentURL=JURI::current();
//$currentURL = JFactory::getURI();

 $session =& JFactory::getSession();
$session->set( 'currentURL',base64_encode($uri->toString()) );

==> lay tham so truyen qua

$session =& JFactory::getSession();
$currentURL = base64_decode($session->get('currentURL'));

Thứ Năm, 26 tháng 7, 2012

Animated scroll to anchor/id function with jQuery

function goToByScroll(id){
      $('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');
}
goToByScroll("theIdIWantToGoTo");

Thứ Tư, 18 tháng 7, 2012

MAGENTO TIPS

ADD STATES to countries
http://dbhoopendra.blogspot.com/2012/02/magento-how-to-add-states-to-countries.html
http://www.sycha.com/magento-add-custom-state-province-region-country

ADD SHIPPING MEHTOD
http://inchoo.net/ecommerce/magento/custom-shipping-method-in-magento/
http://www.magentocommerce.com/wiki/5_-_modules_and_development/shipping/create-shipping-method-module
http://techportal.inviqa.com/2011/06/09/creating-a-custom-magento-shipping-method/
http://www.excellencemagentoblog.com/magento-create-custom-shipping-method

30 EXTENSION
http://visionwidget.com/free-magento-extensions.html

regular expression web huu ich

http://webcheatsheet.com/php/regular_expressions.php

joomla - Ham huu dung

Tao intro text gioi han ky tu
 JHTML::_('string.abridge');
          JHTML::_('string.truncate');
          $data['alias']=JHtmlString::truncate($params['title'],10);

Tạo alias :
JFilterOutput::stringURLSafe('        f hjk  có bà sáu lé nè con ơi ll--re2xzl.;;  ');

trang web hay ve tut joomla

http://www.phpeveryday.com/articles/Joomla-Component-Adding-Comment-Create-Table--P63.html

Lam gallery luu trang thai nut nhan


import caurina.transitions.Tweener;
var butArray:Array=new Array(but.b1,but.b2,but.b3,but.b4,but.b5)
var movingArea=222;
var time=4;
var movingItem=4
var mcArray:Array=new Array(
  'http://www.limeorange.vn/vnt_upload/File/Flash/banner_left_scroll/1.png',
  'http://www.limeorange.vn/vnt_upload/File/Flash/banner_left_scroll/2.png',
  'http://www.limeorange.vn/vnt_upload/File/Flash/banner_left_scroll/3.png',
  'http://www.limeorange.vn/vnt_upload/File/Flash/banner_left_scroll/4.png',
  'http://www.limeorange.vn/vnt_upload/File/Flash/banner_left_scroll/5.png'
  )
var mcLink:Array=new Array(
  'http://www.limeorange.vn/product/stripe-t-shirt-10.html',
  'http://www.limeorange.vn/product/typho-grphy-t-shirt-7.html',
  'http://www.limeorange.vn/product/stylish-t-shirt-9.html',
  'http://www.limeorange.vn/product/ilust-t-shirt-6.html',
  'http://www.limeorange.vn/product/character-8.html'
  )

var mcCount=mcArray.length;
var mc_wrap:MovieClip=new MovieClip();
addChildAt(mc_wrap,0);

for(var i=0; i<mcCount;i++){
var url:String=mcLink[i];
var mcload:MovieClip=new full_image();

mc_wrap.addChild(mcload);
mcload.path=mcArray[i];
mcload.t_shirt=i+1;
mcload.y=i*movingArea
mcload.name=url
mcload.buttonMode = true;
mcload.useHandCursor = true;

mcload.addEventListener(MouseEvent.MOUSE_DOWN,linkTo)
}
function linkTo(e:MouseEvent){
var link=e.currentTarget.name
var request:URLRequest = new URLRequest(link);
navigateToURL(request,'_self')
}

var count:int = 0;
var sliderTimer:Timer = new Timer(time,0);
sliderTimer.addEventListener(TimerEvent.TIMER, updateSlide);
sliderTimer.start();

function updateSlide(e:TimerEvent){
if(count >=movingItem){
count =0;
}else{
count ++;}

//trace('count = '+count)
moveBtn()
}

function moveBtn():void {
if(count>=movingItem){
Tweener.addTween(mc_wrap,{y:0,time:1.5, transition:"easeoutelastic"});
}
var a=-222*count
//trace('y = '+a)
Tweener.addTween(mc_wrap,{y:a,time:0.8,transition:"easeoutexpo"});
Tweener.addTween(mc_wrap,{alpha:0.1,time:0.3,transition:"easeoutquint"});
Tweener.addTween(mc_wrap,{alpha:1,time:0.5,delay:0.3,transition:"easeoutexpo"});

sliderTimer.reset();
sliderTimer.start();

for(var j=0;j<butArray.length;j++){
butArray[j].alpha=0;
}

Tweener.addTween(butArray[count],{alpha:1,time:0.3});
}

for(var j=0;j<mcBut.length;j++){
mcBut[j].addEventListener(MouseEvent.MOUSE_DOWN,playimg);
}

function playimg(e:MouseEvent){
//moveBtn()
var c=(e.target.name).substr(1);
count=Number(c)-1;
trace(count)
moveBtn()
}

for(var u=0;u<mcBut.length;u++){
mcBut[u].alpha=0;
}
mcBut[0].alpha=1;

Thứ Ba, 17 tháng 7, 2012

Tips: ajax in joomla component

Viet trong controller


Joom 1.5
//Hien thi du lieu
global $mainframe; $mainframe->close();
joom 1.6 va nhung ban sau
//Hien thi du lieu
$app = &JFactory::getApplication();
$app->close();

Chủ Nhật, 15 tháng 7, 2012

JHTML

JHTML::date($row1->date_begin_special,'%d-%m-%Y %H:%M:%S')

$editor=JFactory::getEditor();
 <?=$editor->display('content',$row1->content, '100%', '400', '70', '15', False); ?>

Thứ Năm, 12 tháng 7, 2012

THU THUAT SEO


http://quangbaweb.edu.vn/showthread.php?13705

submit website
https://www.google.com/webmasters/tools/submit-url?hl=vi

lay 2500 backlink
http://www.imtalk.org/cmps_index.php?pageid=IMT-Website-Submitter

template 2.5 joomla


http://www.shape5.com/component/option,com_docman/Itemid,96/task,cat_view/gid,190/

http://www.shape5.com/product_details/free_extensions/

http://www.shape5.com/component/option,com_docman/Itemid,96/task,cat_view/gid,15/

http://www.shape5.com/component/option,com_docman/Itemid,96/task,cat_view/gid,13/

thuat toan multicategory trong joomla


Truong hop edit cua multi category

old lay id cua item, vao bang item_size, tao mang size.
new lay mang item_size sau khi edit gui qua

==>tim nhung phan tu co trong mang cu khong co trong mang moi ( xoa )
==>tim nhung phan tu co trong mang moi, nhung khong co trong mang cu ( them )

old=array('a','b','c','d')
new=array('a','b','c','f')

co trong mang cu, khong co trong mang moi
Array
(
    [3] => d
)

co trong mang moi, khong co trong mang cu
Array
(
    [3] => f
)


//save
 kiem tra neu ton tai ten file  => luu hinh
 kiem tra mang iapp_media so voi mang trong database, lay phan tu khong co trong mang cu de delete.

vua co ten file hinh vua delete hinh cu=> vay phai kiem tra 2mang truoc, sau do moi upload hinh


//them moi:
- id<=0
- kiem tra ten file neu ton tai .
- save hinh,va ordering=1;

//edit
- id>0
- chi them moi, ko xoa
- them moi va xoa

 kiem tra mang iaap_item_medias >0
     so sanh mang cu, xoa hinh , cap nhat odering moi

     nguoc lai neu mang iaap_item_medias<=0
     dung id item, xoa het hinh anh trong 2 bang

kiem tra ten file neu ton tai .
  ten hinh anh ton tai => save hinh va ordering=count(mang odering) +1;



css3 - fullpage background


http://css-tricks.com/perfect-full-page-background-image/

background: url(images/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;

Joomla 404 custom page

if (($this->error->getCode()) == '404') {
header('Location: /url cua bai viet'); exit; }


http://www.inmotionhosting.com/support/edu/joomla-25/how-to/configure-email-over-smtp

Related Posts Plugin for WordPress, Blogger...