Search found 15 matches

by Misteric
Mon Apr 15, 2024 8:26 pm
Forum: General
Topic: Handling calendar / date in pages?
Replies: 4
Views: 88

Re: Handling calendar / date in pages?

Kristian You have the creation date and the Modified day: with an if statement like this: <?php $date = $page->date(); if(isset($page->dateModified())) { $date = $page->dateModified(); } if(strtotime($date) > strtotime(date("2024-10-31 23:59:59"))) { echo timeBetween(strtotime($date), strt...
by Misteric
Tue Apr 09, 2024 3:37 pm
Forum: General
Topic: Handling calendar / date in pages?
Replies: 4
Views: 88

Re: Handling calendar / date in pages?

Hi Kristian, To show how many minutes and days are past, you can use the php-code below: <?php function timeBetween($start_date,$end_date) { $diff = $end_date-$start_date; $seconds = 0; $hours = 0; $minutes = 0; if($diff % 86400 <= 0){$days = $diff / 86400;} // 86,400 seconds in a day if($diff % 864...
by Misteric
Sun Mar 24, 2024 4:16 pm
Forum: General
Topic: Custom fields on parent page
Replies: 2
Views: 90

Re: Custom fields on parent page

Hi Bayerberg, 1. List all the pages. 2. Check first if it's a parent page. 3. Afterwards you check if it has a custom field... You can do something like that: <?php // Page number of the paginator, the first page is 1 $pageNumber = 1; // The value -1 tell to Bludit to returns all the pages on the sy...
by Misteric
Thu Dec 07, 2023 7:06 pm
Forum: Themes
Topic: static pages and secondary pages
Replies: 1
Views: 17070

Re: static pages and secondary pages

Hi GutoCamargo,

You can find some information in the bludit's docs:
https://docs.bludit.com/en/dev-snippets ... d-subpages

If you don't find what you looking for, let's know!

No thanks,


Misteric
by Misteric
Tue Sep 12, 2023 2:19 pm
Forum: Languages
Topic: Translate Formatted Strings
Replies: 2
Views: 4577

Re: Translate Formatted Strings

You can use some php functions:
- strstr() (case sensitive),
- stristr() (case insenstive),

Put it into an IF statement, like this:

Code: Select all

if (strstr( $L->get( 'String with %s a function' ), '%s')) {
  // do something
}
by Misteric
Thu Aug 31, 2023 11:35 am
Forum: General
Topic: Customize automatic title generation?
Replies: 4
Views: 10878

Re: Customize automatic title generation?

Hi Kristian,

When a post is (auto)saved, add a timestamp before the title in the files:

bludit/bl-kernel/admin/views/new-content.php
bludit/bl-kernel/admin/views/edit-content.php ( I don't know if this is necessary )
by Misteric
Thu Aug 31, 2023 11:13 am
Forum: General
Topic: Display all uploaded images (regardless of parent post) in a gallery?
Replies: 1
Views: 1911

Re: Display all uploaded images (regardless of parent post) in a gallery?

Hi Kristian, You can use the php GLOB or SCANDIR function, like this: <?php $dir = "../*.png"; // upload folder to list png files foreach (glob($dir) as $filename) { echo $filename . "\n"; }?> <?php $dir = "/images/"; $files = scandir($dir); ?> Kind regards, Misteric
by Misteric
Mon Jul 10, 2023 7:49 am
Forum: General
Topic: Bludit v4 - Alpha version
Replies: 32
Views: 238173

Re: Bludit v4 - Alpha version

Hi there, Will there be numbers in between the previous and next buttons for the list item page? And is autofocus username on the login page still missing? Misteric Code myself a script: <?php if(!isset($_GET['page'])){ $getPage = 1; } else { $getPage = $_GET['page']; } ?> <ul class="list-grou...
by Misteric
Sun Jul 09, 2023 10:01 am
Forum: Themes
Topic: [SOLVED] Pagination
Replies: 6
Views: 18265

Re: [SOLVED] Pagination

A pagination script with numbers, first and last button: <?php if(!isset($_GET['page'])){ $getPage = 1; } else { $getPage = $_GET['page']; } ?> <ul class="list-group flex-md-row"> <?php if($getPage != 1) { ?> <li class="list-group-item"> <a class="btn btn-dark" href=&qu...
by Misteric
Fri Jul 07, 2023 7:51 am
Forum: General
Topic: Parent submenu (list children on child page)
Replies: 4
Views: 4894

Re: Parent submenu (list children on child page)

Hi, A Bludit (v3.14) script for a bootstrap menu of the parents with dropdown of the child pages: echo '<div class="dropdown">'; // Get the list of parent pages $parents = $staticContent; foreach ($parents as $parent) { if(!$parent->isChild() && $parent->hasChildren()) { echo '<a c...