vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   usernames in qoutes for member/guests (https://vborg.vbsupport.ru/showthread.php?t=275296)

ReBe 12-10-2011 09:14 AM

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.

Lynne 12-10-2011 04:37 PM

Perhaps you can write a plugin that turns postcaching off for guests?

ReBe 12-10-2011 07:03 PM

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;
}


ReBe 12-15-2011 02:09 PM

Its really important for me. So it would be nice, if someone can help me. :)

Lynne 12-15-2011 03:26 PM

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.

ReBe 12-15-2011 05:11 PM

No, i dont try this, because the terminus "enablepostcache" comes from my fantasie. It would be mad random, if that's true. :)

kh99 12-15-2011 06:04 PM

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).

ReBe 12-15-2011 07:42 PM

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.

ReBe 12-18-2011 11:54 AM

Quote:

Originally Posted by kh99 (Post 2278088)
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

kh99 12-18-2011 11:58 AM

Yeah, sorry, it should have been this:

Code:

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



All times are GMT. The time now is 07: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.03913 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete