Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Latest Blog in Postbit Using Carp for vBulletin 4.x Details »»
Latest Blog in Postbit Using Carp for vBulletin 4.x
Version: 4.01, by djbaxter djbaxter is offline
Developer Last Online: Aug 2021 Show Printable Version Email this Page

Category: New Posting Features - Version: 4.0.6 Rating:
Released: 01-26-2010 Last Update: 08-22-2010 Installs: 15
Uses Plugins Template Edits
Re-useable Code Translations  
No support by the author.

This is an update for nevetS' mod for 3.5 at https://vborg.vbsupport.ru/showthread.php?t=91781 and gotlinks' update for 3.6 at https://vborg.vbsupport.ru/showthread.php?t=163718 to make it work in 4.x.

If you already have Carp Free or Carp LE or Carp Evolution, great. If not, you'll have to download a copy from http://carp.docs.geckotribe.com/download.php (Carp Free is now renamed Carp LE). If you need to install Carp first, golinks has some instructions at https://vborg.vbsupport.ru/showthread.php?t=163718 and there are of course more detailed instructions at http://carp.docs.geckotribe.com/

Now, modify your vBulletin installation.

1. Add three custom profile fields - in my setup, they are as follows, but make a note of the field# for later in case yours are different:
  1. Name = Blog RSS Feed (RSS Only!)
    Single-Line Text Box Editable, Searchable, Members field6
    The member enters his blog feed here.
  2. Latest Blog Title
    Single-Line Text Box Searchable, Members field7
    This is filled automatically by Carp with the latest blog post at that feed.
  3. Blog URL
    Single-Line Text Box Searchable, Members field8
    This is the URL to the blog, filled by Carp and used in postbit to make the blog title a live URL.

2. Create a new plugin called Carp Configuration and attach it to hook location: global_bootstrap_init_start

PHP Code:
global $vbulletin;
require_once 
'./carp/carp.php';
CarpConf('carperrors',0);
CarpConf('cacheinterval',3);
CarpConf('cborder','');
CarpConf('poweredby','');
CarpConf('maxitems',1);
CarpConf('iorder','link');
CarpConf('linktarget',1); 
3. Create another plugin called Get Users Blog Entry and attach this to hook location: postbit_display_start

PHP Code:
global $vbulletin;
ob_start();
CarpCacheShow($post[field6]);
$blogentry ob_get_contents();
ob_end_clean();
vB_Template::preRegister('postbit',array('blogentry' => $blogentry)); 

4. Edit postbit (and/or legacy):

Find:

PHP Code:
<vb:if condition="$post['rank']">
                        <
span class="rank">{vb:raw post.rank}</span>
                    </
vb:if> 
Add after:

PHP Code:
<!-- latest blog hack -->
<
vb:if condition="$post['field6']">
<
span class="smallfont">Recent Blog: <a href="{vb:raw post.field8}" target="_blank">{vb:raw blogentry}</a></span>
</
vb:if>
<!-- 
end latest blog hack --> 
Remember to change field6 and field8 to correspond to the numbers of the custom fields for your forum.

For postbit_legacy, use this code instead (thanks to 993ti who posted this here:

PHP Code:
ob_start();  
CarpCacheShow($post[field6]);  
$blogentry ob_get_contents();  
ob_end_clean();  
vB_Template::preRegister('postbit_legacy',array('blogentry' => $blogentry)); 

Download Now

File Type: txt Latest-Blog-in-Postbit-Suite.txt (2.7 KB, 33 views)

Screenshots

File Type: jpg latest-blog-in-postbit.jpg (4.1 KB, 0 views)

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 01-26-2010, 11:29 PM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you wish to restrict the latest blog display to only members in good standing, follow the instructions above but use the following code for postbit:

PHP Code:
<!-- latest blog hack for members in good standing only -->
<
vb:if condition="!in_array($bbuserinfo[usergroupid],array(G1,G2,G3,G4,G5))">
<
vb:if condition="$post['field6']">
<
span class="smallfont">Recent Blog: <a href="{vb:raw post[field8]}" target="_blank">{vb:raw blogentry}</a></span>
</
vb:if>
</
vb:if>
<!-- 
end latest blog hack for members in good standing only --> 
Replace "G1,G2,G3,G4,G5" by the usergroup ID numbers of any groups who should NOT show the latest blog.

For example, I restrict privileges for new members for the first 10 posts so they don't get to display their blogs. Similarly, I don't want blog titles and links displayed for banned members.

Therefore, I disable this for the following groups:
New member (Registered Members): 2
Probation: 22
Banned: 20
Blocked: 30
Post Moderation: 28
so I would use the following code in postbit:

PHP Code:
<!-- latest blog hack for members in good standing only -->
<
vb:if condition="!in_array($bbuserinfo[usergroupid],array(2,20,22,28,30))">
<
vb:if condition="$post['field6']">
<
span class="smallfont">Recent Blog: <a href="{vb:raw post[field8]}" target="_blank">{vb:raw blogentry}</a></span>
</
vb:if>
</
vb:if>
<!-- 
end latest blog hack for members in good standing only --> 
Reply With Quote
  #3  
Old 01-28-2010, 07:33 PM
993ti 993ti is offline
 
Join Date: Dec 2005
Location: Netherlands
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice mod, thx, comes in handy on my forum
Might want to add that if you use postbit_legacy the plugincode of Get Users Blog Entry should be
Code:
ob_start();  
CarpCacheShow($post[field6]);  
$blogentry = ob_get_contents();  
ob_end_clean();  
vB_Template::preRegister('postbit_legacy',array('blogentry' => $blogentry));
Reply With Quote
  #4  
Old 01-28-2010, 07:53 PM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, 993ti. Added in OP and credited to you.
Reply With Quote
  #5  
Old 04-19-2010, 08:57 PM
ChaibiAlaa ChaibiAlaa is offline
 
Join Date: Apr 2010
Location: Tunisia
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I did everything, and the blog rss isn't showing, only the text "Recent Blog :" is showing up, no URL neither RSS title .. I did EVERYTHING without any expetion ! I even changed cache time to 1 minute and still nothing shown from my blog, here is the url of a thread where nothing shown in my profile http://www.blogging-talk.com/showthr...?t=3&p=4#post4
Reply With Quote
  #6  
Old 04-19-2010, 09:02 PM
ChaibiAlaa ChaibiAlaa is offline
 
Join Date: Apr 2010
Location: Tunisia
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Now working very great when I used the postbit_legacy code I was too Dunky first time
Reply With Quote
  #7  
Old 06-08-2010, 04:55 PM
Tryppnotic69 Tryppnotic69 is offline
 
Join Date: Nov 2007
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works great on 4.0.3

Thanks so much for this great mod!
Reply With Quote
  #8  
Old 08-16-2010, 02:00 PM
daveaite's Avatar
daveaite daveaite is offline
 
Join Date: Jul 2009
Location: Florida
Posts: 1,890
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It works perfectly but it affects my cms when a comment is posted in one of the articles via CMS and not the forums (SUITE Version 4.06), trying to figure out why it causes this error:

Quote:
Fatal error: Call to undefined function CarpCacheShow() in /home/buypoe/public_html/includes/class_postbit.php(284) : eval()'d code on line 2
Is it because CMS does not use postbit and its trying to find it?
Reply With Quote
  #9  
Old 08-16-2010, 02:19 PM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this:
  1. Go into Admin CP | Plugins & Products | Plugin manager
  2. Find and edit the two p[lugins: Carp Configuration and Get Users Blog Entry
  3. Change the hook locations for both to global_complete
Reply With Quote
  #10  
Old 08-16-2010, 02:45 PM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Apparently, that didn't work for davaeaite.

Until recently, I wasn't using the CMS because it was too buggy. I'm just trying it out now and obviously something needs to be changed to register these variables more globally.

I'll update when/if I can figure it out. For now, it works for forum only.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:37 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04466 seconds
  • Memory Usage 2,354KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (7)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete