Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Blog Comments vBAdvanced CMPS (formatted) Details »»
Blog Comments vBAdvanced CMPS (formatted)
Version: 2.00, by optrex optrex is offline
Developer Last Online: Mar 2011 Show Printable Version Email this Page

Category: vBulletin Blog - Version: 3.8.1 Rating:
Released: 02-20-2009 Last Update: 02-26-2009 Installs: 31
Additional Files  
No support by the author.

Add blog comments to your portal !

One of the main problems with the vB blog module is its poor integration with the main forum. This module allows you to show the last 5 blog comments (number is configurable) in a module on your vba portal page. It displays a short version of the comment, the blog title, and the person who commented, with built in links to the commment, user profile and the blog post itself.

This was the first and is still the only blog comments module for vBAdvanced


Features
  • Comments will not display if they have not been approved.
  • Configurable number of comments
  • Includes smilies
  • Includes URL formatting
  • Allows for text format such as bold
  • Configurable word count in comments
Instructions
Click install
Download the attached zip file
Edit blog_comments.php and change the variables to allow connection to your database.
Upload blog_comments.php to your modules directory.


From your admincp - vba cmps
Add new module
PHP file
Title - call it what you want
Active - yes
File to include - blog_comments.php
Identifier - call it what you want
Initialize BB Code Parser - YES
Select clean file output
Link - choose either blog home or comments page as you wish
Save and add to the page of your choice, the module has been designed to be a center block on the basis that long URL titles will push the margins. You can however place it where you want.

28th Feb 2009 - VERSION 2
Version 2 has been completely re-coded to make install land confiuration simpler. Rather than 2 files, there is now only one. This must be installed in the modules folder.
Allows blog titles
Allows configurable word count to be displayed
Links to user profile, blog and comment included.
Made variable changes easier in file.


22nd Feb 2009
Version upgrade from https://vborg.vbsupport.ru/showthread.php?t=173381

Allows smilies
Allows URL's
Allows formatting [BBCODE] Bold etc

Download Now

File Type: zip blog_comments.zip (1.2 KB, 256 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 02-23-2009, 10:00 PM
BWJ BWJ is offline
 
Join Date: Aug 2005
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by optrex View Post
Q1 - That's something I've tried to do before. I think it is possible, because vb does something similar in the "all blogs comments" pages. But as yet, I can't work it out with my basic php knowledge as the blog text table displays a blank title field for comments.
Okay... I thought there was a reason...

Quote:
Originally Posted by optrex View Post
Q2 I will look into, but it may have to be a manual edit based on category id rather than name. I take it you are also thinking admin categories rather than user ones - or both?
Admin categories will be fine. I don't mind a manual edit. Optrex - thank you for looking into this... :up: It would really be great if you are able to do it.
Reply With Quote
  #13  
Old 02-27-2009, 11:36 AM
optrex optrex is offline
 
Join Date: Sep 2005
Posts: 344
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well it took me a while, But I have integrated the suggestions made above.

We now have word limits (better than character limits) for the number of words displayed and we also have the blog entry titles etc as requested. I have also re-written the code to be one file rather than the 2 previously. The variables are also clearer and easier to change. Install time is now less than 5 mins for a noobie
Reply With Quote
  #14  
Old 02-27-2009, 04:14 PM
yotsume's Avatar
yotsume yotsume is offline
 
Join Date: Dec 2006
Posts: 844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You have a typo here:

$limit = 5; //replace 5 with the umber of comments

Should say: number

I will have to update again and give this new version a try.

Thanks for the much needed great work!
Reply With Quote
  #15  
Old 02-28-2009, 01:26 AM
miloheckport miloheckport is offline
 
Join Date: Oct 2004
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

We are just getting our blog going and comments are not frequent. Can you code a version that displays Recent Blog Entries vs. Recent Comments. and if there is a recent comment display the comment
Reply With Quote
  #16  
Old 02-28-2009, 01:51 AM
optrex optrex is offline
 
Join Date: Sep 2005
Posts: 344
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have a mod that picks up new blog entries and puts them into your "new posts". See my signature. Otherwise I need to take a look and put something fresh together, I have some ideas in mind.
Reply With Quote
  #17  
Old 02-28-2009, 03:16 AM
inciarco's Avatar
inciarco inciarco is offline
 
Join Date: Mar 2007
Posts: 758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great Improvements, Congratulations. :up:

Thank You For Sharing Them. :up:

My Best Regards.

Reply With Quote
  #18  
Old 02-28-2009, 05:35 AM
optrex optrex is offline
 
Join Date: Sep 2005
Posts: 344
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BWJ View Post
Admin categories will be fine. I don't mind a manual edit. Optrex - thank you for looking into this... :up: It would really be great if you are able to do it.
Here is the edit to list by a category

in the variables add the line

$category = x; //where x is the category id number found in your AdminCP

in line 35, find:
Code:
$query = "SELECT {$prefix}blog.blogid,
and AFTER add:
Code:
{$prefix}blog.categories,
then in line 38 find
Code:
AND {$prefix}blog_text.state = 'visible'
and REPLACE with:
Code:
AND {$prefix}blog_text.state = 'visible' AND {$prefix}blog.categories = '{$category}'
This should result in only comments from the category selected being displayed. Please let me know how you get on.
Reply With Quote
  #19  
Old 03-02-2009, 10:03 PM
BWJ BWJ is offline
 
Join Date: Aug 2005
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by optrex View Post
This should result in only comments from the category selected being displayed. Please let me know how you get on.
Thank you for your hard work! With the default solution (all categories) it works very fine.

But if I try with the changes for a specific category:

Fatal error: Cannot redeclare shorten_string() in /home/xxx/public_html/forum/modules/blog_comments.php on line 18
Reply With Quote
  #20  
Old 03-03-2009, 07:02 AM
optrex optrex is offline
 
Join Date: Sep 2005
Posts: 344
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BWJ View Post
Thank you for your hard work! With the default solution (all categories) it works very fine.

But if I try with the changes for a specific category:

Fatal error: Cannot redeclare shorten_string() in /home/xxx/public_html/forum/modules/blog_comments.php on line 18
I've changed the code in the above post. I had a stray , and category should have been categories. Tested and working 100%. Om the additional variable, don't forget the ;
Reply With Quote
  #21  
Old 03-03-2009, 09:44 AM
BWJ BWJ is offline
 
Join Date: Aug 2005
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry doesn't work for me. I have tried for 1? hour now:

Now I get this error:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'nobody'@'localhost' (using password: NO) in [path]/modules/blog_comments_cars.php on line 31
I cannot connect to the database

I am 100% sure the password is correct - as I use it with success with e.g. your default version. This is the code I use with your changes:

PHP Code:
<?php
// I spent a while on this please leave the next couple of lines intact
// Coded by Optrex @ www.midlandsweather.org.uk
// Please do not put this onto any other site for download unless permision 

has been granted by myself (Optrex)
// This script is copyright www.midlandsweather.org.uk 

//variables to change below
$database database//replace xxx with the name of your 

database$username username//replace xxx with your database 

username$password password//replace xxx with your database 

password$wordcount 50//replace 50 with the number of words you want to 

have in your comments until cut off with ....
$website "http://xxx.com/forum/blog.php"//full website URL to your 

blog .php file including http
$prefix 
forum//table prefix - IF YOU DONT  HAVE ONE USE '' INSTEAD OF vb
$category 16//where x is the category id number found in your AdminCP
$limit 5//replace 5 with the umber of comments you want to show
//end of variables

function shorten_string($string$wordsreturned)
{
        
$retval $string;      //      Just in case of a problem
        
$array explode(" "$string);
        if (
count($array)<=$wordsreturned)
        {
                
$retval $string;
        }
        else
        {
                
array_splice($array$wordsreturned);
                
$retval implode(" "$array)."....read more";
        }
        return 
$retval;
}

$link mysql_connect ("localhost""{$username}""{$password}") or die("I 

cannot connect to the database"
);
mysql_select_db ("{$database}");
$query "SELECT {$prefix}blog.blogid, {$prefix}blog.categories, 

{$prefix}blog_text.title, {$prefix}blog_text.blogtextid, 

{$prefix}blog_text.userid, {$prefix}blog_text.username, 

{$prefix}blog_text.state, {$prefix}blog_text.pagetext, {$prefix}blog.title AS 

title2  "
.
 
"FROM {$prefix}blog, {$prefix}blog_text ".
    
"WHERE {$prefix}blog.blogid = {$prefix}blog_text.blogid AND 
{$prefix}blog_text.title = '' AND {$prefix}blog_text.state = 'visible' AND 
{$prefix}blog.categories = '{$category}'
ORDER BY 
{$prefix}blog_text.dateline desc
LIMIT 
{$limit}";
$result mysql_query($query) or die(mysql_error());
while(
$row mysql_fetch_array($result)){
$longcommentshorten_string($row['pagetext'],$wordcount);
$comment$bbcode_parser->do_parse($longcomment1,1,1,1);
    echo 
"<tr><td class=\"$bgclass\" align=\"left\"><span 

class=\"
{$Style['small']}\"><a 

href=\"
{$website}/member.php?u={$row['userid']}\">{$row['username']}</a>";
    echo 
" Made a ";
    echo 
"<a 

href=\"
{$website}/blog.php?bt={$row['blogtextid']}\">comment</a>";
    echo 
" in " 
    echo 
"<a 

href=\"
{$website}/blog.php?b={$row['blogid']}\">{$row['title2']}</a><br />";
    echo 
$comment" in " 
    echo 
"<a 

href=\"
{$website}/blog.php?b={$row['blogid']}\">{$row['title2']}</a>";
    echo 
"<br /></td></tr>";
}

?>
Reply With Quote
Reply


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. The time now is 10:54 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04933 seconds
  • Memory Usage 2,381KB
  • Queries Executed 28 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (1)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete