Author Topic: [SOLVED] Style a droplet  (Read 2148 times)

Offline warp

  • Posts: 4
[SOLVED] Style a droplet
« on: May 26, 2013, 04:43:08 PM »
Is there a way to style the [[ModifiedWhen]] droplet?
I'using  
Code: [Select]
<span style="font-size:9px;">[[ModifiedWhen]]</span> to reduce the font size.
Can I somehow integrate it in the original code:
Code: [Select]
global $database, $wb;
if (PAGE_ID>0) {
$query=$database->query("SELECT modified_when FROM ".TABLE_PREFIX."pages where page_id=".PAGE_ID);
$mod_details=$query->fetchRow();
return "Deze pagina is laatst gewijzigd/aangepast op ".date("d-m-Y",$mod_details[0]);
}

I thought something like this would do it, but to no avail:

Code: [Select]
return <span style="font-size:9px;">
"Deze pagina is laatst gewijzigd/aangepast op ".date("d-m-Y"
</span>
,$mod_details[0]);
« Last Edit: May 26, 2013, 06:18:02 PM by warp »

Offline pcwacht

  • Posts: 2923
  • Gender: Male
    • Dutch ICT info
Re: Style a droplet
« Reply #1 on: May 26, 2013, 05:49:57 PM »
Allmost, you forgot the '

Code: [Select]
return '<span style="font-size:9px;">Deze pagina is laatst gewijzigd/aangepast op '.date("d-m-Y",$mod_details[0]).'</span>';

or make it more readable:
The .= appends text to a variable.
Code: [Select]
$return_string = '<span style="font-size:9px;">Deze pagina is laatst gewijzigd/aangepast op ';
$return_string .= date("d-m-Y",$mod_details[0]);
$return_string .= '</span>';
return $return_string;

Have fun,
John
http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....

Offline warp

  • Posts: 4
Re: Style a droplet
« Reply #2 on: May 26, 2013, 06:16:39 PM »
Wow, that is a really quick and accurate answer!
Even better: It Works  :wink:

John, thanks a lot.

Frank Kalf

 

postern-length