Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-05-2002, 07:27 AM
Ryangel Ryangel is offline
 
Join Date: Jun 2002
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Different Postbit for Mods/Admins

Can this be achieved?

What comes to my mind first is showthread.php, and a new templates postbit_admin, postbit_mod.

I did open up showthread and got lost after loking through it. lol.
Anyone here worked with showthread a whole lot and know which part i should look at? (if its even showthread.php at all )

Just wondering... Thanks.
Reply With Quote
  #2  
Old 08-05-2002, 08:57 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Edit functions.php, find:

PHP Code:
    } else {
        eval(
"\$retval = \"".gettemplate("postbit")."\";");
    } 
Replace it as:
PHP Code:
} else {

if ($
$bbuserinfo[usergroupid]==6
{eval(
"\$retval = \"".gettemplate("postbit2")."\";");
}
else{
eval(
"\$retval = \"".gettemplate("postbit")."\";");
}


Now create a new template named "postbit2" and you are done..

The ideal hack would be to give the users the option of choosing the postbit template they want to use and to post custom postbits for admins to add to postbit library. We discussed about this hack some time ago. I want to code it but I have other hacks more important to me in my pending list and nobody volunteered to code it although everybody liked the idea. I'm reminding the hackers reading requests forum once more: This would be a very nice hack if you have time to code it.
Reply With Quote
  #3  
Old 08-05-2002, 11:28 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i have started on such a hack some time ago, but have had problems with the replacementvars this time, so i stopped it.

perhaps i'll give it another try next weeks while i'm at work
Reply With Quote
  #4  
Old 08-05-2002, 12:19 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I dont know what the problem was, but if you share your algorithm and the problems you encountered I believe we can solve the problems.

I would structure the hack like this:
* a seperate table that saves custom post bits.
* Code to post new postbits (invisible/moderated) and Admin CP integration to add/edit/approve (make visible) these new postbits
* User CP modification to give the users the right to choose their postbit. ($bbuserinfo[postbit])
* functions.php modification to check if $bbuserinfo[postbit] is set, if yes get the postbit from custom table to apply, if no/or invalid/unallowed postbit get default one.
You can use the function in webtemplates hack to get/parse a custom template from a custom table.

Needless to say anything I can do, I'm ready for help..
Reply With Quote
  #5  
Old 08-05-2002, 12:29 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's the problem, i've deleted all of my code because it doesn't work

but i think it wouldn't be so hard to rewrite it

my hackstructure was a bit different:
* an extra field in user-table called custompostbit
* editable below the signature in usercp
- If a user hasn't entered one, it displays the standart postbit in the textbox
- After saving profile it compares it with the standart, if the custom is empty or equal to standart nothing is saved in the db
- it was unmoderated, because just Admins got that feature

Now i think anything i can do, but i started the hack, some time ago while i wasn't as good as now

i think i'll restart the project these weeks, and the other ones on my large to do list now
Reply With Quote
  #6  
Old 08-05-2002, 03:52 PM
Ryangel Ryangel is offline
 
Join Date: Jun 2002
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Logician
Edit functions.php, find:

PHP Code:
    } else {
        eval(
"\$retval = \"".gettemplate("postbit")."\";");
    } 
Replace it as:
PHP Code:
} else {

if ($
$bbuserinfo[usergroupid]==6
{eval(
"\$retval = \"".gettemplate("postbit2")."\";");
}
else{
eval(
"\$retval = \"".gettemplate("postbit")."\";");
}


Now create a new template named "postbit2" and you are done..

The ideal hack would be to give the users the option of choosing the postbit template they want to use and to post custom postbits for admins to add to postbit library. We discussed about this hack some time ago. I want to code it but I have other hacks more important to me in my pending list and nobody volunteered to code it although everybody liked the idea. I'm reminding the hackers reading requests forum once more: This would be a very nice hack if you have time to code it.
whao, thanks!
Much appreciated.
Reply With Quote
  #7  
Old 08-06-2002, 12:08 AM
Ryangel Ryangel is offline
 
Join Date: Jun 2002
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmmm this is my new fnction.php edit

PHP Code:
// do posts from ignored users
    
if (($ignore[$post[userid]] and $post[userid] != 0)) {
        eval(
"\$retval = \"".gettemplate("postbit_ignore")."\";");
    } else {
        if (
$bbuserinfo[usergroupid]==6) {
            eval(
"\$retval = \"".gettemplate("postbit_admin")."\";");
        }
        else{
            eval(
"\$retval = \"".gettemplate("postbit")."\";");
        }

    }
    return 
$retval;

but somehow its displaying all the posts with postbit_admin . Even with normal users. Any ideas?
Reply With Quote
  #8  
Old 08-06-2002, 01:22 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

change it to that:

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

    }
    return 
$retval;

Reply With Quote
  #9  
Old 08-06-2002, 01:40 AM
squawell's Avatar
squawell squawell is offline
 
Join Date: Oct 2001
Posts: 681
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i use firefly's hack--postbit_first so this is my functions code

how do i change it??
PHP Code:
// do posts from ignored users
    
if (!$ignore[$post[userid]]) {
        eval(
"\$retval = \"".gettemplate($templatename)."\";");
    } else {
        eval(
"\$retval = \"".gettemplate("postbit_ignore")."\";");
    }
    return 
$retval;

Reply With Quote
  #10  
Old 08-06-2002, 01:43 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
// do posts from ignored users
    
if (!$ignore[$post[userid]]) {
        if (
$post[usergroupid]==6) {
            eval(
"\$retval = \"".gettemplate("postbit_admin")."\";");
        }
        else{
            eval(
"\$retval = \"".gettemplate("$templatename")."\";");
        }
    } else {
        eval(
"\$retval = \"".gettemplate("postbit_ignore")."\";");
    }
    return 
$retval;

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 03:11 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04350 seconds
  • Memory Usage 2,287KB
  • 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
  • (8)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete