PDA

View Full Version : vBulletin Blog - Blog Comments vBAdvanced CMPS


optrex
03-17-2008, 10:00 PM
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
03-18-2008, 08:37 AM
Updated version now at https://vborg.vbsupport.ru/showthread.php?p=1750571
to include fixes for smilies, & URL's

Additional instructions see https://vborg.vbsupport.ru/showpost.php?p=1623150&postcount=31
Recommendations https://vborg.vbsupport.ru/showpost.php?p=1623150&postcount=40

FleaBag
03-18-2008, 05:44 PM
Real nice, thanks a lot!

rainyleaves
03-19-2008, 04:16 AM
Thanks for your mod. :)

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

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

optrex
03-20-2008, 08:07 AM
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
03-31-2008, 02:58 PM
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
03-31-2008, 06:53 PM
sounds like it.

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

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

JBMoney
04-01-2008, 04:24 PM
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
04-07-2008, 02:29 AM
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
04-07-2008, 03:29 AM
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
04-07-2008, 04:56 PM
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
05-12-2008, 10:56 PM
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
05-15-2008, 08:58 AM
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
06-03-2008, 06:16 PM
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
06-04-2008, 02:39 AM
Didn't work for me. I kept getting a Line 2 error in cmps_comments_block.php file.

optrex
06-06-2008, 06:59 AM
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-06-2008, 07:00 AM
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
06-23-2008, 01:39 AM
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
06-26-2008, 09:24 PM
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
06-26-2008, 11:28 PM
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
06-28-2008, 07:04 PM
/path/to/forum/comments.php

change /path/to/forum/

to your forum path

yotsume
08-30-2008, 08:26 PM
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
08-30-2008, 08:52 PM
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
09-05-2008, 07:45 AM
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
09-15-2008, 05:30 PM
Getting only white pages. Verified correct db settings and forum path.

yotsume
09-15-2008, 05:47 PM
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
09-15-2008, 07:08 PM
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,blog textid
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
09-15-2008, 08:41 PM
// 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,blog textid
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
09-16-2008, 04:13 AM
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,blog textid
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
09-16-2008, 04:17 PM
Congratulations! Yotsume.

yotsume
09-30-2008, 02:53 AM
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
09-30-2008, 05:47 AM
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
10-15-2008, 07:07 PM
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
11-13-2008, 05:10 AM
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
11-13-2008, 06:49 AM
Thats a standard feature in the blog settings

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

inciarco
01-20-2009, 09:07 PM
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
01-22-2009, 10:23 PM
* 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
01-23-2009, 12:24 AM
* 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
01-23-2009, 06:26 AM
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
02-21-2009, 10:29 AM
To all of those who asked, this mod has now been updated to include formatting, smilies and URL's.

The updated version is at https://vborg.vbsupport.ru/showthread.php?p=1750571