vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Trim Thread Title Posted on Forum. External Data Provider (https://vborg.vbsupport.ru/showthread.php?t=294908)

Naijasite 02-09-2013 12:34 AM

Trim Thread Title Posted on Forum. External Data Provider
 
Some of my Thread Title length posted from rss feed are so long. Maximum Characters Per Thread/Post Title to 85.
I still have some Thread Title length that is up to 3 lines (200 word). that were posted from Rss.

Please how do i trim Thread title posted from Rss Feed?


Your assistance will be appreciated.

LifesGreatestGift 02-09-2013 01:28 AM

Open ./includes/cron/rssposter.php

On line 386

Find:
PHP Code:

$itemdata->set('title'strip_bbcode($html_parser->parse_wysiwyg_html_to_bbcode($feed['xml']->parse_template($feed['titletemplate'], $item)))); 

Replace With:
PHP Code:

                    $thread_length $vbulletin->options['titlemaxchars'];
                    
$new_length $thread_length 4;
                    
$current_title strip_bbcode($html_parser->parse_wysiwyg_html_to_bbcode($feed['xml']->parse_template($feed['titletemplate'], $item)));
                    if (
strlen($current_title) > $thread_length) {
                        
$new_title substr($current_title0$new_length) . ' ...';
                    } else {
                        
$new_title $current_title;
                    }    
                    
$itemdata->set('title'$new_title); 


I haven't tested it, but it should work.


All times are GMT. The time now is 05:44 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.00950 seconds
  • Memory Usage 1,718KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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