The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hi,
I'm trying to create a custom USERCP page, based on this How-To : https://vborg.vbsupport.ru/showthrea...uct_usercp_nav So I create a new page successful (new item on the usercp menu, and new page with header, usercp menu etc). But I don't understand how to include contents. Can you help me? Thanks. |
#2
|
||||
|
||||
![]()
So, you created a new link in the User CP navbar and now you need help creating the actual page? You may want to start here - [How-To] vBulletin API Basics: Creating Custom Pages & Misc.
|
#3
|
|||
|
|||
![]()
Yes, I need help creating the actual page. I know how to create a custom page, but the USERCP page seems to be different.
The USERCP template is a template which inclure the header, the navbar, the USERCP menu and the content space. So your new page had to implement the USERCP template (like is described here). So it isn't a simple custom page which include the USERCP menu. My question, is how to complete the content space? |
#4
|
|||
|
|||
![]()
Actually, It is a simple custom page that includes the USERCP menu. There is a template called 'USERCP_SHELL' that has the HTML for the structure of the UserCP(including menu). There is variable within that template called '$HTML'.
What you do is fill in the variable $HTML with whatever data you want displayed before you fetch/eval/print the 'USERCP_SHELL' template in your custom page. |
#5
|
|||
|
|||
![]()
Ok that's work, thanks.
Is it possible to include dynamic contents (PHP code) directly in $HTML? For example, to include some file in the $HTML? |
#6
|
|||
|
|||
![]()
You use php in your custom pages, look at the link Lynne provided. Step one is your php file, you do all php work in that file and then fill the variable $HTML with the html code to display on the page.
|
#7
|
|||
|
|||
![]()
Ok, I'll try to do this.
Thanks for answers ![]() |
#8
|
|||
|
|||
![]()
The use of the $HTML variable is very constraining.
![]() I had to convert an old php script which write HTML code. In the old version, I used many ?> html code <?php and echo to insert HTML code. PHP Code:
Now I had to write this : PHP Code:
Do you know an easier way to convert this script? For example, is it possible to insert PHP condition into concatenation? PHP Code:
|
#9
|
||||
|
||||
![]()
The vBulletin templating system is actually quite flexible easy to use (once you get the hang of it). Add this to your template:
Code:
<script type="text/javascript"> //<![CDATA[ var myVar1 = <if condition="isset($myPhpVar1)">$myPhpVar1<else />$myPhpVar1Default</if>; var myVar2 = <if condition="isset($myPhpVar2)">$myPhpVar2<else />$myPhpVar2Default</if>; var lenght = 25; function func(){ if (length > $lengthPHP) { document.getElementById('myID').value = document.getElementById('myID').value.substring(0, $lengthPHP); } } //]]> </script> |
#10
|
|||
|
|||
![]()
Great!
At first sight, programming with vBulletin is a bit strange, but finally it's verry powerful ![]() Thanks very much for your help ![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|