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 09-22-2014, 03:27 PM
mightyudis mightyudis is offline
 
Join Date: Mar 2014
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Change threadbit if user is deleted

Hey,

i am trying to change the content of the author div in threadbit, base on whether the user is deleted or not.

This is the default threadbit author div of the template i use (and also the default vbulletin4 i belive)
Code:
{vb:rawphrase started_by_x_y_z_a, {vb:link member, {vb:raw thread}, null, 'postuserid', 'postusername'}, {vb:raw thread.postusername}, {vb:raw thread.startdate}, {vb:raw thread.starttime}, {vb:stylevar dirmark}}
This results in
Quote:
Started by Username, 31.12.2014 23:59
Which is fine for existing users, but if the user is deleted the query results in
Quote:
Started by , 31.12.2014 23:59
So i tried to get the username from {vb:raw post.username}
Code:
{vb:rawphrase started_by_x_y_z_a, {vb:raw post.username}, {vb:raw thread.postusername}, {vb:raw thread.startdate}, {vb:raw thread.starttime}, {vb:stylevar dirmark}}
Which works fine, but there is no markup for the usernames and vbulletin is making the username linking to root dir.
Quote:
Started by Deletedusername[marked as link to root dir /], 31.12.2014 23:59
I tried hard-linking the variables, which works too
Code:
Started by {vb:raw thread.postusername}, {vb:raw thread.startdate} {vb:raw thread.starttime}
but has no phrase support for non-english users and i still lack the if condition.

My questions are:
- How can i test in the template whether the user still exists or not with some <vb:if> (or something else)

IF user exists
Started by Username with markup and all
ELSE
Started by Deletedusername just plain text

- and how can i then use phrase replacements without vbulletin marking the deleted usernames as links?

Any suggestions?

Regards
Reply With Quote
  #2  
Old 09-22-2014, 03:49 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why not just try this mod, https://vborg.vbsupport.ru/showthread.php?t=245183
Reply With Quote
  #3  
Old 09-22-2014, 04:01 PM
mightyudis mightyudis is offline
 
Join Date: Mar 2014
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I found this too while searching for a solution, but i don't want to have to do it for manually every thread of a user i delete/that gets deleted in a cleanup process.

(Also i am pretty sure that the query would still return empty since the username doesn't exist anymore, but can be accessed via {vb:raw post.username})

So changing the template query seems the better solution to me. (And i don't have to install another mod that may or may not interfer with other mods/custom modifications)
Reply With Quote
  #4  
Old 09-22-2014, 04:05 PM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mightyudis View Post
I found this too while searching for a solution, but i don't want to have to do it for manually every thread of a user i delete/that gets deleted in a cleanup process.
Search up "One touch ban and clean" here.
Reply With Quote
  #5  
Old 09-22-2014, 04:07 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For your condition, you can look to see of $post[userid] > 0. Basically, deleted users no longer have a userid.
Reply With Quote
Благодарность от:
tbworld
  #6  
Old 09-22-2014, 04:14 PM
mightyudis mightyudis is offline
 
Join Date: Mar 2014
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Max Taxable View Post
Search up "One touch ban and clean" here.
Thanks, but that still does not display the deleted username in the threadbit of forumdisplay.

(Which is probably not the main goal for the modification to begin with)

Quote:
Originally Posted by Lynne View Post
For your condition, you can look to see of $post[userid] > 0. Basically, deleted users no longer have a userid.
Okay, i will try that.
Reply With Quote
  #7  
Old 09-22-2014, 04:18 PM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mightyudis View Post
Thanks, but that still does not display the deleted username in the threadbit of forumdisplay.
Right, because once you use the one touch ban and clean there is nothing to display.

Maybe I don't understand the problem or the circumstances. My post was about how to avoid this issue in the future.
Reply With Quote
  #8  
Old 09-22-2014, 08:25 PM
mightyudis mightyudis is offline
 
Join Date: Mar 2014
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I solved a part of my problem. Somebody had installed the e360 markup mod. As i deactivated the mod all thread creator names were shown.

e360 uses
PHP Code:
fetch_musername($fetch_userinfo); 
to get the marked up name, but on a deleted user this of course returns empty, so there is no data for
PHP Code:
fetch_musername($fetch_userinfo
So i modified it to use
PHP Code:
if (empty($thread['post_musername'])){
        
$thread['post_musername']  = "<strike>".$thread['postusername']."</strike>";

in the threadbit_display.php hook to get the username from $thread and striking it through.

That solves the first part of my problem.

Now vbulletin just has to stop to link to non-existing profiles and everything is flowers.

Thanks for the help so far.
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:57 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.04529 seconds
  • Memory Usage 2,243KB
  • 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
  • (3)bbcode_code
  • (3)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (1)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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
  • 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