Changeset 3965:b4e408d85ae5 for inc/public/class.dc.template.php
- Timestamp:
- 05/03/19 13:45:04 (6 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/public/class.dc.template.php
r3874 r3965 243 243 244 244 # --BEHAVIOR-- templateInsideBlock 245 $this->core->callBehavior('templateInsideBlock', $this->core, $this->current_tag, $attr, [ &$content]);245 $this->core->callBehavior('templateInsideBlock', $this->core, $this->current_tag, $attr, [ & $content]); 246 246 247 247 $res .= parent::compileBlockNode($this->current_tag, $attr, $content); … … 967 967 968 968 if (isset($attr['url'])) { 969 $url = addslashes(trim($attr['url'])); 969 $url = addslashes(trim($attr['url'])); 970 $args = preg_split('/\s*[?]\s*/', $url, -1, PREG_SPLIT_NO_EMPTY); 971 $url = array_shift($args); 972 $args = array_flip($args); 970 973 if (substr($url, 0, 1) == '!') { 971 $url = substr($url, 1); 972 $if[] = '($_ctx->categories->cat_url != "' . $url . '")'; 974 $url = substr($url, 1); 975 if (isset($args['sub'])) { 976 $if[] = '(!$core->blog->IsInCatSubtree($_ctx->categories->cat_url, "' . $url . '"))'; 977 } else { 978 $if[] = '($_ctx->categories->cat_url != "' . $url . '")'; 979 } 973 980 } else { 974 $if[] = '($_ctx->categories->cat_url == "' . $url . '")'; 981 if (isset($args['sub'])) { 982 $if[] = '($core->blog->IsInCatSubtree($_ctx->categories->cat_url, "' . $url . '"))'; 983 } else { 984 $if[] = '($_ctx->categories->cat_url == "' . $url . '")'; 985 } 975 986 } 976 987 } … … 980 991 if (is_array($urls) && count($urls)) { 981 992 foreach ($urls as $url) { 993 $args = preg_split('/\s*[?]\s*/', trim($url), -1, PREG_SPLIT_NO_EMPTY); 994 $url = array_shift($args); 995 $args = array_flip($args); 982 996 if (substr($url, 0, 1) == '!') { 983 $url = substr($url, 1); 984 $if[] = '($_ctx->categories->cat_url != "' . $url . '")'; 997 $url = substr($url, 1); 998 if (isset($args['sub'])) { 999 $if[] = '(!$core->blog->IsInCatSubtree($_ctx->categories->cat_url, "' . $url . '"))'; 1000 } else { 1001 $if[] = '($_ctx->categories->cat_url != "' . $url . '")'; 1002 } 985 1003 } else { 986 $if[] = '($_ctx->categories->cat_url == "' . $url . '")'; 1004 if (isset($args['sub'])) { 1005 $if[] = '($core->blog->IsInCatSubtree($_ctx->categories->cat_url, "' . $url . '"))'; 1006 } else { 1007 $if[] = '($_ctx->categories->cat_url == "' . $url . '")'; 1008 } 987 1009 } 988 1010 } … … 1325 1347 if (isset($attr['category'])) { 1326 1348 $category = addslashes(trim($attr['category'])); 1349 $args = preg_split('/\s*[?]\s*/', $category, -1, PREG_SPLIT_NO_EMPTY); 1350 $category = array_shift($args); 1351 $args = array_flip($args); 1327 1352 if (substr($category, 0, 1) == '!') { 1328 1353 $category = substr($category, 1); 1329 $if[] = '($_ctx->posts->cat_url != "' . $category . '")'; 1354 if (isset($args['sub'])) { 1355 $if[] = '(!$_ctx->posts->underCat("' . $category . '"))'; 1356 } else { 1357 $if[] = '($_ctx->posts->cat_url != "' . $category . '")'; 1358 } 1330 1359 } else { 1331 $if[] = '($_ctx->posts->cat_url == "' . $category . '")'; 1360 if (isset($args['sub'])) { 1361 $if[] = '($_ctx->posts->underCat("' . $category . '"))'; 1362 } else { 1363 $if[] = '($_ctx->posts->cat_url == "' . $category . '")'; 1364 } 1332 1365 } 1333 1366 } … … 1337 1370 if (is_array($categories) && count($categories)) { 1338 1371 foreach ($categories as $category) { 1372 $args = preg_split('/\s*[?]\s*/', trim($category), -1, PREG_SPLIT_NO_EMPTY); 1373 $category = array_shift($args); 1374 $args = array_flip($args); 1339 1375 if (substr($category, 0, 1) == '!') { 1340 1376 $category = substr($category, 1); 1341 $if[] = '($_ctx->posts->cat_url != "' . $category . '")'; 1377 if (isset($args['sub'])) { 1378 $if[] = '(!$_ctx->posts->underCat("' . $category . '"))'; 1379 } else { 1380 $if[] = '($_ctx->posts->cat_url != "' . $category . '")'; 1381 } 1342 1382 } else { 1343 $if[] = '($_ctx->posts->cat_url == "' . $category . '")'; 1383 if (isset($args['sub'])) { 1384 $if[] = '($_ctx->posts->underCat("' . $category . '"))'; 1385 } else { 1386 $if[] = '($_ctx->posts->cat_url == "' . $category . '")'; 1387 } 1344 1388 } 1345 1389 }
Note: See TracChangeset
for help on using the changeset viewer.