Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Admin text Hack all vb2 Details »»
Admin text Hack all vb2
Version: 1.00, by miz miz is offline
Developer Last Online: Sep 2005 Show Printable Version Email this Page

Version: 2.3.x Rating:
Released: 04-16-2004 Last Update: Never Installs: 3
 
No support by the author.

ok this hack added new bbcode

for exsample if some user want to say something only that only admins will see
then he do [admin] what he want to say [/admin]

and "what he want to say" will be viewable only for admins

so lets start :

open admin/functions.php

find :

PHP Code:
"/(\[)(php)(])(\r\n)*(.*)(\[\/php\])/esiU"
After add :

PHP Code:
"/(\[)(admin)(])(\r\n)*(.*)(\[\/admin\])/esiU"
find :

PHP Code:
// ###################### Start stripbrsfromcode #######################
function stripbrsfromcode($foundcode) {
  
$foundcode str_replace("\\\"","\"",$foundcode);
  return 
"</normalfont><blockquote><pre><smallfont>code:</smallfont><hr>" str_replace("<br>"""str_replace("<br />"""$foundcode) ) . "<hr></pre></blockquote><normalfont>";

After Add :

PHP Code:
// ###################### Start Admin ########################
function admin($admintext) {
  global 
$post$bbuserinfo$DB_site;
  if (
$bbuserinfo['usergroupid']!=6) {
    
$admintext="";
  }
  return 
"$admintext";

Save the file and upload it back to your server

open root/newreply.php

Find :

PHP Code:
$pagetext trim(preg_replace("/(\[quote])(.*)(\[\/quote])/siU"""$pagetext)); 
After Add :

PHP Code:
$pagetext trim(preg_replace("/(\[admin])(.*)(\[\/admin])/siU"""$pagetext)); 
Thats All

Enjoy.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 04-18-2004, 09:35 AM
Aaron1's Avatar
Aaron1 Aaron1 is offline
 
Join Date: Oct 2002
Location: Amsterdam
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Interesting!
I could use that! Cool


So if i wanted to add supermoderators or another usergroup i just change this:

if ($bbuserinfo['usergroupid']!=6) {

to this?:

if ($bbuserinfo['usergroupid']!=5 AND $bbuserinfo['usergroupid']!=6 AND $bbuserinfo['usergroupid']!=7) {
Reply With Quote
  #3  
Old 04-18-2004, 12:44 PM
miz miz is offline
 
Join Date: Mar 2003
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if (($bbuserinfo['usergroupid']!=5) or ($bbuserinfo['usergroupid']!=6) or ($bbuserinfo['usergroupid']!=7)) {

this is the right syntex

i dont think some1 can be in 3 usergroups
Reply With Quote
  #4  
Old 04-18-2004, 02:09 PM
Aaron1's Avatar
Aaron1 Aaron1 is offline
 
Join Date: Oct 2002
Location: Amsterdam
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm thanks, but that doesn't work for me, ackwardly enough, mine does though :-)

---------------------------------------------------------
function admin($admintext) {
global $post, $bbuserinfo, $DB_site;
if ($bbuserinfo['usergroupid']!=5 AND $bbuserinfo['usergroupid']!=6 AND $bbuserinfo['usergroupid']!=7) {
$adminktext="";
}
return "$admintext";
}
---------------------------------------------------------

If i am not mistaken (i could be though) the script above means (simply said):

If user is NOT in groupid 5 and NOT in group id 6 and NOT in group id 7 show nothing, if he is, show admin text.

Forgive me i am trying to learn PHP abit, and i hope i doing ok


And i have another question, how do you design the $admintext? Can i use stylesheet for that? If i try this, it will show the div class box for people that aren't allow to see it.

return "<div class=\"admtxt\">$talktext</div>";

Thanks again!

/Aaron

-
Reply With Quote
  #5  
Old 04-18-2004, 02:24 PM
Dimitrix Dimitrix is offline
 
Join Date: Mar 2002
Location: Pittsburgh, PA
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

AND is not the correct syntax but it will work (I guess)
Use && instead of AND, but if it works for you, good
Dimitry
Reply With Quote
  #6  
Old 04-18-2004, 09:26 PM
miz miz is offline
 
Join Date: Mar 2003
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

admin text is not desgined its return it as normal text like all other threads text
if u want to desgin its throw the templte engine u can call to admin text car with gettemplte engine

and 1 more thing

when u past parts of code please use the php tags
so unlincened users wont be able to see parts of code
thanx
Reply With Quote
  #7  
Old 04-19-2004, 09:12 AM
Aaron1's Avatar
Aaron1 Aaron1 is offline
 
Join Date: Oct 2002
Location: Amsterdam
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry Miz, you are right, i forgot about it!
Can you take a look if i am close on using a template for this?
I already created a special template with the $admintext in it. But not sure about the code in functions.php

I attached the code this time :-)
Reply With Quote
  #8  
Old 04-19-2004, 10:47 AM
miz miz is offline
 
Join Date: Mar 2003
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nop
u ++++ed up the text hehe
its get the admin text any way
change it to be like that

PHP Code:

// ###################### Start admin ######################## 
function admin($admintext) { 
  global 
$post$bbuserinfo$DB_site
  if ((
$bbuserinfo['usergroupid']!=5) && ($bbuserinfo['usergroupid']!=6) && ($bbuserinfo['usergroupid']!=7)) {
    
$admintext=""
  } else {
  eval(
"\$admintext = \"".gettemplate("admin_text")."\";");
}
  return 
"$admintext"

u missed this else part..
Reply With Quote
  #9  
Old 04-19-2004, 10:54 AM
Aaron1's Avatar
Aaron1 Aaron1 is offline
 
Join Date: Oct 2002
Location: Amsterdam
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Woohaa! To cool, that worked Miz! :-)
Thanks for the help! Appreciated!
Reply With Quote
  #10  
Old 04-20-2004, 03:06 PM
miz miz is offline
 
Join Date: Mar 2003
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

np, if u liked this hack please press the install button ;]
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 07:14 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.05437 seconds
  • Memory Usage 2,309KB
  • Queries Executed 25 (?)
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
  • (7)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete