Guest User

Untitled

a guest
Apr 12th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.73 KB | None | 0 0
  1. <div class=”td-page-options-tab-wrap”>
  2. <div class=”td-page-options-tab td-page-options-tab-active” data-panel-class=”td-post-option-general”>General</div>
  3. </div>
  4.  
  5. <div class=”td-meta-box-inside”>
  6.  
  7. <?php if( current_user_can(‘author’) ) { ?>
  8. <!– post option general –>
  9. <div class=”td-page-option-panel td-post-option-general td-page-option-panel-active”>
  10.  
  11. <div class=”td-meta-box-row”>
  12. <span class=”td-page-o-custom-label”>
  13. Post template:
  14. <?php
  15. td_util::tooltip_html(‘
  16. <h3>Post templates:</h3>
  17. <p>When this is set to “From panel” the theme will load the template that is set in the panel.</p>
  18.  
  19. If set, this setting overrides the Theme panel setting from <i>Post settings > Default post template</i>
  20. ‘, ‘right’)
  21. ?>
  22. </span>
  23. <div class=”td-inline-block-wrap”>
  24. <?php
  25. echo td_panel_generator::visual_select_o(array(
  26. ‘ds’ => ‘td_post_theme_settings’,
  27. ‘item_id’ => ”,
  28. ‘option_id’ => ‘td_post_template’,
  29. ‘values’ => td_api_single_template::_helper_td_global_list_to_metaboxes(),
  30. ‘selected_value’ => $mb->get_the_value(‘td_post_template’)
  31. ));
  32. ?>
  33. </div>
  34. </div>
  35.  
  36. <!– primary category –>
  37. <div class=”td-meta-box-row”>
  38. <span class=”td-page-o-custom-label”>
  39. Primary category:
  40. <?php
  41. td_util::tooltip_html(‘
  42. <h3>Primary category explained:</h3>
  43. <p>In ‘. TD_THEME_NAME . ‘ theme each post has a <i>Primary category</i> and all the settings from that category will be trasfered to the post. The Primary category will
  44. also be used as a category label that appears on the thumbs and the category breadcrumb</p>
  45.  
  46. <p>Here are the settings that are inherited from the <i>Primary category</i>: Custom sidebars, Sidebar position and Background</p>
  47. <p>How the Primary category is picked</p>
  48.  
  49. Manually – If you select it from this box, this post will inherit all the settings form the <i>Primary category</i>.
  50. If the post has only one category – that will be the <i>Primary category</i>
  51. If the post has multiple categories and no manual Primary category, the theme will pick the first category from the categories of this post ordered alphabetically
  52. ‘, ‘right’)
  53. ?>
  54. </span>
  55. <?php $mb->the_field(‘td_primary_cat’); ?>
  56. <div class=”td-select-style-overwrite td-inline-block-wrap”>
  57. <select name=”<?php $mb->the_name(); ?>” class=”td-panel-dropdown”>
  58. <option value=””>Auto select a category</option>
  59. <?php
  60. $td_current_categories = td_util::get_category2id_array(false);
  61.  
  62. //print_r($td_current_categories);
  63. //die;
  64. foreach ($td_current_categories as $td_category => $td_category_id) {
  65. ?>
  66. <option value=”<?php echo $td_category_id?>”<?php $mb->the_select_state($td_category_id); ?>><?php echo $td_category?></option>
  67. <?php
  68. }
  69. ?>
  70. </select>
  71. </div>
  72. <span class=”td-page-o-info”>If the posts has multiple categories, the one selected here will be used for settings and it appears in the category labels.</span>
  73. </div>
  74.  
  75. <!– sidebar position –>
  76. <div class=”td-meta-box-row”>
  77. <span class=”td-page-o-custom-label”>
  78. Sidebar position:
  79. <?php
  80. td_util::tooltip_html(‘
  81. <h3>Sidebar position:</h3>
  82. <p>For best results and easy to maintain websites we recommend that you set the sidebar from the <i>Primary category</i> of this post. That way if you have
  83. multiple posts, when you change the category settings all the posts will match the category</p>
  84.  
  85. This setting overrides the Theme panel setting from <i>Post settings > Default post template</i> and the <i>Category settings</i>
  86. On default – the post will look at the primary category settings and it will try to get the position form there. If the primary category
  87. does not have a custom sidebar position, the post will load the setting from <i>Template settings > Blog and posts template</i>
  88. ‘, ‘right’)
  89. ?>
  90. </span>
  91. <?php
  92. echo td_panel_generator::visual_select_o(array(
  93. ‘ds’ => ‘td_post_theme_settings’,
  94. ‘item_id’ => ”,
  95. ‘option_id’ => ‘td_sidebar_position’,
  96. ‘values’ => array(
  97. array(‘text’ => ”, ‘title’ => ‘Sidebar Default’, ‘val’ => ”, ‘class’ => ‘td-sidebar-position-default’, ‘img’ => get_template_directory_uri() . ‘/images/panel/sidebar/sidebar-default.png’),
  98. array(‘text’ => ”, ‘title’ => ‘Sidebar Left’, ‘val’ => ‘sidebar_left’, ‘class’ => ‘td-sidebar-position-left’, ‘img’ => get_template_directory_uri() . ‘/images/panel/sidebar/sidebar-left.png’),
  99. array(‘text’ => ”, ‘title’ => ‘No Sidebar’, ‘val’ => ‘no_sidebar’, ‘class’ => ‘td-no-sidebar’, ‘img’ => get_template_directory_uri() . ‘/images/panel/sidebar/sidebar-full.png’),
  100. array(‘text’ => ”, ‘title’ => ‘Sidebar Right’, ‘val’ => ‘sidebar_right’, ‘class’ => ‘td-sidebar-position-right’,’img’ => get_template_directory_uri() . ‘/images/panel/sidebar/sidebar-right.png’)
  101. ),
  102. ‘selected_value’ => $mb->get_the_value(‘td_sidebar_position’)
  103. ));
  104. ?>
  105. </div>
  106.  
  107. <!– custom sidebar –>
  108. <div class=”td-meta-box-row”>
  109. <span class=”td-page-o-custom-label”>
  110. Custom sidebar:
  111. <?php
  112. td_util::tooltip_html(‘
  113. <h3>Custom sidebar:</h3>
  114. <p>For best results and easy to maintain websites we recommend that you set the sidebar from the <i>Primary category</i> of this post. That way if you have
  115. multiple posts, when you change the category settings all the posts will match the category</p>
  116.  
  117. This setting overrides the Theme panel setting from <i>Post settings > Default post template</i> and the <i>Category settings</i>
  118. On default – the post will look at the primary category settings and it will try to get the sidebar form there. If the primary category
  119. does not have a custom sidebar, the post will load the setting from <i>Template settings > Blog and posts template</i>
  120. ‘, ‘right’)
  121. ?>
  122. </span>
  123. <?php
  124. echo td_panel_generator::sidebar_pulldown(array(
  125. ‘ds’ => ‘td_post_theme_settings’,
  126. ‘item_id’ => ”,
  127. ‘option_id’ => ‘td_sidebar’,
  128. ‘selected_value’ => $mb->get_the_value(‘td_sidebar’)
  129. ));
  130. ?>
  131. </div>
  132.  
  133. <script>
  134. $(function () {
  135. $(“.textBox”).hide();
  136. $(‘a.clickMe’).click(function () {
  137. var target = $(this).nextAll(‘div.textBox:first’);
  138. $(“.textBox”).not(target).hide();
  139. target.toggle();
  140. });
  141. });
  142. </script>
  143. More Options
  144. <br />
  145. <div class=”textBox”>
  146. <div class=”td-meta-box-row”>
  147. <?php $mb->the_field(‘td_subtitle’); ?>
  148. <span class=”td-page-o-custom-label td_text_area_label”>Subtitle:</span>
  149. <textarea name=”<?php $mb->the_name(); ?>” class=”td-textarea-subtitle”><?php $mb->the_value(); ?></textarea>
  150. <span class=”td-page-o-info”>This text will appear under the title</span>
  151. </div>
  152.  
  153. <div class=”td-meta-box-row”>
  154. <?php $mb->the_field(‘td_quote_on_blocks’); ?>
  155. <span class=”td-page-o-custom-label”>Quote on blocks:</span>
  156. <input class=”td-input-text-post-settings” type=”text” name=”<?php $mb->the_name(); ?>” value=”<?php $mb->the_value(); ?>”/>
  157. <span class=”td-page-o-info”>Show a quote (only when this article shows up in blocks that support quote and only on blocks that are on one column)</span>
  158. </div>
  159.  
  160. <div class=”td-meta-box-row”>
  161. <?php $mb->the_field(‘td_source’); ?>
  162. <span class=”td-page-o-custom-label”>Source name:</span>
  163. <input class=”td-input-text-post-settings” type=”text” name=”<?php $mb->the_name(); ?>” value=”<?php $mb->the_value(); ?>”/>
  164. <span class=”td-page-o-info”>This name will appear at the end of the article in the “source” spot on single posts</span>
  165. </div>
  166.  
  167. <div class=”td-meta-box-row”>
  168. <?php $mb->the_field(‘td_source_url’); ?>
  169. <span class=”td-page-o-custom-label”>Source url:</span>
  170. <input class=”td-input-text-post-settings” type=”text” name=”<?php $mb->the_name(); ?>” value=”<?php $mb->the_value(); ?>”/>
  171. <span class=”td-page-o-info”>Full url to the source</span>
  172. </div>
  173.  
  174. <div class=”td-meta-box-row”>
  175. <?php $mb->the_field(‘td_via’); ?>
  176. <span class=”td-page-o-custom-label”>Via name:</span>
  177. <input class=”td-input-text-post-settings” type=”text” name=”<?php $mb->the_name(); ?>” value=”<?php $mb->the_value(); ?>”/>
  178. <span class=”td-page-o-info”>Via (your source) name, this will appear at the end of the article in the “via” spot</span>
  179.  
  180. </div>
  181.  
  182. <div class=”td-meta-box-row”>
  183. <?php $mb->the_field(‘td_via_url’); ?>
  184. <span class=”td-page-o-custom-label”>Via url:</span>
  185. <input class=”td-input-text-post-settings” type=”text” name=”<?php $mb->the_name(); ?>” value=”<?php $mb->the_value(); ?>”/>
  186. <span class=”td-page-o-info”>Full url for via</span>
  187. </div>
  188. </div>
  189.  
  190. </div> <!– /post option general –>
  191. <?php } ?>
  192. <?php if( current_user_can(‘editor’) || current_user_can(‘administrator’) ) { ?>
  193. <div class=”td-meta-box-row”>
  194. <span class=”td-page-o-custom-label”>
  195. Post template:
  196. <?php
  197. td_util::tooltip_html(‘
  198. <h3>Post templates:</h3>
  199. <p>When this is set to “From panel” the theme will load the template that is set in the panel.</p>
  200.  
  201. If set, this setting overrides the Theme panel setting from <i>Post settings > Default post template</i>
  202. ‘, ‘right’)
  203. ?>
  204. </span>
  205. <div class=”td-inline-block-wrap”>
  206. <?php
  207. echo td_panel_generator::visual_select_o(array(
  208. ‘ds’ => ‘td_post_theme_settings’,
  209. ‘item_id’ => ”,
  210. ‘option_id’ => ‘td_post_template’,
  211. ‘values’ => td_api_single_template::_helper_td_global_list_to_metaboxes(),
  212. ‘selected_value’ => $mb->get_the_value(‘td_post_template’)
  213. ));
  214. ?>
  215. </div>
  216. </div>
  217.  
  218. <!– primary category –>
  219. <div class=”td-meta-box-row”>
  220. <span class=”td-page-o-custom-label”>
  221. Primary category:
  222. <?php
  223. td_util::tooltip_html(‘
  224. <h3>Primary category explained:</h3>
  225. <p>In ‘. TD_THEME_NAME . ‘ theme each post has a <i>Primary category</i> and all the settings from that category will be trasfered to the post. The Primary category will
  226. also be used as a category label that appears on the thumbs and the category breadcrumb</p>
  227.  
  228. <p>Here are the settings that are inherited from the <i>Primary category</i>: Custom sidebars, Sidebar position and Background</p>
  229. <p>How the Primary category is picked</p>
  230.  
  231. Manually – If you select it from this box, this post will inherit all the settings form the <i>Primary category</i>.
  232. If the post has only one category – that will be the <i>Primary category</i>
  233. If the post has multiple categories and no manual Primary category, the theme will pick the first category from the categories of this post ordered alphabetically
  234. ‘, ‘right’)
  235. ?>
  236. </span>
  237. <?php $mb->the_field(‘td_primary_cat’); ?>
  238. <div class=”td-select-style-overwrite td-inline-block-wrap”>
  239. <select name=”<?php $mb->the_name(); ?>” class=”td-panel-dropdown”>
  240. <option value=””>Auto select a category</option>
  241. <?php
  242. $td_current_categories = td_util::get_category2id_array(false);
  243.  
  244. //print_r($td_current_categories);
  245. //die;
  246. foreach ($td_current_categories as $td_category => $td_category_id) {
  247. ?>
  248. <option value=”<?php echo $td_category_id?>”<?php $mb->the_select_state($td_category_id); ?>><?php echo $td_category?></option>
  249. <?php
  250. }
  251. ?>
  252. </select>
  253. </div>
  254. <span class=”td-page-o-info”>If the posts has multiple categories, the one selected here will be used for settings and it appears in the category labels.</span>
  255. </div>
  256.  
  257. <!– sidebar position –>
  258. <div class=”td-meta-box-row”>
  259. <span class=”td-page-o-custom-label”>
  260. Sidebar position:
  261. <?php
  262. td_util::tooltip_html(‘
  263. <h3>Sidebar position:</h3>
  264. <p>For best results and easy to maintain websites we recommend that you set the sidebar from the <i>Primary category</i> of this post. That way if you have
  265. multiple posts, when you change the category settings all the posts will match the category</p>
  266.  
  267. This setting overrides the Theme panel setting from <i>Post settings > Default post template</i> and the <i>Category settings</i>
  268. On default – the post will look at the primary category settings and it will try to get the position form there. If the primary category
  269. does not have a custom sidebar position, the post will load the setting from <i>Template settings > Blog and posts template</i>
  270. ‘, ‘right’)
  271. ?>
  272. </span>
  273. <?php
  274. echo td_panel_generator::visual_select_o(array(
  275. ‘ds’ => ‘td_post_theme_settings’,
  276. ‘item_id’ => ”,
  277. ‘option_id’ => ‘td_sidebar_position’,
  278. ‘values’ => array(
  279. array(‘text’ => ”, ‘title’ => ‘Sidebar Default’, ‘val’ => ”, ‘class’ => ‘td-sidebar-position-default’, ‘img’ => get_template_directory_uri() . ‘/images/panel/sidebar/sidebar-default.png’),
  280. array(‘text’ => ”, ‘title’ => ‘Sidebar Left’, ‘val’ => ‘sidebar_left’, ‘class’ => ‘td-sidebar-position-left’, ‘img’ => get_template_directory_uri() . ‘/images/panel/sidebar/sidebar-left.png’),
  281. array(‘text’ => ”, ‘title’ => ‘No Sidebar’, ‘val’ => ‘no_sidebar’, ‘class’ => ‘td-no-sidebar’, ‘img’ => get_template_directory_uri() . ‘/images/panel/sidebar/sidebar-full.png’),
  282. array(‘text’ => ”, ‘title’ => ‘Sidebar Right’, ‘val’ => ‘sidebar_right’, ‘class’ => ‘td-sidebar-position-right’,’img’ => get_template_directory_uri() . ‘/images/panel/sidebar/sidebar-right.png’)
  283. ),
  284. ‘selected_value’ => $mb->get_the_value(‘td_sidebar_position’)
  285. ));
  286. ?>
  287. </div>
  288.  
  289. <!– custom sidebar –>
  290. <div class=”td-meta-box-row”>
  291. <span class=”td-page-o-custom-label”>
  292. Custom sidebar:
  293. <?php
  294. td_util::tooltip_html(‘
  295. <h3>Custom sidebar:</h3>
  296. <p>For best results and easy to maintain websites we recommend that you set the sidebar from the <i>Primary category</i> of this post. That way if you have
  297. multiple posts, when you change the category settings all the posts will match the category</p>
  298.  
  299. This setting overrides the Theme panel setting from <i>Post settings > Default post template</i> and the <i>Category settings</i>
  300. On default – the post will look at the primary category settings and it will try to get the sidebar form there. If the primary category
  301. does not have a custom sidebar, the post will load the setting from <i>Template settings > Blog and posts template</i>
  302. ‘, ‘right’)
  303. ?>
  304. </span>
  305. <?php
  306. echo td_panel_generator::sidebar_pulldown(array(
  307. ‘ds’ => ‘td_post_theme_settings’,
  308. ‘item_id’ => ”,
  309. ‘option_id’ => ‘td_sidebar’,
  310. ‘selected_value’ => $mb->get_the_value(‘td_sidebar’)
  311. ));
  312. ?>
  313. </div>
  314.  
  315. <div class=”td-meta-box-row”>
  316. <?php $mb->the_field(‘td_subtitle’); ?>
  317. <span class=”td-page-o-custom-label td_text_area_label”>Subtitle:</span>
  318. <textarea name=”<?php $mb->the_name(); ?>” class=”td-textarea-subtitle”><?php $mb->the_value(); ?></textarea>
  319. <span class=”td-page-o-info”>This text will appear under the title</span>
  320. </div>
  321.  
  322. <div class=”td-meta-box-row”>
  323. <?php $mb->the_field(‘td_quote_on_blocks’); ?>
  324. <span class=”td-page-o-custom-label”>Quote on blocks:</span>
  325. <input class=”td-input-text-post-settings” type=”text” name=”<?php $mb->the_name(); ?>” value=”<?php $mb->the_value(); ?>”/>
  326. <span class=”td-page-o-info”>Show a quote (only when this article shows up in blocks that support quote and only on blocks that are on one column)</span>
  327. </div>
  328.  
  329. <div class=”td-meta-box-row”>
  330. <?php $mb->the_field(‘td_source’); ?>
  331. <span class=”td-page-o-custom-label”>Source name:</span>
  332. <input class=”td-input-text-post-settings” type=”text” name=”<?php $mb->the_name(); ?>” value=”<?php $mb->the_value(); ?>”/>
  333. <span class=”td-page-o-info”>This name will appear at the end of the article in the “source” spot on single posts</span>
  334. </div>
  335.  
  336. <div class=”td-meta-box-row”>
  337. <?php $mb->the_field(‘td_source_url’); ?>
  338. <span class=”td-page-o-custom-label”>Source url:</span>
  339. <input class=”td-input-text-post-settings” type=”text” name=”<?php $mb->the_name(); ?>” value=”<?php $mb->the_value(); ?>”/>
  340. <span class=”td-page-o-info”>Full url to the source</span>
  341. </div>
  342.  
  343. <div class=”td-meta-box-row”>
  344. <?php $mb->the_field(‘td_via’); ?>
  345. <span class=”td-page-o-custom-label”>Via name:</span>
  346. <input class=”td-input-text-post-settings” type=”text” name=”<?php $mb->the_name(); ?>” value=”<?php $mb->the_value(); ?>”/>
  347. <span class=”td-page-o-info”>Via (your source) name, this will appear at the end of the article in the “via” spot</span>
  348.  
  349. </div>
  350.  
  351. <div class=”td-meta-box-row”>
  352. <?php $mb->the_field(‘td_via_url’); ?>
  353. <span class=”td-page-o-custom-label”>Via url:</span>
  354. <input class=”td-input-text-post-settings” type=”text” name=”<?php $mb->the_name(); ?>” value=”<?php $mb->the_value(); ?>”/>
  355. <span class=”td-page-o-info”>Full url for via</span>
  356. </div>
  357.  
  358. </div> <!– /post option general –>
  359.  
  360. <!– post option smart list –>
  361. <div class=”td-page-option-panel td-page-option-post-smart-list”>
  362. <!– smart list –>
  363. <div class=”td-meta-box-row”>
  364. <span class=”td-page-o-custom-label”>
  365. Use a smart list? :
  366. <?php
  367. td_util::tooltip_html(‘
  368. <h3>Smart Lists:</h3>
  369. <p>Using <i>Smart lists</i> you can transform your article in a list of items. Each item must have a title, an image and a description</p>
  370. <p>How to make an item:</p>
  371.  
  372. add a text wrapped in H3 – this will be the title of the item
  373. add any picture from the media library
  374. in a new paragraph below the picture, add some text
  375. <i>repeat the last 3 steps for each item that you want to add</i>
  376. <p>The system will use the H3 from the tiles to split your article and make each individual slide or numbered item</p>
  377. ‘, ‘right’)
  378. ?>
  379. </span>
  380.  
  381. <div class=”td-inline-block-wrap”>
  382. <?php
  383. echo td_panel_generator::visual_select_o(array(
  384. ‘ds’ => ‘td_post_theme_settings’,
  385. ‘item_id’ => ”,
  386. ‘option_id’ => ‘smart_list_template’,
  387. ‘values’ => td_api_smart_list::_helper_td_smart_list_api_to_panel_values(),
  388. ‘selected_value’ => $mb->get_the_value(‘smart_list_template’)
  389. ));
  390. ?>
  391. </div>
  392. </div>
  393.  
  394. <!– title tag –>
  395. <div class=”td-meta-box-row”>
  396. <span class=”td-page-o-custom-label”>
  397. Title tags:
  398. <?php
  399. td_util::tooltip_html(‘
  400. <h3>Smart lists title tags:</h3>
  401. <p>Customize what tag is used for <i>Title</i> lookup. This setting is useful if for example, you already have articles that use H2 for items</p>
  402. ‘, ‘right’)
  403. ?>
  404. </span>
  405. <?php $mb->the_field(‘td_smart_list_h’); ?>
  406. <div class=”td-select-style-overwrite td-inline-block-wrap”>
  407. <select name=”<?php $mb->the_name(); ?>” class=”td-panel-dropdown”>
  408. <option value=”h1″<?php $mb->the_select_state(‘h1’); ?>>Heading 1 ( H1 tag )</option>
  409. <option value=”h2″<?php $mb->the_select_state(‘h2’); ?>>Heading 2 ( H2 tag )</option>
  410. <option value=”” <?php $mb->the_select_state(”); ?>>Heading 3 ( H3 tag )</option>
  411. <option value=”h4″<?php $mb->the_select_state(‘h4’); ?>>Heading 4 ( H4 tag )</option>
  412. <option value=”h5″<?php $mb->the_select_state(‘h5’); ?>>Heading 5 ( H5 tag )</option>
  413. <option value=”h6″<?php $mb->the_select_state(‘h6’); ?>>Heading 6 ( H6 tag )</option>
  414. </select>
  415. </div>
  416. <span class=”td-page-o-info”>The tags that wrap the title of each Smart List item.</span>
  417. </div>
  418.  
  419. <!– smart list numbering –>
  420. <div class=”td-meta-box-row”>
  421. <span class=”td-page-o-custom-label”>
  422. Smart list numbering:
  423. <?php
  424. td_util::tooltip(‘Change the sort order of the items’, ‘right’)
  425. ?>
  426. </span>
  427. <?php $mb->the_field(‘td_smart_list_order’); ?>
  428. <div class=”td-select-style-overwrite td-inline-block-wrap”>
  429. <select name=”<?php $mb->the_name(); ?>” class=”td-panel-dropdown”>
  430. <option value=””<?php $mb->the_select_state(”); ?>>Descending (ex: 3, 2, 1)</option>
  431. <option value=”asc_1″ <?php $mb->the_select_state(‘asc_1’); ?>>Ascending (ex: 1, 2, 3)</option>
  432. </select>
  433. </div>
  434. <span class=”td-page-o-info”>The smart lists put a number on each item, select the counting method.</span>
  435. </div>
  436. </div> <!– /post option smart list –>
  437.  
  438. <!– post option review –>
  439. <div class=”td-page-option-panel td-page-option-post-review”>
  440.  
  441. <div class=”td-meta-box-row”>
  442. <span class=”td-page-o-custom-label”>Is this a product review?</span>
  443. <?php $mb->the_field(‘has_review’); ?>
  444. <div class=”td-select-style-overwrite td-inline-block-wrap”>
  445. <select id=”reviewSelector” name=”<?php $mb->the_name(); ?>” class=”td-panel-dropdown”>
  446. <option value=””>No</option>
  447. <option value=”rate_stars”<?php $mb->the_select_state(‘rate_stars’); ?>>Stars</option>
  448. <option value=”rate_percent”<?php $mb->the_select_state(‘rate_percent’); ?>>Percentages</option>
  449. <option value=”rate_point”<?php $mb->the_select_state(‘rate_point’); ?>>Points</option>
  450. </select>
  451. </div>
  452. </div>
  453.  
  454. <div class=”rating_type rate_Stars”>
  455. <p>
  456. Add star ratings for this product:<br>
  457. </p>
  458.  
  459. <?php while($mb->have_fields_and_multi(‘p_review_stars’)): ?>
  460. <div class=”td-meta-box-row”>
  461. <?php $mb->the_group_open(); ?>
  462.  
  463. <?php $mb->the_field(‘desc’); ?>
  464. <span class=”td-page-o-custom-label”>Feature name:</span>
  465. <input style=”width: 200px;” type=”text” name=”<?php $mb->the_name(); ?>” value=”<?php $mb->the_value(); ?>”/>
  466.  
  467. <?php $mb->the_field(‘rate’); ?>
  468.  
  469. <select name=”<?php $mb->the_name(); ?>”>
  470. <option value=””>Select rating</option>
  471. <option value=”5″<?php $mb->the_select_state(‘5’); ?>>5 stars</option>
  472. <option value=”4.5″<?php $mb->the_select_state(‘4.5’); ?>>4.5 stars</option>
  473. <option value=”4″<?php $mb->the_select_state(‘4’); ?>>4 stars</option>
  474. <option value=”3.5″<?php $mb->the_select_state(‘3.5’); ?>>3.5 stars</option>
  475. <option value=”3″<?php $mb->the_select_state(‘3’); ?>>3 stars</option>
  476. <option value=”2.5″<?php $mb->the_select_state(‘2.5’); ?>>2.5 stars</option>
  477. <option value=”2″<?php $mb->the_select_state(‘2’); ?>>2 stars</option>
  478. <option value=”1.5″<?php $mb->the_select_state(‘1.5’); ?>>1.5 stars</option>
  479. <option value=”1″<?php $mb->the_select_state(‘1’); ?>>1 stars</option>
  480. <option value=”0.5″<?php $mb->the_select_state(‘0.5’); ?>>0.5 stars</option>
  481. </select>
  482. Delete
  483.  
  484. <?php $mb->the_group_close(); ?>
  485. </div>
  486. <?php endwhile; ?>
  487.  
  488. <p>Add rating category</p>
  489. </div>
  490.  
  491. <div class=”rating_type rate_Percentages”>
  492. <p>
  493. Add percent ratings for this product:<br>
  494. Note: The percent range is between 0 and 100 (do not add the %)
  495. </p>
  496. <?php while($mb->have_fields_and_multi(‘p_review_percents’)): ?>
  497. <div class=”td-meta-box-row”>
  498. <?php $mb->the_group_open(); ?>
  499.  
  500. <?php $mb->the_field(‘desc’); ?>
  501. <span class=”td-page-o-custom-label”>Feature name: </span><input style=”width: 200px;” type=”text” name=”<?php $mb->the_name(); ?>” value=”<?php $mb->the_value(); ?>”/>
  502.  
  503. <?php $mb->the_field(‘rate’); ?>
  504. – Percent:
  505. <input style=”width: 100px;” type=”text” name=”<?php $mb->the_name(); ?>” value=”<?php $mb->the_value(); ?>”/>
  506.  
  507. Delete
  508.  
  509. <?php $mb->the_group_close(); ?>
  510. </div>
  511. <?php endwhile; ?>
  512.  
  513. <p>Add rating category</p>
  514. </div>
  515.  
  516. <div class=”rating_type rate_Points”>
  517. <p>
  518. Add points ratings for this product:<br>
  519. Note: The points range is between 1 and 10
  520. </p>
  521. <?php while($mb->have_fields_and_multi(‘p_review_points’)): ?>
  522. <div class=”td-meta-box-row”>
  523. <?php $mb->the_group_open(); ?>
  524.  
  525. <?php $mb->the_field(‘desc’); ?>
  526. <span class=”td-page-o-custom-label”>Feature name: </span><input style=”width: 200px;” type=”text” name=”<?php $mb->the_name(); ?>” value=”<?php $mb->the_value(); ?>”/>
  527.  
  528. <?php $mb->the_field(‘rate’); ?>
  529. – Points:
  530. <input style=”width: 100px;” type=”text” name=”<?php $mb->the_name(); ?>” value=”<?php $mb->the_value(); ?>”/>
  531.  
  532. Delete
  533.  
  534. <?php $mb->the_group_close(); ?>
  535. </div>
  536. <?php endwhile; ?>
  537.  
  538. <p>Add rating category</p>
  539. </div>
  540.  
  541. <div class=”review_desc”>
  542. <div>Review description:</div>
  543. <p class=”td_help_section”>
  544. <?php $mb->the_field(‘review’); ?>
  545.  
  546. <textarea class=”td-textarea-subtitle” type=”text” name=”<?php $mb->the_name(); ?>”><?php $mb->the_value(); ?></textarea>
  547. </p>
  548. </div>
  549.  
  550. <script>
  551. jQuery().ready(function() {
  552. td_updateMetaboxes();
  553.  
  554. jQuery(‘#reviewSelector’).change(function() {
  555. td_updateMetaboxes();
  556. });
  557.  
  558. function td_updateMetaboxes() {
  559. var cur_selection = jQuery(‘#reviewSelector option:selected’).text();
  560.  
  561. if(cur_selection.indexOf(“No”) !== -1) {
  562. //alert(‘ra’);
  563. jQuery(‘.rating_type’).hide();
  564. jQuery(‘.review_desc’).hide();
  565.  
  566. } else {
  567. jQuery(‘.rating_type’).hide();
  568. jQuery(‘.rate_’ + cur_selection).show();
  569. jQuery(‘.review_desc’).show();
  570. //alert(cur_selection);
  571. }
  572.  
  573. }
  574. }); //end on load
  575. </script>
  576. </div> <!– /post option review –>
  577. <?php } ?>
  578. </div>
Advertisement
Add Comment
Please, Sign In to add comment