Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Saturday, October 31, 2026
About Us
O nás
Magazine
Magazín
Open Source
Otvorený softvér
CVS
CVS
Services
Služby
Index  »  Projects  »  phpMyEdit  »  Forum  »  [strftimemask] support timestamp UNIX in addition to MySql

phpMyEdit Features     [strftimemask] support timestamp UNIX in addition to MySql
Post new topic   Reply to topic   Goto page 1, 2  Next  
 
Sab     Joined: 26 Dec 2004   Posts: 5  
Post Posted: 2005-03-05 19:26
Back to top  Reply with quote     

I'm not using anymore MySql timestamp for a long time but directly the php one. Ok this is my choice and it is not the question here but how to made phpMyEdit support it natively in addition to MySql one with option strftimemask .

To enable this I've inherited the phpMyEdit class and rewrite the cellDisplay method just adding one single line.

Code:

function cellDisplay($k, $row, $css) /* {{{ */
   {
      $escape  = isset($this->fdd[$k]['escape']) ? $this->fdd[$k]['escape'] : true;
      $key_rec = $row['qf'.$this->key_num];
      if (@$this->fdd[$k]['datemask']) {
         $value = intval($row["qf$k".'_timestamp']);
         $value = $value ? @date($this->fdd[$k]['datemask'], $value) : '';
      } else if (@$this->fdd[$k]['strftimemask']) {
         $value = intval($row["qf$k".'_timestamp']);
         [BEGIN]//Addition : Sab 08/11/2004 - manage php/unix timestamps declared as INT as of MySql
         if ($value == '')$value = $row["qf$k"];[/END]
         $value = $value ? @strftime($this->fdd[$k]['strftimemask'], $value) : '';
      } else if ($this->is_values2($k, $row["qf$k"])) {
         $value = $row['qf'.$k.'_idx'];
         if ($this->fdd[$k]['select'] == 'M') {
            $value_ar  = explode(',', $value);
            $value_ar2 = array();
            foreach ($value_ar as $value_key) {
               if (isset($this->fdd[$k]['values2'][$value_key])) {
                  $value_ar2[$value_key] = $this->fdd[$k]['values2'][$value_key];
                  $escape = false;
               }
            }
            $value = join(', ', $value_ar2);
         } else {
            if (isset($this->fdd[$k]['values2'][$value])) {
               $value  = $this->fdd[$k]['values2'][$value];
               $escape = false;
            }
         }
      } else {
         $value = $row["qf$k"];
      }
      $original_value = $value;
      if (@$this->fdd[$k]['strip_tags']) {
         $value = strip_tags($value);
      }
      if (intval($this->fdd[$k]['trimlen']) > 0 && strlen($value) > $this->fdd[$k]['trimlen']) {
         $value = ereg_replace("[\r\n\t ]+",' ',$value);
         $value = substr($value, 0, $this->fdd[$k]['trimlen'] - 3).'...';
      }
      if (@$this->fdd[$k]['mask']) {
         $value = sprintf($this->fdd[$k]['mask'], $value);
      }
      if ($this->col_has_URL($k)) {
         return $this->urlDisplay($k, $original_value, $value, $css, $key_rec);
      }
      if (strlen($value) <= 0) {
         return '&nbsp;';
      }
      if ($escape) {
         $value = htmlspecialchars($value);
      }
      return nl2br($value);
   } /* }}} */


I didn't found any other ways to made it work nor I test side effects of the modification using non timestamp fields.

Well if you found it cool and by chance robust would be cool that you integrate it on future version ;).

 
Mescalito     Joined: 15 Mar 2004   Posts: 3  
Post Posted: 2005-03-15 20:12
Back to top  Reply with quote     

Thank you Sab,

I also prefer PHP timestamp, and your add is very useful.

M.

 
MarianneBCarter     Joined: 05 May 2020   Posts: 1  
Post Posted: 2020-05-05 14:26
Back to top  Reply with quote     

Thanks for sharing this complete code with the detail to use it. People want to find essaypro.com review that can provide the best ideas to them so that they can resolve their problems.

 
Lyda Baumgarten     Joined: 01 Jul 2020   Posts: 3  
Post Posted: 2021-01-11 08:53
Back to top  Reply with quote     

I am glad to read this article. google

 
mariajchin     Joined: 02 Feb 2021   Posts: 24  
Post Posted: 2021-02-13 10:28
Back to top  Reply with quote     

Thanks for sharing this information to increase our knowledge. Looking forward for more on your site. Here is such an amazing check this out Apoc Euphoria Yellow Jacket now you can get this with special discount and with free shipping as well.

 
markrollins     Joined: 18 Mar 2021   Posts: 1  
Post Posted: 2021-03-18 11:21
Back to top  Reply with quote     

Visit the best online store theextradiscount to grab amazing & exclusive deals on Edens Herbals Coupons & save up to 20% of on your entire eshopping.

 
mariajchin     Joined: 02 Feb 2021   Posts: 24  
Post Posted: 2021-06-21 11:22
Back to top  Reply with quote     

Thanks for sharing this informative article keep it up check this discounted coupon on education now preschoolsmiles coupons code

 
mariajchin     Joined: 02 Feb 2021   Posts: 24  
Post Posted: 2021-10-27 09:46
Back to top  Reply with quote     

Wow such an amazing content i never read this before keep it up and keep sharing with us more useful information. Check this gosphero discount code discounted coupon now and avail it.

 
mariajchin     Joined: 02 Feb 2021   Posts: 24  
Post Posted: 2021-10-27 09:47
Back to top  Reply with quote     

Thanks for sharing this amazing blog with some unique information keep it up. gosphero coupon

 
jacksonmilla87     Joined: 10 Dec 2021   Posts: 2  
Post Posted: 2021-12-29 17:35
Back to top  Reply with quote     

Toronto custom glass is the best glass shower doors company for custom frameless glass shower doors, glass railings, glass panels & more
Shower glass doors

 
oujeer     Joined: 25 May 2022   Posts: 11  
Post Posted: 2022-05-25 08:04
Back to top  Reply with quote     

wow! your content is very helpful for us such a nicer article provide I really impressed with this stuff black sheepskin jacket mens

 
jacobhue     Joined: 24 Feb 2022   Posts: 46  
Post Posted: 2022-05-27 13:00
Back to top  Reply with quote     

Thanks for this information. I really appreciate the information that you have provided. omegle bazoocam chatrandom

 
harryjack     Joined: 25 Jun 2022   Posts: 15  
Post Posted: 2022-08-31 11:34
Back to top  Reply with quote     

Put on the stylish naruto jacket for a standout appearance. It was developed with today's revolutionaries in mind. It will attract your attention in an inconceivable way with its style! With this jacket, you may change your look without compromising your comfort!

 
janiineford3     Joined: 07 Sep 2022   Posts: 20  
Post Posted: 2022-09-07 07:24
Back to top  Reply with quote     

There are also certain wildlife animals such as woodpeckers that are considered to be outside the scope of the wildlife removal companies.
Vallejo Pest Control Co.

 
ameliezilber     Joined: 05 Aug 2021   Posts: 21  
Post Posted: 2022-09-08 08:58
Back to top  Reply with quote     

I read this article. if you want alternative so visit Varsity Jackets

 
Post new topic   Reply to topic   Goto page 1, 2  Next  

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Odkazový formulár · Application form · Prihláška
Report bug on PLATON.SK website · Upozorniť na chybu na PLATON.SK webstránke · Terms of use · Podmienky použitia · Privacy policy · Ochrana osobných údajov