View Full Version : USER/CP Type Page
ChrisBaktis
02-20-2005, 09:34 AM
Im creating a Trade Center for my users based on the USER/CP area...
When you go into the USER/CP area now it shows all subscribed threads...I would like to replace this (in the trade center) to show the results of a search. I have a link that when you click it it will show all a users threads in a certain forum. I would like this list to display instead of subscribed threads. I dont know how to generate the results of this search without actually clicking a link.
Any help?
Anyone?
Mark Wing
02-21-2005, 02:51 AM
Chris,
I assume you don't want to get away from subscribing to threads?
Here is how I would attack this: Modify usercp.php and change the subscribed thread query so it return what you need.
Find this:
// query thread ids
$getthreads = $DB_site->query("
SELECT thread.threadid, thread.forumid
FROM " . TABLE_PREFIX . "thread AS thread, " . TABLE_PREFIX . "subscribethread AS subscribethread
LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(deletionlog.primaryid = thread.threadid AND type = 'thread')
WHERE subscribethread.threadid = thread.threadid
AND subscribethread.userid = $bbuserinfo[userid]
AND thread.visible = 1
AND lastpost > $bbuserinfo[lastvisit]
AND deletionlog.primaryid IS NULL
");
and change it to something like this:
// query thread ids
$getthreads = $DB_site->query("
SELECT distinct(thread.threadid), thread.forumid
FROM " . TABLE_PREFIX . "thread AS thread,
" . TABLE_PREFIX . "post AS post
WHERE thread.forumid = 36
AND thread.threadid = post.threadid
AND post.userid = $bbuserinfo[userid]
AND thread.visible = 1
ORDER BY thread.threadid
");
While I didn't actually test this out, the stuff you want should appear in place of subscribed threads. Finally, modify the USERCP template so that the title says what ever you want and not "Subscribed Threads."
I hope this helps. If you have questions, drop me an e-mail.
Mark
ChrisBaktis
02-21-2005, 01:19 PM
Mark,
Thanks for the help...Just a couple quick things maybe you can help with. This is the one part of vBulletin that I am still learning.
The change you had me do above works great. I want to run this by you so maybe I can get some additional help.
If I post a trade I want to make sure that if the person I traded with goes to his Trade Center that this post will show up. From the code above it looks like only the person who posted the thread will get it pulled. The way our members post trades is through a form that will add both traders names. Is there a way to use the above code to look throught the whole thread for the user name?
For example...If I post a trade with member 'test' and I go to the trade center, that post I just made will show up. I want member 'test' to be able to go to his trade center and see the same thread since his name is in it'. Is this possible?
Also I would like to use this for 2 additional forums, exact same things, but 2 different forums. I would want the results from each forum showing up seperate.
Im going to drop you an email with info also.
Thanks again.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.