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 - New Blogs/Comments in Forum Search Results (https://vborg.vbsupport.ru/showthread.php?t=182609)

dartho 06-15-2008 10:00 PM

New Blogs/Comments in Forum Search Results
 
This add-on will include recent blogs and blog comments in your forums search results - This includes "New Posts" and "Today's Posts" results...

Options
Maximum number of search results to return
Maximum age of comments/blogs to be included in search results

Limitations
There is no tracking of if a blog has been read or not - if a blog/comment fits in with the above criteria it will be displayed in the search results whether it has been read or not. This can probably be coded in by a more experienced coder than myself - any assistance appreciated. Although I like the extra exposure the blogs get from this so it is not an issue for me.

Version History
0.0.1 - Initial release - marked beta until I get some feedback.
0.0.2 - added table prefixes to query
0.0.3 - added table prefixes to query - again :erm:
0.0.4 - fixed the query causing issues on DBs with table prefixes (Confirmed working now)
0.0.5 - removed title tags from listings till I get time to fix issue with title breaking display
0.0.6 - fixed links in results to link to blogs/blogs/comments in the same way search results link to forums/threads/posts
0.0.7 - fixed broken image link, removed errant "<"
0.0.8 - Added fix where blog drafts were showing up in searches as per this post by KrisP
0.0.9 - Now only shows the latest comment from each blog
0.0.9a - Fixed but in 0.0.9
0.0.9b - Fixed date time display to be consistent with rest of forum
0.0.10 - Fixed small bug which sjhows on some systems as per this post by entertain
0.0.11 - Fixed bug where pending blogs were being displayed as per this post by jibi
Dependencies
You must have vBulletin Blogs Installed

Installation Instructions
1. Install Product File
2. Add a single line to your search_results template as below:
Edit your "search_results" template
search for:
Code:

<tr>
        <td class="tfoot" colspan="$threadcolspan" align="$stylevar[right]">
                <if condition="$show['results']">
                <span class="smallfont"><phrase 1="$first" 2="$last" 3="$numitems">$vbphrase[showing_results_x_to_y_of_z]</phrase></span>
                <else />
                &nbsp;
                </if>
        </td>
</tr>
</table>

add the following immediately below:
Code:

<br />$blogsinsrch
Other Modifications
There is another work around HERE which offers an alternative way to integrate blogs with Forum search results...

Extra Notes
To only show new blogs/comment since last visit (in much teh same way as "New Posts" works) see Post Number 41 of this thread

For a vBAdvanced module of this add-on, see Post Number 83

Nikke 06-16-2008 05:00 AM

Great man! Will install!

Baldilocks 06-16-2008 06:05 AM

This caused a database error on my board that took me an hour to get fixed.

dartho 06-16-2008 07:09 AM

Do you use table prefixes in your DB? After reading your post I see that I have forgotten to include that in the query. New version up shortly.

As it only does a DB read query - I can't imagine anything would have been damaged, just a db error which should have gone away with the product being uninstalled... Many apologies!

Baldilocks 06-16-2008 07:12 AM

Yes, once I was finally able to get back into the adminCP i just unistaled the plug-in.

dartho 06-16-2008 07:19 AM

Just uploaded 0.0.2 which should resolve any issues.

Alfa1 06-16-2008 12:21 PM

Does this include blog entries in new posts?

dartho 06-16-2008 12:42 PM

Yep - new posts, todays posts and searches - all search screens

Alfa1 06-16-2008 01:14 PM

I bow to you oh holy Dartho! ;)

Thanx!

dartho 06-16-2008 01:48 PM

Thanks, but no bowing please. As with all my other addons/style - this is simply something I needed for my own site which I managed to work out, and thought I'd share here.

bertwrld 06-16-2008 05:39 PM

Would it be possible to get something like this, but for the new posts in social groups?

PtitLu 06-17-2008 08:23 AM

Quote:

Originally Posted by dartho (Post 1550599)
Just uploaded 0.0.2 which should resolve any issues.

Same problem for me : dB error

Quote:

Database error in vBulletin 3.7.1:

Invalid SQL:
SELECT blog_text.state, blog_text.blogid, blog_text.username,blog_text.userid, date(FROM_UNIXTIME(blog_text.dateline)) as date, time(FROM_UNIXTIME(blog_text.dateline)) as time, blogtitle.userid as authorid, blogtitle.username as author, blogtitle.views as views ,pagetext,blogtitle.title as title FROM vb_`blog_text` INNER JOIN blog as blogtitle on blogtitle.blogid = blog_text.blogid WHERE blog_text.dateline >=1213089690 AND blog_text.state = 'visible' ORDER by blog_text.dateline DESC LIMIT 5;

MySQL Error : Table 'forums.vb_' doesn't exist
Product deactivated.

dartho 06-17-2008 10:41 AM

Thanks for reporting that PtitLu - however that error doesn't seem to make sense to me - although that doesn't necessarily mean much..

It did however make me look at the query again and I saw that I was missing the TABLE_PREFIX variable on the join which I have rectified and uploaded a new version.

Thanks

Koroku 06-17-2008 07:25 PM

Quote:

Database error in vBulletin 3.7.1:

Invalid SQL:
SELECT blog_text.state, blog_text.blogid, blog_text.username,blog_text.userid, date(FROM_UNIXTIME(blog_text.dateline)) as date, time(FROM_UNIXTIME(blog_text.dateline)) as time, blogtitle.userid as authorid, blogtitle.username as author, blogtitle.views as views ,pagetext,blogtitle.title as title FROM forum_`blog_text` INNER JOIN blog as blogtitle on blogtitle.blogid = blog_text.blogid WHERE blog_text.dateline >=1213129466 AND blog_text.state = 'visible' ORDER by blog_text.dateline DESC LIMIT 5;

MySQL Error : Table 'dats_forums.forum_' doesn't exist
Error Number : 1146
Request Date : Tuesday, June 17th 2008 @ 03:24:26 PM
Error Date : Tuesday, June 17th 2008 @ 03:24:26 PM
Script : http://forums.dats.us/search.php?do=getnew
Referrer : http://forums.dats.us/
IP Address : 75.168.72.16
Username : Boy 412
Classname : vB_Database
MySQL Version : 5.0.45-community-log
:/

Still having problems with the 3rd version.

BigDog56 06-17-2008 07:40 PM

Same here.

Database error in vBulletin 3.7.1:

Invalid SQL:
SELECT blog_text.state, blog_text.blogid, blog_text.username,blog_text.userid, date(FROM_UNIXTIME(blog_text.dateline)) as date, time(FROM_UNIXTIME(blog_text.dateline)) as time, blogtitle.userid as authorid, blogtitle.username as author, blogtitle.views as views ,pagetext,blogtitle.title as title FROM ravensfo_`blog_text` INNER JOIN blog as blogtitle on blogtitle.blogid = blog_text.blogid WHERE blog_text.dateline >=1213130405 AND blog_text.state = 'visible' ORDER by blog_text.dateline DESC LIMIT 5;

MySQL Error : Table 'ravensfo_forums.ravensfo_' doesn't exist
Error Number : 1146
Request Date : Tuesday, June 17th 2008 @ 02:40:05 PM
Error Date : Tuesday, June 17th 2008 @ 02:40:06 PM
Script : http://ravensforums.com/forums/search.php?do=getdaily
Referrer : http://ravensforums.com/forums/blog.php?u=468
IP Address : 76.11.133.237
Username : Jeff
Classname : vb_database
MySQL Version : 5.0.45-community-log

dartho 06-17-2008 09:53 PM

I obviously have no idea how to query databases which use table prefixes .... :( Next version will fix it for you - promise ;)


[Edit: Just checked - the XML that was there was still 0.0.2. Have uploaded 0.0.3 (and changed its name so there can be no mistakes.

I've doubled checked and double checked again and 0.0.3 *should* be right.]

BigDog56 06-18-2008 12:51 AM

I'll try it again! Be right back.

BigDog56 06-18-2008 12:55 AM

Database error in vBulletin 3.7.1:

Invalid SQL:
SELECT blog_text.state, blog_text.blogid, blog_text.username,blog_text.userid, date(FROM_UNIXTIME(blog_text.dateline)) as date, time(FROM_UNIXTIME(blog_text.dateline)) as time, blogtitle.userid as authorid, blogtitle.username as author, blogtitle.views as views ,pagetext,blogtitle.title as title FROM xxxxx_blog_text INNER JOIN xxxxxxx_blog as blogtitle on blogtitle.blogid = blog_text.blogid WHERE blog_text.dateline >=1213149267 AND blog_text.state = 'visible' ORDER by blog_text.dateline DESC LIMIT 5;

MySQL Error : Unknown column 'blog_text.state' in 'field list'
Error Number : 1054
Request Date : Tuesday, June 17th 2008 @ 07:54:27 PM
Error Date : Tuesday, June 17th 2008 @ 07:54:27 PM
Script : http://ravensforums.com/forums/search.php?do=getnew
Referrer :
IP Address : 76.11.133.237
Username : Jeff
Classname : vb_database
MySQL Version : 5.0.45-community-log

dartho 06-18-2008 01:15 AM

Quote:

Originally Posted by dartho (Post 1552085)
I obviously have no idea how to query databases which use table prefixes .... :(

Guess I was right on that part...

I've sought expert help to resolve this. I'll be back....

dartho 06-18-2008 02:32 AM

0.0.4 up now - lets try this again... Thanks to Nexialys for help on the query :up:

BigDog56 06-18-2008 03:00 AM

off to try it now!

BigDog56 06-18-2008 03:08 AM

BINGO! Works perfectly! Thank you for all your hard work!:up: Clicks "Installed!"

Brandon Sheley 06-18-2008 03:31 AM

wooohoo

I'll hold off a day or two, but this is something I've been looking for :)

dartho 06-18-2008 04:32 AM

Quote:

Originally Posted by BigDog56 (Post 1552260)
BINGO! Works perfectly! Thank you for all your hard work!:up: Clicks "Installed!"

Thanks for you perseverance - glad it is working for everyone now!

Next up, I have to phrase it :erm:

PtitLu 06-18-2008 06:49 AM

OK, it works now. By the way, how can i change the language to french (or another one) ? Is there a language file available ?
Thanks for your work.

dartho 06-18-2008 07:19 AM

For now you will need to manually edit the templates... I will endeavour to phrase it so that it uses vBulletins default phrases and no translation will be required...

Baldilocks 06-18-2008 07:46 AM

Works great now, thank you!!

dartho 06-18-2008 07:54 AM

You're welcome, happy to hear it!

PtitLu 06-18-2008 08:07 AM

Quote:

Originally Posted by dartho (Post 1552374)
I will endeavour to phrase it so that it uses vBulletins default phrases and no translation will be required...

Thanks :)

Quote:

Originally Posted by dartho (Post 1552374)
For now you will need to manually edit the templates...

OK, which ones should i edit ?

dartho 06-18-2008 08:25 AM

bloginsrch and bloginsrch_bit

Brandon Sheley 06-18-2008 03:09 PM

okay, I've added it
now to see if the members notice it down there.. it would be nice to get the blog post mixed in with the threads new post
btw..

[high]* Brandon Sheley clicked install last night :D[/high]

Koroku 06-25-2008 10:48 PM

Works wonderfully now!

Bravo :D

Alfa1 06-27-2008 10:33 PM

Looks good.

Would it be possible to list every blog only once? Sometimes I get the same blog listed 6 times, because there where 6 comments.

Alfa1 06-29-2008 02:05 PM

To place the latest blogs below the list of page numbers (so you don't have to scroll past it to click on the next page), do this:
Below:
PHP Code:

<if condition="$pagenav">
<
table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-top:3px">
<
tr valign="top">
    <if 
condition="$pagenav"><td align="$stylevar[right]">$pagenav</td></if>
</
tr>
</
table>
</if> 

Place:
PHP Code:

<br />$blogsinsrch 

Does anyone know the code to only show this on the first page of search results?

dartho 06-29-2008 09:42 PM

Quote:

Originally Posted by Alfa1 (Post 1560738)
Looks good.

Would it be possible to list every blog only once? Sometimes I get the same blog listed 6 times, because there where 6 comments.

I'll see what I can work out...

Alfa1 07-01-2008 12:56 PM

I see that it shows moderated blogs, so when members click on the link the get a no permissions page.

Zweeper 07-01-2008 02:03 PM

when i use the [font] bb code, then somethin goes wrong with the indexing?!

for example, post a blog like this:

[ FONT="Fixedsys"]

bla bla bla

[ /FONT]

Dabbi 07-06-2008 08:11 PM

Thank you! :) This is wonderful and one of the things I was hoping for to get the blogs more visible. :cool:

Is there any way that when a member has read a blog or comment or marked as read under New Posts they could work in a similar manner as posts do?

dartho 07-06-2008 09:44 PM

Alfa1 - does the standard Blogs page show moderated blogs?
Zweeper - do you have an example?
Dabbi - there may be a way, but I wanted to give the blogs more attention

When I next do some tweaks/updates to my site I'll have another look at this add-on

Dabbi 07-06-2008 09:51 PM

Thanks Dartho!

I want them to get attention as well which is why I really like this mod, but if a member has read them already it would be handy if they would disappear until a "New Post" or Comment were added like posts do when using New Posts. I'm concerned that if they see the same thing each time they may mentally ignore that area which sort of defeats the purpose of getting them more visible I would think. :)


All times are GMT. The time now is 04:57 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.03362 seconds
  • Memory Usage 1,830KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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