Search found 17 matches

by Misteric
Tue Apr 29, 2025 7:17 pm
Forum: Themes
Topic: Clean Blog
Replies: 2
Views: 254602

Re: Clean Blog

Hallo Wolfgang!,

Don't forget to download, activate and adjust the settings first for the plugins tags and search.

Just a reminder,


Misteric
by Misteric
Sun Jun 02, 2024 4:25 pm
Forum: General
Topic: Limit number of Tags (Plugin)
Replies: 4
Views: 7443

Re: Limit number of Tags (Plugin)

You can use this:


// By default the database of tags are alphanumeric sorted

foreach( $tags->db as $key=>$fields ) {
for( $numb_tags = 0; $numb_tags < 10; $numb_tags++ ) {
$html .= '<li>';
$html .= '<a href="'.DOMAIN_TAGS.$key.'">';
$html .= $fields['name'];
$html .= '</a>';
$html ...
by Misteric
Sat Jun 01, 2024 7:31 pm
Forum: General
Topic: Limit number of Tags (Plugin)
Replies: 4
Views: 7443

Re: Limit number of Tags (Plugin)

You count the numb_tags and break the foreach loop.


// By default the database of tags are alphanumeric sorted

$numb_tags = 0;

foreach( $tags->db as $key=>$fields ) {

$html .= '<li>';
$html .= '<a href="'.DOMAIN_TAGS.$key.'">';
$html .= $fields['name'];
$html .= '</a>';
$html .= '</li ...
by Misteric
Wed Apr 24, 2024 4:50 pm
Forum: General
Topic: Why not write a forum script?
Replies: 3
Views: 9304

Re: Why not write a forum script?

Hi agg1401,

You have https://www.humhub.com/en/download. it's a open source social network.
Maybe that's helpfull.

Have a nice day!


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

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 ...
by Misteric
Tue Apr 09, 2024 3:37 pm
Forum: General
Topic: Handling calendar / date in pages?
Replies: 4
Views: 9177

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 ...
by Misteric
Sun Mar 24, 2024 4:16 pm
Forum: General
Topic: Custom fields on parent page
Replies: 2
Views: 7964

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 ...
by Misteric
Thu Dec 07, 2023 7:06 pm
Forum: Themes
Topic: static pages and secondary pages
Replies: 1
Views: 23352

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: 61896

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: 14528

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 )