PDA

View Full Version : vBulletin Blog - Blog Comments vBAdvanced CMPS


optrex
18 Mar 2008, 09:36
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 in a module on your vba portal page.

Features
Comments will not display if they have not been approved.

Instructions
Click install and download the attached zip file
Edit comments.php and change the variables to allow connection to your database.
Edit cmps_comments_block.php and change the path.
Upload comments.php to your forum directory.
Upload cmps_comments_block.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 - cmps_comments_block.php
Identifier - call it what you want
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 left or right block.

optrex
18 Mar 2008, 09:37
Updated version now at http://www.vbulletin.org/forum/showthread.php?p=1750571
to include fixes for smilies, & URL's

Additional instructions see http://www.vbulletin.org/forum/showpost.php?p=1623150&postcount=31
Recommendations http://www.vbulletin.org/forum/showpost.php?p=1623150&postcount=40

FleaBag
18 Mar 2008, 18:44
Real nice, thanks a lot!

rainyleaves
19 Mar 2008, 05:16
Thanks for your mod. :)

You need prefix.
$result = mysql_query("SELECT username,title,pagetext,dateline,state,userid,blogtextid
FROM " . TABLE_PREFIX . "blog_text

Hornstar
20 Mar 2008, 06:15
very nice, however if you know how to get the blog comments to show on a non VB page, that would be fantastic.

optrex
20 Mar 2008, 09:07
very nice, however if you know how to get the blog comments to show on a non VB page, that would be fantastic.

I will try and sort something out if I get time.

JBMoney
31 Mar 2008, 15:58
After I install this it writes the contents to the top of the page, above the header and all. There's no header either. Did I miss something?

optrex
31 Mar 2008, 19:53
sounds like it.

Use Module Wrapper Template - yes
Use clean file output - yes

JBMoney
01 Apr 2008, 17:23
Can this be used on the Forum Home page too? If so, how?

JBMoney
01 Apr 2008, 17:24
P.S. I did get it to work on the vbAdvanced page, but it's not converting BB links. Any way I can change it so it does?

Quigg
07 Apr 2008, 03:29
Strange...installed the module...

Everything looks like it should be fine...permissions are fine...

But nothing shows up on the vBadvanced front page where the module should be...

Any thoughts?

angkor408
07 Apr 2008, 04:29
Hi, I already have a blog installed and everything is working fine. Is it possible to display the avatar pix in a module block?

-Angkor

optrex
07 Apr 2008, 17:56
Strange...installed the module...

Everything looks like it should be fine...permissions are fine...

But nothing shows up on the vBadvanced front page where the module should be...

Any thoughts?

check you have it activated and that you have a clean output file. Have you installed the module onto one of your pages?

TruthElixirX
12 May 2008, 23:56
check you have it activated and that you have a clean output file. Have you installed the module onto one of your pages?

I'm getting the same thing. I have selected clean file output and installed it to a page.

optrex
15 May 2008, 09:58
The only other thing I can think of is, have you uploaded the 2 files to the correct folders and made the changes required?

Stilgar
03 Jun 2008, 19:16
I'm not sure how I went wrong. I am getting this output:

Table 'DB_NAME_REMOVED.blog_text' doesn't exist

Any ideas?

carrlos
04 Jun 2008, 03:39
Didn't work for me. I kept getting a Line 2 error in cmps_comments_block.php file.

optrex
06 Jun 2008, 07:59
I'm not sure how I went wrong. I am getting this output:



Any ideas?

check your main DB and look for the table blog_text
It thinks its missing. If you can see it then your reference to the DB is wrong

optrex
06 Jun 2008, 08:00
Didn't work for me. I kept getting a Line 2 error in cmps_comments_block.php file.

If you want help, you need to click install, but to give you a clue, your path is wrong.

Antiblank
23 Jun 2008, 02:39
I have a pathing issue using the mod myself.

My forums are installed at http://forums.mysite.com/ the vBA page resides at http://www.mysite.com/

The module shows up there but all the links use the www.mysite.com instead of forums.mysite.com. Is there a way to make this module understand vB's pathing? The rest of my vBA setups all path correctly.

optrex
26 Jun 2008, 22:24
The only links that appear are

"comments" and the "username" , so you need to change www.mysite.com to blogs.mysite.com in comments.php to get the paths correct

carrlos
27 Jun 2008, 00:28
If you want help, you need to click install, but to give you a clue, your path is wrong.

Can you tell me what my path should look like? I really like the hack and would really like to have it work. You're help is appreciated.

BTW, I originally clicked "Installed" but when I couldn't get it to work, I then clicked "Uninstalled".

optrex
28 Jun 2008, 20:04
/path/to/forum/comments.php

change /path/to/forum/

to your forum path

yotsume
30 Aug 2008, 21:26
I tried your mod. Entered my correct database info but it didn't work.

It gives me this message in the block: Table 'dbxxxxxxxxxxx.blog_text' doesn't exist

So what did I miss? Your instructions are lacking and how you commented inside your files is also not clear enough.

Hope you can help.

THANKS!

yotsume
30 Aug 2008, 21:52
check your main DB and look for the table blog_text
It thinks its missing. If you can see it then your reference to the DB is wrong

What do you mean your reference to the DB is wrong? What reference and where? How about real instructions please.

That listing for me shows as: vb_blog_text

My table prefix is the default. vb_

So what gives here?

yotsume
05 Sep 2008, 08:45
I need to bump here because I really need to get this block to work on my CMPS for my site. Can anyone help me out here?

THANKS!

tormodg
15 Sep 2008, 18:30
Getting only white pages. Verified correct db settings and forum path.

yotsume
15 Sep 2008, 18:47
Getting only white pages. Verified correct db settings and forum path.

Yea this module would be great if iit worked and the instructions were better written. Be even been if it was ACTUALLY supported! I've been waiting for help but get nothing!

The VB Blog system needs more modules design by better coders. The people over at VBA need to design the mods directly! We desperately need better blog full integrated mods asap!

What I am going to do is look at the people who have posted in this thread and PM them for help and ask if they have got this to work and how...

yotsume
15 Sep 2008, 20:08
Where in the code do you set your table prefix? Your instructions inside the file lack. Please give better specific instructions so maybe one person can get this to work!

// You may need to change the db_table_prefix if you altered it from default to something else or removed it
$result = mysql_query("SELECT username,title,pagetext,dateline,state,userid,blogtextid
FROM blog_text
WHERE title = ''
AND state = 'visible'
ORDER BY dateline desc
LIMIT 5" ) or die(mysql_error());
while($row = mysql_fetch_array( $result )) {I tried my table prefix in here: WHERE title = '' like WHERE title = 'vb_'

Nothing I do works and my error remains: Table 'db218080794.blog_text' doesn't exist

My paths seems to be correct and my database info is correct.

Some help please. Unfortunately this is the only mod for blog comments. It says beta but you did set it as supported so please support it!

yotsume
15 Sep 2008, 21:41
// You may need to change the db_table_prefix if you altered it from default to something else or removed it
$result = mysql_query("SELECT username,title,pagetext,dateline,state,userid,blogtextid
FROM " . TABLE_PREFIX . " blog_textThsi mod will not work because the designer left out any way for all of us to enter in our table prefix in this line of code. For this mod to work and not spit back this error:

Table 'dbxxxxxxxxxxx.blog_text' doesn't existThis mod needs the proper code for calling the table prefix. Anything I have tried does not work. Can anyone post the correct line of code here to the blog_txt table will include our correct vb_ prefix?

I don't know how to get the correct table prefix code entered on this line. I have compared this to the recent blog mod for VBA but that hasn't helped me.

Just telling people here their url is wrong and database info is wrong is poor advise when the original code in comments.php is missing vital code need to make this mod work in the first place.

Hello community wake up and lets fix this because we all need real blog blocks ASAP!

yotsume
16 Sep 2008, 05:13
Finally Got This Working!
Finally got this working with the help of member "rainyleaves". Here are better instructions and a code fix which is missing from the author's zip file comments.php file. The missing code is for selecting your database table prefix which is missing.

IMPORTANT NOTE: IMG Tags Can Stretch Sideblock
IMG tags with longer urls will break this if you set this as a side block. Your cmps page will get stretched breaking your layout! NOTE: More coding is needed to correct this issue. Suggestion: (temp fix) You may want to use this mod as a center block instead.

INSTRUCTIONS:
Edit the cmps_comments_block.php file.
The path in this file must be entered in full url format like this:
include('/homepages/xx/xxxxxxxx/htdocs/foldername/comments.php');
If you use a normal url here it wont work such as: http://www.domain.com/folder/comments.php (http://www.domain/folder/comments.php) you will get error messages with that type of url.
Once you have your correct url entered upload the cmps_comments_block.php file to your modules folder.
Next edit the comments.php file which I have attached here that contains the correct fixed code. In the blue highlighted text you must enter in your correct database information.
The red text represents the new code that allows this mod to select your correct table prefix. Example: vb_ which is the default prefix. This code fix will select your correct prefix for you. You do not edit anything here. Without this code in the comments.php file there is no way for this module to work and you will receive the errors that have been reported in this thread. NOTE: The author should correct his original zip file with this updated comments.php file that I have attached here.
Optional: You can choose how many comments to include in the block. This number is marked in green. I set it to 10 in the example below.
Next you must change the two urls to match your site. I labeled these in orange.
Upload the comments.php file to your forum root.
The rest of the author's instructions are correct. (see author's original instructions on how to make a new cmps module.)
Here is the corrected contents of the comments.php file with color highlights to match my above instructions:
Blue = Where you must enter your database information
Red = New table prefix code
Green = Number of comments to include: 10 or 5 or whatever.
Orange = Change the two urls to match your site.
<?php
// UPDATED comments.php file with small fix tweak by Yotsume
// 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 permission has been granted by myself (Optrex)
// This script is copyright www.midlandsweather.org.uk

//edit the variables on the next few lines in order for the script to connect to your database.
$link = mysql_connect ("database_host", "database_user", "password") or die('I cannot connect to the database.');
mysql_select_db ("database_name")or die("Could not select your database");

// You do NOT need to change the db_table_prefix if you altered it from default to something else the below code will do this for you
$result = mysql_query("SELECT username,title,pagetext,dateline,state,userid,blogtextid
FROM " . TABLE_PREFIX . "blog_text
WHERE title = ''
AND state = 'visible'
ORDER BY dateline desc
LIMIT 10" ) or die(mysql_error());
while($row = mysql_fetch_array( $result )) {

//edit the urls to represent your sites url. (remember to check the /forum folder name)

$comms .= <<<PRINT

<tr>
<td class="$bgclass" align="left">
<span class="{$Style['small']}"><a href="http://www.yourwebsite.com/blog.php?bt=$row[blogtextid]">Comment</a> by <a href="http://www.yourwebsite.com/member.php?u=$row[userid]">$row[username] </a><br>$row[pagetext]
</td>


</tr>



PRINT;
}

?>

Ok this now works for me but I had to set it as a center block since my members use IMG tags in their blog comments. I hope you all find my instructions helpful. Thanks to "rainyleaves" for helping with the missing table prefix code. Again use the attached fixed comments.php file until the author updates his original zip file.

HAPPY BLOGGING!

rainyleaves
16 Sep 2008, 17:17
Congratulations! Yotsume.

yotsume
30 Sep 2008, 03:53
More Poor Code Problems!

This mod has more problems. If a member posts a comment and makes a few color changes to their text the code will expand the block and destroy the layout of your site by stretching it. Please how can we make it so this mod will not show code in the comments? its showing the raw code and not the styled comments.

So already can you fix this please! This is the only comment cmps mod and its got big problems for site owners!

Please update your mod with a fix so code doesnt show in the comments.

optrex
30 Sep 2008, 06:47
I have the same issues with the mod myself but I cannot post an update atm as I am in the process of emigrating from one side of the world to the other and do not have regular PC access. The problem is due to the way the db parses the code into a text string, it just nees some stuff stripping out of it. Shouldn't be too difficult for someone.

Either that or ask your members to post only text based comments.

yotsume
15 Oct 2008, 20:07
I have the same issues with the mod myself but I cannot post an update atm as I am in the process of emigrating from one side of the world to the other and do not have regular PC access. The problem is due to the way the db parses the code into a text string, it just nees some stuff stripping out of it. Shouldn't be too difficult for someone.

Either that or ask your members to post only text based comments.


You do realize you have the ONLY Blog Comments module designed to date. Your module is just one step away from perfection. We need to prevent img tabs from showing inside the block. I co NOT have the members of my blog not use img tags in their blogs.

Please someone look at the code of this hack and come up with a way to strip img tags from being pulled into the block. I am going to ask around to other designers who have other types of comments blocks how they are able to prevent this problem in their mods.

fourat
13 Nov 2008, 06:10
How i add Recent , Random entries & recent comment to vBadvanced CMPS in the center column under recent threads ? (like attached picture)

i want to add it under recent threads .. it will be beautiful
can you do that ?

templates shown in picture :
- blog_entry_featured
- blog_home

http://img515.imageshack.us/my.php?image=85ah4.gif

optrex
13 Nov 2008, 07:49
Thats a standard feature in the blog settings

fourat
13 Nov 2008, 08:48
yes , but Possible that we use in vBadvanced CMPS
can you do it ?
its will seem so beautiful feature

inciarco
20 Jan 2009, 22:07
With Long Path Images on the vBAdvanced Page the Blog Comments pesented with this Mod Affect the CMPS Pages where it is presented (Left, Center, or Right Column), because it doesn't Trim the Long Words. :( :confused:

My Best Regards.

:)

optrex
22 Jan 2009, 23:23
* It is well documented that this hack does not work in its current state with images or url's in comments. I would suggest that for now you disable the following functionality in blog comments

Maximum Images Per Comment = 0

Then in usergroups, under blog comments
Allow Smilies = no
Allow BB Code = no
Allow [IMG] Code = no
Allow HTML = no

inciarco
23 Jan 2009, 01:24
* It is well documented that this hack does not work in its current state with images or url's. I would suggest that for now you disable the following functionality in blog comments

Maximum Images Per Comment = 0

The in usergroups, under blog comments
Allow Smilies = no
Allow BB Code = no
Allow [IMG] Code = no
Allow HTML = no

That's Not a Solution; the Solution is that the Developer creates the Code/Plugin that Reads Each Comment and Cut the Long Words, and offer the Option to Set that Max. Number of Characters on Words; you can see that functionality on vBAdvanced for the Latest Threads/Posts Module, where they offer that Option (to Cut Words Larger than X Characters). :confused:

For Now with that Problem is not Possible to Use this Mod at least not without offering Forumers Less Options on the Blogs, which wouldn't be Atractive (Blogs would be Boring that way). :(

My Best Regards.

:)

optrex
23 Jan 2009, 07:26
That's Not a Solution; the Solution is that the Developer creates the Code/Plugin that Reads Each Comment and Cut the Long Words, and offer the Option to Set that Max. Number of Characters on Words; you can see that functionality on vBAdvanced for the Latest Threads/Posts Module, where they offer that Option (to Cut Words Larger than X Characters

You are correct it is not a solution. Infact its a "work around" and in post 1 it is referred to as a "recommendation". I have provided a hack to the best of my ability that reaches the limits of my coding skills. It works, but its not perfect. Of course I would like it to work flawlessly, perhaps oneday, someone would like to work alongside me and improve it.

Until then, your option is to take it or leave it.

Of course you could always use one of the many other hacks that put blog comments onto vbA.....oh there are none .....perhaps that is a reflection on how difficult it is to modify?

optrex
21 Feb 2009, 11:29
To all of those who asked, this mod has now been updated to include formatting, smilies and URL's.

The updated version is at http://www.vbulletin.org/forum/showthread.php?p=1750571