vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   I have two questions? (https://vborg.vbsupport.ru/showthread.php?t=300702)

Easy5s.net 08-01-2013 08:59 AM

I have two questions?
 
1) How to put {vb:rawphrase xxx} in file xxx.js

2) How to count the total number of unread topics in a certain box?
Example: forumid = 10.

kh99 08-02-2013 06:36 PM

Quote:

Originally Posted by Easy5s.net (Post 2436481)
1) How to put {vb:rawphrase xxx} in file xxx.js


If you look at the headinclude template, you can see where a number of js variables are defined using template variable. You can create one of your own using a phrase, then use the variable in xxx.js (assuming it's included after the headinclude code). You could use the headinclude_javascript template hook to include your code, and maybe create a plugin using hook parse_templates and code like:
Code:

global $template_hook;

$template_hook['headinclude_javascript'] .= '<script type="text/javascript">
<!--
PHRASE_XXX = "' . addcslashes($vbphrase['xxx'], '"\\')  . '";
</script>';


Then use PHRASE_XXX in xxx.js. The phrase has to be a type that's loaded on the page that you're displaying (if it's a phrase you're creating and your not sure, use GLOBAL for the type).

I haven't tried the above code at all so it's possible there are typos or other errors.

I don't know the answer to your second question.


All times are GMT. The time now is 09:23 AM.

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.02554 seconds
  • Memory Usage 1,712KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete