Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 11-25-2014, 03:00 PM
omardealo's Avatar
omardealo omardealo is offline
 
Join Date: Nov 2008
Location: egypt
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default [SOLVED] hide the full post for a specific post for a specific user

HELLO ,

I Use this code to hide the content of post for a specific post for a specific member , And works well .
but if I want to hide the full post ,What condition should I use?


HOOK : postbit_display_complete

Code:
if ($vbulletin->userinfo['userid']==1 AND $this->post['postid']==35) 
{
$replacer = "You can not see the content";
$this->post['message'] = str_replace($post[message],$replacer,$this->post['message']); 
}
Reply With Quote
  #2  
Old 11-25-2014, 05:05 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Doesn't that hide the full post (postid 35)? Or do you mean you don't want to show that message ("You can not see the content") either?
Reply With Quote
Благодарность от:
omardealo
  #3  
Old 11-25-2014, 05:12 PM
omardealo's Avatar
omardealo omardealo is offline
 
Join Date: Nov 2008
Location: egypt
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Doesn't that hide the full post (postid 35)? Or do you mean you don't want to show that message ("You can not see the content") either?
i want hide full post (content+posterusername+all user info) without any message
Reply With Quote
  #4  
Old 11-25-2014, 05:15 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, that would be a bit more difficult especially since you will have a skip in postids (say, go from 3 to 5 instead of 3 to 4). Do you mind if the postids are not sequential?
Reply With Quote
  #5  
Old 11-25-2014, 05:43 PM
omardealo's Avatar
omardealo omardealo is offline
 
Join Date: Nov 2008
Location: egypt
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Ah, that would be a bit more difficult especially since you will have a skip in postids (say, go from 3 to 5 instead of 3 to 4). Do you mind if the postids are not sequential?
yeah i know postids will be are not sequential , but not for all users
only userid 1 will not see postid 35 but he still see postid 1,2,3...elc 33,34,36...elc
Reply With Quote
  #6  
Old 11-25-2014, 08:09 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You may want to just put a condition around the whole postbit & postbit_legacy template.

<if condition="!($post[postid]==35 AND $bbuserinfo[userid]==1)">
all the postbit code
</if>
Reply With Quote
  #7  
Old 11-26-2014, 11:10 AM
omardealo's Avatar
omardealo omardealo is offline
 
Join Date: Nov 2008
Location: egypt
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
You may want to just put a condition around the whole postbit & postbit_legacy template.

<if condition="!($post[postid]==35 AND $bbuserinfo[userid]==1)">
all the postbit code
</if>
thanx , it's working well :up: , can i do the same code by a plugin .. becouse if i used your code i must edit every style template [postbit & postbit_legacy]
Reply With Quote
  #8  
Old 11-26-2014, 04:38 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would guess so, but I don't know the plugin code off the top of my head. Perhaps someone else will have it.
Reply With Quote
Благодарность от:
ozzy47
  #9  
Old 11-26-2014, 06:18 PM
omardealo's Avatar
omardealo omardealo is offline
 
Join Date: Nov 2008
Location: egypt
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
I would guess so, but I don't know the plugin code off the top of my head. Perhaps someone else will have it.
okay ...
you have a very good help here :up: thank you anyway

--------------- Added [DATE]1417103600[/DATE] at [TIME]1417103600[/TIME] ---------------

okay , Simple solution , if you want hide a post by a plugin
Thanks again Lynne

HOOK : postbit_display_complete


PHP Code:
if ($vbulletin->userinfo['userid'] ==AND $this->post['postid'] ==35
{
// Replace the template with nothing SO Postid 35 does not appear for userid 1
$this->templatename '';

Reply With Quote
3 благодарности(ей) от:
Lynne, ozzy47, SnakeV
Reply

Thread Tools
Display Modes

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:39 AM.


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.04430 seconds
  • Memory Usage 2,255KB
  • 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
  • (1)bbcode_code
  • (1)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (5)post_thanks_box_bit
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete