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

Reply
 
Thread Tools Display Modes
  #1  
Old 06-28-2008, 01:49 AM
Sema Sema is offline
 
Join Date: Jul 2007
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need Help With My First Product

Hello,,,

This is my first product

I am so excited about it

But I have a problem in it

The Product is to hide some Profiles and I tryed to do that in the plugin but it didn't work so I did it in MEMBERINFO Template.

I know what is wrong but I don't know what to do to fix it.

Code:
<if condition="$vboptions[on_off]">
<if condition="$userinfo['userid'] == $vboptions[profileid]">
standard_error('Sorry you are not allowed to view this profile')
</if>
</if>
The problem is in
PHP Code:
standard_error('Sorry you are not allowed to view this profile'
How can I fix that?
Reply With Quote
  #2  
Old 06-28-2008, 04:56 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You cannot run PHP functions in templates.
Reply With Quote
  #3  
Old 06-28-2008, 03:14 PM
Sema Sema is offline
 
Join Date: Jul 2007
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As I said I know the problem but how can it show the error message because if I use the plugin it will not show the error.

I use this code:

PHP Code:
$on $vbulletin->options['on_off']; 
$hide $vbulletin->options['profileid']; 
$user $user[userid]; 

if (
$on){ 
if (
$hide !=""){ 
if (
$user == $hide){ 

standard_error('Sorry you are not allowed to view this profile'); 



Reply With Quote
  #4  
Old 06-28-2008, 03:25 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can combine all of that into a single condition...
PHP Code:
if(($vbulletin->options['on_off']) AND (!empty($vbulletin->options['profileid'])) AND ($user['userid'] == $vbulletin->options['profileid']))
{
    
standard_error('Sorry...');

Are you sure [minicode]$user['userid'][/minicode] is the correct variable, maybe it should be [minicode]$userinfo['userid'][/minicode]?

Use print_no_permission()
Reply With Quote
  #5  
Old 06-28-2008, 09:10 PM
Sema Sema is offline
 
Join Date: Jul 2007
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am just a newbie so combining would be a hard thing because I need to know where is the errors, but I can't make it better that what you did

I don't want to use
PHP Code:
print_no_permission() 
I thought about using it but the message is better to show the reason

I am not sure about
PHP Code:
$user['userid'
it dosen't work even with
PHP Code:
$userinfo['userid'
but it is used in the template MEMBERINFO

I don't think there should be template change because the plugin hook is member_start
Reply With Quote
  #6  
Old 06-29-2008, 02:57 AM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The current userinfo is
PHP Code:
$vbulletin->userinfo 
or in template
Code:
$bbuserinfo
On member.php the userinfo of the profile is
PHP Code:
$userinfo 
Reply With Quote
  #7  
Old 06-29-2008, 03:38 AM
Sema Sema is offline
 
Join Date: Jul 2007
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I used it like that

PHP Code:
if(($vbulletin->options['on_off']) AND (!empty($vbulletin->options['profileid'])) AND ($vbulletin->userinfo['userid'] == $vbulletin->options['profileid']))
{
    
standard_error('Sorry you are not allowed to view this profile');

But the problem is it is hiding the profile if the viewer id was = userid

What I want is to hide the profile from all members

ex.
If the page was
Code:
www.example.com/member.php?u=$vbulletin->options['profileid']
It will show the error message.
Reply With Quote
  #8  
Old 06-29-2008, 04:26 AM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
if($userinfo['userid'] == $vbulletin->options['profileid'])
{
//show error

Reply With Quote
  #9  
Old 06-29-2008, 12:30 PM
Sema Sema is offline
 
Join Date: Jul 2007
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I did try the code but it dosn't work

PHP Code:
if(($vbulletin->options['on_off']) AND (!empty($vbulletin->options['profileid'])) AND ($userinfo['userid'] == $vbulletin->options['profileid']))
{
    
standard_error('Sorry you are not allowed to view this profile');

For more than a week and I am doing my best to make it work and I try to do it more than 300 times ya realy more than 300 times
Reply With Quote
  #10  
Old 06-29-2008, 12:55 PM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What hook are you putting it at?
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:31 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.04180 seconds
  • Memory Usage 2,274KB
  • 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_code
  • (11)bbcode_php
  • (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