Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 04-26-2014, 09:03 AM
XiTCLUB XiTCLUB is offline
 
Join Date: Jan 2010
Location: Lahore, Pakistan
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Zachery View Post
Please enlighten me, why can't you just update the video bbcode template?
Because it is not allowing me to run PHP directly into template to get meta data ofvideo from dailymotion API

I wanted to accomplish this thing

Code:
<div itemprop="video" itemscope itemtype="http://schema.org/VideoObject">
  <h2>Video: <span itemprop="name">Title</span></h2>
  <meta itemprop="duration" content="T1M33S" />
  <meta itemprop="thumbnailUrl" content="thumbnail.jpg" />
  <meta itemprop="contentURL" content="http://www.example.com/video123.flv" />
  <meta itemprop="embedURL" content="http://www.example.com/videoplayer.swf?video=123" />
  <meta itemprop="uploadDate" content="2011-07-05T08:00:00+08:00" />
  <meta itemprop="expires" content="2012-01-30T19:00:00+08:00" />
  <object ...>
    <param ...>
    <embed type="application/x-shockwave-flash" ...>
  </object>
  <span itemprop="description">Video description</span>
</div>
And now tell me how its possible by just updating videobb_code template ??

and if you help me out achieving this thing it can help the community very much and i will surely share the code with the community, so their video content get indexed just like youtube, dailymotion.
thumbnail shows alongside the search results so forum owners can get more traffic from their video content
Reply With Quote
  #12  
Old 04-26-2014, 09:23 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, you could try this: use a plugin on hook bbcode_create to replace the video handling function that's in $this->tag_list with your own function. Then have your function check for the provider option of "dailymotion", and do your special handing (return whatever html you want), and if it's not "dailymotion", call the existing function (or copy the code from the existing function). Or I suppose in your case you could just register your extra information to the bbcode_video template as you are doing in your plugin, then call the existing code.

See includes/class_bbcode.php, function vB_BbcodeParser() and function handle_bbcode_video().

I believe vB_BbcodeParser() is the constructor for a base class, so you may want to check the actual class before replacing the video handling function, so that the classes in class_bbcode_alt.php will still work as the default (for instance, when a text-only version is being rendered).
Reply With Quote
  #13  
Old 04-26-2014, 09:31 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could also look at my "Private Message Quote Formatting" mod (the bbcode_create plugin code) for an example. In that case I was doing it only for private messages, so of course you wouldn't want the check for 'private', but otherwise it's basically what I tried to describe in the post above.
Reply With Quote
  #14  
Old 04-26-2014, 04:38 PM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Zachery View Post
You can't use PHP in the bbcode templates, or any templates for that matter.
For using PHP in BBCodes, this may work for:
https://vborg.vbsupport.ru/showthread.php?t=264896
Reply With Quote
  #15  
Old 04-28-2014, 07:01 AM
XiTCLUB XiTCLUB is offline
 
Join Date: Jan 2010
Location: Lahore, Pakistan
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
OK, you could try this: use a plugin on hook bbcode_create to replace the video handling function that's in $this->tag_list with your own function. Then have your function check for the provider option of "dailymotion", and do your special handing (return whatever html you want), and if it's not "dailymotion", call the existing function (or copy the code from the existing function). Or I suppose in your case you could just register your extra information to the bbcode_video template as you are doing in your plugin, then call the existing code.

See includes/class_bbcode.php, function vB_BbcodeParser() and function handle_bbcode_video().

I believe vB_BbcodeParser() is the constructor for a base class, so you may want to check the actual class before replacing the video handling function, so that the classes in class_bbcode_alt.php will still work as the default (for instance, when a text-only version is being rendered).
Hi, Thank for your kind support i have edited the file "class_bbcode.php" and it solved my problem
Reply With Quote
  #16  
Old 04-28-2014, 08:18 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by XiTCLUB View Post
Hi, Thank for your kind support i have edited the file "class_bbcode.php" and it solved my problem
...or you could do that. I guess I'm used to thinking of how to do things without edits.

Anyway, glad you solved it.
Reply With Quote
  #17  
Old 04-28-2014, 11:33 AM
XiTCLUB XiTCLUB is offline
 
Join Date: Jan 2010
Location: Lahore, Pakistan
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
...or you could do that. I guess I'm used to thinking of how to do things without edits.

Anyway, glad you solved it.
Yup i tried many ways but as i am not an expert PHP programer i have managed to solve the problem at my expertise level.
I will share the code once i got expected results in Google search
Reply With Quote
Reply


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 04:55 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.03751 seconds
  • Memory Usage 2,230KB
  • 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
  • (5)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
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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