vBulletin Modifications

Variable Help - Last Attachment shows on forumdisplay.

Welcome to vBHackers.com! - vBHackers Updates:

Go Back   vBulletin Modifications > General vBulletin Section > General vBulletin Support

Reply
 
LinkBack Thread Tools
Old 06-19-2006, 04:16 PM   #1
Charter Member
Aceman's Avatar
Join Date: Apr 2004
Real Name: Chris Canada
Location: Washington D.C.
Aceman is on a distinguished road

Default Variable Help - Last Attachment shows on forumdisplay.

I am currently attempting to modify the following hack:

http://www.vbulletin.org/forum/showthread.php?t=98651

Basically this hack shows the first attachment of the first post of the thread on the forumdisplay page. This would be great because I have a PROJECTS area that I would like to be able to show the LATEST PROGESS on the forumdisplay page.

I'm currently trying to modify this hack to show the LAST ATACHMENT, from the LATEST POST of the THREAD STARTER. Ignoring all other attachments posted by other users to the thread.

The XML file reads like this: (orginal) -

You must first be a registered member to view any code.
if you change the MIN to a MAX is simply shows the LAST POST from the very first post of the thread.. not exactly what I'm looking for.

Would any VB Guru be willing to give me alittle guideance?

Aceman




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 06-19-2006, 04:23 PM   #2
vBulletin Guru
Nick R's Avatar
Join Date: May 2006
Real Name: Nick
Location: Cyberspace, UK
Nick R is on a distinguished road

Default

what do you want to do then? Show the latest attachment submitted by the thread starter on the thread bit?




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-19-2006, 04:36 PM   #3
Charter Member
Aceman's Avatar
Join Date: Apr 2004
Real Name: Chris Canada
Location: Washington D.C.
Aceman is on a distinguished road

Default

I want to show the last attachment made to the thread by the thread starter on the forumdisplay page. Ignoring any attachment made by other users. This hack in it's native format shows the FIRST attachment to the thread. And it works great.. I just want to modify that.

And I can't figure out how to modify the xml to show the correct thumbnail of the last attachment posted to teh thread my the thread's starter.

Aceman




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-19-2006, 04:37 PM   #4
vBulletin Guru
Nick R's Avatar
Join Date: May 2006
Real Name: Nick
Location: Cyberspace, UK
Nick R is on a distinguished road

Default

ah so by attachment do you mean thumbnail not file.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-19-2006, 04:38 PM   #5
vBulletin Guru
Nick R's Avatar
Join Date: May 2006
Real Name: Nick
Location: Cyberspace, UK
Nick R is on a distinguished road

Default

this could work:
You must first be a registered member to view any code.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-19-2006, 04:44 PM   #6
Charter Member
Aceman's Avatar
Join Date: Apr 2004
Real Name: Chris Canada
Location: Washington D.C.
Aceman is on a distinguished road

Default

Database error when you change first to last in the line you changed of that code.

$hook_query_joins .= "LEFT JOIN " . TABLE_PREFIX . "attachment as attachment ON(attachment.postid = thread.firstpostid) "

$hook_query_joins .= "LEFT JOIN " . TABLE_PREFIX . "attachment as attachment ON(attachment.postid = thread.lastpostid) " <-- Database Error when you use this.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-19-2006, 04:46 PM   #7
Charter Member
Aceman's Avatar
Join Date: Apr 2004
Real Name: Chris Canada
Location: Washington D.C.
Aceman is on a distinguished road

Default

http://www.scifi-meshes.com/forums/forumdisplay.php?f=9 <--- shows the working UNMODIFIED version of this hack which merely shows the first attached image on the forumdisplay.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-20-2006, 12:13 PM   #8
Charter Member
Aceman's Avatar
Join Date: Apr 2004
Real Name: Chris Canada
Location: Washington D.C.
Aceman is on a distinguished road

Default

Where are my uber coders out there?!




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-21-2006, 03:33 AM   #9
Coder
SirAdrian's Avatar
Join Date: Jun 2006
SirAdrian is on a distinguished road

Default

Was Boofo helping you with this earlier? lol Sounds awfully familiar...

Anyway, this is what I told him:

Because there is no way to tell the threadID in the attachment table, you could either go the path of extreme inefficiency, store the threadid in the attachment table, or store the last attachmentID that you want in the thread table. After you do any of these last two options, it should make things much simpler.

The cheap-o solution I offered him earlier (which you didn't like) was to simply change the MIN to a MAX, but that limits the attachments to the first postid.

I can't offer much more help at this point, too busy. I should have some time this weekend if you are still stumped.

--

edit: after actually reading the other post in the thread... add a lastpostid field to the database. Have it update whenever it updates the last poster. The only downside of this way is if the last post has no attachment it won't work.
__________________


vBlogetin: an advanced blogging tool for vBulletin
>> Beta 3 released with SE-Friendly URLs!

Last edited by SirAdrian; 06-21-2006 at 04:01 AM.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-21-2006, 11:51 AM   #10
vBulletin Guru
Arnoud's Avatar
Join Date: Nov 2004
Real Name: Arnoud Kuipers
Location: Europe, Flanders
Arnoud is on a distinguished road

Default

The lastpostid has already been added in vB 3.6.0.. just a little fyi.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Attachment page emzz vBulletin Modification Requests 3 12-30-2005 05:22 PM
Attachment lockdown untill reply b6gm6n vBulletin Modification Requests 15 07-10-2005 09:27 AM
Forumdisplay FTP & Country D3LTA vBulletin Modification Requests 6 12-31-2004 12:46 AM
Thumbnail of attachment on forumdisplay Aceman vBulletin Modification Requests 11 12-24-2004 11:04 PM
Private Message attachment Keyser Söze vBulletin Modification Requests 2 10-31-2004 10:28 PM


All times are GMT -3. The time now is 02:04 PM.


SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc. (Patent Pending)