vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Show thread created from SectionID in postbit (https://vborg.vbsupport.ru/showthread.php?t=312054)

Skyrider 06-11-2014 04:53 AM

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.

Skyrider 06-14-2014 06:16 AM

I assume no one knows?

tbworld 06-14-2014 08:09 AM

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.

Skyrider 06-15-2014 07:41 PM

Quote:

Originally Posted by tbworld (Post 2501883)
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.

kh99 06-15-2014 08:52 PM

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.

tbworld 06-15-2014 09:32 PM

Quote:

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

Skyrider 06-18-2014 04:30 PM

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!

kh99 06-18-2014 07:55 PM

Quote:

Originally Posted by Skyrider (Post 2502498)
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.

mokujin 06-18-2014 08:11 PM

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.

Skyrider 06-25-2014 06:50 AM

Quote:

Originally Posted by mokujin (Post 2502527)
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? :)


All times are GMT. The time now is 01:07 AM.

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.01923 seconds
  • Memory Usage 1,740KB
  • 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
  • (5)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