vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Custom postbit based on UserGroup (https://vborg.vbsupport.ru/showthread.php?t=51982)

Jagang 04-22-2003 09:32 PM

Custom postbit based on UserGroup
 
I'm not sure if something like this has ever been released but I was unable to find it in a search. If it exist just point me in the right direction. What I am looking for is the ability to assign certain postbit templates to certain member groups. My use for this mainly has to do with the RPG Intergration hack. Since it has a custom postbit showing RPG stats I would like to make a member group "RPG Members" and only have them seeing this postbit. The regular members I would like to only see the regular default postbit without the RPG Info. I'm sure this could have other uses beyond just this one hack though like for mods and admins. So does anyone have any ideas on how this could be done?

Dean C 04-23-2003 10:12 AM

This would require hacking :)

- miSt

Jagang 04-24-2003 02:43 AM

I figured it might, could one of the mods please move this to Hack Request.

Dean C 04-24-2003 09:22 AM

*Moved upon request* :)

- miSt

Jagang 04-25-2003 05:13 AM

Anyone have any suggestions? Anyone at all? ;)

Brad 04-25-2003 05:30 AM

Open /admin/functions.php

## Find:

PHP Code:

// do posts from ignored users
    
if (($ignore[$post[userid]] and $post[userid] != 0)) {
        eval(
"\$retval = \"".gettemplate("postbit_ignore")."\";");
    } else {
        eval(
"\$retval = \"".gettemplate("postbit")."\";");
    }
    return 
$retval

## Replace with:

PHP Code:

// do posts from ignored users
    
if (($ignore[$post[userid]] and $post[userid] != 0)) {
        eval(
"\$retval = \"".gettemplate("postbit_ignore")."\";");
    } elseif (
$post[usergourpid]==4) { // change 4 to the usergourpid of the rpg gourp
            
eval("\$retval = \"".gettemplate("postbit_rpg")."\";");
      } else {
        eval(
"\$retval = \"".gettemplate("postbit")."\";");
    }
    return 
$retval

Change the number 4 as told in code comments

Add a new template named postbit_rpg, this is the postbit that will display for your rpg gourp. :)

Jagang 04-25-2003 11:09 AM

Thanx loo, btw I also need my mod and admin groups to have the rpg postbit as well, what line would I add for more groups. Extra elseif lines?

EDIT:
Nevermind, it worked like I thought. I was able to add extra groups like this:

PHP Code:


// do posts from ignored users
    
if (($ignore[$post[userid]] and $post[userid] != 0)) {
        eval(
"\$retval = \"".gettemplate("postbit_ignore")."\";");
    } elseif (
$post[usergroupid]==6) { 
            eval(
"\$retval = \"".gettemplate("postbit_rpg")."\";");
} elseif (
$post[usergroupid]==12) { 
            eval(
"\$retval = \"".gettemplate("postbit_rpg")."\";");
} elseif (
$post[usergroupid]==7) { 
            eval(
"\$retval = \"".gettemplate("postbit_rpg")."\";");
      } else {
        eval(
"\$retval = \"".gettemplate("postbit")."\";");
    }
    return 
$retval

Now it is showing just like I wanted it to. Once again thanx alot loo


All times are GMT. The time now is 04:44 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.02203 seconds
  • Memory Usage 1,735KB
  • 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
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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