Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 25. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  images don't refresh

phpMyEdit General     images don't refresh
Odoslať novú tému   Odpovedať na tému    
 
DUMMY51     Založený: 23.02.2010   Príspevky: 1  
Príspevok Zaslal: 2010-02-23 09:31
Návrat hore  Odpovedať s citátom     

Hi,

Since I have many columns filled with "Y" or "N", I'm trying to improve the visual result.

I managed to put green tick and red cross images (Y.png and N.png) with this code :

Kód:

'sql|LF' => 'CONCAT(\'<img src="../phpMyEdit/images/\', category_publish, \'.png">\')',


Works fine, the page is much easier to read, but when I save the changes, while the database is correctly updated, the images never change.

Emptying the browser cache and refreshing has no effect. Is there another cache somewhere or my code is it wrong ?

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2010-02-24 18:01
Návrat hore  Odpovedať s citátom     

Use the forum's Search box to search for other CONCAT examples (examples which are conditional based on the field's value).

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2010-02-24 19:01
Návrat hore  Odpovedať s citátom     

Display either a red or green icon depending on the value of the `hidden` field.
Kód:
$opts['fdd']['hidden'] = array(
  'css'        => array('postfix' => 'right-justify'),
  'default'    => '0',
  'input'      => '',
  'maxlen'     => 1,
  'name'       => 'Hidden',
  'options'    => 'ACPVDFL',
  'select'     => 'D',
  'escape|LF'  => false,
  'sql|LF'     => 'if(hidden = "0", CONCAT("<img src=\"images/pme-red.gif\">"), CONCAT("<img src=\"images/pme-green.gif\">"))',
  'sqlw'       => 'TRIM("$val_as")',
  'values2'    => $select_no_yes,
  'sort'       => true,
  'tab|ACP'    => 'Hidden etc'
);


http://phpvs.com/misc/pme-screenshot.gif
http://phpvs.com/misc/pme-red.gif
http://phpvs.com/misc/pme-green.gif

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2010-02-24 19:27
Návrat hore  Odpovedať s citátom     

Here's another example (not exactly related to the above) which someone might need someday.

A dummy / virtual field which uses CONCAT and REPLACE to alter the value of the `dir` field in order to display a link to an image (instead of a link to the /tn/ subfolder withiin an images directory).

Kód:
$opts['fdd']['dummy1'] = array (
   'name' => 'Link',
   'sql|LF' => 'if(category = "image" || category = "other",
      CONCAT("<a href=\"", dir, "/", filename, "\" target=\"_blank\">link</a>"),
         if(category = "thumb", CONCAT("<a rel=\"lightbox\" href=\"", REPLACE(dir, "/tn", "/"), filename, "\" title=\"", photo_text, "\"><img src=\"", dir, "/", filename, "\" ", img_src_attr, " alt=\"\"></a>"), ""))',
   'options'  => 'L',
   'escape' => false,
   'sort'     => false
);


 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov