Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-31-2002, 08:17 AM
Esdee's Avatar
Esdee Esdee is offline
 
Join Date: Oct 2002
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default simple level hack

Well, as I'm still very new to PHP, I have a little question.
I find many RPG hacks and such, but what I want is something very simple and yet, I can't find it anywhere.

I only want a new stat in the postbit: Level: and it has to give the amounth of posts divided by 50

Can anyone tell me how to make such 'hack' ?

Thanks ^_^
Reply With Quote
  #2  
Old 11-01-2002, 11:51 AM
Esdee's Avatar
Esdee Esdee is offline
 
Join Date: Oct 2002
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anybody ?
please ??
Reply With Quote
  #3  
Old 11-01-2002, 02:05 PM
Bitsys's Avatar
Bitsys Bitsys is offline
 
Join Date: Oct 2002
Posts: 444
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am sort of new at this stuff too, but I think the following should work:

In your admin directory in functions.php (back up functions.php before editing it) 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
It should be at the end of the getpostbit function.

Insert before it:
PHP Code:
$level $post[posts] / 50;
$level floor ($level 1); 
Go to the postbit template (in the admin cp) and and use the following code to display the level of the person:
PHP Code:
Level$level<br
I tested it on my boards and it worked so let me know if you have any questions or problems. As I said before, I am still kind of new at this stuff too. BTW, You can change the actual wording of the level display in postbit, just use $level wherever you want to insert that person's level.
Reply With Quote
  #4  
Old 11-01-2002, 05:41 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lol what an excellently simple hack

- miSt
Reply With Quote
  #5  
Old 11-01-2002, 10:29 PM
Esdee's Avatar
Esdee Esdee is offline
 
Join Date: Oct 2002
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks man !
It works perfectly !
(I did have to leave out the +1 though )

But I do have a question: Hwo do you know where you have to add such code in the functions.php file ?

And don't tease us, Mist ^_^
Everybody starts somewhere.
We might just be the future's great hackers

And besides, the little hacks can be most fun
Reply With Quote
  #6  
Old 11-02-2002, 04:01 AM
Bitsys's Avatar
Bitsys Bitsys is offline
 
Join Date: Oct 2002
Posts: 444
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How did I know where to add it? Well, I first looked at showthread.php to find out how posts are displayed. Then, I saw a call to the getpostbit function. This function was called for each post in the thread, so I figured that is where all of the variables and calculations were done. So I went to functions.php and found the getpostbit function. As far as where to put it in the getpostbit function, I just decided to skim to the bottom since all of the other stuff didn't pertain to or affect what I was trying to do. However, it would have been pointless to put it at the very bottom of the getpostbit function, since the postbit template would have been evaluated before the $level variable was set. So I just put it above the place where the postbit template was evaluated.

Is that what you were asking? If not, then just PM me and I can give a more detailed answer.

BTW, I agree that the little hacks can be the most fun
Reply With Quote
  #7  
Old 11-02-2002, 08:25 AM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wasn't teasing you - i was just happy at how simple things can be

- miSt
Reply With Quote
  #8  
Old 11-02-2002, 02:21 PM
Esdee's Avatar
Esdee Esdee is offline
 
Join Date: Oct 2002
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

^_^

Thanks Bitsys
That was exactly what I wanted toi know
Reply With Quote
  #9  
Old 11-02-2002, 03:02 PM
Bitsys's Avatar
Bitsys Bitsys is offline
 
Join Date: Oct 2002
Posts: 444
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

^_^

Glad I was able to help
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:20 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.04194 seconds
  • Memory Usage 2,245KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete