51

Re: Attachments (pun_attachment)

1. I've just tried on two seperate installations to download attachments as a guest. With guests set to allow. Did not work. If it works on your test-environment I guess it must be something I've changed....

2. http://keydogbb.info/misc.php?item=7&download=1  Try and download from here  , then from my page: http://keydogbb.info/topic121-hide-show … -beta.html   
I have settings to allow guests.... and CHMOD settings are okay as one can access via 3rd site...?

EDIT: my bad, viewtopic.php file was corrupt... all seems to be working as it should now.

Re: Attachments (pun_attachment)

Hi all,

download_counter keeps value 0 in db, because the script exits without ending the transaction.
The patch:

Index: manifest.xml
===================================================================
--- manifest.xml    (révision 1592)
+++ manifest.xml    (copie de travail)
@@ -962,6 +962,12 @@
                     'WHERE'        => 'id = '.$attach_item
                 );
                 $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
+
+                // End the transaction
+                $forum_db->end_transaction();
+
+                // Close the db connection (and free up any result data)
+                $forum_db->close();
             }
             exit();
         }

Charly.

Re: Attachments (pun_attachment)

Hi all,

Another patch that uses format_time for better date display:

Index: include/attach_func.php
===================================================================
--- include/attach_func.php    (révision 1592)
+++ include/attach_func.php    (copie de travail)
@@ -226,7 +226,7 @@
                 $show_image = false;
             $download_link = !empty($attach['secure_str']) ? forum_link($attach_url['misc_download_secure'], array($attach['id'], $attach['secure_str'])) : forum_link($attach_url['misc_download'], $attach['id']);
             $view_link = !empty($attach['secure_str']) ? forum_link($attach_url['misc_view_secure'], array($attach['id'], $attach['secure_str'])) : forum_link($attach_url['misc_view'], $attach['id']);
-            $attach_info = format_size($attach['size']).', '.($attach['download_counter'] ? sprintf($lang_attach['Since'], $attach['download_counter'], date('Y-m-d', $attach['uploaded_at'])) : $lang_attach['Never download']).' ';
+            $attach_info = format_size($attach['size']).', '.($attach['download_counter'] ? sprintf($lang_attach['Since'], $attach['download_counter'], format_time($attach['uploaded_at'],1)) : $lang_attach['Never download']).' ';
 
             ?>
             <div class="<?php echo $show_image ? 'ct-set' : 'sf-set'; ?> set<?php echo ++$forum_page['item_count'] ?>">
@@ -292,7 +292,7 @@
             $show_image = false;
         $download_link = forum_link($attach_url['misc_download'], $attach['id']);
 
-        $attach_info = format_size($attach['size']).', '.($attach['download_counter'] ? sprintf($lang_attach['Since'], $attach['download_counter'], date('Y-m-d', $attach['uploaded_at'])) : $lang_attach['Never download']).'&nbsp;';
+        $attach_info = format_size($attach['size']).', '.($attach['download_counter'] ? sprintf($lang_attach['Since'], $attach['download_counter'], format_time($attach['uploaded_at'],1)) : $lang_attach['Never download']).'&nbsp;';
         if ($allow_downloading)
         {
             if ($show_image)
@@ -383,4 +383,4 @@
             $forum_db->query_build($attach_query) or error(__FILE__, __LINE__);
         }
     }
-}
\ No newline at end of file
+}

Charly.

54

Re: Attachments (pun_attachment)

charlyx wrote:

download_counter keeps value 0 in db, because the script exits without ending the transaction.

I've looked at my db values for downloads and they are counted, but do not load immediately on refresh of page. It seems to take a while for the download_counter to return the value?

Re: Attachments (pun_attachment)

What DBMS are you using ?

I'm using punBB 1.3.4 with PostgreSQL 8.3.4 and downloads aren't counted if the transaction isn't ended correctly.
In all cases, it is important to end the transaction and close the connection properly.

Charly.

56

Re: Attachments (pun_attachment)

mySQL 5.1.x
punBB 1.3.2

in this particular instance I see there must be large timelag because the counters do change over the course of 24 hours ...

but either way you're right... the bug needs to be fixed in extension....

Re: Attachments (pun_attachment)

KeyDog wrote:

but either way you're right... the bug needs to be fixed in extension....

Yes, that's why I posted a patch !

58

Re: Attachments (pun_attachment)

semantics I guess
but a patch like you made
is unusual for a fix here... not even sure how I use that on mysql

you're the first person to ever post script/code like that anyway big_smile

normal procedure:
bug report => extension gets fixed and update released....

Re: Attachments (pun_attachment)

Yes, but I fixed it by myself and I have to redistribute it under the GPL.
And it's the only way I found ...

There is another way to contribute ?

60 (edited by abask 2010-03-14 20:22)

Re: Attachments (pun_attachment)

I have
punbb v 1.3.4
pun_attachment v1.0.3

to post attached .torrent file

If I try to download it from firefox (3.6) everything is ok
if I try it  from another browser (ie, opera, google-chr) file downloads not fully

why?

http://www.torrent.by/misc.php?item=128&download=1
http://www.torrent.by/misc.php?item=129&download=1

61

Re: Attachments (pun_attachment)

Problem has not decided.
Dear developers, I rely on your support.

Re: Attachments (pun_attachment)

How to modify this extension to display the image file instead of showing an icon?
I want to make it very easy to upload photos for users.
Thanks!

63

Re: Attachments (pun_attachment)

pun_attachment does not update the download count for me.  I'm using sqllite.  I've tried adding the code above to manifest.xml, but currently it doesn't seem to have made any difference.

Thanks.

-- gyre --

64

Re: Attachments (pun_attachment)

The bug regarding counter still isn't fixed btw.
Also I noticed that if I want to replace the attachment with a newer file and delete the old file from post a "Bad request. The link you followed is incorrect or outdated." will be served.

That's a shame as the search ranking was very good for one file that I deleted!
So maybe it would be good if there was a way to delete an attachment from a post without deleting it from the db ?

Will be very interested in those two fixes (deleted, counter).
Thanks.

65

Re: Attachments (pun_attachment)

Hello,

So, are there any chances for adding the possibility to display thumbnails of attached images?

I love punbb, its clean look, simplicity and logical design. With the 'tags' and 'attachments' extension it would be just perfect for me, except this one little missing feature... Pretty please :-)

Anyway, thanks to the devs for their great work!
Regards,
bvw

Re: Attachments (pun_attachment)

Check extension settings — it can display image inline.

67

Re: Attachments (pun_attachment)

Yes, I saw this option, thank you, but it's not what I actually need because it displays original images. Several digital photos attached in a topic might easily make opening it quite a bandwidth consuming task.

For example, SMF deals very nicely with image attachments: it creates small thumbnail images during the upload and displays them inline in posts. Only when a user clicks on thumbnails, the original image is loaded and displayed.

Alternatively, could you maybe advice other solution? I tried several unofficial extensions and mods like "image upload", but they were either outdated or just didn't want to work.

Thanks,
-bvw

Re: Attachments (pun_attachment)

bvw wrote:

Alternatively, could you maybe advice other solution? I tried several unofficial extensions and mods like "image upload", but they were either outdated or just didn't want to work.

You can host the pictures elsewhere. I think that's better anyway. Here is an example:
http://princetontraditional.org/viewtopic.php?id=25
With dialup accounts bandwidth is a problem, but even on a slow connection like mine, simply keeping the images to a reasonable size, such as used for web pages, allows for reasonably fast loading. This page with 6 pictures is not too slow in my opinion.

Re: Attachments (pun_attachment)

You can try this http://punbb.informer.com/forums/topic/ … s-to-post/

70

Re: Attachments (pun_attachment)

Updated to 1.0.5

Re: Attachments (pun_attachment)

This extension doesn't work with SQLite. Could this be fixed? I really like SQLite, but I like this extension too smile.

Re: Attachments (pun_attachment)

haker305 wrote:

This extension doesn't work with SQLite. Could this be fixed? I really like SQLite, but I like this extension too smile.

I have

Attachment (Version 1.1.17) Created by PunBB Dev Team installed and working on SQlite without problems...  forum located at -www.intelifuel.com/forum

Re: Attachments (pun_attachment)

http://punbb.informer.com/forums/topic/ … e-errno-1/

I have exactly this issue.

Re: Attachments (pun_attachment)

Question: how to set folder permissions on a local host computer?

75

Re: Attachments (pun_attachment)

Hi,
I'm having a problem with this extension since I upgraded to PunBB 1.4.1
Upload of attachment works, but they don't appear in the post when it's published. The weird thing is that when you edit the post, you can actually see the attachment. But not when it's published.

Can you please help ? Is that a know issue.

By the way, I kept the old 1.3 CSS because I couldn't adapt 1.4's to my design (to much complicated for me). Would that be the problem ? If someone could help me adapting 1.4's CSS to my design, I would be very happy. (I could pay a little bit for it!)

My forums : http://www.forumpassat.fr/forum
Punbb version : 1.4.1
Attachment version : 1.0.5

Thanks a lot.