vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   FlashChat : Integration upgrades for vBulletin. (https://vborg.vbsupport.ru/showthread.php?t=74613)

Paul M 05-07-2005 09:06 PM

Quote:

Originally Posted by jdsinclair
Paul,

This has been up on my live forums for about a week and still working like a charm.

Thanks again,

jd :)

Thanks for letting me know. :)

vulture 05-10-2005 02:06 PM

Does the hack only work for primary usergroups?

Paul M 05-10-2005 03:59 PM

Quote:

Originally Posted by vulture
Does the hack only work for primary usergroups?

Yes.

vulture 05-10-2005 04:04 PM

Quote:

Originally Posted by Paul M
Yes.


Next question: how can you make it work for secondary groups? I have a promotion set where once a user gets to a certain amount of posts, they get access to chat. I can't have them changing their primary usergroup as that will mess up other hacks. Any ideas?

Paul M 05-10-2005 04:46 PM

Quote:

Originally Posted by vulture
Next question: how can you make it work for secondary groups? I have a promotion set where once a user gets to a certain amount of posts, they get access to chat. I can't have them changing their primary usergroup as that will mess up other hacks. Any ideas?

In theory it would be possible to make it take note of secondary groups - however it does pose a problem - if one group is not allowed access, and another is, and another is a mod group, what takes priority. Normally a non allowed group would take priority over all others, but you are asking for the opposite (mod/admin would always take priority over user).

vulture 05-10-2005 07:26 PM

Quote:

Originally Posted by Paul M
In theory it would be possible to make it take note of secondary groups - however it does pose a problem - if one group is not allowed access, and another is, and another is a mod group, what takes priority. Normally a non allowed group would take priority over all others, but you are asking for the opposite (mod/admin would always take priority over user).

Well, I've hacked the code so it takes care of secondary groups. I created a new role (ROLE_BANNED) so if a mod/admin/user has n secondary groups of which any are classed as banned, then access is denied. Access rights are granted in the following precedence: ROLE_BANNED, ROLE_ADMIN, ROLE_USER, ROLE_NOBODY

Its working fine atm.

Paul M 05-10-2005 10:14 PM

Nice. :)

speedway 05-12-2005 12:16 AM

Quote:

Originally Posted by vulture
Well, I've hacked the code so it takes care of secondary groups. I created a new role (ROLE_BANNED) so if a mod/admin/user has n secondary groups of which any are classed as banned, then access is denied. Access rights are granted in the following precedence: ROLE_BANNED, ROLE_ADMIN, ROLE_USER, ROLE_NOBODY

Its working fine atm.

Would you mind sharing that mod? Sounds like something I need...

Cheers
Bruce

vulture 05-12-2005 04:30 PM

Its got some of Paul's code in there (userinrole function), so if paul doesn't mind me posting the changes here ...

Paul M 05-12-2005 06:13 PM

Quote:

Originally Posted by vulture
Its got some of Paul's code in there (userinrole function), so if paul doesn't mind me posting the changes here ...

Fine by me. :)

pgowder 05-13-2005 12:12 PM

Little confused! I'm just starting to install flashchat, do i start with this hack?

Paul M 05-13-2005 02:27 PM

No, Install flashchat and get it working first, then you can install this hack. :)

pgowder 05-13-2005 02:37 PM

Quote:

Originally Posted by Paul M
No, Install flashchat and get it working first, then you can install this hack. :)

Where is Flash Chat hack?? Or download?

Paul M 05-13-2005 03:19 PM

<a href="http://www.tufat.com" target="_blank">www.tufat.com</a> - it costs $5.

Paul M 05-14-2005 02:22 AM

Version 1.55 released (for FlashChat 4.0.1 or above).

This adds a 4th new feature - an optional welcome message when a member first joins the chat. :)

snotek 05-16-2005 09:54 PM

vulture> Are you going to post that addition? I too could use something like that.

Paul M 05-17-2005 01:13 AM

snotek

Make the following changes to your vbulletinCMS file (whichever one you are using).

Find;
PHP Code:

$this->getUserStmt = new Statement("SELECT userid AS id, username AS login, usergroupid FROM {$GLOBALS['tableprefix']}user WHERE userid=?"); 

Replace with;
PHP Code:

$this->getUserStmt = new Statement("SELECT userid AS id, username AS login, usergroupid, membergroupids FROM {$GLOBALS['tableprefix']}user WHERE userid=?"); 

Find;
PHP Code:

$rec['roles'] = $this->getRoles($rec['usergroupid']); 

Replace with;
PHP Code:

$rec['usergroupid'] .= ",".$rec['membergroupids'] ; //added by Paul M
$rec['roles'] = $this->getRoles($rec['usergroupid']); 

Find the getRoles function ;
PHP Code:

function getRoles($usergroupid) {

# current block of code # >



Replace it with a new version ;
PHP Code:

  // Paul M Version - Edit to set user roles for different vB usergroups 
  
function getRoles($usergroupid) {

    
// Set default access
    
$userrole ROLE_NOBODY ;

    
$groups explode(',',$usergroupid);

    
// Set Allowed groups
    
if (in_array(2,$groups)) $userrole ROLE_USER;
    if (
in_array(7,$groups)) $userrole ROLE_USER;

    
//Set Staff groups
    
if (in_array(5,$groups)) $userrole ROLE_ADMIN;
    if (
in_array(6,$groups)) $userrole ROLE_ADMIN;

    
//Set Banned groups
    
if (in_array(8,$groups)) $userrole ROLE_NOBODY;
    if (
in_array(9,$groups)) $userrole ROLE_NOBODY;

    return 
$userrole;
  } 

Edit the above function for your usergroups. This is working fine on my test system.

This version assigns access in the following priority based on both primary and secondary groups.

1. Assign default access (which is set to NO access).
2. If they are a member of an allowed group, grant USER access.
3. If they are a member of a staff group, grant ADMIN access.
4. If they are a member of a banned group, grant NO access.

:)

plateau 05-18-2005 10:54 AM

well done!

installed clicked!!!

dsboyce8624 05-18-2005 11:16 AM

It doesn't look like the stuff from post #57 (waste of space to quote it) is included in the instructions, unless I somehow missed it.

Is that on purpose, or just lack of time?

Once bitten twice shy, screwed up things before and don't wanna do it again.

Thanks

Paul M 05-18-2005 10:27 PM

Quote:

Originally Posted by dsboyce8624
It doesn't look like the stuff from post #57 (waste of space to quote it) is included in the instructions, unless I somehow missed it.

Is that on purpose, or just lack of time?

It will be in the next release when I have time to update the instructions. :)

dsboyce8624 05-19-2005 05:36 PM

Well, I've already botched up things once, so when you get it all combined in one place I'll go for it, in the meantime I'll subscribe the thread so I don't forget.

Thanks,

Dennis

lifesourcerec 05-20-2005 06:25 AM

When I use install.php, it hangs at step 5. Says "Could not write to './inc/cmses/defaultUsrExtCMS.php ' file ". It installs with install2.php, but installs for "free for all" version. Can't get it integrated with VB. v3.9.x worked great, but 4.0.6 is a pain.

T3MEDIA 05-20-2005 01:32 PM

anyone actually got flashchat 4 to work? (intergrate)

Paul M 05-20-2005 04:05 PM

Yes.

lifesourcerec 05-20-2005 06:02 PM

I get this error when re-installing it.

Quote:

Warning: fopen(log.txt): failed to open stream: Permission denied in /public_html/forum/chat/inc/common.php on line 127

Warning: fwrite(): supplied argument is not a valid stream resource in /public_html/forum/chat/inc/common.php on line 128

Warning: fwrite(): supplied argument is not a valid stream resource in /public_html/forum/chat/inc/common.php on line 129

Warning: fwrite(): supplied argument is not a valid stream resource in /public_html/forum/chat/inc/common.php on line 130

Warning: fwrite(): supplied argument is not a valid stream resource in /public_html/forum/chat/inc/common.php on line 140

Paul M 05-20-2005 09:44 PM

It's trying to write to the log file (probably due to another error) and failing due to lack of permission.

lifesourcerec 05-20-2005 11:22 PM

On Step 3, there are 2 examples of that code back to back, which one do I replace? (v4.0.6)

Paul M 05-25-2005 04:15 AM

Quote:

Originally Posted by lifesourcerec
On Step 3, there are 2 examples of that code back to back, which one do I replace? (v4.0.6)

Sorry, I missed this question. I hadn't noticed this double match - I have updated the instructions to make the match unique. The answer is the second set. (It wouldn't harm anything if you did both, the other bit of code is never called in a vB integration).

tteal 05-25-2005 11:52 AM

Subscribing.......

Paul M 05-25-2005 08:56 PM

Quote:

Originally Posted by tteal
Subscribing.......

Subscribing ??

T3MEDIA 05-26-2005 12:31 PM

Quote:

Originally Posted by Paul M
Yes.

oh thats good to know.

Chadi 05-26-2005 07:36 PM

Where do I edit what users are entitled to enter?

Paul M 05-26-2005 08:44 PM

Quote:

Originally Posted by chadi
Where do I edit what users are entitled to enter?

Your kidding right ?

Code:

function getRoles($usergroupid) {
/*
        ## Paul M Version ##

        Edit the code below to set roles for different vB usergroups

        This assigns access in the following priority based on all primary and secondary group membership.


        1. Assign default access (which is set to NO access below).
        2. If they are a member of an allowed group, grant USER access.
        3. If they are a member of a staff group, grant ADMIN access.
        4. If they are a member of a banned group, grant NO access.
*/

<rest of code>


Chadi 05-26-2005 08:50 PM

Quote:

Originally Posted by Paul M
Your kidding right ?

Code:

function getRoles($usergroupid) {
/*
        ## Paul M Version ##

        Edit the code below to set roles for different vB usergroups

        This assigns access in the following priority based on all primary and secondary group membership.


        1. Assign default access (which is set to NO access below).
        2. If they are a member of an allowed group, grant USER access.
        3. If they are a member of a staff group, grant ADMIN access.
        4. If they are a member of a banned group, grant NO access.
*/

<rest of code>


How did you know I was kidding?

Paul M 05-26-2005 09:00 PM

Quote:

Originally Posted by chadi
How did you know I was kidding?

I have special powers to detect these things. :)

Chadi 05-26-2005 09:29 PM

The problem is no one can get into the chat and yet the settings / groups seem right.

My vbulletin has this:
Administrators 6
Banned 8
Unregistered / Not Logged In 1
Registered 2
Super Moderators 5

vbulletincms2.php

$userrole = ROLE_NOBODY ;

$groups = explode(',',$usergroupid);

// Set Allowed groups
if (in_array(2,$groups)) $userrole = ROLE_USER;
if (in_array(7,$groups)) $userrole = ROLE_USER;

//Set Staff groups
if (in_array(5,$groups)) $userrole = ROLE_ADMIN;
if (in_array(6,$groups)) $userrole = ROLE_ADMIN;

//Set Banned groups
if (in_array(8,$groups)) $userrole = ROLE_NOBODY;
if (in_array(9,$groups)) $userrole = ROLE_NOBODY;

What am I missing here?

Paul M 05-26-2005 11:24 PM

Quote:

Originally Posted by chadi
The problem is no one can get into the chat and yet the settings / groups seem right.

What am I missing here?

Looks right to me, which suggests that maybe there is another problem - what message do you get - do you have a test user on your site (actually, where is your site).

Chadi 05-26-2005 11:30 PM

Prompts for login first the tells me permission denied

Chadi 05-26-2005 11:33 PM

Try user/password "testuser"
www.talkjesus.com

Chadi 05-26-2005 11:36 PM

btw, that's a "regular" user


All times are GMT. The time now is 04:17 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.01505 seconds
  • Memory Usage 1,844KB
  • 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
  • (2)bbcode_code_printable
  • (6)bbcode_php_printable
  • (17)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (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