View Single Post
  #15  
Old 08-25-2013, 09:00 AM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@Peter Walker: This simply doesn't work. At the time of my last post I had gotten a very simple template bb code to work (it just made the font color red). I thought it would then be a simple matter to place conditionals in the template to change the output html for different user groups but that doesn't work for bb codes, template or not. So my project here has only the modest advantage of creating a bb code that's easy to modify in the style manager but so far has the disadvantage of not having a button in the editor. So I'm afraid you're stuck with the system you have in place now.

One thing you may wish to consider is a new page for your videos instead of posting them in a thread. A good coder (and there are plenty here) could probably put it together with little effort for a modest payment. I would do it but I can no longer use vB3, as I mentioned above. You would have to have an array associating video titles with their urls so you don't have a query string value equal to the url and therefore visible to members. Every time you make a new video available you would have to edit in a title => url pair into the array and then just post a new link in a thread.

--------------- Added [DATE]1377425821[/DATE] at [TIME]1377425821[/TIME] ---------------

For anyone interested here's a bare bones example of a template bb code. You can develop it further by reading through includes/class_bbcode.php and vb/ckeditor.php and experimenting around.

plugin for [premium] tags

Plugin Code for bbcode_fetch_tags:

Code:
/**
* Hook: bbcode_fetch_tags, includes/class_bbcode.php line 3719
* See function handle_external() line 1751
*/

$tag_list['no_option']['premium'] = array(
	'callback'  => 'handle_external',
	'external_callback' => 'handle_bbcode_premium'
);

function handle_bbcode_premium($registry, $value)
{
	$templater = vB_Template::create('bbcode_premium');
		$templater->register('value', $value);
	return $templater->render();
}
Template bbcode_premium:

HTML Code:
<span style="color:red;">{vb:raw value}</span>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01119 seconds
  • Memory Usage 1,769KB
  • 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
  • (1)bbcode_code
  • (1)bbcode_html
  • (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