Updates from January, 2014 Toggle Comment Threads | Keyboard Shortcuts

  • r4ccoon 6:13 am on January 6, 2014 Permalink | Reply  

    why people making bad codes with PHP 

    Many people reason is: “I got this code from a tutorial.”
    (More …)

     
  • r4ccoon 3:49 pm on April 23, 2012 Permalink | Reply  

    jquery jqgrid [g.cell] error 

    happens when you try to use JSON data on JQGrid. your JSON is probably fine, but your initiation code probably wrong.

    if this happened to you, try to do

    repeatitems : false

    on the options for the initiation

     
  • r4ccoon 3:36 pm on February 14, 2012 Permalink | Reply
    Tags: ,   

    joomla 1.5 get item id from plugin, module, component 


    $menu = &JSite::getMenu();
    $active = $menu->getActive();

    ///if the active menu is empty means you are in front page
    if(!$active)
    $active = $menu->getDefault();

    $Itemid = $active->id;

     
  • r4ccoon 5:33 pm on November 3, 2011 Permalink | Reply  

    <?php count(false); gives you 1 

    <?php echo count(false);?>

    above code will give you 1 as a result. so becareful if you do a test on a function that returning a boolean

     
  • r4ccoon 1:16 pm on February 2, 2011 Permalink | Reply  

    php domdocument get element by tag name 

    The following takes a list of news items from an XML file (or an RSS feed), assigning it to an array first for a name value pair and then generating an HTML list.

     
     <?php  
     $xml =<<<EOT  
     <?xml version="1.0" encoding="ISO-8859-1"?>  
     <news>  
       <item>  
         <title>News 1</title>  
         <created>04/2/2010 08:00 EST</created>  
         <url>http://news.example.com/news.pdf</url>  
       </item>  
       <item>  
         <title>News 2</title>  
         <created>04/25/2010 08:00 EST</created>  
         <url>http://news.example.com/news.pdf</url>  
       </item>  
       <item>  
         <title>News 3</title>  
         <created>04/27/2010 08:00 EST</created>  
         <url>http://news.example.com/news.pdf</url>  
       </item>  
     </news>  
     EOT;  
     $doc = new DOMDocument();  
     if ($doc->loadXML($xml)) {  
       $items = $doc->getElementsByTagName('item');  
       $headlines = array();  
       foreach($items as $item) {  
         $headline = array();  
         if($item->childNodes->length) {  
           foreach($item->childNodes as $i) {  
             $headline[$i->nodeName] = $i->nodeValue;  
           }  
         }  
         $headlines[] = $headline;  
       }  
       if(!empty($headlines)) {  
         $hc = 0;  
         echo '<ul>';  
         foreach($headlines as $headline) {  
           if(++$hc <= 3) {  
             echo '<li>'  
               .'<a href="'.$headline['url'].'" target="_blank">'  
                 .'<span>'.date('F j, Y', strtotime($headline['created'])).'</span><br />'  
                 .$headline['title']  
               .'</a>'  
             .'</li>';  
           }  
         }  
         echo '</ul>';  
       }  
     }   
    

    from http://www.php.net/manual/en/domdocument.getelementsbytagname.php#97608

     
  • r4ccoon 4:14 am on May 25, 2010 Permalink | Reply  

    mysql data type limit 

    Data Type Storage Required
    TINYINT 1 byte
    SMALLINT 2 bytes
    MEDIUMINT 3 bytes
    INT,
    INTEGER
    4 bytes
    BIGINT 8 bytes
    FLOAT(p) 4 bytes if 0 <= p <= 24, 8 bytes if 25
    <= p <= 53
    FLOAT 4 bytes
    DOUBLE [PRECISION],
    REAL
    8 bytes
    DECIMAL(M,D),
    NUMERIC(M,D)
    Varies; see following discussion
    BIT(M) approximately (M+7)/8 bytes
    Data Type Storage Required
    DATE 3 bytes
    TIME 3 bytes
    DATETIME 8 bytes
    TIMESTAMP 4 bytes
    YEAR 1 byte
    Data Type Storage Required
    CHAR(M) M × w bytes,
    0 <= M
    <=
    255, where w is
    the number of bytes required for the maximum-length
    character in the character set
    BINARY(M) M bytes, 0 <=
    M <=
    255
    VARCHAR(M),
    VARBINARY(M)
    L + 1 bytes if column values require 0
    – 255 bytes, L + 2 bytes
    if values may require more than 255 bytes
    TINYBLOB,
    TINYTEXT
    L + 1 bytes, where
    L <
    28
    BLOB, TEXT L + 2 bytes, where
    L <
    216
    MEDIUMBLOB,
    MEDIUMTEXT
    L + 3 bytes, where
    L <
    224
    LONGBLOB,
    LONGTEXT
    L + 4 bytes, where
    L <
    232
    ENUM('value1','value2',...) 1 or 2 bytes, depending on the number of enumeration values (65,535
    values maximum)
    SET('value1','value2',...) 1, 2, 3, 4, or 8 bytes, depending on the number of set members (64
    members maximum)
     
  • r4ccoon 6:45 pm on September 10, 2009 Permalink | Reply
    Tags: icon03.net   

    menambah icon03 feed RSS ke blog Widget kamu 

    hi teman2 skalian.. g pp deh kl kalian punya blog sendiri2. tp taruh link2 nya post2an anak2 icon di blog kamu dong..

    oh iya. ini nih cara nya..

    1. login ke admin panel.

    2. cari di kiri di bagian theme-> widget. klik deh

    3. cari “RSS” klik dan drag ke bagian kanan. nanti disuruh masukin feed. nah. kasi ini nih link nya..

    http://icon03.net/activity/feed&#8221;

    ini gambar nya kl mo.. tp di gambar nya link feed RSS nya beda.. ganti ma ini ya “http://icon03.net/activity/feed&#8221;

    icon03rss

     
  • r4ccoon 11:06 am on September 10, 2009 Permalink | Reply  

    PHP Tutorials Examples PHP Recursive Array To XML With DOM 

    PHP Tutorials Examples PHP Recursive Array To XML With DOM

    This class provides a method to recursively create XML from a PHP array. The functionality is provided by extending the built in Document Object Model (DOM) class. By extending the DOM class, all the functions within are available locally to the array2xml class. The main engine in this class is the createNode method, which is a recursive function that adds the child nodes to the parent root directory.

     
  • r4ccoon 12:08 am on September 8, 2009 Permalink | Reply  

    integration interspire email marketer step 1 

    http://idn.interspire.com/categories/Email-Marketer/

    that link is not very complete. i spent hours just to make the sample working. it is not very tricky though. here was my problem. i was trying to integrate IEM with joomla. i followed the sample, and the sample needs the usertoken. i tried to look up everywhere on the installation, but i couldnt find it. so i looked up on the database directly. yes it was there. but it more than 64 character. i tried to put it on the sample code, and ofcourse it wasnt going to work anyway.

    i relooked up on the admin panel of IEM. and LOL i found a check box “enable this user to use xml API”. click save. and then it gives you the correct API token. copy paste that token, and the sample is working.

    IEM1a

    IEM1B

    the PHP code is still the same as the sample on the link. just copy paste that.

     
  • r4ccoon 5:22 am on June 8, 2009 Permalink | Reply
    Tags: ,   

    regexp to extract parameter like option=[value] 

    preg_match_all("#(\w+)=\[(.*?)\]#s", $param_line, $matches);

    sample string = {gallery width=[129] url=[http://google.com] height=[122]}

     
    • wes 8:30 pm on September 1, 2009 Permalink | Reply

      Do you do custom work on Virtuemart websites? I need help in changing the way virtuemart works for a client i have. I have asked a couple of developers if they can make the changes i want but they have not been any help.

      Basically i want virtuemart to show all products in a big list like the link shows. And function the same way as the large table of products shows.

      would there be a way to do the drop down menu’s as well.

      Thank you,

      Wes

      http://register.rcmusic.ca/rcms/capricorn?para=calendarWelcome

      my website i am providing is the website i am currently working on.

      • r4ccoon 12:14 am on September 2, 2009 Permalink | Reply

        what you can do is make a menu that link to a certain category. and put browse_1, or browse_2,browse_3 or browse_4 or browse_5 in browse page text box form
        try all of those type of .

        you need to create your own browse page if you cant find what are you looking for on those 5 type of browse pages.

        just try that first and see what happens.

c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel