Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Hide ANYTHING from unregistered user Details »»
Hide ANYTHING from unregistered user
Version: , by Tim Wheatley Tim Wheatley is offline
Developer Last Online: Dec 2021 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 09-07-2002 Last Update: Never Installs: 0
 
No support by the author.

Insert this into phpinclude template:

Code:
// hide feature from unregistered
if ($bbuserinfo['userid']<"1") {
    $unregopen = "<!-- ";
} else {
    $unregopen = "";
}
// hide feature from unregistered

// hide feature from unregistered
if ($bbuserinfo['userid']<"1") {
    $unregclose = " -->";
} else {
    $unregclose = "";
}
// hide feature from unregistered
Then if you want to hide something place

$unregopen before it and $unregclose after it.

This is someone elses hack to show the register button to guests and the cp button to members, but i changed it for this, I feel quietly pleased with myself.

Show Your Support

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

Comments
  #2  
Old 09-07-2002, 07:10 PM
Tim Wheatley's Avatar
Tim Wheatley Tim Wheatley is offline
 
Join Date: Nov 2001
Location: England
Posts: 489
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just noticed too, by doing it this way I'm getting:

Logged in as me:
(11.37% PHP - 88.63% MySQL) with 35 queries.

Logged Out:
(9.99% PHP - 90.01% MySQL) with 28 queries.

I was actually worried I'd add some time too but, nope.
Reply With Quote
  #3  
Old 09-18-2002, 10:22 AM
ProgS ProgS is offline
 
Join Date: Sep 2002
Location: berlin - germany
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$unregopen='';
$unregclose='';
if (
$bbuserinfo['userid'] == 0) {
  
$unregopen '<!-- ';
  
$unregclose '-->';

i dont understand why I cant use the variables for example in the postbit-template?!

It doesnt work!!!
everybody means: it must work, but it doesnt!

for exemple:

in phpinclude-template I wrote:

$test = "hallo";

in postbit-template I use the variable $test, but nothing happend (empty)!!!

what do I wrong???

please help...
thxxxx

greez
sven
Reply With Quote
  #4  
Old 09-18-2002, 11:47 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ProgS - you do not put anything of your own into the phpinclude template - you put the code exactly as Tim has posted in the first post.

Then, in any template, like he said, if you don't want something to show up for an unregistered user, you comment it out with HTML using the function that you have just pasted by adding the commenting out tags.

Read his first post carefully - he explains it quite well.

Good idea Tim. You can make this into a hack, by placing the same code in global.php.
Reply With Quote
  #5  
Old 09-18-2002, 11:59 AM
ProgS ProgS is offline
 
Join Date: Sep 2002
Location: berlin - germany
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@Erwin

you havent understand what I mean!!!
but in the other thread of me I got the answer for my problem!

I had exactly this script included like in the first post!
I can use this variables in the header-template, okay...
but NOT in the postbit-template!!!
I dont know why, but it is so...

but thank you for your answer!!!
Reply With Quote
  #6  
Old 09-18-2002, 03:15 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've tested it and you're right ProgS.
You can't use the variables defined in phpinclude in the postbit template....

think i have to take a look why it's so as it is
Reply With Quote
  #7  
Old 09-18-2002, 03:35 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this is the code i use in my phpinclude:
Code:
// Make feature just show for logged ins
// And code just for unregistred users
if ($bbuserinfo['userid']<1) {
    $justloggedinopen = "<!-- ";
    $justloggedinclose = " -->";
    $justunregopen = "";
    $justunregclose = "";
} else {
    $justloggedinopen = "";
    $justloggedinclose = "";
    $justunregopen = "<!-- ";
    $justunregclose = " -->";
}
it works on most of the templates, but not on postbit??
it think it has something to do with the repeating...
i hope i'll find out
Reply With Quote
  #8  
Old 09-19-2002, 06:47 AM
ProgS ProgS is offline
 
Join Date: Sep 2002
Location: berlin - germany
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Xenon
this is the code i use in my phpinclude:
...
it works on most of the templates, but not on postbit??
it think it has something to do with the repeating...
i hope i'll find out
thxxx!
nice to see that somebody understand me!!!

I still spend to much time for this prob...

I hope in version 3 it is solved, and then the pics an links are only to see if the user has the permissions for it....
Reply With Quote
  #9  
Old 09-19-2002, 09:26 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

damn, it's so obvious...
think i have had to less time yesterday when trying this out.

the postbit template is parsed within the getpostbit-FUNCTION so all variables which are not global would be nulled.

so in your admin/functions.php in getpostbit section you have to add
PHP Code:
 global $unregopen,$unregclose
befor this:
PHP Code:
    // user
    
global $bbuserinfo,$session,$ignore,$cookietimeout
Reply With Quote
  #10  
Old 09-20-2002, 05:36 PM
spittingangels spittingangels is offline
 
Join Date: Mar 2002
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great idea, i can also see how a slight modification of this hack would assist in creating a usergroup with limited features.

for instance, i have a user on my board that insists on using a post icon designated for mature/adult type posts only and does so on every one of his posts out of context despite being asked not to repeatedly. i don't want to ban him but with a mod of this hack, i can remove the post icon section entirely from his view, plus other features like smilies and any other features that are abused.

i have yet to install this hack but i will try tonight. last night i tried and fubared my functions.php file (don't ask) but i was not at my own computer with all my backup files like i will be tonight.
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 01: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.04692 seconds
  • Memory Usage 2,306KB
  • Queries Executed 23 (?)
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
  • (2)bbcode_code
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)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
  • (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_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