vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Custom Postbit for Admin (https://vborg.vbsupport.ru/showthread.php?t=42634)

kmfdm_kid2000 08-22-2002 10:00 PM

Custom Postbit for Admin
 
First off, if this doesn't belong here, delete, move, ect. I'm new here, so forgive me. Secondly, this is NOT my hack. Credit goes to Zajako 100%. He created this hack while he was a Co-Admin on my board. I just cracked it, that's all.

Step 1:

Create a new profile field edittable only by Admin. Call it something like Postbit#. Then note the ID# for it, you'll need that info later. Best way to find out is Click on Modify custom Profile fields after it's created, right click it, copy shortcut, and paste it somewhere like a blank notepad page. The last 2 numbers will be it's ID#. Open your profile, and in that field, put a 1.

Step 2:

Open your postbit template. Highlight it's contents, and copy. Then create a new template, name that postbit_admin and paste the contents of the standard post bit into your new post bit. Save it. You can come back to this template, and customize it to your liking.

Step 3:

Here's what qualifies this as a hack, I think. Download and open admin/functions.php then find this line:

PHP Code:

} else {
        eval(
"\$retval = \"".gettemplate("postbit")."\";"); 

Directly above it, put this code in:

PHP Code:

} else {
        If (
$post[fieldX] == "1")
            eval(
"\$retval = 

\""
.gettemplate("postbit_admin")."\";"); 

Note the X in $post[fieldX] is the ID# of that custom field you made in step 1. You can make multiple templates as well. I.E. I have clans on my board. I've made different templates for each, I usually change the post colors. For instance, there's a clan that's called HGC. I named that template postbit_HGC and in the gettemplate("postbit_admin")." part, I just changed it to gettemplate("postbit_HGC")." However, you need a different number in the custom profile field. Let's say you use 2 to denote someone posting w/ an HGC post bit. The part that says If ($post[fieldX] == "1") gets changed to If ($post[fieldX] == "2")

Just add another line above that, I.E.

PHP Code:

} else {
        If (
$post[fieldX] == "2")
            eval(
"\$retval = 

\""
.gettemplate("postbit_HGC")."\";"); 

And you can add as many as you have templates for.

I have 8 different templates on my site. Mind you, every time I make a post bit change, I must apply it to every postbit template. You can customize the different templates as you see fit. Here's some screen shots:

http://gamequest2.netfirms.com/custompostbit.jpg

Note my highly customized postbit, that's not even a sig, it's HTML built right into the postbit's HTML coding itself

http://gamequest2.netfirms.com/standardpostbit.jpg

This is the standard post bit. Play around with the code, and see if you can customize things to your liking. There are 5 places you must look for to change post color, just look for
Code:

<td bgcolor="$post[backcolor]"
and hard edit it to your liking.

Enjoy, and please, remember this was NOT my hack, this was Zajako's hack. If I did something wrong, please tell me. I'll try to help as much as I can, but you'll have to do your own HTML customization...

EDIT: For a full Demo, visit http://www.gqforums.com
Threads aren't viewable if you're not logged in, so here's Log in info:

Username: Visitor Password: gamequest

GuruXL 08-22-2002 11:52 PM

umm..this hack is nice, but...i still think it needs something more...but ok...thanks anywho

Storm 08-23-2002 12:13 AM

Nice hack, I have this one! :D

kmfdm_kid2000 08-23-2002 12:19 AM

EDIT:

I'm no longer supporting RPG Palace and it's corrupt Administration techniques...

Dyntheos 08-23-2002 01:58 AM

your kidding me right?

There no customization on those forums apart from a color shift. The buttons are even the same. :/

Neo 08-23-2002 06:13 AM

I am working on a more advanced version of this oO;;;

g-force2k2 08-23-2002 06:20 AM

Neo i remember your user style hack ;) are you going to be doing an advance version along those lines :)

btw about the hack its really just customization no?

g-force2k2

kmfdm_kid2000 08-23-2002 08:31 AM

Quote:

Originally posted by g-force2k2
btw about the hack its really just customization no?

g-force2k2

Basically it is that exactly. i think if you've got all of your users on a standard post bit, it's nice to stand out as an Admin. And plenty of boards have clans, so I think it'd be nice to have certain clan postbits with logos, images, ect. built right in.

As far as my own template, I've removed most of the Variables, and hard coded almost everything in directly. Username, title, avatar, signature, everything was all removed and hard coded in directly into the template. I think if you like to code, it's a lot more fun to have an entire template to customize, rather than your standard ACP profile. There's almost limitless possibilities, as per the definition of customization.

Neo, by all means, if you want to improve on this, that'd be great, and appreciated. I'd be eager to see what you can add to this :D

This hack isn't anything profoundly functional, it's very much a cosmetic hack. The only thing really qualifying it as a "Hack" is a line of PHP, but I still liked it enough to share it. It's more of a Template Mod/ Mini-Hack. I'm still very much a newbie when it comes to coding, but I learn fast, and I hope to someday bring new functionality to my community, as well as others out there...

Xenon 08-23-2002 10:03 AM

Quote:

Originally posted by Neo
I am working on a more advanced version of this oO;;;
Not only you ;)

ZiRu$ 08-23-2002 02:09 PM

thanks....but not useful to me


All times are GMT. The time now is 03:58 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.01111 seconds
  • Memory Usage 1,747KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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