diff --git a/inc/class.cinecturlink2.php b/inc/class.cinecturlink2.php index e74abfe..02f9f5c 100644 --- a/inc/class.cinecturlink2.php +++ b/inc/class.cinecturlink2.php @@ -121,6 +121,15 @@ class cinecturlink2 $strReq .= "AND L.link_lang = '" . $this->con->escape($params['link_lang']) . "' "; } + if (!empty($params['q'])) { + $q = $this->con->escape(str_replace('*', '%', strtolower($params['q']))); + $strReq .= "AND LOWER(L.link_title) LIKE '%" . $q . "%' "; + } + + if (!empty($params['where'])) { + $strReq .= $params['where'] . ' '; + } + if (!empty($params['sql'])) { $strReq .= $params['sql'] . ' '; } diff --git a/inc/lib.cinecturlink2.list.php b/inc/lib.cinecturlink2.list.php index c971e81..4e9a838 100644 --- a/inc/lib.cinecturlink2.list.php +++ b/inc/lib.cinecturlink2.list.php @@ -91,18 +91,16 @@ class adminlistCinecturlink2 '' . '%s'; - if ($enclose_block) { - $html_block = sprintf($enclose_block, $html_block); - } - $blocks = explode('%s', $html_block); + $enclose_blocks = explode('%s', $enclose_block); + $blocks = explode('%s', $html_block); - echo $pager->getLinks() . $blocks[0]; + echo $enclose_blocks[0] . $pager->getLinks() . $blocks[0]; while ($this->rs->fetch()) { echo $this->linkLine(isset($links[$this->rs->link_id])); } - echo $blocks[1] . $blocks[2] . $pager->getLinks(); + echo $blocks[1] . $blocks[2] . $pager->getLinks() . $enclose_blocks[1]; } } diff --git a/index.php b/index.php index 5250dba..6037eca 100644 --- a/index.php +++ b/index.php @@ -144,6 +144,7 @@ if ($part == 'links') { $c2link_filter = new adminGenericFilter($core, 'c2link'); $c2link_filter->add('part', 'links'); $c2link_filter->add(dcAdminFilters::getPageFilter()); + $c2link_filter->add(dcAdminFilters::getSearchFilter()); $c2link_filter->add(dcAdminFilters::getSelectFilter( 'catid', __('Category:'), @@ -507,7 +508,7 @@ if ($part == 'links') { '
' . form::combo('part', $action_combo) . '
' . - $core->adminurl->getHiddenFormFields('admin.plugin.cinecturlink2', array_diff_key($c2link_filter->values(true), ['part' => ''])) . + $core->adminurl->getHiddenFormFields('admin.plugin.cinecturlink2', array_diff_key($c2link_filter->values(), ['part' => ''])) . form::hidden(['redir'], $links_redir) . $core->formNonce() . '' .