Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-21-2012, 02:20 PM
ChiNa ChiNa is offline
 
Join Date: Jul 2012
Posts: 457
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Another Str_Replace Question (vB4 & vB3)

Hi everyone, I saw the other thread answered by Kh99 and Scanu..

I am working on a project, my plan is to build a Product, for example Bookmark-Buttons that I wanna add in POSTBIT and POSTBIT LEGACY! I have to the buttons "On top of the Signature" or simply replace the "Signature Start"! So far I have made this done with the help of a few friends for vB 3.8. And thanks to Scanu for his contribution and help the other day. Now I wanna publish my Products for vB4.x also! And I have 2 simple questions..

First my replacement code: (for vB3.8) worked perfect:
Code:
$replace = '$template_hook[postbit_signature_start]';
        $vbulletin->templatecache['postbit'] = str_replace($replace,$replace.fetch_template('MYCODE'),$vbulletin->templatecache['postbit']);
        $vbulletin->templatecache['postbit_legacy'] = str_replace($replace,$replace.fetch_template('MYCODE'),$vbulletin->templatecache['postbit_legacy']);


Question 1:
I have only made a few modifications, but dont know about the vb 4.x system yet. Now what should I change in my replacement code, to make the code fit on vBulletin 4.x! Obviously my vB3.8 code didnt work on vb 4.x

Here is the line where I wanna start my replacement in vB 4.x Postbit and Postbit Legacy:
Code:
{vb:raw template_hook.postbit_signature_start}


I have followed the other thread, where kh99 replied with:
Code:
$myput = '<!-- message area -->';
$replace = '\'; $final_rendered .= \'' . $myinput . substr(fetch_template('new_posting_newthread'), 19) . ' $final_rendered .= \'';
$vbulletin->templatecache['newthread'] = str_replace($myput,$replace,$vbulletin->templatecache['newthread']);


I can see that this is 1 Template Change. How to do 2 changes in 2 different Templates, using 1 xml product. As you can see I have to replace Postbit and Postbit legacy... So I really hope I can get an exact same code or explanation for vB 4.x!

Thank you very much in advance,
Reply With Quote
Reply


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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:24 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04965 seconds
  • Memory Usage 2,214KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete