Thứ Tư, 22 tháng 8, 2012

renew joomla


function renewProperty($id){
        //echo __FILE__;
   
       $now=date("Y-m-d H:i:s");
     
       $db=  JFactory::getDbo();
       $query = $db->getQuery(true);
       $query->update('#__iproperty as i');
       $query->set('i.created = "'.$now.'"');
       $query->set('i.publish_up = "'.$now.'"');
       $query->set('i.modified = "'.$now.'"');
       $query->set('i.state= 1 ,i.approved= 1');
       $query->where('i.id='.(int)$id);
       $db->setQuery($query);
       $db->query();
       //.',i.publish_up i.state= 1 ,i.approved= 1'
     
       echo '<pre>';
       print_r($query);
       echo '</pre>';
    }

 $date=  JDate::getInstance('now');
//$now=date("Y-m-d H:i:s");

RENEW ADS


 function renewContent($contentid,$ad_duration)
{
$ad_duration = 1;
                $this->_db->setQuery( "SELECT expiration_date FROM #__adsmanager_ads WHERE id = ".(int)$contentid);
$expiration_date = $this->_db->loadResult();
$time = strtotime($expiration_date);
if ($time < time())
{
$time = time();
}
$time = $time + ( $ad_duration * 3600 *24);
                $newdate = date("Y-m-d",$time);
                $now=date("Y-m-d H:i:s");
             
$this->_db->setQuery( "UPDATE #__adsmanager_ads SET expiration_date = '$newdate', date_created = '$now',recall_mail_sent=0,published=1 WHERE id=".(int)$contentid);
$this->_db->query();
}


 $table=  JTable::getInstance('Property', 'IpropertyTable');
        $table->created=date("Y-m-d H:i:s");

JHTML


JHTML::_('icon.edit', $this->article, $this->params, $this->access);

truncate trong phph

http://www.the-art-of-web.com/php/truncate/?sent#section_7

Thứ Tư, 8 tháng 8, 2012

List cac field trong joomla


<field name="font-size" type="list" default="12" description="What size font should the message use?" label="Font size">
    <option value="8">8px</option>
    <option value="12">12px</option>
    <option value="16">16px</option>
</field>

aaaaaaa

<field name="color" type="radio" default="black" description="Which color should the message be displayed in?" label="Color">
    <option value="black">black</option>
    <option value="red">red</option>
    <option value="blue">blue</option>
</field>

vvvvvv

<field name="alt-text" type="text" default="" label="Alternative Text" description="Besides Hello World, you can specify other text here to print to the screen instead." />

llll
$this->params->get('alt-text')
kkkkk

<fieldset name="basic">
    <field name="text-options" type="spacer" default="Text Settings" label="&lt;b&gt;Text Settings&lt;/b&gt;" description="Text Settings" />
        <field name="alt-text"  type="text" default="" label="Alternative Text" description="Besides Hello World, you can specify other text here to print to the screen instead." />
    <field name="font-options" type="spacer" default="Font Settings" label="&lt;b&gt;Font Settings&lt;/b&gt;" description="Font Settings" />
        <field name="color" type="radio" default="black" description="Which color should the message be displayed in?" label="Color">
            <option value="black">black</option>
            <option value="red">red</option>
            <option value="blue">blue</option>
        </field>
        <field name="font-size" type="list" default="12" description="What size font should the message use?" label="Font size">
            <option value="8">8px</option>
            <option value="12">12px</option>
            <option value="16">16px</option>
        </field>
</fieldset>


How to use Spacers to add HTML

The key to using HTML within a plugin is to change:
  • > to &gt;
  • < to &lt;

InMotion Hosting provides the &lt;a href='http://www.inmotionhosting.com/joomla-hosting/best-joomla-hosting.html'&gt;best joomla hosting&lt;/a&gt;
<field name="great-joomla-hosting" type="spacer" description="InMotion Hosting provides joomla hosting" label="InMotion Hosting provides the &lt;a href='http://www.inmotionhosting.com/joomla-hosting/best-joomla-hosting.html'&gt;best joomla hosting&lt;/a&gt;" />

Viết plugin joomla

http://www.phpeveryday.com/articles/12-2-Make-a-Simple-Plugin-P757.html
http://learnwebdesignonline.com/tutorial-joomla-plugin

TUT HAY
http://www.inmotionhosting.com/support/edu/joomla-25/create-plugin

Joomla tips


Lấy 100 ky tự thôi
$truncated_text = JHtml::_('string.truncate', $text, 100);
echo $truncated_text;

Bảo mật file ajax trong joomla
// No direct access to this file
define('IS_AJAX', isset($_SERVER['HTTP_X_REQUESTED_WITH'])
&&strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
if(!IS_AJAX) {die('Restricted access');}

Set generator tag, trong file index.php
$this->setGenerator('Enter_whatever_you_want_here');


Get params trong component
http://www.minitek.gr/tutorials/joomla-16-tutorials/development-tutorials/item/235-how-to-get-the-component-parameters-from-within-a-model.html

Gọi module trong view của 1 component
$modules =& JModuleHelper::getModules('position_name');
foreach ($modules as $module){
     echo JModuleHelper::renderModule($module);
}

Gửi mail joomla
http://www.minitek.gr/tutorials/joomla-16-tutorials/item/150-how-to-send-email-from-a-joomla-component.html

Thứ Tư, 1 tháng 8, 2012

PR

PR3
http://www.sitepoint.com/forums/showthread.php?833570-Coldfusion
http://www.sitepoint.com/forums/showthread.php?822353-Frameworks

PR 2
http://quangbaweb.edu.vn/showthread.php?13891-Chuoc-Toi
http://quangbaweb.edu.vn/showthread.php?14119-Hem-Cut

PR3
http://diendan.camau.gov.vn/showthread.php?t=43306
http://diendan.camau.gov.vn/showthread.php?t=43436
http://diendan.camau.gov.vn/showthread.php?t=43267
http://diendan.camau.gov.vn/showthread.php?t=42982
http://diendan.camau.gov.vn/showthread.php?t=42297
http://diendan.camau.gov.vn/showthread.php?t=42981
http://diendan.camau.gov.vn/showthread.php?t=41981
http://diendan.camau.gov.vn/showthread.php?t=41641
http://diendan.camau.gov.vn/showthread.php?t=41981
http://diendan.camau.gov.vn/showthread.php?t=42005

http://diendan.camau.gov.vn/showthread.php?t=42717
http://diendan.camau.gov.vn/showthread.php?t=42754
http://diendan.camau.gov.vn/showthread.php?t=42774
http://diendan.camau.gov.vn/showthread.php?t=42589
http://diendan.camau.gov.vn/showthread.php?t=42640
http://diendan.camau.gov.vn/showthread.php?t=42586

PR 2
http://quangbaweb.edu.vn/showthread.php?14680-Lua-Tro-Bong
http://quangbaweb.edu.vn/showthread.php?14431-Thi-cong-mang
http://quangbaweb.edu.vn/showthread.php?14055-Nguoi-Doi-3
http://quangbaweb.edu.vn/showthread.php?14060-Ky-Nguyen-Rock
http://quangbaweb.edu.vn/showthread.php?14061-Dac-Vu-Catwalk
http://quangbaweb.edu.vn/showthread.php?14059-Ke-Doc-Tai
http://quangbaweb.edu.vn/showthread.php?14048-Hung-Dong-2
http://quangbaweb.edu.vn/showthread.php?13506-Chuyen-Lang-Be
http://quangbaweb.edu.vn/showthread.php?13015-Hoa-Phu-Dung
http://quangbaweb.edu.vn/showthread.php?12931-Tuyen-CTV-marketing
http://quangbaweb.edu.vn/showthread.php?12901-Nguoi-Dep-Online
http://quangbaweb.edu.vn/showthread.php?11717-Hakuhodo-Viet-Nam
http://quangbaweb.edu.vn/showthread.php?10426-Giveaway-ColorlabsProject-Themes
http://quangbaweb.edu.vn/showthread.php?6819-Hoi-ve-htaccess
http://quangbaweb.edu.vn/showthread.php?14671-Doi-Canh-Dong-Tien
http://quangbaweb.edu.vn/member.php?4683-Nguyen-Tien-Toan
http://quangbaweb.edu.vn/showthread.php?14921-Tinh-Vo-Tran-Chan
http://quangbaweb.edu.vn/showthread.php?14912-Arang-Va-Tham-Phan
http://quangbaweb.edu.vn/showthread.php?14674-Quoc-Sac-Thien-Huong
http://quangbaweb.edu.vn/showthread.php?13980-SEO-tren-google-map
http://quangbaweb.edu.vn/showthread.php?12836-Ca-Cuoc-Cuoc-Doi
Trầm Bê Đại gia Ngân hàng Việt Nam

RERULER EXPRESSION

http://www.catswhocode.com/blog/15-php-regular-expressions-for-web-developers
http://phpvn.info/2007/07/regular-expression
xoa nhung the a co src=''

$html = '<img src="adasas.jpg" /><br />asasas<br />sdfsdf<br /><a href="adafgag"><img title="asa" src="" /></a>';


'!(<a\s[^>]+>)?<img([^>]+)src=""([^>]*)>(</a>)?!i'

SUA LOI ALIAS TRONG JOOMLA HIEN THI SAI TIENG VIET

https://sites.google.com/site/qbinh68/thu-thuat/joomla/cach-sua-loi-tieng-viet-trong-title-alias-cua-joomla-1-5
Related Posts Plugin for WordPress, Blogger...