Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 08-22-2013, 09:22 AM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There's still the JavaScript method I suggested earlier. I have a product (which I haven't published) that does something like what you want. I could make some changes and get it to work if you could do the debugging. The only drawback is that a member could use a developer tool like FireBug to see the video, but most people wouldn't even think to check out how it works and I suspect even many of the people who play with coding here don't know how to use a developer tool.

I have a very complicated bb code in the works and I would like to look into how to use a template for it. If I ever figure it out I'll PM you .

EDIT: I think I can remove the video for non-premium members to prevent them from viewing it.
Reply With Quote
  #12  
Old 08-24-2013, 02:59 PM
Peter Walker Peter Walker is offline
 
Join Date: Oct 2005
Location: Germany
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks. For the interim I am working on a simple solution.

The actual videos have been placed in posts on a hidden sub forum where only premium members have viewing rights. From there I copy the link for an individual post (#1).

My Premium Video forum is set to allow all members to view posts and that is where I have put my description of the video with an image of the video to click on. I then add the link, to that hidden video, to that image.

This allows everyone to read the description and when a premium member clicks on the image, a new window (or tab) opens showing the one post containing the video and a description. One more click on the video and it starts. When the member is finished, they just close the window.

Non-premium members who click on the image are shown an error message inviting them to buy a subscription.

I know this is all a bit clumsy, but it is the best I could do under the current circumstances until you guys can think of a better way.

If any of the coders here want to see what I have done in action, pm me and I will provide you with a dummy account on my forum.

Regards

Peter
Reply With Quote
  #13  
Old 08-24-2013, 03:41 PM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm interested in this subject because I have a very complicated bb code I'm working on and I would like to use a template instead of creating all the html with JavaScsript. So far, I have the basic idea working, I'm stuck on how to get a button working in the editor. For now you would have to manually type in the tag but that shouldn't be a problem. I'll see if I can get a crude version later today (US time).

What is the usergroup id of your premium members?
Reply With Quote
  #14  
Old 08-24-2013, 10:49 PM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Interesting @Nerbert, I am interested to see how you make out using a template. I haven't explored the bbcode code since on the board I oversee we don't use anything more than the basic set.

But something like that might be interesting on my daughters small board. I am currently adding usergroup permissions to smilies right now so I started exploring class_bbcode.php and decided I might take a stab at adding usergroup permissions for bbcodes. As we all know setting permissions is not the problem, it all comes down to the presentation aspect.

Of course when I get done with the forums, I am sure I will run into different problems getting it to work on the CMS and blog. It's never that easy.
Reply With Quote
  #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
  #16  
Old 08-25-2013, 12:38 PM
Peter Walker Peter Walker is offline
 
Join Date: Oct 2005
Location: Germany
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nerbert View Post
I'm interested in this subject because I have a very complicated bb code I'm working on and I would like to use a template instead of creating all the html with JavaScsript. So far, I have the basic idea working, I'm stuck on how to get a button working in the editor. For now you would have to manually type in the tag but that shouldn't be a problem. I'll see if I can get a crude version later today (US time).

What is the usergroup id of your premium members?
Usergroup id is 30.

Thanks for all your efforts and I can see it is not an easy task. The system I put in place with linking to a post in a sub-forum works so I will just live with that.

Regards

Peter
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:47 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06967 seconds
  • Memory Usage 2,218KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete