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

Reply
 
Thread Tools Display Modes
  #1  
Old 12-10-2011, 10:14 AM
ReBe ReBe is offline
 
Join Date: Jul 2007
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default usernames in qoutes for member/guests

Hi all,

i have make the usernames in quotes invisible vor guests. Members can see the names. I edit the template bbcode_quotes per TMS:

I replace
Code:
<img src="{vb:stylevar imgdir_misc}/quote_icon.png" alt="{vb:rawphrase quote}" /> {vb:rawphrase originally_posted_by_x, {vb:raw username}}
with
Code:
<img src="{vb:stylevar imgdir_misc}/quote_icon.png" alt="{vb:rawphrase quote}" /> 
<vb:if condition="$show['member']">{vb:rawphrase originally_posted_by_x, {vb:raw username}}
<vb:else />
<span style="font-weight:bold; font-size:10pt">{vb:rawphrase quote}</span>
</vb:if>
After that, i create new postcache. Now it works fine. But after some hours can members in some postings not seeing the names and guest see the names in some posts. If i now let the postcache create new, then the errors are gone.

I think if a guest look as the first user to a post, then the posting comes with no username in quote in the postcache. And if the a member looks to this posting, it comes from the postcache. And thats why the member not see the username. I hope you can follow me.

How can i fix it? We have realnames in our foum, so ist necassery to hide the usernames for guest/searchengines.
Reply With Quote
  #2  
Old 12-10-2011, 05:37 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Perhaps you can write a plugin that turns postcaching off for guests?
Reply With Quote
  #3  
Old 12-10-2011, 08:03 PM
ReBe ReBe is offline
 
Join Date: Jul 2007
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for your answer. But i have no idea how to write a plugin.

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

I search this and the german vb-forum, but i found no good dokumantation for the plugin-creation.
I make a try, please help me:

Add-On: vBulletin
Hook: ?

PHP-Code:
Code:
if($vbulletin->$bbuserinfo[usergroupid] == '1'
{
    $vbulletin->options['enablepostcache'] = 0;
}
Reply With Quote
  #4  
Old 12-15-2011, 03:09 PM
ReBe ReBe is offline
 
Join Date: Jul 2007
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Its really important for me. So it would be nice, if someone can help me.
Reply With Quote
  #5  
Old 12-15-2011, 04:26 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you try that plugin? Perhaps at global_bootstrap_start? or global_bootstrap_end?

Also, make sure you develop plugins on your test site, not live site.
Reply With Quote
  #6  
Old 12-15-2011, 06:11 PM
ReBe ReBe is offline
 
Join Date: Jul 2007
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, i dont try this, because the terminus "enablepostcache" comes from my fantasie. It would be mad random, if that's true.
Reply With Quote
  #7  
Old 12-15-2011, 07:04 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I haven't tried it, but you could try a plugin using hook location showthread_post_start and this code:

Code:
if($vbulletin->userinfo[usergroupid] == '1')
{
    $post_cachable = 0;
}

That might work for showthread.php but I'm not sure if there's anywhere else that might be a problem. I think a better thing to do would be to arrange for specific posts to not be cached, which can be done by setting $parsedtext = '' at hook bbcode_parse_start. The problem is that you'd have to figure out how to tell if a post has the quote tag in it. You could set $parsedtext = '' all the time and effectively turn off all post caching, but I don't know if you want to do that. I know my site has a lot of guest activity so i don't think we'd even want to turn off caching for guests.

(BTW, you can't check the usergroup to decide whether or not to set $parsedtext = '' or you'll end up with the same problem you have now).
Reply With Quote
  #8  
Old 12-15-2011, 08:42 PM
ReBe ReBe is offline
 
Join Date: Jul 2007
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for your detailed answer. If i understand you right, i can use the template edits (see first post) + parse the postings for quote-tags and dont cache that quote-postings. I think that would be the best option for me. I will try that at the weekend.

I wonder that i´m be probably the only one with the wish to make the usernames for guests invisible. Social screening is a major theme and its a big advantage, if your realname will dont show for guests and searchengines.
Reply With Quote
  #9  
Old 12-18-2011, 12:54 PM
ReBe ReBe is offline
 
Join Date: Jul 2007
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
I haven't tried it, but you could try a plugin using hook location showthread_post_start and this code:

Code:
if($vbulletin->$bbuserinfo[usergroupid] == '1')
{
    $post_cachable = 0;
}
It does not work. I get a error message:
Code:
Fatal error: Cannot access empty property in /var/www/vhosts/xxxxx/httpdocs/showthread.php(811) : eval()'d code on line 1
Reply With Quote
  #10  
Old 12-18-2011, 12:58 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, sorry, it should have been this:

Code:
if($vbulletin->userinfo[usergroupid] == '1')
{
    $post_cachable = 0;
}
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 10:05 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.06944 seconds
  • Memory Usage 2,252KB
  • Queries Executed 11 (?)
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
  • (7)bbcode_code
  • (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_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