Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Comment Count on Linked Blog Posts
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Sep 9, 2012 - 11:40 am

No, they wont get added to the wp admin...

It should print out 'Here' on the page where the comments come out...

That indicates to me, that Headway is not grabbing comments using the WP API...  which will make it very hard for us to affect...   or that the code I gave you was not entered correctly...

can you post the spFunctions.php changes you made?  include some code above and below where you entered my code...  please use the code button to format it properly...

you could also try putting the code in your wp theme functions.php file too vs our spFunctions.php file...

Avatar
JohnD
Member
Free Members
sp_UserOfflineSmall Offline
Sep 9, 2012 - 12:01 pm

Here's what I currently have for code

Also, when I add the code you gave me to the WP functions.php I receive this error Parse error: syntax error, unexpected '}' in /problem-with-post-edit-buttonome2/phogropa/public_html/wp-content/themes/problem-with-post-edit-buttoneadway/functions.php on line 37

function spDefault_spShowFontResize() {

$tipMinus = __sp('decrease forum font size');

$tipReset = __sp('reset forum font size');

$tipPlus = __sp('increase font size');

sp_FontResizer('tagClass=spFontSizeControl spRight', $tipMinus, $tipReset, $tipPlus);

sp_InsertBreak('direction-right');

add_filter('get_comments_number', 'my_comments_count', 10, 2);

function my_comments_count($count, $postid) {

vshow('here');

$total = 0;

$links = sp_blog_links_control('read', $postid);

if ($links) sp_forum_api_support();

if ($links && sp_get_auth('view_forum', $links->forum_id)) {

$sfpostlinking = sp_get_option('sfpostlinking');

# link found for this post

$total = sp_get_posts_count_in_linked_topic($links->topic_id, $sfpostlinking['sfhideduplicate']) - 1;

}

$count = $count + $total;

return $count;

}

}

?>

Avatar
JohnD
Member
Free Members
sp_UserOfflineSmall Offline
Sep 9, 2012 - 12:05 pm

Actually - the error that your code creates is - 

Fatal error: Call to undefined function sp_get_posts_count_in_linked_topic() in /problem-with-post-edit-buttonome2/phogropa/public_html/wp-content/themes/problem-with-post-edit-buttoneadway/functions.php on line 30.

That previous error was something I'd created and didn't even realize I'd copied it incorrectly. 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Sep 9, 2012 - 1:32 pm

sorry, watching NFL...

so inside the function, at the top, add:

    include_once(SPBLLIB.'sp-linking-blog.php');

Avatar
JohnD
Member
Free Members
sp_UserOfflineSmall Offline
Sep 9, 2012 - 1:40 pm

Oh no worries I've got the game on as well - it's good to be back to football season!

And adding this code to the WP function file did the trick!

Thanks so much for your help much appreciated!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Sep 9, 2012 - 2:08 pm

Did you try it again in the spFunctions.php file?

good news though... will see if I can get that in the next update of the blog linking plugin...

Avatar
JohnD
Member
Free Members
sp_UserOfflineSmall Offline
Sep 9, 2012 - 2:16 pm

Mr Papa said
Did you try it again in the spFunctions.php file?

Just tried it for you, but no luck. It seems to only work properly when placed within the WP functions.php file. 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Sep 9, 2012 - 3:48 pm

okay, thanks for the feedback... glad its working for you...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17363
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625