Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Using XThreads Custom Thread Field to Hold Additional Data
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #5
RE: Using XThreads Custom Thread Field to Hold Additional Data
(03-28-2011 11:52 PM)leefish Wrote:  I just think requiring the user to "mark" the thread will risk us having incomplete data.
I'm sorry, I can't understand what you meant by the 'incomplete data'?

(03-28-2011 11:52 PM)leefish Wrote:  If this was a new install I would think it would be better that the action of downloading the item automatically updated the existing table.
If you already edit the XThreads file, I think you can stick the code there.

(03-28-2011 11:52 PM)leefish Wrote:  I already have something "hooked" onto that bit of the xthreads.attach.php...... if it was possible to add them both then that would be cool, but I see that there may be an issue with guest downloads.
Probably create other dedicated table with this structure:

did => Primary Key
aid => attachment id
tid => thread id
uid => user id (downloader)
lastupdate => the updatetime of the attachment being downloaded. Probably you need to edit your query to load the update time of the attachment being downloaded, and record the result into this field.

Update/insert the fields when a user download an attachment.

(03-28-2011 11:52 PM)leefish Wrote:  but I see that there may be an issue with guest downloads.
Check whether the user has an uid or not before run the update/insert query?

(03-28-2011 11:52 PM)leefish Wrote:  I would definitely see this as a thing for the downloader/admin to use, and for the actual uploader to have no visibility on WHO downloaded the thread. In my experience it could cause squabbles and friction if an uploader discovers that user x downloaded and did not thank the thread (simmers are very emotional).
I think in showthread you can check whether a user is admin or not before run a query (if you want to display who downloaded the attachment in this page) from the table (select uid, and put tid in WHERE clause)?

In usercp (using a specified action maybe), run a query (put uid in WHERE clause). I think you need to join the xtattachments table with this query, so you can compare the lastupdate and the updatetime.

It is only my opinion Biggrin

03-29-2011 06:44 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: Using XThreads Custom Thread Field to Hold Additional Data - RateU - 03-29-2011 06:44 AM

 Standard Tools
Forum Jump: