Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-11-2014, 04:53 AM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Show thread created from SectionID in postbit

We are using a special reputation section where only 1 thread is allowed. The thing is that we need something that easily allows us to go to his/her reputation thread that he/she created within the reputation section. But the problem currently is that people constantly have to search for their own rep thread.

I was wondering if someone could help me out with a code that shows a users thread within the postbit area from a specific section.

For example:

Quote:
Join Date: Oct 27, 2008
Posts: 11
Threads: 2

IMAGE LINK TO REPUTATION THREAD
I was thinking of an image, but a link is fine as well (text link). I'm aware that if such code can be made, that there has to be certainty that the user can only create 1 thread max, without breaking stuff.

I appreciate all the help.
Reply With Quote
  #2  
Old 06-14-2014, 06:16 AM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I assume no one knows?
Reply With Quote
  #3  
Old 06-14-2014, 08:09 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I do not really have an answer for you, but I can fill in some blanks. The reputation table only stores the ID of the post where the reputation was given. So you need to query the post table with that ID to obtain the thread id. From there you could create a link and redirect to the users thread. Thankfully, you do not have to query the thread table since you already know the forum ID. I am guessing your one thread per user is in a unique forum.

Another approach although more evasive is to add "thread id" to the reputation table. Thus simplifying the recall of the data later.

I do not know if it helps at all, at least it's feedback.
Reply With Quote
  #4  
Old 06-15-2014, 07:41 PM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tbworld View Post
I do not really have an answer for you, but I can fill in some blanks. The reputation table only stores the ID of the post where the reputation was given. So you need to query the post table with that ID to obtain the thread id. From there you could create a link and redirect to the users thread. Thankfully, you do not have to query the thread table since you already know the forum ID. I am guessing your one thread per user is in a unique forum.

Another approach although more evasive is to add "thread id" to the reputation table. Thus simplifying the recall of the data later.

I do not know if it helps at all, at least it's feedback.
My apologies. We aren't using the reputation feature of vBulletin for the reputation section. The reputation section we use with reputation posts/threads identifies who the user is, and has their information within their post.

Seeing it's a bit of a pain to search for their reputation thread all the time, and seeing they can only have 1 thread within that specific section. I was wondering if I could add a thread link witin the postbit_legacy pinpointing to their first (and only) thread they created within that section.
Reply With Quote
  #5  
Old 06-15-2014, 08:52 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think what you'd want to do is something like add a column to the user table and use it to save the threadid of the reputation thread when it's created, then use that value to create a link in the postbit. Or you might be able to use a profile field instead. In either case you could write a short piece of code that would run once to set the field for existing users by doing queries on the thread table as you suggested.
Reply With Quote
  #6  
Old 06-15-2014, 09:32 PM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
I think what you'd want to do is something like add a column to the user table and use it to save the threadid of the reputation thread when it's created, then use that value to create a link in the postbit. Or you might be able to use a profile field instead. In either case you could write a short piece of code that would run once to set the field for existing users by doing queries on the thread table as you suggested.
Yep, it should be coded in a method similar to yours @kh99. I was just stating the process of obtaining the data as an example. In reality I would have coded something similar, eliminating the extra query. Although on my board, adding to the user table can be more of a challenge.
Reply With Quote
Благодарность от:
kh99
  #7  
Old 06-18-2014, 04:30 PM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would love to design such a system, sucky part is that I suck at coding so I have honestly no idea how to make it. Appreciate the replies btw!
Reply With Quote
  #8  
Old 06-18-2014, 07:55 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Skyrider View Post
Would love to design such a system, sucky part is that I suck at coding so I have honestly no idea how to make it. Appreciate the replies btw!
Yeah, this is the request forum and not the programming forum. I think your request is somewhere near that grey area between custom programming and a generally useful mod. But maybe someone would be willing to write a mod that takes a forumid as a setting, and whenever a thread is created in that forum the threadid is saved in the user table. And the install code could fill it in for existing threads. That might be general enough to be of interest to other forum owners.
Reply With Quote
  #9  
Old 06-18-2014, 08:11 PM
mokujin's Avatar
mokujin mokujin is offline
 
Join Date: Oct 2005
Location: Czech
Posts: 345
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very easy way to do it, create a new field in usertextfield table, and a hook that after a user creates a thread there it updates that threadid to the field in usertextfield table. Then you can use if/else condition in template to show user's thread.
Reply With Quote
Благодарность от:
tbworld
  #10  
Old 06-25-2014, 06:50 AM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mokujin View Post
Very easy way to do it, create a new field in usertextfield table, and a hook that after a user creates a thread there it updates that threadid to the field in usertextfield table. Then you can use if/else condition in template to show user's thread.
Haha, maybe easy for you but not for me. Would you be so kind to create the code for me?
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:10 PM.


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.09339 seconds
  • Memory Usage 2,266KB
  • 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
  • (5)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
  • (2)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (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
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete