vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Limit length in RSS (External Data Provider) (https://vborg.vbsupport.ru/showthread.php?t=166703)

abroad 01-02-2008 04:53 AM

Limit length in RSS (External Data Provider)
 
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....91&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

Quote:

Originally Posted by abroad (Post 1437537)
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:
Quote:

vBulletin
Hook Location:
Quote:

external_query
Title:
Quote:

external_query
Plugin PHP Code:
Quote:

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

Quote:

Originally Posted by abroad (Post 1438193)
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...


All times are GMT. The time now is 10:50 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.01542 seconds
  • Memory Usage 1,735KB
  • 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
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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