Skip to content

Commit

Permalink
Initial upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Quasiocculti committed Jan 24, 2023
1 parent 2e79888 commit a29d43b
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 0 deletions.
28 changes: 28 additions & 0 deletions pagecount/inc/pagecount.functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/**
* @package pagecount
* @version 1.20
* @author Dmitri Beliavski
* @copyright Copyright (c) seditio.by 2017-2023
*/

defined('COT_CODE') or die('Wrong URL');

function cot_pagecount ($condition = '', $mode = '', $cats = '', $subs = true, $decl = 'pages') {
global $db, $db_pages, $Ls;
require_once cot_langfile('page', 'module');
require_once cot_incfile('pagelist', 'plug');

$where_cat = cot_compilecats($mode, $cats, (bool)$subs);
$condition = (empty($condition)) ? '' : 'AND '.$condition;

$totalitems = $db->query("
SELECT COUNT(*)
FROM $db_pages
WHERE page_state='0' $where_cat $condition
")->fetchColumn();

$totalitems = (empty($decl)) ? $totalitems : cot_declension($totalitems, $Ls[$decl]);

return $totalitems;
}
16 changes: 16 additions & 0 deletions pagecount/lang/pagecount.en.lang.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* @package pagecount
* @version 1.20
* @author Dmitri Beliavski
* @copyright Copyright (c) seditio.by 2017-2023
*/

defined('COT_CODE') or die('Wrong URL');

/**
* Plugin Info
*/

$L['info_name'] = '[SEDBY] Pagecount';
$L['info_desc'] = 'Display amount of pages according to the specified parameters';
16 changes: 16 additions & 0 deletions pagecount/lang/pagecount.ru.lang.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* @package pagecount
* @version 1.20
* @author Dmitri Beliavski
* @copyright Copyright (c) seditio.by 2017-2023
*/

defined('COT_CODE') or die('Wrong URL');

/**
* Plugin Info
*/

$L['info_name'] = '[SEDBY] Pagecount';
$L['info_desc'] = 'Отображение количества страниц в соответствии с указанными параметрами';
17 changes: 17 additions & 0 deletions pagecount/pagecount.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
/* ====================
[BEGIN_COT_EXT]
Hooks=global
[END_COT_EXT]
==================== */

/**
* @package pagecount
* @version 1.20
* @author Dmitri Beliavski
* @copyright Copyright (c) seditio.by 2017-2023
*/

defined('COT_CODE') or die('Wrong URL');

require_once cot_incfile('pagecount', 'plug');
Binary file added pagecount/pagecount.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions pagecount/pagecount.setup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/* ====================
[BEGIN_COT_EXT]
Code=pagecount
Name=[SEDBY] Page Count
Description=Displays amount of site pages accoding to specified parameters
Version=1.20
Date=2017-06-27
Category=navigation-structure
Author=Dmitri Beliavski
Copyright=&copy; 2017-2023 seditio.by
Notes=
Auth_guests=R
Lock_guests=12345AW
Auth_members=R
Lock_members=12345AW
Requires_plugins=pagelist
[END_COT_EXT]
[BEGIN_COT_EXT_CONFIG]
[END_COT_EXT_CONFIG]
==================== */

/**
* @package pagecount
* @version 1.20
* @author Dmitri Beliavski
* @copyright Copyright (c) seditio.by 2017-2023
*/

defined('COT_CODE') or die('Wrong URL');

0 comments on commit a29d43b

Please sign in to comment.