SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru thr's Avatar
    Join Date
    Jun 2003
    Location
    Sweden
    Posts
    664
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A different aproach? Who knows...

    Don't know how interresting this is for you guys. I came up with a nifty little class while i was doing some "dynamicly-colored-html-table-rows"..

    Bascily wath this class does is that it takes to string arguments into it's constructor, which are funktion names.

    When you run link::run([... arguments]) it passes the arguments to the funktions and switches between them everytime link::run() is called...

    here's the code:
    http://www.recide.net/thr/toggle.phps

    here's the same code running:
    http://www.recide.net/thr/toggle.php

  2. #2
    simple tester McGruff's Avatar
    Join Date
    Sep 2003
    Location
    Glasgow
    Posts
    1,690
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Colour-coding search results according to ranking can also be nice:

    PHP Code:
         function _colorGradient($rank
         {
             if(
    $rank 10)
             {
                 return 
    0;
             
             } else {
             
                 return 
    dechex(10 $rank 5);
             }
         }
     
             
    // later:
             
    $html  '<span style="width: 3em; ';
             
    $html .= 'background-color: ';
             
    $html .= '#f' $this->_colorGradient($current['rank']) . '0;">';
             
    $html .= '&nbsp;&nbsp;';
             
    $html .= '</span>'

  3. #3
    SitePoint Guru thr's Avatar
    Join Date
    Jun 2003
    Location
    Sweden
    Posts
    664
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice idea.. have to keep that one in mind


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •