![]() |
Creating Addons
Hi,
I have a few different themes on my board and when ever I install a new theme, I have to make manual edits to make everything fit the way I want it to. For example: I have the post thanks mod installed and I have changed the look of the "thanks box". So I uploaded a new theme, and I have to go into it and edit the thanks box to look the same as the other themes. I'm looking for someone who can help me create (more to the point, learn) an addon so I can make my own in the future for this kind of situation. Thanks |
You want to recreate an existing addon from scratch just because you have to make some style edits? How often do you install new styles :eek:
|
Some mods are going to be that way, if they use their own classes, vs using built in classes.
Even if you were to us built in classes, it would be using a stylevar, which you would have to change to suit your needs. Or create your own class, assign it a stylevar, and change it for each style. For most mods, it is much easier just to edit the template, or the CSS for the mod in that style. |
Quote:
|
There is no tutorial, basically you have to know, php, html, css, and have a understanding of how vBulletin works. Then take it and put it all together.
PHP, basic guide: PHP 5 Tutorial HTML basic guide: HTML Tutorial - (HTML5 Compliant) CSS basic guide: CSS Tutorial vBulletin basic mod guide: Creating a Product |
Quote:
I understand PHP, HTML & CSS to a degree. I was looking at your recent mod: https://vborg.vbsupport.ru/showthread.php?t=314177 What I don't understand yet is, if I create an addon (say to replace the post thanks box look) and include my code, will it automatically overwrite the default thanks box code from the post thanks mod? Or do I need to do something to overwrite the default code?/ |
Well actually if you only need to keep changes in templates of a mod, you need to turn on debug mode and edit the template on the master style. This way when you add a new style you won't need to change templates again. However if you still want to know how to make an addon and you already have php and html knowledge you can look for a tutorial ppsted on vb.com on how to make a vb5 extension, it's almost the same
|
Quote:
|
Quote:
https://vborg.vbsupport.ru/showthread.php?t=307739 One plugin could seemingly manipulate all styles to suit, you can define differences there as well. Edit: Do not turn on debug mode and edit your master style, no! |
Quote:
|
Quote:
|
Because the master style will be overwritten when he next upgrades. And I don't imagine he fancies redoing all his styling after every upgrade :)
|
Quote:
|
O create a new template, in each style, with the exact contents you want. Then create this plugin using the hook location, template_render_output
PHP Code:
|
Ohhh, I should also add you will need to cache that new template, using the hook location, cache_templates like so.
PHP Code:
|
For a single template, just append to the end of the existing array. Use:
Code:
cache[] = 'NEW_TEMPLATE_NAME'; |
Yeah that's true. :)
|
Quote:
|
Sure it does, I have used this for a couple of years now. Did you make sure to add the correct template names?
|
Quote:
Code:
if ($this->template == 'post_thanks_box') |
If you want, pm me a admin account and I can see if I can figure it out when I get home today.
|
Quote:
Anyway, is there any way to use the above code and have 10 different templates changed using an array or something like this? PHP Code:
|
Quote:
Quote:
PHP Code:
|
Thanks for that. I will test it out.
|
I want to add something under the navbar. How do I add something to the end of the navbar temaplate OR include a template after the navbar? I'm not quite sure on using the pre-defined hooks or add new hooks into templates.
|
|
Quote:
Code:
$templater = vB_Template::create('custom_template'); --------------- Added [DATE]1411115460[/DATE] at [TIME]1411115460[/TIME] --------------- Sorry, I never added the cache and it now shows. Does the code I used above look OK? I have now added a new plugin for the forumhome using forumhome_complete hook location. I want it to show at the end of the navbar template. How do I insert my OWN custom template hook into the navbar template without having to manually edit the navbar template? |
How do I add my own CSS to the additional.css template using a plugin?
|
You can't, you need to include your own css template, and call it in the script.
|
This is more for ozzy47 lol as I have used your mod [OzzModz] Change Forumrow Color On Mouseover as an example to make my own mod. I am making this plugin to change the background of moderated posts, does this look OK?
Code:
global $vbulletin; |
Looks ok, but I on my mobile, so hard to tell.
Just moderate the post with the moderation tools menu when viewing a post. |
I have spent the last 2 hours trying to get it to work. Im not sure if I'm using the wrong hook location (it's parse_templates at the moment) or theres something else wrong.
|
I can check when I get off work. Where exactly is the color change supposed to show?
|
The background of the post should change. I'm trying to get this edit to be a mod.
https://vborg.vbsupport.ru/showthread.php?t=285655 |
All right, I'll look when I get home later today.
|
Quote:
|
There might be a easier way to do it, I'll look into it later.
|
OK cool. I want it to be an addon so I can add options to it later.
--------------- Added [DATE]1412024571[/DATE] at [TIME]1412024571[/TIME] --------------- Spend another 3 hours researching the issue and can't find the problem |
1 Attachment(s)
Ok here it is. I also added the missing settings for the mod, and set the product URL and the version check URL.
I would suggest creating a stylevar for the background color, instead of having it hardcoded or as a option in the settings. This way the end user can have different colors for different styles. I would uninstall your version, then load this one up. :) |
Thanks. Can you tell me what you added so I know for next time?
|
All times are GMT. The time now is 06:27 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|