vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   WebTemplates 3.5.x: VB Integrated CMS (Content Management System) (https://vborg.vbsupport.ru/showthread.php?t=103076)

fn9mm 12-26-2005 08:42 AM

You're absolutely right !!
Thx for the help,...

Masiello 12-26-2005 08:46 AM

Anyone have my same issue? After installing webtemplate the users who using FireFox dont showing check bot for Terms aggrement in registration page (register.php)

Masiello 12-26-2005 12:50 PM

I have solved my issue, the problem is the language file not compatible, Thanks and sorry for my disturb

TTG 12-27-2005 01:37 AM

Quote:

Originally Posted by TTG
Installed but nothing showing in admincp .. double checked all file additions ?

Found the problem .. disabling ACP display order and list now shows in admincp.

Might prove useful for anyone else that has the same problem.

dc1pop 12-27-2005 01:10 PM

edit

JohnBee 12-28-2005 02:04 AM

Awesome! - I will try this out on my forum ASAP.

Kihon Kata 12-28-2005 03:13 AM

Fricken over the top Logician! Installed! Now I have to figure out how to use it.

yessir 12-28-2005 05:47 PM

Anyone got a vBAdvanced CMPS module for webtemplates yet?

Masiello 12-28-2005 05:52 PM

I'm looking around for that too.

badham 12-29-2005 02:31 AM

This is a great hack, works like a charm

badham

bulbasnore 01-01-2006 08:09 PM

Well, as Shirley Temple would say*:

OH MY GOODNESS!

I followed the install instructions, then the upgrade. Got a little out of phase because of uploading the files in the wrong spot. Then with fear and trepidation I imported my old templates which make heavy use of external variables.

BOINK!

It just works. Oh wait, looks like I have some work to do on my external variables. Oh well!

Hooray for Logician and happy new year!

*Sorry, I'm an old guy. Watch one of her movies!

bulbasnore 01-01-2006 08:48 PM

Alrighty, here's my problem.

In the old templates I had this in the Outside Variables box of the target template:

formSetNo

Another template POSTS that variable and an integer value to the target via selection from a popup menu.

Following this sample code:

$vbulletin->input->clean_array_gpc('r', array(
'my_variable_1' => TYPE_STR,
'my_variable_2' => TYPE_INT,
));


I have the following in the 3.5 target template:

$vbulletin->input->clean_array_gpc('r', array(
'formSetNo' => TYPE_INT
));


I've also tried it with TYPE_STR.

Anyway, the target template isn't getting the variable. Any suggestions? This is for a major feature of our site!

bulbasnore 01-01-2006 09:15 PM

And here's the fix:

vBulletin wisely forces you to clean inputs. This is explained here:

http://www.vbulletin.com/docs/html/codestandards_gpc :glasses:

For your Webtemplate PHP include, you can collect and clean variables (using an array) or a single variable (using key/value hash pair). I used the latter.

So, my one webtemplate POSTs a variable from a form field called 'formSetNo'.

In the target webtemplate, my php include is:

PHP Code:

$vbulletin->input->clean_gpc('p''formSetNo'TYPE_INT); 

The 'p' indicates to the clean_gpc function to look at the POSTed variable. See the documentation link for dealing with other types of input like GETs and COOKIEs.

To use the value in that variable in my php script in my target webtemplate, I use something like this:

PHP Code:

$colname__Recordset2 =  $vbulletin->GPC['formSetNo']; 

Now $colname_Recordset2, which I use to do work elsewhere in my php code, has the value from the POSTed variable! Yay!

Nice to see that vB has a way to do this and it works with WT :banana:

da prez 01-02-2006 08:10 PM

sheer genius.

thanks logician.

now i just gotta learn how to write queries. :D

b6gm6n 01-04-2006 01:50 AM

I wondered if adding my default style header, navbar & footer wouldnt be more easier... i've read the docs and assumed i could either add my default vb header using : $header either in a 'theme' where it's called into my pages (with styling) or as pages parsed as php, but i does not... whats the trick? i've tried : Included VB Templates...nope, tried a simple theme, no go, also added as php...so frustrating, please help

-b6

Kihon Kata 01-04-2006 02:09 AM

Quote:

Originally Posted by b6gm6n
I wondered if adding my default style header, navbar & footer wouldnt be more easier... i've read the docs and assumed i could either add my default vb header using : $header either in a 'theme' where it's called into my pages (with styling) or as pages parsed as php, but i does not... whats the trick? i've tried : Included VB Templates...nope, tried a simple theme, no go, also added as php...so frustrating, please help

-b6

Same thing for me b6. I have a whole section programmed OUTSIDE my forums(w/ db connectivity) and I did the same thing and nothing. :(

RaceJunkie 01-04-2006 02:33 AM

How do i make this text smaller?

WebTemplate Quick Info Panel for Admins - [CMS by Logician]

Logician 01-04-2006 07:20 AM

Quote:

Originally Posted by b6gm6n
I wondered if adding my default style header, navbar & footer wouldnt be more easier... i've read the docs and assumed i could either add my default vb header using : $header either in a 'theme' where it's called into my pages (with styling) or as pages parsed as php, but i does not... whats the trick? i've tried : Included VB Templates...nope, tried a simple theme, no go, also added as php...so frustrating, please help

I'm not sure if I can follow you on this?

Please check the default themes that comes with the installation. For instance check "Default Basic Theme" theme. It already has "$header" variable in it, and it is displaying your default style header, isn't it? So if you create a theme of your own and put $header in it in the same way "Default Basic Theme" has, it will display your header. It should include all relevant variables like this:

PHP Code:

$stylevar[htmldoctype]
<
html dir="$stylevar[textdirection]lang="$stylevar[languagecode]">
<
head>
<
title>Your page title</title>
$headinclude
</head>
<
body>
$header
$navbar

<page content goes here>

<and 
dont forget footer too

On the other hand things are more complicated in PHP parsed webtemplates. If you want to paste content of your header in a PHP parsed webtemplate do it with PHP commands. Eg.

PHP Code:

echo $header

Quote:

How do i make this text smaller? WebTemplate Quick Info Panel for Admins - [CMS by Logician]
It is inside template named "WebTemplates_AdminPanel"

b6gm6n 01-06-2006 01:05 AM

Default Basic Theme? whos got one of those then?
right... my default install came with nothing, i created a simple bbcode page as the instructions told me and it worked, no styling of anykind just text on a white background, great, ...i see i have "No Header/Footer WebTemplates Exist at the moment.." and "No Themes Exist at the moment.."... i did create a theme but still nothing, so...whats the code for this "Default Basic Theme"? and what to call it when im setting it up etc etc, i did hope to see my header, nav and footer with my text also...im i being pushy? :)

-b6

yessir 01-06-2006 04:05 AM

Quote:

Originally Posted by b6gm6n
Default Basic Theme? whos got one of those then?
right... my default install came with nothing, i created a simple bbcode page as the instructions told me and it worked, no styling of anykind just text on a white background, great, ...i see i have "No Header/Footer WebTemplates Exist at the moment.." and "No Themes Exist at the moment.."... i did create a theme but still nothing, so...whats the code for this "Default Basic Theme"? and what to call it when im setting it up etc etc, i did hope to see my header, nav and footer with my text also...im i being pushy? :)

From the install doc.

Quote:

STEP 3- Close your browser, reopen it, relogin to your admin cp and you should to see "Logician's WebTemplates" in the left menu. Expand it and click "Export/Import", then "Upload Webtemplate .XML File", point the file named "webtemplate_export.xml".
(There are 2 XML files, please make sure you import the file named "webtemplate_export.xml")
(This step is to upload default webtemplates and webqueries to your webtemplate system)

Logician 01-06-2006 07:12 AM

Quote:

Default Basic Theme? whos got one of those then?
Exactly as roscoe36 said.

You forgot to install default webtemplates and webqueries in installation step 3

b6gm6n 01-06-2006 12:55 PM

DOH!, i miss read, sorry guys, all working!

-b6

adwolf1 01-10-2006 10:16 PM

hi, great plugin!

quick question about simple form handling ..

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.

The submitted form variables aren't making it to the target page (ie, echo $_POST['myvariable']; shows nothing. Is there anything special I have to do to get the variables to show up?

Thanks for the help!

Gayble 01-12-2006 08:48 AM

EXACTLY what I was after! :) I love you! :)

Thanks for making this hack.

WAR 01-12-2006 07:26 PM

Quote:

Originally Posted by Gayble
EXACTLY what I was after! :) I love you! :)

Thanks for making this hack.

First off, thank you for an awesome hack.

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...

WAR 01-13-2006 11:22 AM

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?

I found the function in the includes file that processes usergroup permissions, is there anywhere else that I would need to change to switch the default into an opt-in system rather than an opt-out? (will be testing later today to try and answer this on my own)

Logician 01-15-2006 07:53 AM

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 


Kurisu 01-15-2006 12:19 PM

Awesome hack!

But I get an error directly after installing... (see screenshot)

Logician 01-15-2006 02:59 PM

Quote:

Originally Posted by Kurisu
Awesome hack!

But I get an error directly after installing... (see screenshot)

Apparently the installation didn't go well for a reason. Uninstall the hack, login to phpmyadmin and manually delete webtemplate tables:

DROP TABLE `wt35_query`, `wt35_theme`, `wt35_visitlog`, `wt35_webtemplate`;

Then reinstall it again (carefully!). If you still have the problem after second install and don't mind me giving admin cp, ftp and phpmyadmin access, I can check for you. Otherwise, I am not sure what goes wrong for you.

Kurisu 01-15-2006 03:35 PM

Quote:

Originally Posted by Logician
Apparently the installation didn't go well for a reason. Uninstall the hack, login to phpmyadmin and manually delete webtemplate tables:

DROP TABLE `wt35_query`, `wt35_theme`, `wt35_visitlog`, `wt35_webtemplate`;

Then reinstall it again (carefully!). If you still have the problem after second install and don't mind me giving admin cp, ftp and phpmyadmin access, I can check for you. Otherwise, I am not sure what goes wrong for you.

Didn't work either... Same error.

Could it have something to do with my PHP version (5.0.5)? I read that PHP 5 handles arrays different...

Logician 01-15-2006 04:00 PM

Quote:

Originally Posted by Kurisu
Didn't work either... Same error.

Could it have something to do with my PHP version (5.0.5)? I read that PHP 5 handles arrays different...

Yes sounds very possible.. I never tested it with PHP 5.x..

apleschu 01-16-2006 04:43 PM

Seriously I was desperate after discovering that 3.5 doesn;t seem to have a portal system available (yet)

But even so, I like the concept of webtemplates MUCH better.

THANKS

Reef 01-17-2006 05:51 AM

Excellent mod and support Logician, Thanks

I missed this somehow when released. I just saw it listed in the H/O/M poll .. Hmm, I think I'm gonna run back over there and vote :D

tidy_boy 01-17-2006 01:46 PM

Hey guys can anyone post a link to pages they have made with this hack so i can see the power of it :D


Thanks

RaceJunkie 01-17-2006 03:21 PM

Quote:

Originally Posted by tidy_boy
Hey guys can anyone post a link to pages they have made with this hack so i can see the power of it :D


Thanks


Here you go

here

tidy_boy 01-17-2006 03:56 PM

Nice anyone else got any other examples then can show me :D

WAR 01-17-2006 05:07 PM

Quote:

Originally Posted by Logician
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); 



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 


Logician,

Thanks for the quick reply and the fix. It worked as far as it was designed, but unfortunately my original request was flawed.

I have 12 "Primary" usergroups. All members belong to at least one of these groups. I also have a couple hundred "Secondary" usergroups, most members belong to several of these each. Using the "Opt-out" paradigm you have here, it is impossible for me to allow access to secondary usergroups without also granting access to entire primary usergroups

Example: If a user is a member of primary group 1 and secondary group A, If I try and block access to Primary Group 1 and allow access to Secondary Group A then the user will still not be allowed access because the way you have it written all users that are in primary group 1 are denied access.

So I re-wrote your permissions function in your include file to switch the whole system to an "Opt-in" paradigm so that it better matches how vbulletin usually treats permissions. Can you take a look at this and let me know if it looks ok? I have tested it out and it seems to work fine. The only thing I needed to disable was the "Restrict individual users" function that you had, other wise granting access to a user with userid = 20 also grants access to the usergroup with usergroupid = 20.

PHP Code:

function WT_UsergroupPermission($userinfo$return10 1$usergroupname '')
{
    global 
$WT;  

    
$permitted 0;

    
$WT['banusergroups'] = trim($WT['banusergroups']);

    if (
$WT['banusergroups'])
    {
        
$WT_banusergroups explode(" "$WT['banusergroups']);
        
        if (
WTis_member_of($userinfo$WT_banusergroups)) 
        {
            
$permitted 1;
        } 
        else 
        {
            
$permitted 0;
        }
        
    
/*    if ($userinfo[userid] > 0 AND in_array('('.$userinfo[userid].')', $WT_banusergroups)) 
        {
            $permitted = 0;
        } */
    
}


    
    if (
$WT['draft'] == AND !WTis_member_of($userinfo, array("6"))) //draft webtemplate
    
{
        
$permitted 0;
    }

    if (
$return10//return 1 or 0
    
{
        return 
$permitted;
    }
    else 
//return usergroup name with color (permitten green, banned red)
    
{
        if (
$permitted
        {
            return 
'<font color="#006600">'.$usergroupname.'</font>';
        }
        else 
        {
            return 
'<font color="#C40000">'.$usergroupname.'</font>';
        }
    }




Logician 01-17-2006 07:41 PM

Quote:

The only thing I needed to disable was the "Restrict individual users" function that you had, other wise granting access to a user with userid = 20 also grants access to the usergroup with usergroupid = 20.
I really don't think so. Individual user info is kept between paranthesis () and checked this way too. So if you grant access to userid 20, the DB record is (20) but if you grant access to usergroupid, the record is just 20.

The section you commented out checks for paranthesis too so I wouldn't think it is allowing usergroupid 20 when you allowed userid 20.

Quote:

Example: If a user is a member of primary group 1 and secondary group A, If I try and block access to Primary Group 1 and allow access to Secondary Group A then the user will still not be allowed access because the way you have it written all users that are in primary group 1 are denied access.
I see what you are saying but this algorithm matches with its logic. Because this section of the hack is for marking "banned" usergroups so when you mark a usergroup, this means the hack shouldn't give access to any user who is part of this group. If the hack would give access due to that users belonging to another usergroup, it would be impossible to ban primary usergroups as their users might get access due to secondary usergroups which they join themselves.

I'm sure you'll agree that most of the admin's permission system would depend on "primary usergroups", not "secondary usergroups" so IMO how it is designed is make sense. :)

WAR 01-17-2006 08:38 PM

I never meant to imply that it worked any way other than what you intended. It is an exceptionally well-written hack. For my own purposes though, I need it to work a different way, I just wanted to have you look over what I did above for a sanity check.

Thanks for clarifying the issue with the ()'s and the individually specified users, it makes much more sense that what I had assumed was going on.

Quote:

If the hack would give access due to that users belonging to another usergroup, it would be impossible to ban primary usergroups as their users might get access due to secondary usergroups which they join themselves.
This is why vbulletin lets you designate a primary usergroup to not allow inherited permissions from any secondary groups for its in-built group permissions.

Again, this is an incredible hack, many thanks for sharing!

Bluestrike2 01-18-2006 01:38 AM

I hate to be a bother, but I'm in need of some help. I searched through the support document, and I've skimmed most of this thread. I'm sorry if this has been asked before.

BUT - I was wondering how could I use the two column theme, but have the content of the one column user-editable while keeping it "moron proof." Actually, if there was a way for them to enter the number (its for scrim record) in a text box, that would be grande (and then another text box to enter the teams they scrimmed).

Also, is it possible to add another user editable field (editor I mean) that would show up another main table (for lack of a better word). If you need clarification, I'll post it. Thank you so much!


All times are GMT. The time now is 01:51 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.02311 seconds
  • Memory Usage 1,905KB
  • 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
  • (12)bbcode_php_printable
  • (19)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete