- Cleaned up whitespace in `class.Settings.php` for better readability. - Enhanced `class.Articles.php` to allow optional template parameter in the `news` method. - Updated regex patterns in `class.Site.php` for better matching of news parameters. - Streamlined HTML generation in `class.Site.php` by reducing redundancy and improving readability. - Improved handling of SEO metadata and canonical links in `class.Site.php`. - Refactored calendar and visit counter methods for consistency in `class.Site.php`.
28 lines
582 B
PHP
28 lines
582 B
PHP
<?php
|
|
namespace front\factory;
|
|
|
|
class Settings
|
|
{
|
|
public static function settings_details()
|
|
{
|
|
global $mdb;
|
|
|
|
if ( !$settings = \Cache::fetch( 'settings_details' ) )
|
|
{
|
|
$results = $mdb -> select( 'pp_settings', '*' );
|
|
if ( is_array( $results ) ) foreach ( $results as $row )
|
|
$settings[ $row['param'] ] = $row['value'];
|
|
|
|
\Cache::store( 'settings_details', $settings );
|
|
}
|
|
|
|
return $settings;
|
|
}
|
|
|
|
public static function visit_counter()
|
|
{
|
|
global $mdb;
|
|
return $mdb -> get( 'pp_settings', 'value', [ 'param' => 'visits'] );
|
|
}
|
|
}
|