PDA

View Full Version : Add-On Releases - Module CMPS:Recent Attachments


sinisterpain
03-24-2007, 10:00 PM
Module CMPS Recent Attachments

Idea was based on original hack by MindTrix

A request from a member for showing document such as text and zip files prompted me to add an additional zip file to this hack. Please be sure you download the correct file. The CMPS_recent_attachment_images.zip is for showing pictures only. The CMPS_newattachments_files.zip will display both but will only output the extension image with the file name and info (see Screenshot below).

What it does:

It will query attachments from the database for the latest 4 images or files posted, and output it to the module created on your home page. I believe I have seen this requested both here and at vBadvanced.
Will add 1 query to the home page.

Files and Templates added:

CMPS_recent_attachment_images.zip
recentattachment.php
adv_portal_newattachments

CMPS_newattachments_files.zip
newattachment.php
adv_portal_recentattachments

Tested on vb3.6.4

Installation:

1. Extract the module file from the zip to your desktop.

2. Go to your admincp->vBa CMPS->Download/Upload Module.

3. Browse to where you put the module file click submit.

4. Make sure you set all options and permisions for the module.

5. Be sure that you enable the module in your default home page or it will not show.


Change log:

version 1.00 - First release. Added additional module for files and docs.
version 1.01 - Added ability to view the members post of the image or file attachment in a new window from CMPS module.
Added update for CMPS 3.0 module
Please be sure to click installed if you want support

sinisterpain
03-25-2007, 08:06 PM
Reserved

tehPARADOX
03-25-2007, 08:33 PM
Any plans on displaying other attachments? such as docs & archives?

sinisterpain
03-25-2007, 08:36 PM
Any plans on displaying other attachments? such as docs & archives?
I plan on playing around with different options so its a possibility

sinisterpain
03-26-2007, 02:28 AM
Any plans on displaying other attachments? such as docs & archives?
Updated and added additional zip file for your request. Hopefully its what you where looking for. :D

tehPARADOX
03-26-2007, 02:40 AM
Wow that was fast, great job! And yes it's exactly what I was looking for.

sensimilla
03-26-2007, 06:36 AM
Outstanding! I have almost payed for this hack ! :) 5 stars and MOTM

Thumbnail creation isnt perfect, they are deformed.

I would request the possibilty to
- not display file title ( with large titles it doesnt look good )
- select forum from which they should be grabbed
- select number of attachments to display

great job! keep up developing this mod!

sinisterpain
03-26-2007, 08:09 PM
Outstanding! I have almost payed for this hack ! :) 5 stars and MOTM

Thumbnail creation isnt perfect, they are deformed.

I would request the possibilty to
- not display file title ( with large titles it doesnt look good )
- select forum from which they should be grabbed
- select number of attachments to display

great job! keep up developing this mod!

If your using the image only zip file you can adjust the size of the picture you want by editing the php file. I think I set it to 75 width 75 height. Change the code in red to what ever size you want.
[ $newattachment['attachment'] .= '<div><img class="inlineimg" src="' . $vbulletin->options['bburl'] . '/attachment.php?' . $session['sessionurl'] . 'attachmentid=' . $attachment['attachmentid'] . '" width="75" height="75">

You can also change the number of files displayed by changing the query from the current 4 to what ever you wish to display. Change the red 4 to what you want.
$query_attachments = $db->query_read("
SELECT *
FROM " . TABLE_PREFIX . "attachment
WHERE visible = 1 AND dateline < " . TIME() ." ORDER BY dateline DESC LIMIT 4");

Glad you could use it. Enjoy :)

FleaBag
03-26-2007, 09:17 PM
Brilliant, thanks! :)

Invalid ID
03-27-2007, 01:17 AM
It's just great. But there's one problem, it's also showing the attachments members using for their signature.

Also, it does not show the pictures attached using https://vborg.vbsupport.ru/external/2011/07/5.gif

Can you please give us one that can also work with images that are attached from some website?

Thanks

sinisterpain
03-27-2007, 02:06 AM
It's just great. But there's one problem, it's also showing the attachments members using for their signature.

Also, it does not show the pictures attached using https://vborg.vbsupport.ru/external/2011/07/5.gif

Can you please give us one that can also work with images that are attached from some website?

Thanks

Im a little confused by what your problem is.

Invalid ID
03-27-2007, 02:18 PM
Ok, I rephrase.

1) Members also attach photos as their signature. This Mod is showing their signature photos also.

2) This Mod is showing only the photos attached using "Manage Attachment" option. But it does not work with the photos that are attached using https://vborg.vbsupport.ru/external/2011/07/5.gif

3) When you click on the photo, it only opens the photo, it should open the first page of the topic where the image was posted to expect some comment on that image.

Thanks

tehPARADOX
03-27-2007, 03:34 PM
Ok, I rephrase.

1) Members also attach photos as their signature. This Mod is showing their signature photos also.

2) This Mod is showing only the photos attached using "Manage Attachment" option. But it does not work with the photos that are attached using https://vborg.vbsupport.ru/external/2011/07/5.gif

3) When you click on the photo, it only opens the photo, it should open the first page of the topic where the image was posted to expect some comment on that image.

Thanks

https://vborg.vbsupport.ru/external/2011/07/5.gif is used for hotlinking images, it's not really an attachment. And when you say members attach photos as their signatures, did you mean with the default signature upload?

Invalid ID
03-27-2007, 05:03 PM
Yes, I mean that.

And what about my question number 2 and 3?

Pottsy
03-27-2007, 06:15 PM
Why do I get:

Fatal error: Call to a member function on a non-object in /home/xxxxx/public_html/forum/modules/recentattachment.php on line 14


Is it because I don't have thumbnails enabled (my images are all viewed inline)?

sinisterpain
03-27-2007, 09:01 PM
Why do I get:




Is it because I don't have thumbnails enabled (my images are all viewed inline)?
I dont believe so, its usually caused by a plugin or a function not being globaled. Try uploading the attached file to your modules folder (overwriting old) and let me know if you still have the issue. If you do try disabling plugins. I will udate the modules to reflect the change for the query call.

sinisterpain
03-27-2007, 09:07 PM
Yes, I mean that.

And what about my question number 2 and 3?
Question 2 has been answer is used for hotlinking images, it's not really an attachment. And when you say members attach photos as their signatures, did you mean with the default signature upload?
Your 3rd question involves a change in code to accomplish, not sure if others want the same thing. If there are more members requesting it, I will add it as an update.

Invalid ID
03-28-2007, 06:36 AM
Ok, I will wait for that :)

Thanks

maxicep
03-28-2007, 09:34 AM
thanks for module ,
but results not showing on my vba page. vb3.62 b& vba 2.2.1

sinisterpain
03-28-2007, 09:44 AM
thanks for module ,
but results not showing on my vba page. vb3.62 b& vba 2.2.1
Did you enable the module on your home page in the admin cp per the above and readme if you do not it will not showup.
and please click installed if you want support

Pottsy
03-28-2007, 01:24 PM
I dont believe so, its usually caused by a plugin or a function not being globaled. Try uploading the attached file to your modules folder (overwriting old) and let me know if you still have the issue. If you do try disabling plugins. I will udate the modules to reflect the change for the query call.

Tried that file in modules with all plugins disabled, and still the same error.

sinisterpain
03-28-2007, 09:04 PM
Tried that file in modules with all plugins disabled, and still the same error.
I edited the file I attached to my post above please re-upload it to your forum/modules directory and overwrite. Since this works for the majority I feel that there is something possibly in your settings or a hook from another hack conflicting with the attachments query.

maxicep
03-29-2007, 09:17 AM
clicked install and thanks for fix, working.
How can exclude 'images' from newattachments files module ?

Pottsy
03-29-2007, 12:15 PM
I edited the file I attached to my post above please re-upload it to your forum/modules directory and overwrite. Since this works for the majority I feel that there is something possibly in your settings or a hook from another hack conflicting with the attachments query.

Tried again with the updated file and all plugins disabled, and still:

Fatal error: Call to a member function on a non-object in /home/xxxxxx/public_html/forum/modules/recentattachment.php on line 14

Thanks for trying anyway.

GrendelKhan{TSU
03-29-2007, 04:45 PM
AWESOME!! been looking for this. will install (when I get home). nice job!!


Ok, I rephrase.

1) Members also attach photos as their signature. This Mod is showing their signature photos also.

2) This Mod is showing only the photos attached using "Manage Attachment" option. But it does not work with the photos that are attached using https://vborg.vbsupport.ru/external/2011/07/5.gif

3) When you click on the photo, it only opens the photo, it should open the first page of the topic where the image was posted to expect some comment on that image.

Thanks

-- it can NOT do 1 and 2 because its not MEANT to do 1 and 2. What you are referring to are NOT attachments, those are called "hotlinks" and are completely different ;) (I know terms can be confusing). Attachments are actually hosted on your site... not linked in from another site.


Question 2 has been answer

Your 3rd question involves a change in code to accomplish, not sure if others want the same thing. If there are more members requesting it, I will add it as an update.


I second that !! or at least something LIKE that...
ie: doesn't have to show first post...but it would be nice if viewing an attachment lead someone back to the actual thread somehow). maybe just show a linkback to the original post or thread?

sinisterpain
03-29-2007, 07:54 PM
AWESOME!! been looking for this. will install (when I get home). nice job!!




-- it can NOT do 1 and 2 because its not MEANT to do 1 and 2. What you are referring to are NOT attachments, those are called "hotlinks" and are completely different ;) (I know terms can be confusing). Attachments are actually hosted on your site... not linked in from another site.





I second that !! or at least something LIKE that...
ie: doesn't have to show first post...but it would be nice if viewing an attachment lead someone back to the actual thread somehow). maybe just show a linkback to the original post or thread?
Dont forget to click install if you like it

GrendelKhan{TSU
03-30-2007, 12:10 PM
rgr that!

ps. any chance on a linkback to the thread? just wondering. :)

sinisterpain
03-30-2007, 07:05 PM
rgr that!

ps. any chance on a linkback to the thread? just wondering. :)
Shouldnt be too hard but I dont have time right now but I will get to it

Invalid ID
03-31-2007, 03:51 PM
I agree with you sinisterpain

And guess what, now I have come across yet another problem, ever since I have turned off thumbnails, the Mod is not working any more.

maxicep
04-02-2007, 11:49 AM
clicked install and thanks for fix, working.
How can exclude 'images' from newattachments files module ?
up..

sinisterpain
04-02-2007, 07:48 PM
up..
I will see what I can do, I havent had much time lately got some things going on.

jaffy
04-03-2007, 04:12 PM
Hello,

I use vbportal. Will this work for that or is there something else that I can use to accomplish the same task.

thanks

jaffy

sinisterpain
04-03-2007, 10:06 PM
Hello,

I use vbportal. Will this work for that or is there something else that I can use to accomplish the same task.


thanks

jaffy

I am not familiar with that hack but I thought another member installed on it not sure

jaffy
04-04-2007, 05:47 AM
I am not familiar with that hack but I thought another member installed on it not sure

NP. Thanks for your reply. :D

Jaffy

nitro
04-04-2007, 10:54 AM
Hello,

I use vbportal. Will this work for that or is there something else that I can use to accomplish the same task.


thanks

jaffy
vbPortal users, having had a quick look at the contents of the module file for cms you should be able to get this working following the "basic rule of thumb" principal in this thread (http://www.phpportals.com/forums/showthread.php?t=18140) post #2 more specifically for vba -> vbportal block conversion as most (but not all) use the similar methods.

Adam21
04-04-2007, 11:06 AM
Hi,some queries::p

Does this Mod allows us to select from which forum,the attachments that should be displayed?

Possible to make it that only attachments under the <Manage Attachments> be displayed instead of also user's signatures that have been uploaded through the forum?

And any usergroup permissions for it?

Great Mod by the way,thanks alot!:up: :)

sinisterpain
04-04-2007, 02:23 PM
Hi,some queries::p

Does this Mod allows us to select from which forum,the attachments that should be displayed?

Possible to make it that only attachments under the <Manage Attachments> be displayed instead of also user's signatures that have been uploaded through the forum?

And any usergroup permissions for it?

Great Mod by the way,thanks alot!:up: :)

1. no

2. it only displays what has been posted in an attachment using the attachment table. Signitures are usually images using the [IMG] tags. So this module already uses manage attachments. If your using attachments for signitures thats your choice.

3. usergroup permisions are assigned when the module is created. You can edit them by going to your CMPS in the admincp and edit the module.

Please click install for support

sinisterpain
04-07-2007, 06:29 PM
Updated for recent requests by members to be able to view the post of the attachment. Enjoy!

Adam21
04-08-2007, 01:47 AM
Hello.I seem to have problem editing the PHP file to - recentattachments.php, "No such file or directory" and the permissions cant be changed too.any idea?

sinisterpain
04-08-2007, 02:24 AM
Hello.I seem to have problem editing the PHP file to - recentattachments.php, "No such file or directory" and the permissions cant be changed too.any idea?

Not sure what your are doing.
Go to your admincp->vBa CMPS->edit modules->Recent Attachments
in their you will see the usergroup permisions for the module.

Invalid ID
04-10-2007, 01:06 AM
Ok, I think now it's confirmed that this Mod. works only if thumbnails are on. So I have to uninstall.

Pottsy
04-10-2007, 09:57 AM
Ok, I think now it's confirmed that this Mod. works only if thumbnails are on. So I have to uninstall.

I suspect that this is why it never worked for me. Uninstalled too.

Sean James
05-29-2007, 02:51 PM
Can i get this to work on my forumhome page, instead of vbadvanced?

katholic
08-04-2007, 06:48 AM
Will this work on VBA v3.0 RC1?

sinisterpain
08-04-2007, 10:51 AM
Will this work on VBA v3.0 RC1?

I will work on updating this shortly. But no right now it uses 2.21.

sinisterpain
08-08-2007, 09:40 PM
Updated for CMPS 3.0. I have identified the files so pick the right one for the purpose you wish .

Adam21
08-09-2007, 07:22 AM
Cant get this to work on my new install of RC1 and vb368.The attachments dont show up.Permissions are enabled and modules are active on the homepage.In the edit modules page in the admincp,there's no options to choose where to pull the latest attachments are from unlike the other default modules.Could this be the fault?

sinisterpain
08-09-2007, 09:24 PM
Cant get this to work on my new install of RC1 and vb368.The attachments dont show up.Permissions are enabled and modules are active on the homepage.In the edit modules page in the admincp,there's no options to choose where to pull the latest attachments are from unlike the other default modules.Could this be the fault?

I had an error with the template in the module. I fixed it just redownload the zip.

Adam21
08-09-2007, 09:35 PM
I had an error with the template in the module. I fixed it just redownload the zip.

Thanks,works great now! :)

lazytown
10-25-2007, 11:17 AM
Great mod -- I hope to install it.

At VBA, some members were claiming this actually used the full-size versions of images scaled down on the homepage.. So if it was 300K and the thumb was 5K, it would use the 300K version (shrunk with html image attributes). Is there any truth to that? If so, it would bloat the homepage significantly. I have thumbnails turned on for my forum.

Second, is there any functionality (even if changing code) to block attachments from specific forums (such as mod forums)?

Thanks
-vissa

sinisterpain
10-25-2007, 08:00 PM
I never had that problem but I will look into it. Right now there is no function in the mod do block any other forum.

Scalemotorcars
03-22-2008, 10:27 PM
How can I get the block to display 5 or 6 images in a row rather then in a side column? Great hack buy the way. Already installed and works perfectly with 3.6.5 Thanks :D

sinisterpain
03-23-2008, 02:36 PM
How can I get the block to display 5 or 6 images in a row rather then in a side column? Great hack buy the way. Already installed and works perfectly with 3.6.5 Thanks :D

I have attached a zip for using the module in center column you will have to remove the other first then install this one.

Scalemotorcars
03-31-2008, 02:21 AM
Thanks. Works great but is it just me or does this put a large load on the server. All the pages its on are slow to load.

AURFSCAN
04-28-2008, 11:09 PM
Thanks,

Installed and working well. See how it goes.

Ive got it so it displays one image, which I call "Latest Forum Image"

and its in a right hand block (viewable to members only, guests see the calender)

thanks

edit: forgot to mention I increased the size of the image from 65px to 120px...looks great

Scalemotorcars
05-07-2008, 09:12 PM
How do I add extra rows to the block. I'm thinking of an attachments page with one center block and 30 or 40 attachments in something like 6 or 7 rows with columns. I know how to edit the php file to get more images but they simply display to one row. Any help would be great and thanks again.

By the way Im using the recentimagescenter file.

sinisterpain
05-07-2008, 09:37 PM
edit the template adv_portal_recentattachments to how you want it displayed