Chủ Nhật, 9 tháng 9, 2012

get Params trong admin


//GET PARAMS IMAGES THUMBNAIL SIZE
        $params = &JComponentHelper::getParams( 'com_iapp' );
        $image_width    = $params->get('image_width',100);
        $image_height   = $params->get('image_height',150);

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
Related Posts Plugin for WordPress, Blogger...