vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   vBulletin Blog - Blog Comments vBAdvanced CMPS (https://vborg.vbsupport.ru/showthread.php?t=173381)

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:
  1. Edit the cmps_comments_block.php file.
  2. The path in this file must be entered in full url format like this:
  3. Quote:

    include('/homepages/xx/xxxxxxxx/htdocs/foldername/comments.php');
  4. If you use a normal url here it wont work such as: http://www.domain.com/folder/comments.php you will get error messages with that type of url.
  5. Once you have your correct url entered upload the cmps_comments_block.php file to your modules folder.
  6. 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.
  7. 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.
  8. 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.
  9. Next you must change the two urls to match your site. I labeled these in orange.
  10. Upload the comments.php file to your forum root.
  11. 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.
Code:

<?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 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

Quote:

Originally Posted by optrex (Post 1633707)
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


All times are GMT. The time now is 05:42 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
  • Page Generation 0.01056 seconds
  • Memory Usage 1,755KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete