vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   New Posting Features - Latest Blog in Postbit Using Carp for vBulletin 4.x (https://vborg.vbsupport.ru/showthread.php?t=234254)

djbaxter 01-26-2010 10:00 PM

Latest Blog in Postbit Using Carp for vBulletin 4.x
 
1 Attachment(s)
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)); 


djbaxter 01-26-2010 11:29 PM

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


993ti 01-28-2010 07:33 PM

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));

;)

djbaxter 01-28-2010 07:53 PM

Thanks, 993ti. Added in OP and credited to you. :)

ChaibiAlaa 04-19-2010 08:57 PM

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

ChaibiAlaa 04-19-2010 09:02 PM

Now working very great when I used the postbit_legacy code :D I was too Dunky first time :p

Tryppnotic69 06-08-2010 04:55 PM

Works great on 4.0.3

Thanks so much for this great mod!

daveaite 08-16-2010 02:00 PM

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?

djbaxter 08-16-2010 02:19 PM

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

djbaxter 08-16-2010 02:45 PM

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.

daveaite 08-16-2010 04:19 PM

Thanks for the reply and effort. The mod works perfectly on forums.

CMS it works until theirs a post on a particular thread and that particular article sends out an error.

djbaxter 08-20-2010 01:03 AM

daveite:

Do you by any chance have this add-on installed: https://vborg.vbsupport.ru/showthread.php?t=150761

If so, disable it and see if you still get the error. That worked with me with the new updated code for the plug-ins now posted above.

If you don't have that specific add-on installed, please look for any other products or plugins that modify the postbit and report them here.

BlueCheri 11-17-2010 03:51 AM

Hi,

Can not see the link of Blog, please guide me.

djbaxter 11-17-2010 04:04 AM

Cannot see what link? The link in the postbit or postbit_legacy?

BlueCheri 11-17-2010 04:26 AM

Quote:

Originally Posted by djbaxter (Post 2122683)
Cannot see what link? The link in the postbit or postbit_legacy?

Its showing "recent blog" only...i cannot see the latest blog entry link..the field is empty.
Can you just tell me where might i be wrong?
Also the codes you have given above ..do we have to put it in postbit or posbit legacy or both?
please specify which code in which templates

Edit: Thanx it is done, Post Filed number not changed.

Olgi 12-15-2010 09:29 AM

Hello,
When using Legacy (Vertical) Postbit Template the blog feed will not show, any way around this?

djbaxter 12-19-2010 02:18 AM

Quote:

Originally Posted by Olgi (Post 2134189)
Hello,
When using Legacy (Vertical) Postbit Template the blog feed will not show, any way around this?

1. Check that you're trying to display an RSS feed and be aware that this mod does not typically work well with Blogger/Blogspot feeds, even with the RSS extensions.

2. Check that you have the right field# in the additional code.

That said, I'm not sure how well suited this is for postbit legacy forums... at best, the blog post title is going to have to wrap condierably. I've never really liked and never used the postbit legacy format so I can't tell you exactly how to modify the display. You may need to play with it a bit.

Can you post a screenshot of (1) what the legacy display looks like now and (2) the code in your legacy postbit?

merk_aus 12-20-2010 05:34 AM

Is this possible to grab blogs made in the vb-blog stuff on the suite - I only want members most recent blogs from there to show in the postbit.

djbaxter 12-20-2010 12:56 PM

Quote:

Originally Posted by merk_aus (Post 2136710)
Is this possible to grab blogs made in the vb-blog stuff on the suite - I only want members most recent blogs from there to show in the postbit.

I've never tried it but you should be able to use any valid RSS feed.


All times are GMT. The time now is 04:51 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.03862 seconds
  • Memory Usage 1,810KB
  • 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
  • (7)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (19)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete