Thread: New Posting Features - [YUI] VSQ - Spoiler
View Single Post
  #81  
Old 02-09-2012, 02:34 PM
ozione ozione is offline
 
Join Date: Nov 2010
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this one is truly awesome.

i've managed to get it work by combining the next tips:

1) upload files per instructions but pay attention and upload images subfolders correctly to an active stlyle's image folder.
my example:
Code:
forum_root/images/avenger_blue
2) update / replace code provided by HoSStiA + modify a path of the style you're using (my example within the code). do this with the next steps:
a) open Plugin Manager and search for BBCode [spoiler]: button
b) click on edit and change the hook to editor_toolbar_start
c) replace the Plugin PHP Code with a new content:
d) replace the style location "$.../imgdir_editor/spoiler.gif"

Code:
if ($show['editor_toolbar'])
{
    $imgdir_editor = vB_Template_Runtime::fetchStyleVar('imgdir_editor');
        $vbulletin->bbcodecache[] = array(
        'buttonimage' => "$avenger_blue/imgdir_editor/spoiler.gif",
        'twoparams' => 0,
        'bbcodetag' => 'spoiler',
        'tag' => 'Spoiler',
                'title' => 'Spoiler'
    );

    $vbulletin->bbcodecache[] = array(
        'buttonimage' => "$avenger_blue/imgdir_editor/spoiler_a.gif",
        'twoparams' => 1,
        'bbcodetag' => 'spoiler',
        'tag' => 'Spoiler +',
                'title' => 'Spoiler +'
    );
}
by now, the function should work fine manualy (with tags)

3) to enable button use fatal1980's tip by adding a custom BB Code. perform this with these steps:
a) AdminCP -> Custom BB Codes -> Add New BB Code
b) insert next values:
Title:
Code:
Spoilers
BB Code Tag Name:
Code:
spoiler
(or whatever you want - i used spoiler)
Replacement:
Code:
<div class="spoiler">
<h2>Spoiler</h2>
<div class="hidden">{param}</div>
</div>
Example:
Code:
[spoiler]this is a test[/spoiler]
Button Image:
previously used image path (within the style's image subfolders). i use another image as the plus sign is not as clear in the meaning. my example:


everything should be working just fine now. you can play a bit more with the css to remove the bright backgrounds. to perform this follow the next step.

4) tweaking css
a) the easiest way to get to the proper css is to find it with the help of the search option
b) AdminCP -> Styles & Templates -> Search in Templates
c) use the search string
Code:
vsq_spoiler
d) you should get a direct result = vsq_spoiler.css, double click it and edit per need

it works for me with VB 4.1.9
button:

working:



i hope it helps!
:up:
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01187 seconds
  • Memory Usage 1,781KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete