Quote:
|
So I've been tinkering around with this tutorial and was close to raising the white flag of surrender because I could not understand this for the life of me.
So after long grueling hours, I've manage to figure things out and get things working...well sort of. I've used Lynne's artcle "[HOW TO - vB4] Create a own vBulletin page" and managed to create an about us page. My about us page named, "about.php" look like this... PHP Code:
My template page named, "aboutus_tmplt" looks like this... Code:
{vb:stylevar htmldoctype} PHP Code:
It feels awesome when things just work! Like they say, "If it ain't broken, don't fix it", well that's not how it is in my case because my knowledge of VB's coding is fairly basic so I feel like I may have butchered some things that weren't necessary. What I'm concerned with is that I have no idea what this line of does in my plug-in code. PHP Code:
Can anyone shed some light as what that line of code does? Also what I'm hoping for is that if anyone can please verify that the lines of code I have posted are valid giving their respective names and all? Any help will greatly be appreciated. Thanks. |
1. because your template is called aboutus_tmplt you need
PHP Code:
PHP Code:
|
1 Attachment(s)
Hi,
I have added the template and plugin. But there is no letters appearing in the navbar. Can anyone help ? My template code <vb:if condition="$vboptions['selectednavtab'] == 'ragteknews'"> <li class="selected"> <a class="navtab" href="news.php{vb:raw session.sessionurl_q}">{vb:rawphrase ragtek_news}</a> <ul class="floatcontainer"> <li><a href="#">#</a></li> </ul> </li> <vb:else /> <li><a class="navtab" href="news.php{vb:raw session.sessionurl_q}">{vb:rawphrase ragtek_news}</a></li> </vb:if> Plugin if (THIS_SCRIPT == 'ragteknews') { //set selected tab $vbulletin->options['selectednavtab'] = 'ragteknews'; } // add the "subtemplate" to the navbartemplate $template_hook['navtab_middle'] .= vB_Template::create('ragtek_news_navbar')->render(); |
@Chee Foo
You have to define "ragtek_news" as a new Phrase in the AdminCP. Then you will get the phrase you defined as the Tabname |
You could also write "my phrase" instead of using a phrase;)
|
Quote:
Phrase Type - Global ? Product - vBulletin ? Varname - ragtek_news ? Text - ?? |
Phrase Type: Global
Varname: A varname, which you will have to use in the template Text: Yout text which will be shown in the template |
Thanks!! It works!
|
Works for me! Awesome, ty sir.
What about changing the order of the tabs... I see that in this example the tab is set to navtab_middle. If I wanted to switch this tab (now in position 2 out of 3) with the default 'what's new' tab (now in position 3 out of 3) would I state navtab_right ? TYTY |
If there's a hook, yes;)
|
Hey ragtek thanks for this i managed to create the button im doing an arcade on my site and did the button no probs but how do i create a page as when you press the button it leads no where im a little bit of a noob only been doing this 3 months an learning lol thanks in advance p.s i know i have to load the games to my server etc just working on that..
--------------- Added [DATE]1262146923[/DATE] at [TIME]1262146923[/TIME] --------------- BTW think im getting there but i also need to add this html code to make the game work <html> <head> <title>Pacman Advanced</title> </head> <body> <center> <h1>Pacman Advanced</h1> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="600" height="400"> <param name="movie" value="pacmanadv.swf"> <param name="quality" value="high"> <embed src="pacmanadv.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="600" height="400"> </embed> </object> <br> <a href="http://www.startgames.ws">Online flash game</a> </center> </body> </html> Where would i add that? this is harder than i thought when i stared 12 hours ago lol. Thanks. --------------- Added [DATE]1262152274[/DATE] at [TIME]1262152274[/TIME] --------------- Also how do i create a page for it to link to when you press the tab?? |
There are some articles for own pages;)
https://vborg.vbsupport.ru/forumdisplay.php?f=242 |
Thanks ragtek but ive looked through everything bud ive been doing this 14 hours with no sleep so getting a little tired now.
i just wanted to know how a create a page forr the button to link to. Thanks B. |
|
Ok great ragtek thank you very much big help think the second one is easiar but how would i direct the tab to that page sorry to be a pest but i am really new to all this and avin many sleepless nights learning while i have time off work great way to spend hols...:erm:
|
1 Attachment(s)
tx helped alot,
one problem on a board im getting these stange spacers but only on the first line "always" as if the text is indent once. and same result for various browsers.. Attachment 108759 Code:
<li class="popupmenu"> |
Is not possible for a not coder user , to use this mod :(
Will be great if one of the vb.org coder release a "Generic addon Tabs" , with a working link that just must be changed..... "Ready to use". |
Quote:
|
I want to show TEST Menu Option only if $myvar is set to 1 (Usergroup Permission) but this is not working for me.
Could someone help me ? PHP Code:
PHP Code:
Fixed it with Lynnes Article: https://vborg.vbsupport.ru/showthread.php?t=226914 |
Hello,
Adapted this to create a link to my main website: Plugin "Main Website Button", on process_template_complete: Code:
$template_hook['navtab_middle'] .= vB_Template::create('Link to Main Website')->render(); Code:
<vb:if condition="$vboptions['selectednavtab'] == 'mainwebsite'"> |
How come when I click on the nav tab, it shows the Forum tab as selected and not the tab I created?
|
Quote:
|
Good article. It worked well. question. if I need to add more tabs do I need to make new templates and hooks?
-CP |
In case anyone is curious and you know how to create a permission group, here is how you can use that group to determine who can see the tab.
FIRST: At the top of the plugin, add a variable for your permission group array: PHP Code:
At the bottom of the plugin, find the following line: PHP Code:
PHP Code:
Open your template and add a line to the top and the bottom. HTML Code:
<vb:if condition="is_member_of($bbuserinfo, $accessgroups)"> HTML Code:
</vb:if> |
I kind of modified this to try and use it with articles as "pages" with the tabs linked to articles.. (and it works, the tabs show as on).... but the HOME button is on too. Is there a way to set the home button to unselected?
Code:
$tabselected = ''; |
I finally figured out a way to add all my variables from my custom page to the navbar. I went about it in a sneaky way.
I first added the following code to my showroster.php file which allowed me to add all the registered variables I wanted to use: PHP Code:
PHP Code:
HTML Code:
<vb:if condition="is_member_of($bbuserinfo, $accessgroups)"> |
Okay I am struggling with this. I want to add a button on my navbar that links to a specific forum, and when a user is viewing that forum for the tab on the navbar to be highlighted.
So this is the information that I used: template name: bb_navbar_events template code: HTML Code:
<vb:if condition="$vboptions['selectednavtab'] == 'navbarevents'"> plugin code: PHP Code:
Should this arrangement be working properly? I want the Events tab to be highlighted when it is on that page, but the Forum tab remains highlighted. Any suggestions? |
How do you do PERMISSIONS with this? I use the following code for permissions in my mods, and it works fine...
Code:
if (!($permissions['medialibperms'] & $vbulletin->bf_ugp_medialibperms['cansubm'])) I am trying to use this code in my plugin, but the permission ALWAYS fails... Code:
if (THIS_SCRIPT == 'media') |
Where do I add these I know to create a new plugin?
|
Hello,
I am a newbie, please help. Where do I create a template and how am I going to upload to my site. Second, how do I suppose to "Create a plugin at the hook process_templates_complete" with PHP codes. I am just really lost and do not know where to begin. Thank you. |
im new to this where do create a new templete
|
Just wanted to say that i used a hybrid between yours and Lynne's walkthrough. I offloaded just the menu items to a template. Thanks for the help ragtek!
https://vborg.vbsupport.ru/showpost....&postcount=393 |
Awesome! Thanks for this! Was slightly confused til I tried Lynne's instructions with adding a tab, then I came back to this one and understood (been away from vBulletin for quite awhile)
|
Quote:
|
This is a great tutorial! Does anyone know how I can retain the sublinks that show just below the tab bar on the forum tab, across all active tabs?
|
hi, great tutorial.
little question my custom page is a clone of content that displays a list of articles on a given section, how can i make those links to point to my page 'news.php' instead of the default 'content.php'? regards |
Is this as easy as adding a Drop down menu, I see those a lot
|
Quote:
|
awesome, works great
|
All times are GMT. The time now is 10:55 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|