WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.9 is now available!


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • [SOLVED] Style a droplet
  • Print
Pages: [1]   Go Down

Author Topic: [SOLVED] Style a droplet  (Read 5804 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 »
Logged

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
Logged
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
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • [SOLVED] Style a droplet
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2