Not able to use Str_replace on article templates ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Eqvaliser
    Senior Member
    • Apr 2008
    • 434
    • 1.1.x

    Not able to use Str_replace on article templates ?

    Trying to add content in my articles, found a suitable location
    but unfortunally im unable to Str_replace like i can in the forum template's

    Not sure why it wont run proberly, excakty same works 100% in both
    forumhome, register and various other pages!

    Code:
    Plugin :
    Hook location :
    Code:
    [B]Process_template_complete [/B]
    PHP Code:
    $find '<div class="title">'
    $add '<br />-------<br />TEST<br />-------<br />'
     
     
    $vbulletin->templatecache['vbcms_content_article_page'] = str_replace($find$add.$find$vbulletin->templatecache['vbcms_content_article_page']); 
    Vbulletin fan
  • Lynne
    Former vBulletin Support
    • Oct 2004
    • 26255

    #2
    I already answered this on vbulletin.org, but I'll post it here too.

    Try using vbcms_article_populate_end and use this for the str_replace:
    PHP Code:
               $view->pagetext str_replace($replacement$placement$view->pagetext); 
    If there are further issues, you should continue posting in your thread on vbulletin.org since this concerns modifying the code - http://www.vbulletin.org/forum/showthread.php?t=252478

    Please don't PM or VM me for support - I only help out in the threads.
    vBulletin Manual & vBulletin 4.0 Code Documentation (API)
    Want help modifying your vbulletin forum? Head on over to vbulletin.org
    If I post CSS and you don't know where it goes, throw it into the additional.css template.

    W3Schools &lt;- awesome site for html/css help

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...