View Single Post
  #107  
Old 01-15-2006, 07:53 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Setting it in php rendering mode, i tried to create a template with a simple web form. I wanted to pass the form to another php page for further processing.
This post should help:
https://vborg.vbsupport.ru/showpost....3&postcount=93

You should clean your POST variable in phpinclude field of webtemplate:

PHP Code:
$vbulletin->input->clean_gpc('p''formSetNo'TYPE_INT);  
$formSetNo =  $vbulletin->GPC['formSetNo']; 

Quote:
Next up: I would really like to change the default behavior of my webtemplates to be hidden from all usergroups, so that I will have to manually check the boxes for groups that are allowed to view the page rather than selecting which groups are not allowed.

Would this be a difficult thing to accomplish? I have almost 300 secondary usergroups and most of my pages should only be visible to 5-10 roups... That is a whole lot of boxes to check for each page...
Edit wt_wt.php, find:

PHP Code:
print_membergroup_row("Disallowed Usergroups <br><font size='1'>Mark usergroups who can <b>NOT</b> display this page</font>"'webtemplate[banusergroupids]'2""); 
replace it as:
PHP Code:
  $usergroups $vbulletin->db->query_read("SELECT usergroupid,title FROM " TABLE_PREFIX "usergroup ORDER BY title");
  while (
$usergroup $vbulletin->db->fetch_array($usergroups))
  {
             
$usergrps_with_space .= $usergroup[usergroupid]." ";
  }
   
$webtemplatebanusergroups[membergroupids] = convert_WTfield_to_usergroup_array($usergrps_with_space);
  

  
print_membergroup_row("Disallowed Usergroups <br><font size='1'>Mark usergroups who can <b>NOT</b> display this page</font>"'webtemplate[banusergroupids]'2,  $webtemplatebanusergroups); 
Quote:
After playing around with this last night, I dicovered that I am unable to restrcit more than 50 or so groups from viewing any given page. I am guessing that maybe not enough space for an array was allocated somewhere or something?

Any ideas where i could expand this to allow for more usergroups to be processed?
Run this query and see if it will help:
PHP Code:
ALTER TABLE `wt35_webtemplateCHANGE `banusergroups` `banusergroupsMEDIUMTEXT NOT NULL ,
CHANGE `logvisitors` `logvisitorsMEDIUMTEXT NOT NULL ,
CHANGE `editors` `editorsMEDIUMTEXT NOT NULL 
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01325 seconds
  • Memory Usage 1,793KB
  • 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
  • (4)bbcode_php
  • (3)bbcode_quote
  • (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