vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Adding Custom Field To ShowThread (https://vborg.vbsupport.ru/showthread.php?t=34928)

Brian 02-09-2002 08:03 PM

I have been having a heck of a time getting the following to work. If some one can help I would very much appreciate it :)

I would like to add a field to showthread, and only have that field viewable to moderators/admin.

The field $userinfo[field5]

And I would like it to look like:

Registered: Nov 1999
Location: Europe, Slovenia, Lovrenc
Posts: 48
FIELD HERE

and if they are not an admin or mod they wouldnt see that.

-Brian

Xenon 02-10-2002 10:24 PM

i think theres no way to do that just in the templates, you have to hack some codelines.

i have hacked my board to have this effekt you want:

open functions.php in your admin folder

find the lines
PHP Code:

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

round line 271
before it add:
PHP Code:

// Admin Postbit Hack
        
if ($bbuserinfo[usergroupid] == 6) {
          eval(
"\$adminpostbit = \"".gettemplate("adminpostbit")."\";");
        } else {
          
$adminpostbit "";
        } 

add other usergroupids in the if-clause for your mods

then make a custom template adminpostbit which contains the line $userinfo[field5] an all the other stuff you want to show only your admins and mods

laststep in the postbit template add the line $adminpostbit after $userinfo[posts]


this should be all

Brian 02-11-2002 04:24 AM

Thanks so much!! Worked like a charm!

-Brian


All times are GMT. The time now is 04:22 PM.

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.02910 seconds
  • Memory Usage 1,719KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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