getURL() . '#plugins' : $_REQUEST['redir']; # -- Get settings -- $core->blog->settings->addNamespace('fac'); $s = $core->blog->settings->fac; $fac_formats = @unserialize($s->fac_formats); if (!is_array($fac_formats)) { $fac_formats = []; } # -- Set settings -- if (!empty($_POST['save'])) { try { $fac_formats = []; foreach($_POST['fac_formats'] as $uid => $f) { if (!empty($f['name'])) { $fac_formats[$uid] = $f; } } // fix 2021.08.21 : formats are now global $s->drop('fac_formats'); $s->put( 'fac_formats', serialize($fac_formats), 'string', 'Formats of feeds contents', true, true ); $core->blog->triggerBlog(); dcPage::addSuccessNotice( __('Configuration has been successfully updated.') ); http::redirect( $list->getURL('module=fac&conf=1&redir=' . $list->getRedir()) ); } catch (Exception $e) { $core->error->add($e->getMessage()); } } # -- Display form -- $i = 1; foreach($fac_formats as $uid => $f) { if (empty($f['name'])) { continue; } echo '
' . form::field( [ 'fac_formats[' . $uid . '][name]', 'fac_formats_' . $uid . '_name' ], 20, 255, empty($f['name']) ? '' : $f['name'], 'maximal' ) . '
' . __('In order to remove a format, leave its name empty.') . '
' . form::field( [ 'fac_formats[' . $uid . '][dateformat]', 'fac_formats_' . $uid . '_dateformat' ], 20, 255, empty($f['dateformat']) ? '' : $f['dateformat'], 'maximal' ) . '
' . __('Use date format of Dotclear or leave empty to use default date format of blog.') . '
' . form::field( [ 'fac_formats[' . $uid . '][lineslimit]', 'fac_formats_' . $uid . '_lineslimit' ], 5, 4, empty($f['lineslimit']) ? '' : $f['lineslimit'], 'maximal' ) . '
' . __('Leave lengh empty for no limit.') . '
' . form::field( [ 'fac_formats[' . $uid . '][linestitletext]', 'fac_formats_' . $uid . '_linestitletext' ], 20, 255, empty($f['linestitletext']) ? '' : $f['linestitletext'], 'maximal' ) . '
' . __('Format can be:') . '%D : ' . __('Date') . ', %T : ' . __('Title') . ', %A : ' . __('Author') . ', %E : ' . __('Description') . ', %C : ' . __('Content') . '
' . form::field( [ 'fac_formats[' . $uid . '][linestitleover]', 'fac_formats_' . $uid . '_linestitleover' ], 20, 255, empty($f['linestitleover']) ? '' : $f['linestitleover'], 'maximal' ) . '
' . __('Format can be:') . '%D : ' . __('Date') . ', %T : ' . __('Title') . ', %A : ' . __('Author') . ', %E : ' . __('Description') . ', %C : ' . __('Content') . '
' . form::field( [ 'fac_formats[' . $uid . '][linestitlelength]', 'fac_formats_' . $uid . '_linestitlelength' ], 5, 4, empty($f['linestitlelength']) ? '' : $f['linestitlelength'], 'maximal' ) . '
' . __('Leave lengh empty for no limit.') . '
' . form::field( [ 'fac_formats[' . $uid . '][linesdescriptionlength]', 'fac_formats_' . $uid . '_linesdescriptionlength' ], 5, 4, empty($f['linesdescriptionlength']) ? '' : $f['linesdescriptionlength'], 'maximal' ) . '
' . __('Leave lengh empty for no limit.') . '
' . form::field( [ 'fac_formats[' . $uid . '][linescontentlength]', 'fac_formats_' . $uid . '_linescontentlength' ], 5, 4, empty($f['linescontentlength']) ? '' : $f['linescontentlength'], 'maximal' ) . '
' . __('Leave lengh empty for no limit.') . '
' . form::field( [ 'fac_formats[' . $uid . '][name]', 'fac_formats_' . $uid . '_name' ], 20, 255, '', 'maximal' ) . '
'. __('In order to remove a format, leave its name empty.') . '
' . form::field( [ 'fac_formats[' . $uid . '][dateformat]', 'fac_formats_' . $uid . '_dateformat' ], 20, 255, '', 'maximal' ) . '
' . __('Use date format of Dotclear or leave empty to use default date format of blog.') . '
' . form::field( [ 'fac_formats[' . $uid . '][lineslimit]', 'fac_formats_' . $uid . '_lineslimit' ], 5, 4, 5, 'maximal' ) . '
' . __('Leave lengh empty for no limit.') . '
' . form::field( [ 'fac_formats[' . $uid . '][linestitletext]', 'fac_formats_' . $uid . '_linestitletext' ], 20, 255, '%T', 'maximal' ) . '
' . __('Format can be:') . '%D : ' . __('Date') . ', %T : ' . __('Title') . ', %A : ' . __('Author') . ', %E : ' . __('Description') . ', %C : ' . __('Content') . '
' . form::field( [ 'fac_formats[' . $uid . '][linestitleover]', 'fac_formats_' . $uid . '_linestitleover' ], 20, 255, '%D', 'maximal' ) . '
' . __('Format can be:') . '%D : ' . __('Date') . ', %T : ' . __('Title') . ', %A : ' . __('Author') . ', %E : ' . __('Description') . ', %C : ' . __('Content') . '
' . form::field( [ 'fac_formats[' . $uid . '][linestitlelength]', 'fac_formats_' . $uid . '_linestitlelength' ], 5, 4, 150, 'maximal' ) . '
' . __('Leave lengh empty for no limit.') . '
' . form::field( [ 'fac_formats[' . $uid . '][linesdescriptionlength]', 'fac_formats_' . $uid . '_linesdescriptionlength' ], 5, 4, 350, 'maximal' ) . '
' . __('Leave lengh empty for no limit.') . '
' . form::field( [ 'fac_formats[' . $uid . '][linescontentlength]', 'fac_formats_' . $uid . '_linescontentlength' ], 5, 4, 350, 'maximal' ) . '
' . __('Leave lengh empty for no limit.') . '
' . __('Theme must have behavoir publicEntryAfterContent.') . ' ' . __('To add feed to an entry edit this entry and put in sidebar the url of the feed and select a format.') . '
' . html::escapeHTML('') . '' . __('Title of feed') . '
' . __('Description of feed') . '
- ' . __('Title of entry') . '
- ' . __('Description of entry') . '