Sab
Založený: 26.12.2004
Príspevky: 5
Zaslal: 2005-03-05 19:26
Návrat hore
Odpovedať s citátom
|
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.
Kód: |
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 ' ';
}
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
Založený: 15.03.2004
Príspevky: 3
Zaslal: 2005-03-15 20:12
Návrat hore
Odpovedať s citátom
|
Thank you Sab,
I also prefer PHP timestamp, and your add is very useful.
M.
|
MarianneBCarter
Založený: 05.05.2020
Príspevky: 1
Zaslal: 2020-05-05 14:26
Návrat hore
Odpovedať s citátom
|
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
Založený: 01.07.2020
Príspevky: 3
Zaslal: 2021-01-11 08:53
Návrat hore
Odpovedať s citátom
|
I am glad to read this article.
google
|
mariajchin
Založený: 02.02.2021
Príspevky: 24
Zaslal: 2021-02-13 10:28
Návrat hore
Odpovedať s citátom
|
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
Založený: 18.03.2021
Príspevky: 1
Zaslal: 2021-03-18 11:21
Návrat hore
Odpovedať s citátom
|
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
Založený: 02.02.2021
Príspevky: 24
Zaslal: 2021-06-21 11:22
Návrat hore
Odpovedať s citátom
|
Thanks for sharing this informative article keep it up check this discounted coupon on education now
preschoolsmiles coupons code
|
mariajchin
Založený: 02.02.2021
Príspevky: 24
Zaslal: 2021-10-27 09:46
Návrat hore
Odpovedať s citátom
|
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
Založený: 02.02.2021
Príspevky: 24
Zaslal: 2021-10-27 09:47
Návrat hore
Odpovedať s citátom
|
Thanks for sharing this amazing blog with some unique information keep it up.
gosphero coupon
|
jacksonmilla87
Založený: 10.12.2021
Príspevky: 2
Zaslal: 2021-12-29 17:35
Návrat hore
Odpovedať s citátom
|
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
Založený: 25.05.2022
Príspevky: 7
Zaslal: 2022-05-25 08:04
Návrat hore
Odpovedať s citátom
|
wow! your content is very helpful for us such a nicer article provide I really impressed with this stuff
black sheepskin jacket mens
|
jacobhue
Založený: 24.02.2022
Príspevky: 46
Zaslal: 2022-05-27 13:00
Návrat hore
Odpovedať s citátom
|
Thanks for this information. I really appreciate the information that you have provided.
omegle
bazoocam
chatrandom
|
harryjack
Založený: 25.06.2022
Príspevky: 15
Zaslal: 2022-08-31 11:34
Návrat hore
Odpovedať s citátom
|
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
Založený: 07.09.2022
Príspevky: 20
Zaslal: 2022-09-07 07:24
Návrat hore
Odpovedať s citátom
|
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
Založený: 05.08.2021
Príspevky: 17
Zaslal: 2022-09-08 08:58
Návrat hore
Odpovedať s citátom
|
I read this article. if you want alternative so visit
Varsity Jackets
|
Odoslať novú tému
Odpovedať na tému
Choď na stránku 1, 2 Ďalší
|