Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 13 Jun 2012, 06:23
fili fili is offline
 
Join Date: Jun 2012
vbcms_widget_recentarticle_page formatting

hello

I want to remove the formating text of {vb:raw article.previewtext}

in

vbcms_widget_recentarticle_page

I want this text without <br> <b> etc like a plain text

Someone can help ?
Reply With Quote
  #2  
Old 13 Jun 2012, 16:32
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
I believe the preview is stored in: $view->previewtext and the hook you need is vbcms_article_populate_end.

At least that is how I manipulate the preview in my mods.

The php function strip_tags should remove HTML tags so just make a new plugin on the hook above with this code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

See if that does it.

Off hand I know my "Word Linker" mod has code on this hook if you want to see a real example.
__________________
-Joe
Qapla.com - Exclusive VB Mods! | Joe's Ultimate Off Topic | My Free VB "Mods"
You can PM me if you want but be warned I do not read them often.
Reply With Quote
  #3  
Old 13 Jun 2012, 18:48
fili fili is offline
 
Join Date: Jun 2012
I'm looking

I see your website... i will soon register, i found some great mod in

--------------- Added 13 Jun 2012 at 19:01 ---------------

Question :
my Template Name is : vbcms_widget_recentarticle_page

i understand that i have to find the code before... but where ?

I search in "Style Manager=> Search in templates => Search in all Styles" for "previewtext" to add :
$view->previewtext = strip_tags($view->previewtext);

but nothing

--------------- Added 13 Jun 2012 at 20:57 ---------------

ok i found in article.php (version 4.2 of vb) :

$view->previewtext = $this->content->getPreviewText(false, false);

so :
$view->previewtext = $this->content->strip_tags(getPreviewText(false, false));

=> Fatal error: Call to undefined method vBCms_Item_Content_Article::strip_tags()

oops

--------------- Added 14 Jun 2012 at 07:12 ---------------

Ok i found the solution

here is :

It's in : /vbcms/widget/recentarticle.php

change line 365 :
$article['previewtext'] = strip_bbcode($pagetext);
in :
$article['previewtext'] = strip_tags($pagetext);
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 19:34.

Layout Options | Width: Wide Color: