vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Creating Addons (https://vborg.vbsupport.ru/showthread.php?t=314198)

Scanu 09-10-2014 04:32 AM

Quote:

Originally Posted by TheLastSuperman (Post 2514452)
That is not advised.

Why? If that is a public board you mean?

cellarius 09-10-2014 05:32 AM

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 :)

Black Snow 09-10-2014 08:52 AM

Quote:

Originally Posted by TheLastSuperman (Post 2514451)
Try doing it this way then:
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!

Thanks for the link and info. It's not simply just the CSS I want to change, it's the template I want to change too. I have edited the Post Thanks box template and renamed certain <DIV> classes and added new div's also. So I want to make a plugin OR addon which will overwrite the default code/template.

ozzy47 09-10-2014 09:02 AM

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:

    if ($this->template == 'OLD TEMPLATE NAME')
    {
        
$this->template 'NEW TEMPLATE NAME';
    } 


ozzy47 09-10-2014 09:23 PM

Ohhh, I should also add you will need to cache that new template, using the hook location, cache_templates like so.

PHP Code:

$cache array_merge($cache, array
        (
            
'NEW TEMPLATE NAME',
        )
    ); 


tbworld 09-11-2014 12:20 AM

For a single template, just append to the end of the existing array. Use:

Code:

  cache[] = 'NEW_TEMPLATE_NAME';

ozzy47 09-11-2014 12:26 AM

Yeah that's true. :)

Black Snow 09-12-2014 08:49 AM

Quote:

Originally Posted by ozzy47 (Post 2514507)
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:

    if ($this->template == 'OLD TEMPLATE NAME')
    {
        
$this->template 'NEW TEMPLATE NAME';
    } 


It didn't work. It doesnt do anything.

ozzy47 09-12-2014 09:11 AM

Sure it does, I have used this for a couple of years now. Did you make sure to add the correct template names?

Black Snow 09-12-2014 11:11 AM

Quote:

Originally Posted by ozzy47 (Post 2514817)
Sure it does, I have used this for a couple of years now. Did you make sure to add the correct template names?

Yup. I made the plugin:
Code:

    if ($this->template == 'post_thanks_box')
    {
        $this->template = 'custom_post_thanks_box';
    }

Made a new template called "custom_post_thanks_box" and put my code in it.


All times are GMT. The time now is 05:56 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
  • Page Generation 0.01280 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (3)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete