The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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, |
#2
|
|||
|
|||
Extended Legacies lets you use the vB4 template syntax in vB3 so you don't have to write template code for each version. First, what the code above does is set our hook name and vB4 template name. Then, it checks if you are running vB3. If you are, it will change the template from MYCODE to MYCODE_LEGACY (the vB3 equivalent) automatically. Otherwise, it will load the vB4 template MYCODE. The above code should place your markup below posts but above the signature. |
Благодарность от: | ||
ChiNa |
#3
|
|||
|
|||
Amazing thing... Thank you so much, This will save me lots of time on vB 3.8,, You have really saved me lots of time and I am simply honored to have got some help from some one like your sir.
Now I have to surely understand vB4.x, befor I can try vB 4. stuff on vB3.8! I will later today release my version for vB3.8, and I will def let you know about my release for vB3.8. But so far the same product I have made for vB3.8, I am lost to do the same thing for vB4.x! And this was why I came to ask for help. And about the Debut Mode, Yes Scanu, yet another amazing coder helped me the other day with it, and as you can see I am totally new to this. I will try work hard on the project and the tutorial you have showen me. And I will def give my best shot! Thank you very much.. Appreciated alot! --------------- Added [DATE]1345593630[/DATE] at [TIME]1345593630[/TIME] --------------- Hi again, I just finished the vB3.8 Product that I was talking about, the Postbit Start Replacemen, here is the thread maybe you would check it out: https://vborg.vbsupport.ru/showthread.php?p=2358841 Thank you very much for your advice and your help! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|