vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Recent Attachments (https://vborg.vbsupport.ru/showthread.php?t=61244)

MindTrix 02-05-2004 10:00 PM

Recent Attachments
 
Hack Author: MindTrix
Email: slimshadyandd12@hotmail.com


Description:

Simply adds a box to your forumhome page displaying the 5 most recent attachments and linking to them.

Credits:

Thanks go to assassingod for his incredible help and patients with me. He truely deserves his Mod spot so i would like to say thank you, And sorry for beeing such a pain. And thank you to Boofo who moaned at me for beeing a slacker and giving up easily :p Cheers Mate!!

Screenshot and installation text file attached. (Sorry for the poor HTML i am useless with the stuff)

(15/2/04 Update -- If you have Kentaurus brilliant Attachments In Private Messages hack installed you need to do this fix he posted here

https://vborg.vbsupport.ru/showpost....&postcount=113

To stop PM attachments showing on forumhome.

colicab-d 02-06-2004 06:33 PM

be amazing if this showed thumbs of the pics :p with an icon for other files :D

MindTrix 02-06-2004 06:35 PM

Yeah i thought the same to be honest. Guess thats something to aim too get done :)

Princeton 02-06-2004 07:19 PM

You can use the attachment id to fetch a thumbnail of file (for images) ... use and if statement to display thumbs (look into functions_showthread to add more functionality to your hack)

however, you will also have to think about permissions...

MindTrix 02-06-2004 07:24 PM

Thanks for the advice ill get right on it

MindTrix 02-06-2004 09:46 PM

First post updated. Attachments now show up as thumbnails. Hope that is better :p

NuclioN 02-06-2004 10:03 PM

Great addon. :) Is it possible to stretch the thumbnails in a horizontal block so you can put it under or above the navbar as in the photoposthack where the latest images are displayed in a similar way?

*arie 02-06-2004 10:06 PM

wow thanks.

LOL @ the latest pics in the attachment. :rolleyes:

NuclioN 02-07-2004 12:18 AM

Horizontal display:

recent_attachments:
Code:

<a href="attachment.php?attachmentid=$recentattachment[attachmentid]" target="_blank">
<img src="attachment.php?attachmentid=$recentattachment[attachmentid]" alt="$recentattachment[filename]" width="62" height="62" border="0"></a> <img src="./spacer.gif" height="0" width="90" border="0">

Under $navbar:

Code:

<table class="tcat" cellpadding="0" cellspacing="0" border="0" width="100%" align="center" valign="top">
<tr><td>
$latestattachments
</td></tr></table>

well..this is not 100% proper code but it looks ok on our forum. Untill it is better coded this is an option. :) You can upload a transparant spacer gif to the right dir. and force the space between the thumbnails in the desired width. Keep also in mind that altough it is a thumb the images have the full kb load on the forumhome.

colicab-d 02-07-2004 09:05 AM

hey thnx dark blue thats handy ;) cause we run a small arts community so this hack is a god send :D

*wonders if an external version showing the last attachment on vbindex etc would be poss :D

MindTrix 02-07-2004 10:29 AM

Thanks for that Nuclion!!

Colicab-d, what version of vbindex?

gmarik 02-07-2004 11:02 AM

Please, make a 2 and 3 and 4 row mode, so it would be more comact - will you?
Thanks, man - you're only 18, but what you code is really fine.

colicab-d 02-07-2004 11:05 AM

latest version mindtrix mate :D

also i know this a bi to ask but.... would it be also possible to show say the latest x attachments, but with only from x forum id :p (if u can accomplish it by mysql ur a god)

memobug 02-08-2004 06:29 AM

Is it possible to illustrate what this hack does using photographs of people with their clothes on not having sex?

assassingod 02-08-2004 09:06 AM

MindTrix, could you please upload a non-pornographic attachment please - thanks.

MindTrix 02-08-2004 10:04 AM

My bad :p Didnt realise to be honest, New screenshot uploaded (and they was not pornographic pictures if you saw them in full size)

Oblivion Knight 02-08-2004 12:19 PM

Just noticed by visiting your forum that the attachment thumbnails are broken. Is this because I'm a guest? If so, is this default behaviour of the mod?

If it is, instead of displaying the latest attachments box, you may well just want to hide them from guests all together.. Lots of red x's don't exactly attract guests to registering. Just a suggestion.!

MindTrix 02-08-2004 07:01 PM

Sorry i didnt think of that, or try it, Try this

replace the code in the php file with

PHP Code:

if ($bbuserinfo['usergroupid']!= 0) {
//Start recent attachments by Trix
$trix $DB_site->query("SELECT attachmentid, dateline, filename FROM attachment WHERE dateline < " TIME() ." ORDER BY dateline DESC LIMIT 5");

while (
$recentattachment $DB_site->fetch_array($trix))
{
    eval(
'$latestattachments .= "' fetch_template('recent_attachments') . '";');
}
//End recent attachments by Trix



Its just a rough guess but i assume it will work

Boofo 02-08-2004 07:40 PM

Or you could use:

PHP Code:

 if ($bbuserinfo['userid']) 


MindTrix 02-08-2004 07:41 PM

In the php file?

Boofo 02-08-2004 07:42 PM

In place of this in your code above. ;)

PHP Code:

 if ($bbuserinfo['usergroupid']!= 0


MindTrix 02-08-2004 07:44 PM

I thought you would need to check it against 0

assassingod 02-08-2004 07:46 PM

If you use
PHP Code:

if ($bbuserinfo['userid']) 

It still checks for 0 which is unregistered users. (I think anyway)

So that won't work.

MindTrix 02-08-2004 07:51 PM

Ahh right, thanks for that

Boofo 02-08-2004 07:57 PM

Steve, you're wrong. What that basically does is ask whether the user has a userid number. Unregsitered users don't. So, yes, it will work. ;)

assassingod 02-08-2004 08:02 PM

I'll admit when i'm wrong (And I was):p

I'll know next time hehe

Boofo 02-08-2004 08:06 PM

That's ok, buddy. You're not alone. ;)

MindTrix 02-08-2004 08:25 PM

Heck i dont even know what php is

Erwin 02-26-2004 09:29 AM

What would make this hack very useful is if you could make it so that it shows the latest attachments WITHIN a specific forum or subforums. :)

MindTrix 02-27-2004 09:32 AM

Guess thats what i need to aim for now then huh :) Thanks for the advice Erwin ill try

Allan 02-27-2004 09:36 PM

Very Nice , thank MindTrix :)

but, would this be possible to add has this hack the option " contract" (collapse) like origin in Vbulletin ?

Geographic2 03-18-2004 01:33 PM

Your making us download fullsize pictures for 62x62 or 50x50 display... so in other words on my forum it's sending 1mb photos for display in a format that could do it in 8000 bytes...

Here's the easy easy easy fix:

In recent_attachments template:

Change this:
PHP Code:

<img src='attachment.php?attachmentid=$recentattachment[attachmentid]' alt='$recentattachment[filename]' width="50" height="50"

to:
PHP Code:

<img src='attachment.php?attachmentid=$recentattachment[attachmentid]&thumb=1' alt='$recentattachment[filename]' width="50" height="50"

Much more efficient. Now you download the thumbnail size photo rather than the fullsize version to be resized in the users browser.

Also consider using only 1 width or height value rather than both
this will allow the ratio between height and width to be maintained
since not all images are perfectly square.

Nice hack.

Clickin install. ;)

MindTrix 03-18-2004 04:06 PM

Thanks mate :) HTML is not my strong point, i hate it. Thank you for the fix and install click :)

Geographic2 03-19-2004 02:17 AM

I agree HTML is stupid. :)

mhobelsb 10-30-2004 08:44 AM

Hello,

great Idea with the attachments...
Would it be possible to show tumbs of attachments in the Forumdisplay? I mean instead of a thread icon show a thumbnail of the attachment inside. So the user can see what is waiting for him inside the post. *G*

would really love that.

thanks

Martin

NuclioN 01-02-2005 01:44 PM

Quote:

Originally Posted by Erwin
What would make this hack very useful is if you could make it so that it shows the latest attachments WITHIN a specific forum or subforums. :)

Or the latest attachments on forumhome OUT of a specific subforum

NuclioN 01-06-2005 06:23 AM

Is it possible to show a 'no thumbnail' image or a default image when someone post a zip, exe etc. file? I've seen it in the forumdisplay attachment addon so maybe it is possible with this to.

VanAusdal 05-09-2005 03:23 PM

Is there any way to get the href to point to the originating thread rather than the image. I would like my users to be able to go to the thread by clicking the image.

Thanks! Great hack by the way!

VanAusdal 05-12-2005 02:37 PM

anybody know a way that this could be done? I have tried everything that I can think of. I have tried a number of things but it seems to pull the most recent thread and the the thread that is associated with the image. I can't seem to wrap my head around this.

NuclioN 05-12-2005 03:26 PM

Yep, i'm also looking for a solution to link the image to the thread it whas placed in. :)


All times are GMT. The time now is 04:44 PM.

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.01216 seconds
  • Memory Usage 1,817KB
  • 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
  • (2)bbcode_code_printable
  • (6)bbcode_php_printable
  • (1)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
  • (40)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