![]() |
Blog Comments vBAdvanced CMPS (formatted)
1 Attachment(s)
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
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 |
Working example at Midlands Weather Forum
Version 2: Upgrade path Delete the 2 files previously used and start again with this new single file install. Now added Configurable word limit in latest comments Blog titles and links to blog areas - profile, blog post, comment etc. Instructions to display comments from specific category: https://vborg.vbsupport.ru/showpost....4&postcount=17 Instructions to display avatars if using vbseo: https://vborg.vbsupport.ru/showpost....7&postcount=25 enjoy :D |
I updated to this new fixed version and it works perfectly!
THANK YOU!!!! Suggestion: You should change your description to say: Quote:
|
hello!
tried but works not ... what must change in comments.php (mean table prefix)? my database have no table prefix - "FROM " . TABLE_PREFIX . "blog_text.." - what make here? get comments in top of my cmps page .... ?? must be center block? regards macc |
Hey Macc,
If its appearing at the top of the page, you need to select the clean output from within vba (as per vba instructions with any php module). This also means it must be working, so no need to change " . TABLE_PREFIX . " however you can remove it if you want (exactly what I put in bold) You can place the block where you like, but long URL titles (not the length of the URL themselves) will push the margins, hence its been "designed" for center placement. **Updated** to those who have already installed this version, there is no need to update, I just re-uploaded the file with some typo corrections in the comments. |
Thank you for this mod!... :)
1) Question/suggestion: How about including the title and author of the blog entry? To make it easier for the viewer to see what the comment is all about. Example from your homepage: If we take the latest comment in this latest blog comment module Comment by Stourbridge Weather Thanks. The Snow was quite bad near you Dolly. Suggestion 1A: SW's Ski Trip to Italy by Stourbridge Weather Comment by Stourbridge Weather Thanks. The Snow was quite bad near you Dolly. or like this - Suggestion 1B: Comment by Stourbridge Weather in SW's Ski Trip to Italy by Stourbridge Weather Thanks. The Snow was quite bad near you Dolly. 2) Question: Is it possible to take advantage of the blog categories and only retrieve the information from entries from only one specific blog category (instead of all the categories as it is now)? |
BWJ, I agree with your suggestion about adding the title of the blog post. :D
Great job optrex! I'll be watching this one ;) |
Ideas: Can You Add 2 Options? :confused:
1. Option to Limit the Number of Characters Displayed on the Comment. (Imagine a Comment of 1,000 or more Characters to be Displayed on CMPS :eek:) 2. Option to Limit the Length of Words in the Comments. Very Big Words or Words that are not Separated would Break the CMPS Layout, so it'd be Good to be able to Limit that. Good Improvements, Thank You For Sharing Them. :up: :) |
Quote:
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? |
Quote:
2) This one I think is more difficult. Can you give a legit example that would break a center column positioning? |
Quote:
Quote:
|
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 :) |
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! |
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
|
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.
|
Great Improvements, Congratulations. :up:
Thank You For Sharing Them. :up: My Best Regards. :) |
Quote:
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, Code:
{$prefix}blog.categories, Code:
AND {$prefix}blog_text.state = 'visible' Code:
AND {$prefix}blog_text.state = 'visible' AND {$prefix}blog.categories = '{$category}' |
Quote:
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 |
Quote:
|
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:
|
I'll PM you the code/file with the parts inserted. Make sure you use notepad, not word or wordpad for editing as it looks like you have returns and extra spaces all over, that or there is a wordwrap issue or something.
The only other notes I can see that are worth mentioning is that the website url should stop as follows $website = "http://xxx.com/forum"; and is your database table prefix really forum? $prefix = forum; |
Thank you very much for your superb support!
First of all the code you sent me works! One interesting note is that the initial error message I received after implementing your original specific category code (before the code from you pm) was: Fatal error: Cannot redeclare shorten_string() in /home/xxx/public_html/forum/modules/blog_comments.php on line 17 Then I think I messed with things too much (as you said it works 100%) Then I suddenly got the new error message I wrote about: 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 Probably due to the messing around. Okay, then I used the code you sent me by pm and then I receive the same error as initially: Fatal error: Cannot redeclare shorten_string() in /home/xxx/public_html/forum/modules/blog_comments.php on line 17 Then I found out I had two instances of your mod on the same cmps page - one with blog_comments.php and one new file for the specific category blog_comments_cars.php Then I removed the "get all blog comments" file: blog_comments.php And then it worked! :D Thank you again! I am sure other people will find this mod interesting. PS: yes it is forum :-) |
Excellent, glad you are all sorted.
PS if anyone has vbseo, then it makes adding the avatars easy ;) |
How to disable shown images in this module !?
And pls few words about user avatars infront of comment Thanks |
To remove images you would need to change
Code:
$comment= $bbcode_parser->do_parse($longcomment, 1,1,1,1); Code:
$comment= $bbcode_parser->do_parse($longcomment, 0,1,1,0); VBSEO for avatars: My avatars are in the format url/avatars/username.gif?datelinestamp I can use this method, due to the fact that usernames are unique. The code I use on the hack is Code:
<img align=\"absmiddle\" src=\"{$website}/avatars/{$row['username']}.gif\" width=\"30\" height=\"30\"></img> |
Just changed code regarding to images, works like charm
But I think with avatars I dont have much luck, its on my side for shure as Iam noobish to all this I have installed VBSEO for my forums, free version...I guess I should install addon for CMPS in order that this avatr thing work out for me Thank you very much for this mod |
AFAIK there is not a free version for VBSEO, unless you are on about the sitemaps generator, which is not the same thing.
|
:)
Yes my mistake .... was thinking about sitemap generator Thanks again for great mod |
I've followed the installation instructions but get a blank page at the moment. I've checked my variables, and they seem to correspond with those in the config.php file. Any ideas?
|
You need to click install for support
but to point you in the right direction http://www.theshebeen.org/blogs/ has no blog comments displaying either :p |
Hi
I got probem when comment link is clicked from CMPS homepage, user is redirected to blogs but they got '...forums/blog.php/blog.php' Note that it says two times 'blog.php'....than I got trouble with images navbar and stuff Any suggestions Thanks for this nice hack, very usefull for my homepage Regards Goran |
Line 7, your website should be in the format
Code:
$website = "http://www.domain.net"; //full website URL including http Code:
$website = "http://www.domain.net/forum/blog.php"; //full website URL including http |
Thanx that resolved my problem
Cheers |
I have installed this and it's at the bottom of our forum portal page here:
http://dpnow.com/forum2/cmps_index.php But I have to say the formatting is not very inspiring - can anyone point me in the right direction for making it present itself more like the Recent Threads module output above on that page? How would you improve it if it was your site? Ian |
I have the latest version of the blog installed and I am trying to get this single file version of the blog comments installed. However, I get the following error message:
Parse error: syntax error, unexpected T_STRING in /homepages/xx/xxxxxx/htdocs/xxxx/modules/blog_comments.php on line 10 Line 10 of your code is asking for the database password. What I notice in this single file is there is no database option for inputing the "Server Name". My host doesn't use "Localhost" for this. Anyway how can I fix this error? THANKS! |
I was able tofix your module by making manual edits to include my database info.
Also, you have the default table prefix as vb and it is usually always vb_. So people will get an error with the prefix set as vb only. I fixed your file this way: 1. I had to comment out //$database //$username //$password 2. I had to manually edit and input my database info like this: Code:
$link = mysql_connect ("xxxx.perfora.net", "dbxxxxxxxx", "pwxxxxx") or die("I cannot connect to the database"); |
The only thing I would like to see added to this (unless I'm missing it here) is a way to add Entries to the list, not just comments.
|
i'm running wordpress + vbulletin + vbridge, does this mod work on wordpress?
|
Quote:
|
There is a separate cmps mod for showing blogs entries.
So far no blog mods are properly formatted. We need blog mods formated to match how nice vba recent threads block looks! Its shocking that no one has created a proper blog mod yet for vba. :( |
All times are GMT. The time now is 05:52 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|