1656 $string = $lang->get($string_id); |
1656 $string = $lang->get($string_id); |
1657 $string = str_replace('\\', '\\\\', $string); |
1657 $string = str_replace('\\', '\\\\', $string); |
1658 $string = str_replace('\'', '\\\'', $string); |
1658 $string = str_replace('\'', '\\\'', $string); |
1659 $text = str_replace_once($matches[0][$i], $string, $text); |
1659 $text = str_replace_once($matches[0][$i], $string, $text); |
1660 } |
1660 } |
|
1661 preg_match_all('/\{url:([A-z0-9]+):([\w\.\/:;\(\)@\[\]_=-]+)(?::([^\s\}]+))?(?:\|(escape))?\}/', $text, $matches); |
|
1662 foreach ( $matches[1] as $i => $string_id ) |
|
1663 { |
|
1664 $namespace =& $matches[1][$i]; |
|
1665 $page_id =& $matches[2][$i]; |
|
1666 $params =& $matches[3][$i]; |
|
1667 $escape =& $matches[4][$i]; |
|
1668 |
|
1669 if ( !$params ) |
|
1670 $params = false; |
|
1671 $escape = !empty($escape); |
|
1672 |
|
1673 $result = makeUrlNS($namespace, $page_id, $params, $escape); |
|
1674 |
|
1675 $text = str_replace_once($matches[0][$i], $result, $text); |
|
1676 } |
1661 return $text; |
1677 return $text; |
1662 } |
1678 } |
1663 |
1679 |
1664 // n00bish comments removed from here. 2008-03-13 @ 12:02AM when I had nothing else to do. |
1680 // n00bish comments removed from here. 2008-03-13 @ 12:02AM when I had nothing else to do. |
1665 |
1681 |
2113 $db->_die('The sidebar text data could not be selected.'); |
2131 $db->_die('The sidebar text data could not be selected.'); |
2114 |
2132 |
2115 // explicitly specify $q in case a plugin or PHP block makes a query |
2133 // explicitly specify $q in case a plugin or PHP block makes a query |
2116 while ( $row = $db->fetchrow($q) ) |
2134 while ( $row = $db->fetchrow($q) ) |
2117 { |
2135 { |
|
2136 // should we skip this block? |
|
2137 if ( |
|
2138 ( $row['item_id'] === 2 && !empty($theme['sb_hide_tools']) ) || |
|
2139 ( $row['item_id'] === 3 && !empty($theme['sb_hide_user']) ) || |
|
2140 ( $row['item_id'] === 4 && !empty($theme['sb_hide_search']) ) |
|
2141 ) |
|
2142 continue; |
|
2143 |
2118 // format the block |
2144 // format the block |
2119 $block_content = $this->format_sidebar_block($row, $vars, $parser); |
2145 $block_content = $this->format_sidebar_block($row, $vars, $parser); |
2120 |
2146 |
2121 // is there a {restrict} or {hideif} block? |
2147 // is there a {restrict} or {hideif} block? |
2122 if ( preg_match('/\{(restrict|hideif) ([a-z0-9_\(\)\|&! ]+)\}/', $block_content, $match) ) |
2148 if ( preg_match('/\{(restrict|hideif) ([a-z0-9_\(\)\|&! ]+)\}/', $block_content, $match) ) |