Liebe/-r Experte/-in, ich habe einen Fehler in Wordpress
in der Datei functions.php (Parse error: syntax error, unexpected ’ false,
‚menu.homeCaption‘ => „Home“,
‚menu.showHome‘ => true,
‚menu.topItemBegin‘ => „“,
‚menu.topItemEnd‘ => „“,
‚menu.source‘ => „Pages“,
‚vmenu.showSubmenus‘ => false,
‚vmenu.simple‘ => false,
‚vmenu.source‘ => „Categories“,
);
$themename = „Poker2010final3“;
$shortname = „artisteer“;
$default_footer_content = „Contact Us | Terms of Use | Trademarks | Privacy Statement
Copyright © 2010 „.get_bloginfo(‚name‘).“. All Rights Reserved.“;
$options = array (
array( „name“ => „HTML“,
„desc“ => sprintf(__(‚XHTML: You can use these tags: %s‘, ‚kubrick‘), ‚a, abbr, acronym, em, b, i, strike, strong, span‘),
„id“ => „art_footer_content“,
„std“ => $default_footer_content,
„type“ => „textarea“)
);
function art_update_option($key, $value){
update_option($key, (get_magic_quotes_gpc()) ? stripslashes($value) : $value);
}
function art_add_admin() {
global $themename, $shortname, $options;
if ( $_GET[‚page‘] == basename(__FILE__) ) {
if (‚save‘ == $_REQUEST[‚action‘] ) {
foreach ($options as $value) {
if($value[‚type‘] != ‚multicheck‘){
art_update_option( $value[‚id‘], $_REQUEST[$value[‚id‘] ] );
}else{
foreach($value[‚options‘] as $mc_key => $mc_value){
$up_opt = $value[‚id‘].’_’.$mc_key;
art_update_option($up_opt, $_REQUEST[$up_opt] );
}
}
}
foreach ($options as $value) {
if($value[‚type‘] != ‚multicheck‘){
if( isset( $_REQUEST[$value[‚id‘] ] ) ) { art_update_option( $value[‚id‘], $_REQUEST[$value[‚id‘] ] ); } else { delete_option( $value[‚id‘] ); }
}else{
foreach($value[‚options‘] as $mc_key => $mc_value){
$up_opt = $value[‚id‘].’_’.$mc_key;
if( isset( $_REQUEST[$up_opt] ) ) { art_update_option( $up_opt, $_REQUEST[$up_opt] ); } else { delete_option( $up_opt ); }
}
}
}
header(„Location: themes.php?page=functions.php&saved=true“);
die;
}
}
add_theme_page(„Footer“, „Footer“, ‚edit_themes‘, basename(__FILE__), ‚art_admin‘);
}
function art_admin() {
global $themename, $shortname, $options;
if ( $_REQUEST[‚saved‘] ) echo ’ ‚.$themename.‘ settings saved. ';
?>
Footer
<?php foreach ($options as $value) {switch ( $value['type'] ) { case 'text': option\_wrapper\_header($value); ?\>" /\> <?php option_wrapper_footer($value);
break; case 'select': option\_wrapper\_header($value); ?\><?php foreach ($value['options'] as $option) { ?>\><?php echo $option; ?><?php } ?><?php option_wrapper_footer($value);
break;
case ‚textarea‘:
$ta_options = $value[‚options‘];
option_wrapper_header($value);
?><?php if( get_settings($value[‚id‘]) !== false) {
echo stripslashes(get_settings($value[‚id‘]));
}else{
echo $value[‚std‘];
}?><?php option_wrapper_footer($value);
break;
case „radio“:
option_wrapper_header($value);
foreach ($value[‚options‘] as $key=>$option) {
$radio_setting = get_settings($value[‚id‘]);
if($radio_setting != ‚‘){
if ($key == get_settings($value[‚id‘]) ) {
$checked = „checked=„checked““;
} else {
$checked = „“;
}
}else{
if($key == $value[‚std‘]){
$checked = „checked=„checked““;
}else{
$checked = „“;
}
}?>
/><?php echo $option; ?>
option\_wrapper\_footer($value); break; case "checkbox": option\_wrapper\_header($value); if(get\_settings($value['id'])){ $checked = "checked=\"checked\""; }else{ $checked = ""; } ?\> /\> <?php option_wrapper_footer($value);
break; case "multicheck": option\_wrapper\_header($value); foreach ($value['options'] as $key=\>$option) { $pn\_key = $value['id'] . '\_' . $key; $checkbox\_setting = get\_settings($pn\_key); if($checkbox\_setting != ''){ if (get\_settings($pn\_key) ) { $checked = "checked=\"checked\""; } else { $checked = ""; } }else{ if($key == $value['std']){ $checked = "checked=\"checked\""; }else{ $checked = ""; } }?\> /\><?php echo $option; ?> <?php }
option\_wrapper\_footer($value); break; case "heading": ?\> <?php echo $value['name']; ?> <?php break;
default: break; } } ?\> <?php }
function option\_wrapper\_header($values){ ?\><?php echo $values['name']; ?>: <?php }
function option\_wrapper\_footer($values){ ?\> <?php echo $values['desc']; ?> <?php }
add\_action('admin\_menu', 'art\_add\_admin'); if (!function\_exists('get\_search\_form')) { function get\_search\_form() { include (TEMPLATEPATH . "/searchform.php"); } } if (!function\_exists('get\_previous\_posts\_link')) { function get\_previous\_posts\_link($label) { ob\_start(); previous\_posts\_link($label); return ob\_get\_clean(); } } if (!function\_exists('get\_next\_posts\_link')) { function get\_next\_posts\_link($label) { ob\_start(); next\_posts\_link($label); return ob\_get\_clean(); } } if (!function\_exists('get\_previous\_post\_link')) { function get\_previous\_post\_link($label) { ob\_start(); previous\_post\_link($label); return ob\_get\_clean(); } } if (!function\_exists('get\_next\_post\_link')) { function get\_next\_post\_link($label) { ob\_start(); next\_post\_link($label); return ob\_get\_clean(); } } function art\_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?\>- id="li-comment-<?php comment_ID() ?>"\> <?php echo get_avatar($comment,$size='48'); ?><?php comment_author_link(); ?>: <?php if ($comment->comment\_approved == '0') : ?\> <?php _e('Your comment is awaiting moderation.') ?> <?php endif; ?><?php edit_comment_link('('.__('Edit', 'kubrick').')',' ','') ?> <?php comment_text() ?> <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max\_depth' =\> $args['max\_depth']))) ?\> <?php }
if (function\_exists('register\_sidebars')) { register\_sidebars(0, array( 'before\_widget' =\> ' '.'', 'before\_title' =\> '', 'after\_title' =\> '', 'after\_widget' =\> ''.' ' )); } function art\_normalize\_widget\_style\_tokens($content, $bw, $bwt, $ewt, $bwc, $bwc, $ewc, $ew) { $result = ''; $startBlock = 0; $endBlock = 0; while (true) { $startBlock = strpos($content, $bw, $endBlock); if (false === $startBlock) { $result .= substr($content, $endBlock); break; } $result .= substr($content, $endBlock, $startBlock - $endBlock); $endBlock = strpos($content, $ew, $startBlock); if (false === $endBlock) { $result .= substr($content, $endBlock); break; } $endBlock += strlen($ew); $widgetContent = substr($content, $startBlock, $endBlock - $startBlock); $beginTitlePos = strpos($widgetContent, $bwt); $endTitlePos = strpos($widgetContent, $ewt); if ((false == $beginTitlePos) xor (false == $endTitlePos)) { $widgetContent = str\_replace($bwt, '', $widgetContent); $widgetContent = str\_replace($ewt, '', $widgetContent); } else { $beginTitleText = $beginTitlePos + strlen($bwt); $titleContent = substr($widgetContent, $beginTitleText, $endTitlePos - $beginTitleText); if (' ' == $titleContent) { $widgetContent = substr($widgetContent, 0, $beginTitlePos) . substr($widgetContent, $endTitlePos + strlen($ewt)); } } if (false === strpos($widgetContent, $bwt)) { $widgetContent = str\_replace($bw, $bw . $bwc, $widgetContent); } else { $widgetContent = str\_replace($ewt, $ewt . $bwc, $widgetContent); } $result .= str\_replace($ew, $ewc . $ew, $widgetContent); } return $result; } function art\_sidebar($index = 1) { if (!function\_exists('dynamic\_sidebar')) return false; ob\_start(); $success = dynamic\_sidebar($index); $content = ob\_get\_clean(); if (!$success) return false; $bw = ''; $bwt = ''; $ewt = ''; $bwc = ''; $ewc = ''; $ew = ''; $content = art\_normalize\_widget\_style\_tokens($content, $bw, $bwt, $ewt, $bwc, $bwc, $ewc, $ew); $replaces = array( $bw =\> " \r\n \r\n", $bwt =\> "", $ewt =\> "", $bwc =\> " \r\n \r\n\r\n", $ewc =\> "\r\n\r\n\r\n \r\n \r\n \r\n", $ew =\> "\r\n \r\n \r\n \r\n" ); if ('' == $replaces[$bwt] && '' == $replaces[$ewt]) { $startTitle = 0; $endTitle = 0; $result = ''; while (true) { $startTitle = strpos($content, $bwt, $endTitle); if (false == $startTitle) { $result .= substr($content, $endTitle); break; } $result .= substr($content, $endTitle, $startTitle - $endTitle); $endTitle = strpos($content, $ewt, $startTitle); if (false == $endTitle) { $result .= substr($content, $startTitle); break; } $endTitle += strlen($ewt); } $content = $result; } $content = str\_replace(array\_keys($replaces), array\_values($replaces), $content); echo $content; return true; } /\* horizontal menu \*/ function art\_menu\_items() { global $artThemeSettings; if ('Pages' === $artThemeSettings['menu.source']) { art\_print\_homepage(); add\_action('get\_pages', 'art\_menu\_get\_pages\_filter'); add\_action('wp\_list\_pages', 'art\_menu\_list\_pages\_filter'); wp\_list\_pages('title\_li=&sort\_column=menu\_order'); remove\_action('wp\_list\_pages', 'art\_menu\_list\_pages\_filter'); remove\_action('get\_pages', 'art\_menu\_get\_pages\_filter'); } else { add\_action('get\_terms', 'art\_menu\_get\_terms\_filter'); add\_action('wp\_list\_categories', 'art\_menu\_wp\_list\_categories\_filter'); wp\_list\_categories('title\_li='); remove\_action('wp\_list\_categories', 'art\_menu\_wp\_list\_categories\_filter'); remove\_action('get\_terms', 'art\_menu\_get\_terms\_filter'); } } /\* end horizontal menu \*/ /\* horizontal menu filters \*/ function art\_menu\_get\_pages\_filter($pages) { global $artThemeSettings; art\_move\_frontpage($pages); $artThemeSettings['menu.blogID'] = art\_blogID($pages); $artThemeSettings['menu.activeID'] = art\_active\_pageID($pages); if (!$artThemeSettings['menu.showSubmenus']) { art\_remove\_subpage($pages); } $artThemeSettings['menu.topIDs'] = art\_top\_pageIDs($pages); return $pages; } function art\_menu\_list\_pages\_filter($output) { global $artThemeSettings; $pref ='page-item-'; if($artThemeSettings['menu.topIDs']) { foreach($artThemeSettings['menu.topIDs'] as $id) { $output = preg\_replace('~ - ]+)\>([^~', '- ' . $artThemeSettings['menu.topItemBegin'] . '$5' . $artThemeSettings['menu.topItemEnd'] . '', $output, 1); } } $frontID = null; $blogID = null; if('page' == get\_option('show\_on\_front')) { $frontID = get\_option('page\_on\_front'); $blogID = $artThemeSettings['menu.blogID']; } if ($frontID) { $output = preg\_replace('~ - ]+)\>([^~', '- ' . $artThemeSettings['menu.topItemBegin'] . '$5' . $artThemeSettings['menu.topItemEnd'] . '', $output, 1); } } if($artThemeSettings['menu.activeID']) { $output = preg\_replace('~ - ]+)\>([^~', '- ' . $artThemeSettings['menu.topItemBegin'] . '$5' . $artThemeSettings['menu.topItemEnd'] . '', $output, 1); } } $frontID = null; $blogID = null; if('page' == get\_option('show\_on\_front')) { $frontID = get\_option('page\_on\_front'); $blogID = $artThemeSettings['vmenu.blogID']; } if ($frontID) { $output = preg\_replace('~ - ]+)\>([^~', '- ' . $artThemeSettings['menu.topItemBegin'] . '$5' . $artThemeSettings['menu.topItemEnd'] . '', $output, 1); } } if($artThemeSettings['vmenu.activeIDs']) { foreach($artThemeSettings['vmenu.activeIDs'] as $id) { $output = preg\_replace('~ - [' .$artThemeSettings['menu.topItemBegin'] . $artTh...]('%2520%250D%250A%2509%2509.%2520get_option('home')%2520%250D%250A%2509%2509.%2520') '; } } function art\_move\_frontpage(&$pages) { if ('page' != get\_option('show\_on\_front')) return; $frontID = get\_option('page\_on\_front'); if (!$frontID) return; foreach ($pages as $index =\> $page) if($page-\>ID == $frontID) { unset($pages[$index]); $page-\>post\_parent = '0'; $page-\>menu\_order = '0'; array\_unshift($pages, $page); break; } } function art\_remove\_subpage(&$pages) { foreach ($pages as $index =\> $page) if ($page-\>post\_parent) unset($pages[$index]); } function art\_top\_pageIDs($pages) { $page\_IDs = array(); foreach ($pages as $index =\> $page) { $page\_IDs[] = $page-\>ID; } $result = array(); foreach ($pages as $index =\> $page) { if (!$page-\>post\_parent || !in\_array($page-\>post\_parent,$page\_IDs)) { $result[]=$page-\>ID; } } return $result; } function art\_blogID($pages) { $result = null; if(!'page' == get\_option('show\_on\_front')) { return $result; } $blogID = get\_option('page\_for\_posts'); if (!$blogID) { return $result; } foreach ($pages as $page) { if ($page-\>ID == $blogID) { $result = $page; break; } } while($result && $result-\>post\_parent) { foreach ($pages as $page) { if ($page-\>ID == $result-\>post\_parent) { $result = $page; break; } } } return ($result ? $result-\>ID : null); } function art\_active\_pageID($pages) { $current\_page = null; foreach ($pages as $index =\> $page) { if (is\_page($page-\>ID)) { $current\_page = $page; break; } } while($current\_page && $current\_page-\>post\_parent) { $parent\_page = get\_page($current\_page-\>post\_parent); if ($parent\_page && $parent\_page-\>post\_status == 'private') { break; } $current\_page = $parent\_page; } return ($current\_page ? $current\_page-\>ID : null); } function art\_active\_pageIDs($pages) { $current\_page = null; foreach ($pages as $index =\> $page) { if (is\_page($page-\>ID)) { $current\_page = $page; break; } } $result = array(); if (!$current\_page) { return $result; } $result[] = $current\_page-\>ID; while($current\_page-\>post\_parent) { $current\_page = get\_page($current\_page-\>post\_parent); $result[] = $current\_page-\>ID; } return $result; } function art\_process\_simple\_pages(&$pages, $activeIDs, $topIds) { foreach ($pages as $index =\> $page) { if ($page-\>post\_parent && !in\_array($page-\>post\_parent,$activeIDs) && !in\_array($page-\>ID,$topIds)) { unset($pages[$index]); } } } /\* end pages \*/ /\* categories \*/ function art\_active\_catID($categories) { global $wp\_query; $result = null; if (!$wp\_query-\>is\_category) { return $result; } $cat\_obj = $wp\_query-\>get\_queried\_object(); if (!$cat\_obj) { return $result; } $result = $cat\_obj-\>term\_id; while ($cat\_obj-\>parent != '0') { foreach ($categories as $index =\> $cat) if ($cat\_obj-\>parent == $cat-\>term\_id) { $cat\_obj = $cat; break; } $result = $cat\_obj-\>term\_id; } return $result; } function art\_active\_catIDs($categories) { global $wp\_query; $result = array(); if (!$wp\_query-\>is\_category) { return $result; } $cat\_obj = $wp\_query-\>get\_queried\_object(); if (!$cat\_obj) { return $result; } $result[] = $cat\_obj-\>term\_id; while ($cat\_obj-\>parent != '0') { foreach ($categories as $index =\> $cat) if ($cat\_obj-\>parent == $cat-\>term\_id) { $cat\_obj = $cat; break; } $result[] = $cat\_obj-\>term\_id; } return $result; } function art\_remove\_subcat(&$terms, $topIds) { foreach ($terms as $index =\> $cat) { if (!in\_array($cat-\>term\_id,$topIds)) { unset($terms[$index]); } } } function art\_top\_catIDs($categories) { $result = array(); $catIds = array(); foreach ($categories as $index =\> $cat) { $catIds[] = $cat-\>term\_id; } foreach ($categories as $index =\> $cat) { if (!in\_array($cat-\>parent,$catIds )) { $result[] = $cat-\>term\_id; } } return $result; } function art\_process\_simple\_cats(&$terms, $activeIDs, $topIds) { foreach ($terms as $index =\> $cat) { if (!in\_array($cat-\>term\_id,$topIds) && !in\_array($cat-\>parent,$activeIDs)) { unset($terms[$index]); } } } /\* end categories \*/ add\_filter('comments\_template', 'legacy\_comments'); function legacy\_comments($file) { if(!function\_exists('wp\_list\_comments')) : // WP 2.7-only check $file = TEMPLATEPATH.'/legacy.comments.php'; endif; return $file; } function widget\_verticalmenu($args) { extract($args); global $artThemeSettings; $bw = ""; $bwt = ""; $ewt = ""; $bwc = ""; $ewc = ""; $ew = ""; echo $bw; if ('' != $bwt && '' != $ewt) { echo $bwt; \_e($artThemeSettings['vmenu.source'], 'kubrick'); echo $ewt; } echo $bwc; ?\> <?php art_vmenu_items(); ?>