The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Latest Blog Feed in Postbit using Carp RSS Details »» | |||||||||||||||||||||||||
I just posted this over at vbWebmaster Forums. I'm all excited because this is my first plugin and I know pretty much nothing about vbulletin. I got the idea from Shawn's forum at Digital Point
I just put this together for 3.5 using carp. Step 1) Add a custom profile field for the RSS link. In my setup it was field5. Step 2) Edit your postbit template as follows: PHP Code:
Here is the code: PHP Code:
Attach this to hook location: postbit_display_start PHP Code:
I'm not sure if this will work with the free version, as I have the paid version. I'm thinking about using grouper to set it up so I can parse atom files, but I don't know how important that will be. Note: carp allows you to enter local paths and http paths for rss feeds. I've tried entering both in my user profile field successfully. You may want to disallow users from entering a local path just to be on the safe side. I don't have any code for that right now, but I'm sure there are some examples for field validation out there. Carp has an option to store it's output in a variable ($carpoutput), but it didn't seem to work for me. That's why I used the ob_start and end_clean functions. If anybody has any feedback as to how this may be improved, I'm willing to listen. Show Your Support
|
Comments |
#62
|
|||
|
|||
Sorry for dugging this old topic, but just want to let you all know that this hack working correctly even with 3.6.8.
|
#63
|
||||
|
||||
I keep getting this error?
[CaRP] Can't open cache file. [CaRP] Failed to open file: /home/thrdgami/public_html/bzimage/rss/carp/autocache/58fae8eb72e8579438002f3ea9fd5c09 [CaRP] Can't open remote newsfeed. |
#64
|
||||
|
||||
Here is how to fix this mod! And it works perfect on my forum at www.bzimage.org
Quote:
|
#65
|
|||
|
|||
OK,
I downloaded this and everything is working great. The only issue I seem to be having with it is the fact that all the blog post titles have all the quote and apostrophe marks replaced with question marks, anyone know why? |
#66
|
|||
|
|||
This most likely has to do with the fact that the rss feeds are unicode. Do you have an rss feed exhibiting the problem that I can point to?
I would think that if your forum is displaying unicode and the rss feed is unicode it wouldn't be a problem, but if you have a doctype specifying western characters it will show the western character version - which is usually a question mark, but it depends on the font. It could be a problem with carp, though. I may be able to insert a regex to replace the characters appropriately. |
#67
|
|||
|
|||
Well,
my forum I'm using is: http://www.conspiracy-forums.com/ and the feed for my blog in my postbit is: http://www.lightningshock.com/feed/ So I'm not exactly sure where the error is turning up. |
#68
|
|||
|
|||
I'm just barely starting to look into this - busy work day. I'll get back to you shortly.
|
#69
|
|||
|
|||
There's definiitely a combination of unicode (UTF-8) (rss feed) and western character sets (ISO-8859-1) (forum page) going on - although I'm actually unsure of a fix at the moment. Looking at the output, there isn't a difference between single and double quotes.
I'll spend some more time this morning checking it out. |
#70
|
|||
|
|||
OK - interesting, but not a solution yet -
If you add the following to your carp configuration, it will output the quotes properly - Code:
CarpConf('encodingout','UTF-8'); This is typically done by having a meta tag in the header as follows: Code:
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> I am a bit concerned that fixing this problem might just break some other things. There is another option in CarpConf Code:
CarpConf('fixentities',1); |
#71
|
|||
|
|||
OK... so here we go. Beware that this may potentially cause some problems because we're changing character encoding. I don't know what kind of problems it might cause but there seems to be a lot of discussion about UTF-8 and I personally don't know a heck of a lot about it.
My mindset is to give it a shot, and be prepared to roll back these changes if they affect anything else. In your carp configuration plugin - the one that has a hook on global_start add: Code:
CarpConf('encodingout','UTF-8'); select language manager, then edit the US English settings. Change the character set from ISO-8859-1 to UTF-8 and then it should work. The things I would be concerned about testing right off the bat would be any add-ons you have that involve javascript. I don't think this change updates the database at all, so the underlying database tables probably still have a character set of ISO-8859-1. Try posting and searching text that includes unicode characters - maybe copy/paste from http://www.revfad.com/flip.html |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|