Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-14-2012, 11:48 PM   PM User | #1
design4
New to the CF scene

 
Join Date: Jan 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
design4 is an unknown quantity at this point
Help Parse error: syntax error, unexpected '}' /functions.php on line 24

Can't seem to figure out how to fix this? Any suggestions

PHP Code:
<?php

require_once(TEMPLATEPATH '/dashboard.php'); 


if ( 
function_exists('register_sidebar') ) 

register_sidebar(array('name' => 'Post Left','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));    
register_sidebar(array('name' => 'Post Center','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));   
register_sidebar(array('name' => 'Post Right','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>')); 
register_sidebar(array('name' => 'Footer Left','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));
register_sidebar(array('name' => 'Footer Center','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));
register_sidebar(array('name' => 'Footer Right','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));
}

function 
trim_excerpt($text) {
  return 
rtrim($text,'[...]');
}
add_filter('get_the_excerpt''trim_excerpt');



# Displays post image attachment (sizes: thumbnail, medium, full)
function dp_attachment_image($postid=0$size='thumbnail'$attributes='') {
    if (
$postid<1$postid get_the_ID();
    if (
$images get_children(array(
        
'post_parent' => $postid,
        
'post_type' => 'attachment',
        
'numberposts' => 1,
        
'post_mime_type' => 'image',)))
        foreach(
$images as $image) {
            
$attachment=wp_get_attachment_image_src($image->ID$size);
            
?><img src="<?php echo $attachment[0]; ?><?php echo $attributes?> /><?php
        
}
}


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;
design4 is offline   Reply With Quote
Old 01-15-2012, 01:35 AM   PM User | #2
Dan13071992
Regular Coder

 
Join Date: Dec 2010
Location: Kent, UK
Posts: 573
Thanks: 23
Thanked 10 Times in 10 Posts
Dan13071992 is an unknown quantity at this point
try this:

PHP Code:
<?php

require_once(TEMPLATEPATH '/dashboard.php'); 


if ( 
function_exists('register_sidebar') ) 

register_sidebar(array('name' => 'Post Left','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));    
register_sidebar(array('name' => 'Post Center','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));   
register_sidebar(array('name' => 'Post Right','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>')); 
register_sidebar(array('name' => 'Footer Left','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));
register_sidebar(array('name' => 'Footer Center','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));
register_sidebar(array('name' => 'Footer Right','before_widget' => '','after_widget' => '','before_title' => '<h2>','after_title' => '</h2>'));
}

function 
trim_excerpt($text) {
  return 
rtrim($text,'[...]');
}
add_filter('get_the_excerpt''trim_excerpt');



# Displays post image attachment (sizes: thumbnail, medium, full)
function dp_attachment_image($postid=0$size='thumbnail'$attributes='') {
    if (
$postid<1$postid get_the_ID();
    if (
$images get_children(array(
        
'post_parent' => $postid,
        
'post_type' => 'attachment',
        
'numberposts' => 1,
        
'post_mime_type' => 'image',)))
        foreach(
$images as $image) {
            
$attachment=wp_get_attachment_image_src($image->ID$size);
            <
img src=/"$attachment[0]/" $attributes />
        }
}


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;
__________________
http://360-tactics.co.uk/forum/index.php

Crime-Wave

please post your code wrapped in tags
please post your PHP wrapped in tags

Last edited by Dan13071992; 01-15-2012 at 01:39 AM..
Dan13071992 is offline   Reply With Quote
Old 01-15-2012, 01:50 AM   PM User | #3
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,292
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
What you have is almost fine. Where is the closing } for your legacy comments function.
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Reply

Bookmarks

Tags
error, parse, php

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:24 PM.


Advertisement
Log in to turn off these ads.