The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
New to vBulletin and PHP - what is the lifecycle of a request?
Where are templates stored, etc. I've found docs on the pieces-parts, but haven't found how they hang together. I'm on 4.2.3
I typically work on JEE/JSP-faces tech stack. I'm having trouble seeing the big picture about how mods hang together. I understand hooks and callbacks. But how do I find the hook I need. It feels like I'm missing something obvious. I haven't found a programming primer that describes the lifecycle of vBulletin. Firefox, showed me the page structure below when I clicked 'New Posts': Code:
... <div class="body_wrapper"> <div id="breadcrumb" class="breadcrumb"> <form id="notices" class="notices" method="post" action="profile.php?do=dismissnotice"> <div id="pagetitle"> <div id="above_searchresults" class="floatcontainer"> <form id="search_inlinemod_form" method="post" action="inlinemod.php"> <input type="hidden" value="/search.php?searchid=2659" name="url"> <input type="hidden" value="" name="s"> <input type="hidden" value="1450912181-94f517a9b74949b6bb0c5b7bec54ff4d7b84b487" name="securitytoken"> <input type="hidden" value="" name="forumid"> <div id="thread" class="block searchresults"> <h2 class="searchlisthead"> <div class="blockbody"> <ol id="searchbits" class="searchbits" start="1"> <li id="thread_854" class="imodselector threadbit dot new title_editable" title="testing one two"> </ol> </div> ... How do I track down the hook I need? How do I add it to the navigation tree? Is there a developer primer? My google-fu has failed me. |
#2
|
||||
|
||||
What I would do, is look at the HTML for something I think will be unique to that template, such as:
HTML Code:
<h2 class="searchlisthead">
AdminCP -> Styles & Templates -> Search in Templates Then in the "Search for Text" field paste: <h2 class="searchlisthead"> and click "Find" You should see the "search_resultlist" template in the result. Double-click it to open the template, and then you will see your search text in the "Search in Template" field, so click the "Find" button, and you will be taken to where the search text is located within the template. Several lines below that, you will find the block: HTML Code:
<div class="blockbody"> <vb:if condition="$displayCommon"> <h3 class="blocksubhead">{vb:rawphrase words_very_common}: $displayCommon</h3> </vb:if> <vb:if condition="$show['results']"> <ol id="searchbits" start="1" class="searchbits"> {vb:raw searchbits} </ol> <vb:else /> <div class="blockrow">{vb:rawphrase no_unread_threads}</div> </vb:if> </div> |
Благодарность от: | ||
andy_mcguire |
#3
|
|||
|
|||
Quote:
I don't think I need options yet, and did not add a settings group. I added some plugin code for the product and template and hooked it to the search_start hook. I tried exporting it, but I only get a pretty much empty xml file in a download dialog. I see no files to be bundled on the filesystem of the server. I also have no clue as to how to add the product into the navigation, I would like to put it into the what's new tab submenu. I really appreciate your time Mark, thank you. |
#4
|
|||
|
|||
In order to find the right hook which you need, you first check the PHP script the page uses which you want to modify. Then open that PHP file and go to the part where PHP does the logic for that part, you can usually tell by the GET or POST parameters that the page uses.
Then simply look for a hook definition around that location. Note that not every location has a hook so there's a chance you may not be able to do what you want without modifying vBulletin's files itself. |
#5
|
|||
|
|||
Quote:
The remaining question I have now is where is the navigation section of the product xml file stored or generated from? |
#6
|
||||
|
||||
What do you mean by "navigation section of the product xml file?"
|
#7
|
|||
|
|||
Quote:
Thanks Again for everyone's help. --------------- Added [DATE]1450986040[/DATE] at [TIME]1450986040[/TIME] --------------- Quote:
In that file is a navigation section that is driven by entries in Settings -> Navigation Manager Thanks again. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|