1

Topic: Image Post

This mod allows for uploading an image that will be shown inline with the message.

The file formats and maximum size are definable by the admin.

You can get it from
Punres

or from script.gr:

mod Imagepost 1.0 tar.gz
mod Imagepost 1.0 Zip

The German PunBB Site:
PunBB-forum.de

Re: Image Post

Sounds interesting. Any screenshots?

Looking for a certain modification for your forum? Please take a look here before posting.

3

Re: Image Post

Not so far.

It's not spectacular anyway, it looks like you put an img tag at the end of your message.
Just that the image is not on somewhere else but will be uploaded.

But if you can't get the picture I will make one wink

The German PunBB Site:
PunBB-forum.de

4

Re: Image Post

Very interesting ... maybe I'll contact you for a bigger project smile but for newbies, it's perfect. is it possible to have a page which lists the uploaded files ?

Re: Image Post

Rod wrote:

Very interesting ... maybe I'll contact you for a bigger project :) but for newbies, it's perfect. is it possible to have a page which lists the uploaded files ?

I guess you could just make a script that lists the files in the img/users directory. Wouldn't be all that elegant, but it'd work I guess. Once upon a time I downloaded a really old version (none of the fancy JS stuff, really bad design) of this script. You might be able to modify it or a similar script.

Looking for a certain modification for your forum? Please take a look here before posting.

6

Re: Image Post

Rod wrote:

Very interesting ... maybe I'll contact you for a bigger project smile but for newbies, it's perfect. is it possible to have a page which lists the uploaded files ?

No, but just beause I haven't thought about that yet. I think it's a good idea though, both for admins and users so I'll work on that. When I find some hours that is, unfortunately I have clients molesting me with jobs from time to time... smile

pogenwurst wrote:

Once upon a time I downloaded a really old version (none of the fancy JS stuff, really bad design) of this script. You might be able to modify it or a similar script.

Since I've done a rather grown up image catalogue anyway I'd rather base it on that. wink

The German PunBB Site:
PunBB-forum.de

Re: Image Post

any thoughts on this error message that Im getting when I upload a pic??

An error was encountered
Error: Your file exceeds the maximum size of 0.

8

Re: Image Post

What did you set the maximum size to?

The German PunBB Site:
PunBB-forum.de

9

Re: Image Post

Would it be terribly difficult to have the pictures parallell with the text instead of beneath it? It looks so much better and professional, I feel.

10

Re: Image Post

Well, this really depends on your layout I guess.
Having it beneath is safer in most situations.
Imagine you have someone uploading a picture of 600 pixel width but your board is set to 550....

So if you want - yes, but at your own risk. I will not pay for damage caused by oversized pics destroying your layout smile

Here we go:

Open viewtopic.php and go for line 329:

<?php echo $cur_post['message']."\n" ?>
<!-- MOD IMAGE POST -->
                    <?php if ($cur_post['userimage'] != '') echo "<br /><img src=\"".PUN_ROOT."img/users/" . $cur_post['userimage'] ."\" alt=\"" . $cur_post['userimage'] ."\">\n"; ?>
<!-- // MOD IMAGE POST -->

It will be easy to put the Image post part before the cur_post['message'] part and add "align='left'" to the image tag.
Or wahetever else you prefer. Simple HTML - but not layout savvy....

The German PunBB Site:
PunBB-forum.de

11

Re: Image Post

the top would be to store pics inside folders which have the same name of the topic.

Why ??? By doing this, it's quite easy to create a PHP gallery which scans the name of folders / topics ... smile

root
- name of my topic
  - img 1 - up by user 10
  - img 2 - up by user 40

- name of my topic
  - img 1 - up by user 1050
  - img 2 - up by user 100

and if you click by user (profile.php ?) you see the pics the user has up' sorting by name of topic.

The advantage would be great for forums artists for example ... (or forums which use a lot of pics)

12

Re: Image Post

Yeah, but that would be more like the gallery mod, wouldn't it?
Anyway, I'll make something that shows all the pics w/o the posts and see how it goes from there.

The German PunBB Site:
PunBB-forum.de

13

Re: Image Post

smile ...

another thing (and promise ... I stop smile)

but instead of going the admin to erase for example a pic .. when you have rights (with groups ??? : admin / mod or particular group) ... under the uploaded PIC INSIDE the thread, you have a "mini" admin which appears : in a first time we can imagine simply "erase the picture" ... you'll say me "edit the post, and erase" ... yes, and I have to go to admin to erase the pic ... so I click 1 .. 2 ... 3 times ... with this method, only one smile

14

Re: Image Post

Hm. I'm not sure if I got this one.

As an admin you can always edit a post which means you can also remove the picture. No three clicks here.

Or what did you mean exactly?
And no, you don't have to stop, it is OK to get an idea what people really need, right?

The German PunBB Site:
PunBB-forum.de

15

Re: Image Post

if you edit to erase the pic from the thread, the pic is always stored isn't it ??? So you have to go to the admin (or ftp) and erase the pic right ??? But adding an admin button beneath the pic with "erase the pic" = erase the pic from the thread and from the stored folder ... ? ...

16

Re: Image Post

No,
in edit.php it says

if((isset($_POST['delete_userimage']) and $_POST['delete_userimage'] == 1) or is_uploaded_file($_FILES['userimage']['tmp_name']))  {
    include_once(PUN_ROOT.'/include/mod_imagepost.php');
    @unlink($userdir .'/'. $_POST['current_userimage']);
    }

for those who don't speak *nix: "unlink" means "throw it away and don't ask questions" smile

The German PunBB Site:
PunBB-forum.de

Re: Image Post

Tobi wrote:

Since I've done a rather grown up image catalogue anyway I'd rather base it on that. wink

Yeah, that would probably be better.

Looking for a certain modification for your forum? Please take a look here before posting.

18 (edited by Smartmonkey 2005-09-12 00:21)

Re: Image Post

Tobi wrote:

What did you set the maximum size to?

where do you set that??  does this mod put that in admin options some where? or did I miss a step.

19

Re: Image Post

Tobi wrote:

What did you set the maximum size to?

Hello

Where can i change the max size and weight of the picture.
I ran the install_mod without modifiying the values
Is it too late

Thanks

Thanks Pun
my forums

20

Re: Image Post

Stupid me!

Forgot this in the readme.txt sad

Here we go:
Open admin_options.php

Find line 561:

            <div class="inform">
                    <fieldset>
                        <legend>E-mail</legend>

Before, add

<!-- MOD IMAGEPOST -->
            <div class="inform">
          <fieldset>
            <legend>Mod Imagepost</legend>
            <div class="infldset">
              <table class="aligntop" cellspacing="0">
                <tr>
                  <th scope="row">Supported Formats</th>
                  <td>
                    <input type="text" name="form[image_formats]" size="45" maxlength="45" value="<?php echo $pun_config['o_image_formats'] ?>" />
                    <span>The supported image formats for upload (defauts to gif,png,jpg,jpeg).</span>
                  </td>
                </tr>
                <tr>
                  <th scope="row">Max Bytes</th>
                  <td>
                    <input type="text" name="form[image_maxbytes]" size="7" maxlength="7" value="<?php echo $pun_config['o_image_maxbytes'] ?>" />
                    <span>The maximum allowed size of avatars in bytes (102400 is default).</span>
                  </td>
                </tr>
                <tr>
                  <th scope="row">Max Dimensions</th>
                  <td>
                    <input type="text" name="form[image_maxdimensions]" size="9" maxlength="9" value="<?php echo $pun_config['o_image_maxdimensions'] ?>" />
                    <span>The maximum allowed Dimensions of avatars in pixels (640x480 is default)</span>
                  </td>
                </tr>
              </table>
            </div>
          </fieldset>
        </div>
<!-- // MOD IMAGEPOST -->

That's all.
You will then find the possibility to set dimensions, max. bytes and supported formats in admin->options below the avatar part.

I'll update the readme.txt as well..... sad

The German PunBB Site:
PunBB-forum.de

21

Re: Image Post

OK ... I continue my trip / requests smile

So I have planned to do a "PDF Factory"
Among my users, I have persons who work in cinema, theatre, concerts ... and a lot of them are able to give me PDF ... I would like if it's possible to have a similar thing, but it would be quite different because it was not inside a post, but in another page (using the rights of users (like groups))

I'll test your image post today smile

22

Re: Image Post

Well, for PDFs I think it might be OK to use the existing attachment mod.
It seems to be useful for many people.
My mod is for showing images inline, not linking to files. That's a different story....

The German PunBB Site:
PunBB-forum.de

23

Re: Image Post

Hum ... yes but in the 2 cases, it's not I would like smile
in the 2 cases you have to go in a thread, for me, I would like to add an admin option for people who have the rights to up pdf smile (so all is controled by pun, but don't appear in the forum)

Thanx for the answer.

24

Re: Image Post

Hm.
Still sounds something that the attachment mod should handle.
My little mod exists only because displaying pictures inline was the only thing the attachment mod could not do.
Otherwise it looks like a swiss army knife and I'm sure with a little tweaking it can do what you want.

The German PunBB Site:
PunBB-forum.de

25

Re: Image Post

Tobi wrote:

Stupid me!

Forgot this in the readme.txt sad

Here we go:
Open admin_options.php

Find line 561:

            <div class="inform">
                    <fieldset>
                        <legend>E-mail</legend>

Before, add

<!-- MOD IMAGEPOST -->
            <div class="inform">
          <fieldset>
            <legend>Mod Imagepost</legend>
            <div class="infldset">
              <table class="aligntop" cellspacing="0">
                <tr>
                  <th scope="row">Supported Formats</th>
                  <td>
                    <input type="text" name="form[image_formats]" size="45" maxlength="45" value="<?php echo $pun_config['o_image_formats'] ?>" />
                    <span>The supported image formats for upload (defauts to gif,png,jpg,jpeg).</span>
                  </td>
                </tr>
                <tr>
                  <th scope="row">Max Bytes</th>
                  <td>
                    <input type="text" name="form[image_maxbytes]" size="7" maxlength="7" value="<?php echo $pun_config['o_image_maxbytes'] ?>" />
                    <span>The maximum allowed size of avatars in bytes (102400 is default).</span>
                  </td>
                </tr>
                <tr>
                  <th scope="row">Max Dimensions</th>
                  <td>
                    <input type="text" name="form[image_maxdimensions]" size="9" maxlength="9" value="<?php echo $pun_config['o_image_maxdimensions'] ?>" />
                    <span>The maximum allowed Dimensions of avatars in pixels (640x480 is default)</span>
                  </td>
                </tr>
              </table>
            </div>
          </fieldset>
        </div>
<!-- // MOD IMAGEPOST -->

That's all.
You will then find the possibility to set dimensions, max. bytes and supported formats in admin->options below the avatar part.

I'll update the readme.txt as well..... sad

Thanks a lot.
Exactly what i needed.
It works fine exept that i have to upload once and after edit again the same post and upload then again for it to work.
But it' s ok for me.=)

Thanks Pun
my forums