miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Official Addons and Solutions miniBB Support Forums / Official Addons and Solutions /  
 

File and Image Attachments

 
 
Page  Page 6 of 14:  « Previous  1  ...  5  6  7  ...  13  14  Next »

Author Paul
Lead Developer 
#76 | Posted: 23 Apr 2009 01:57 
Check for the file named addon_fileupload_topic_thumbnails.code.txt under your add-on's package, it contains an additional code which will allow to produce something similar you have in mind, and what's currently presented on our demo forums. Cutting some extra parts from this code, you could also achieve that only icon is displayed.

Here is the other snippet I have from the past development, not sure it will work, but you may try:

/* file upload addon PLUGIN [bb_plugins.php code] - displaying little thumbnails in latest discussions and topics list. Plugin works ONLY if $dirsTopic is set to TRUE. Copy attach.gif to the img/forum_icons/ folder. Paste {$topicThumbnails} in main_last_discuss_cell.html either main_topics_cell.html. Works beginning from miniBB v. 2.0 RC5. */

function parseTopic(){

/* File Upload icon attachment addon plugin */
$topic=$GLOBALS['topic'];

$pth=$GLOBALS['lookTopicDir'].$topic;
if($pth!=$topic and is_dir($pth)) $GLOBALS['topicThumbnails']
="<img src=\"{$GLOBALS['main_url']
}/img/forum_icons/attach.gif\" style=\"width:16px;height:16px;border:0px;vertical-align:middle\" alt=\"This topic should contain attached files\" title=\"This topic should contain attached files\" /> ";
else $GLOBALS['topicThumbnails']
='';
/* --File Upload icon attachment addon plugin */

}


Author Paul
Lead Developer 
#77 | Posted: 23 Apr 2009 02:07 
harootun:
Is there any downside to not having that javascript behavior in the <body> tag?
There are actually two ways of how to place a self.close JavaScript code over the window. You are right, the first one is like now, when this event is placed over the whole body. Some browsers consider to close such window also when you click the right mouse button. But for pop-ups like we have in this add-on, it is more suitable, because then it allows to place a background image very precisely.

I already tried to implement the other way of how the self.close event is placed, in <a href...> tag over the picture itself. In that case it will work only when you press the left mouse button. However there is another trouble, because such code would work ideally only with wrong HTML definition. If we define XHTML transitional, it will add some scrollbars to the pop-up window, and it all will start to look terrible.

So there will be no changes regarding this case... I suppose, users who need to save pictures, could do it anyway in another browser, or as mentioned, just set up the pop-ups so they close "regular" way.

Author panatan
Partaker
#78 | Posted: 23 Apr 2009 12:27 
Thank you again Paul !
Another question : how can i define max size for downloaded images ?
In addon_fileupload_options.php I have :

'image/jpeg'=>256000,
'image/pjpeg'=>256000,
'image/gif'=>102400,
'image/x-png'=>102400,
'image/png'=>102400,


But i don't know how can I define 500px/500px in max size ?
Thank you !

Author Paul
Lead Developer 
#79 | Posted: 23 Apr 2009 14:55 
So, could you be more specific please at what you thank me ;-) Does the snippet above works, or do you have tried the solution from the package?

The sizes you mentioned mean maximum of the uploaded file size of the certain type.

What you need means a dimensions probably. This is defined under the option called $resizeBigPictures set under the same file upload add-on's options file. You need to enable (uncomment) it and set the specific dimension. More explanation is in the file itself.

Author Paul
Lead Developer 
#80 | Posted: 28 Sep 2009 03:55 
harootun
There is update on your post above, regarding {$selfClose} in the <body> tag: it seems Firefox 3 coders finally got around this, and now the latest version of the file upload add-on (2.0.1 currently) should work in Firefox as well.

I.e. if you set $saveAsEnable=1; and $closeByClick=1; it should close the window when you left-click on it, and should suggest the menu of saving options when you right-click on it.

Author Danny2000
Partaker
#81 | Posted: 2 Dec 2009 05:29 
when I installed file upload add-on..
I had also this one:

addon_fileupload_topic_thumbnails.code

where must I copy that?

Author Paul
Lead Developer 
#82 | Posted: 2 Dec 2009 10:59 
You have to install this piece of code only if you would like little thumbnails generated and appearing on the front page of forums and topic listings. Like it's presented on our demo forums.

The add-on may work without this option as well, because it will take additional resources, specially on large forums. It also could work only in Full Mode of PHP.

Inside of the code at the top you will find explanations, what and where you should do to install it. The first code block /* File Upload addon hack */ stays for putting under bb_plugins.php, and the other one saying /* File Upload addon hack parseTopic part */ goes for parseTopic function.

Author Danny2000
Partaker
#83 | Posted: 3 Dec 2009 03:27 
I put them in bb_plugins.php and set $dirsTopic=TRUE;
also $maxThWidth2 and.....
but it doesn't show small thumbnail in topics.. it just shows the little attachment icon front of it..
Could you please explain for me just in this section?

Author Paul
Lead Developer 
#84 | Posted: 3 Dec 2009 03:45 
Then it means the thumbnails were not generated actually. You should re-upload files/images to see such effect in topic listings. If you just enable the setting, older files can't be automatically "extended" with that feature.

Author Danny2000
Partaker
#85 | Posted: 3 Dec 2009 04:08 
Thank you so much, It's Really a Great File Upload... ;-)

Author Danny2000
Partaker
#86 | Posted: 4 Dec 2009 12:34 
Paul

I have 2 Questions:

1) Is there any Option to set some file upload just for Moderator not users..
like PDF or Video Files Upload Only..
Rest of them be as normal...?

2) and also can we check up the uploaded files that need to be cleaned or for example some files that have not been accessed for 30 or more days.. we can delete them.. like small thumbnails or big anyway... is there any solution for this one?

Thanks.. ;)

Author Paul
Lead Developer 
#87 | Posted: 4 Dec 2009 14:54 
1. You may use conditions in addon_fileupload_options.php regarding $uploadTypes setting, for example put this after this variable's declaration:

if($isMod==1) $uploadTypes['application/pdf']=102400;
and exclude such definition from default $uploadTypes array.

2. Only crontab solution is possible. There must be a script which will check by file's date, and it should delete the file and all associated files. We don't have such solution by default.

Author Danny2000
Partaker
#88 | Posted: 4 Dec 2009 15:22 
Thanks... But It gives error... don't know how to set it..

Sorry.. I'm not Professional about PHP codes :-p
could you please tell me how can I put it.. cus I did this it's giving error...

$uploadTypes=array(

'image/jpeg'=>204800,

if($isMod==1) $uploadTypes['application/pdf']=102400;

);

Author Paul
Lead Developer 
#89 | Posted: 5 Dec 2009 05:31 
Put it below the declaration of $uploadTypes.

$uploadTypes=array(
//here come definitions of public types
);

if($isMod==1) $uploadTypes['application/pdf']=102400;

Author Danny2000
Partaker
#90 | Posted: 5 Dec 2009 07:48 
Paul:
Put it below the declaration of $uploadTypes.
Thank you so much.. ;)

Page  Page 6 of 14:  « Previous  1  ...  5  6  7  ...  13  14  Next » 
Official Addons and Solutions miniBB Support Forums / Official Addons and Solutions /
 File and Image Attachments
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Get the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑