mirror of
https://github.com/v2board/v2board.git
synced 2024-11-14 07:29:13 +08:00
update: fix knowledge access data foreach
This commit is contained in:
parent
d5504354bc
commit
d42c271942
@ -63,9 +63,9 @@ class KnowledgeController extends Controller
|
|||||||
|
|
||||||
private function formatAccessData(&$body)
|
private function formatAccessData(&$body)
|
||||||
{
|
{
|
||||||
function getBetween($input, $start, $end){$substr = substr($input, strlen($start)+strpos($input, $start),(strlen($input) - strpos($input, $end))*(-1));return $substr;}
|
function getBetween($input, $start, $end){$substr = substr($input, strlen($start)+strpos($input, $start),(strlen($input) - strpos($input, $end))*(-1));return $start . $substr . $end;}
|
||||||
while (strpos($body, '<!--access start-->') !== false) {
|
while (strpos($body, '<!--access start-->') !== false) {
|
||||||
$accessData = '<!--access start-->' . getBetween($body, '<!--access start-->', '<!--access end-->') . '<!--access end-->';
|
$accessData = getBetween($body, '<!--access start-->', '<!--access end-->');
|
||||||
if ($accessData) {
|
if ($accessData) {
|
||||||
$body = str_replace($accessData, '<div class="v2board-no-access">'. __('You must have a valid subscription to view content in this area') .'</div>', $body);
|
$body = str_replace($accessData, '<div class="v2board-no-access">'. __('You must have a valid subscription to view content in this area') .'</div>', $body);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user