View Full Version : Limit length in RSS (External Data Provider)
abroad
01-02-2008, 04:53 AM
Is it possible to limit the length output of each thread e.g. 200 Characters to produce a RSS with the external data provider?
optrex
01-14-2008, 09:14 PM
I need something like this too please, to limit words not characters. I also want to be able to put a "signature" at the end of each item
ResaleBroker
02-06-2008, 04:02 PM
Yes. Here is a link to a post that covers this: https://vborg.vbsupport.ru/showpost.php?p=1372991&postcount=8
abroad
02-06-2008, 05:38 PM
There is no way to limit it without using a plugin (as we do here).
This is a simplfied version of what we do ;
Hook: external_query
Code:
unset($vbulletin->GPC['fulldesc']);
$vbulletin->options['threadpreview'] = 200;
$hook_query_fields .= ",LEFT(post.pagetext,400) AS message";
__________________
And what do I have to do here? Write this in a file and upload it as a plugin? :)
ResaleBroker
02-06-2008, 06:18 PM
And what do I have to do here? Write this in a file and upload it as a plugin? :)Admin CP >> Plugins & Products >> Add New Plugin >>
Product:
vBulletin
Hook Location:
external_query
Title:
external_query
Plugin PHP Code:
unset($vbulletin->GPC['fulldesc']);
$vbulletin->options['threadpreview'] = 250;
$hook_query_fields .= ",LEFT(post.pagetext,400) AS message";
abroad
02-07-2008, 12:39 PM
Tried it but the RSS output looks not good:
XML Parsing Error: junk after document element
Location: http://www.domainxyz/external.php&rss2
Line Number 2, Column 1:<b>Parse error</b>: syntax error, unexpected $end in <b>/forum/external.php(67) : eval()'d code</b> on line <b>4</b><br />
ResaleBroker
02-07-2008, 01:17 PM
I have updated the code in my previous post. You might give it a try.
abroad
02-07-2008, 01:33 PM
ok now it works...but I fo not see any differences if I change 250 to 150?
ResaleBroker
02-07-2008, 02:02 PM
ok now it works...but I fo not see any differences if I change 250 to 150?Change this:
$vbulletin->options['threadpreview'] = 250;
to
$vbulletin->options['threadpreview'] = 150;
And this:
AdminCP >> vBulletin Options >> Forum Display Options (forumdisplay) >>
Length of Thread Preview Text (Set this value to 150)
abroad
02-08-2008, 04:11 AM
hmm...when I call ...external.php?rss2 on Firefox it looks like that it shows up short but on the IE7 it still shows the full content...
ResaleBroker
02-08-2008, 12:34 PM
hmm...when I call ...external.php?rss2 on Firefox it looks like that it shows up short but on the IE7 it still shows the full content...Please verify that your Hook Location is: external_query
abroad
02-19-2008, 07:09 AM
There is still a problem. If I have this plug in activated and I want to open the RSS feed in a browser, an empty page appears. When I click on reload it actually shows then the feed. I tried it with IE and Firefox.
why do I have to push reload to load this feed?
I do .../external.php&rss2
Trichomes
07-17-2009, 12:31 PM
can this be done for the javascript version, it didnt work for me :(
Marvin Hlavac
12-05-2009, 01:56 PM
There is no way to limit it without using a plugin (as we do here).
This is a simplfied version of what we do ;
Hook: external_query
Code:
unset($vbulletin->GPC['fulldesc']);
$vbulletin->options['threadpreview'] = 200;
$hook_query_fields .= ",LEFT(post.pagetext,400) AS message";
Would someone please be so kind and tell me step-by-step how to implement this?
I've spent last night and this morning searching vbulletin.org and vbulletin.com for a simple step-by-step instructions on how to limit the output of my RSS feed, but I only found this thread.
Lynne
12-05-2009, 02:28 PM
Take a look in the manual on how to create a plugin - Plugin System (http://www.vbulletin.com/docs/html/plugin_system) And then all you need to do for this is right in the post you quoted. It tells you the hook location and the contents for plugin. Save and make sure you set it to Active. Wait a little bit (depending on what value you have the cache set up) until you can see the plugin working (it won't work right away because of the cache).
Marvin Hlavac
12-05-2009, 04:55 PM
Lynne, thanks for pointing me the right direction. It works now. :-)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.