vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Add-On Releases - Module CMPS:Recent Attachments (https://vborg.vbsupport.ru/showthread.php?t=143143)

sinisterpain 03-24-2007 10:00 PM

Module CMPS:Recent Attachments
 
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

Quote:

Originally Posted by tehPARADOX (Post 1212144)
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

Quote:

Originally Posted by tehPARADOX (Post 1212144)
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

Quote:

Originally Posted by sensimilla (Post 1212508)
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.
Code:

[ $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.
Code:

$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

Quote:

Originally Posted by Invalid ID (Post 1213290)
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

Quote:

Originally Posted by Invalid ID (Post 1213621)
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:

Quote:

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

Quote:

Originally Posted by Pottsy (Post 1213788)
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

Quote:

Originally Posted by Invalid ID (Post 1213727)
Yes, I mean that.

And what about my question number 2 and 3?

Question 2 has been answer
Quote:

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

Quote:

Originally Posted by maxicep (Post 1214344)
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

Quote:

Originally Posted by sinisterpain (Post 1213963)
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

Quote:

Originally Posted by Pottsy (Post 1214466)
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

Quote:

Originally Posted by sinisterpain (Post 1214795)
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!!


Quote:

Originally Posted by Invalid ID (Post 1213621)
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.


Quote:

Originally Posted by sinisterpain (Post 1213973)
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

Quote:

Originally Posted by GrendelKhan{TSU (Post 1215414)
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

Quote:

Originally Posted by GrendelKhan{TSU (Post 1216052)
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

Quote:

Originally Posted by maxicep (Post 1215133)
clicked install and thanks for fix, working.
How can exclude 'images' from newattachments files module ?

up..

sinisterpain 04-02-2007 07:48 PM

Quote:

Originally Posted by maxicep (Post 1218265)
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

Quote:

Originally Posted by jaffy (Post 1219134)
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

Quote:

Originally Posted by sinisterpain (Post 1219326)
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

Quote:

Originally Posted by jaffy (Post 1219134)
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 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

Quote:

Originally Posted by Adam21 (Post 1219584)
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

Quote:

Originally Posted by Adam21 (Post 1222385)
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.


All times are GMT. The time now is 06:09 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.01352 seconds
  • Memory Usage 1,848KB
  • 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
  • (24)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