PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.

#1 2007-04-23 00:13:15

Koos
Administrator
Registered: 2007-01-14
Posts: 524
Website

Automatic Image Upload with Thumbnails 1.3

Code:

##
##        Mod title:  Automatic Image Upload with Thumbnails
##
##      Mod version:  1.3.0
##   Works on PunBB:  1.2.*
##     Release date:  2007-04-22
##           Author:  Koos (pampoen10@yahoo.com)
##
##      Description:  This tool allows users to upload images and automatically
##                    creates thumbnails for them which can then be displayed
##                    in your forum posts. Clicking the thumbnail shows the
##                    original image. By only displaying thumbnails pages load
##                    quicker. This is not really a "MOD" since no punbb files
##                    have to be modified and the database is not affected.
##                    This makes for very easy installation and removal if
##                    needed. Also no changes are necessary when upgrading 
##                    your punbb forum.
##
##   Affected files:  none
##                                     
##       Affects DB:  no
## 
##            Notes:  Requires the GD library on your Web server. Script can
##                    upload JPEG, PNG AND GIF images.
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
################################################################################
## CHANGELOG:
## 1.3.0 : strips all non-alphanumeric characters in filename
##         fixed image resize aspect ratio problem
##         added delete functionality
##         added option to resize images on upload
##         added option to view image URL link below thumbnail in the gallery
##         thumbnail now shown on the results page after upload
##         other minor fixes and improvements
## 1.2.2 : totals now shown in the 'upload statistics' table
##         added language support
##         fixed: upload not saved if thumbnail can not be created
##         fixed: PNG Image file interpretation problem in IE
##         - (ie6 sends image/x-png instead of image/png)
##         other minor changes
## 1.2.1 : BBCode now generated below each thumbnail in the gallery
##         - like Photobucket/ImageShack
## 1.2.0 : changed layout to conform more closely to the punbb standard
##         added an 'upload statistics' feature
##         added flickr style gallery feature - with latest upload displayed first
##         added full permission control
##         all spaces in filenames of uploaded images now replaced with _ (underscore)
##         dates in upload list now displayed as in the rest of your forum
##         other minor improvements
## 1.1.1 : fixed compatibility problem with Internet Explorer
##         some other minor fixes
## 1.1.0 : added support for PNG and GIF files
##         simplified  configuration (don't have to specify absolutepath or forumurl)
## 1.0   : initial release 
################################################################################

Download here

Last edited by elbekko (2007-04-29 14:26:26)

Offline

 

#2 2007-04-23 00:14:01

Koos
Administrator
Registered: 2007-01-14
Posts: 524
Website

Re: Automatic Image Upload with Thumbnails 1.3

I have added quite a few new features with this release. Almost everything can be configured to suite your needs.

By popular demand I added delete functionality. I have made it very secure - and it works very well. You have full control over who can delete their own images. Also: only Administrators will ever be able to delete the images of other users - this can not be configured for safety purposes.

See the changelog for the rest of the new features in this release.

Features:

* Extremely easy to install and remove
* Can view a list and gallery of all your uploaded images
* Can not replace a file with same filename
* Can create thumbnails of JPEG, PNG and GIF files (depending on your GD version)
* Can specify maximum file size to upload
* Can view upload statistics of users who have uploaded images

How it works:

1. You select an image file to upload e.g. image.jpg
2. The image is uploaded with your pun user id used as the prefix e.g. 12_image.jpg - this is to differentiate your uploads from the uploads of other users.
3. Thumbnail is created in the thumbnails directory
4. You are supplied with the code which you must copy and paste into your post. This allows the thumbnail of your uploaded image to be displayed in your post. Clicking the thumbnail shows the original image.

Note:

The easiest way to see whether the GD library has been installed on your Web server and which file types it supports is to create a small file (e.g. test.php) containing:

        <?php phpinfo() ?>

    and look at it using a web browser. There you will also be able to see what your PHP memory limit is (see the memory_limit parameter). It is recommended that this is at least 16MB for proper thumbnail creation operation. Ask your system administrator to raise it for you. With 16MB of PHP memory you will be able to create thumbnails of images of up to about 2000x1500 pixels in size. Uploading larger images you get a blank screen (symptom of memory max-out).

Update:
Added statement in v1.3.2 for allocating all necessary memory for image processing. On some servers this will allow you to upload and resize any size image.

Last edited by Koos (2008-10-13 16:49:55)

Offline

 

#3 2007-04-23 18:48:29

nickfzx
Member
From: Oxford, England
Registered: 2006-05-18
Posts: 69
Website

Re: Automatic Image Upload with Thumbnails 1.3

cool, I just tried it out and it's really nice.

2 Feature requests:

First: the ability to choose between clickable thumbnail code and just IMG tags wrapped around the image url:  [img]url_to_image.jpg[/img]

Second:  why not have the whole thing as one page, instead of 3?  The file uploader above the gallery (or list).  So when you hit upload it justs add the image to the gallery (no need for the current intermediate page).  Like photobucket has with the upload boxes above your album.


Just my thoughts...great work btw smile

Offline

 

#4 2007-04-23 19:08:38

MattF
Member
From: South Yorkshire, England
Registered: 2007-03-16
Posts: 415

Re: Automatic Image Upload with Thumbnails 1.3

With the second question, I'd personally say it boils down to preference and separation. Personal preference wise, there isn't a cat in hells chance of pleasing everyone. big_smile That's why you mod things to your personal requirements if you want them to behave differently. smile Separation is something I would value more, however. Combine it all into one, and any errors can carry through to all, and updating becomes more complex. Separate things into their constituent parts, and the one doesn't affect the whole, whilst at the same time being easier to update and maintain. That's only my personal opinion though. big_smile

Offline

 

#5 2007-04-23 20:59:29

nickfzx
Member
From: Oxford, England
Registered: 2006-05-18
Posts: 69
Website

Re: Automatic Image Upload with Thumbnails 1.3

you are probably right MattF that it is a question of preference...it is my preference to have it all on one page as I think it is more powerful for the user...Photobucket do it for a reason wink

I think that regardless of preference there is no real need for the page between the upload page and the gallery page, why not skip it and go straight to gallery, surely this would simplify things for everyone?

Offline

 

#6 2007-04-23 22:09:18

Koos
Administrator
Registered: 2007-01-14
Posts: 524
Website

Re: Automatic Image Upload with Thumbnails 1.3

nickfzx wrote:

you are probably right MattF that it is a question of preference...it is my preference to have it all on one page as I think it is more powerful for the user...Photobucket do it for a reason wink

I think that regardless of preference there is no real need for the page between the upload page and the gallery page, why not skip it and go straight to gallery, surely this would simplify things for everyone?

There are quite a number of reasons why I decided not to go straight to the gallery after upload. Here are some of them:

1. When you want to upload multiple images (which is very often the case), it is better to be taken to a simple page which only confirms that the upload has been successful. You can then quickly browse back to upload another. I don't want the browser to load all 16 or 20 images in the gallery while I still want to upload more images.

I have not added multiple upload slots because this might cause the PHP memory to deplete very quickly, resulting in memory max-out. Remember: Photobucket and Imageshack specialize in image upload - so they have gigabytes of memory available for image proccessing. Most users only have about 8-16MB of memory to process their images on their web servers.

2. Since the upload and upload_view scripts are separate, one would have to be redirected to the gallery if you want to go there after upload. Also: the problem with internet explorer is: if you browse back from the gallery to the upload page you get a 'page unavailable error'. This is because IE sees the post (upload) as a page between the upload and gallery page. So you will have to click the browser back button twice, to get past the 'page unavailable' page.

Last edited by Koos (2007-04-23 22:13:19)

Offline

 

#7 2007-04-23 22:22:24

nickfzx
Member
From: Oxford, England
Registered: 2006-05-18
Posts: 69
Website

Re: Automatic Image Upload with Thumbnails 1.3

Koos wrote:

nickfzx wrote:

you are probably right MattF that it is a question of preference...it is my preference to have it all on one page as I think it is more powerful for the user...Photobucket do it for a reason wink

I think that regardless of preference there is no real need for the page between the upload page and the gallery page, why not skip it and go straight to gallery, surely this would simplify things for everyone?

There are quite a number of reasons why I decided not to go straight to the gallery after upload. Here are some of them:

1. When you want to upload multiple images (which is very often the case), it is better to be taken to a simple page which only confirms that the upload has been successful. You can then quickly browse back to upload another. I don't want the browser to load all 16 or 20 images in the gallery while I still want to upload more images.

I have not added multiple upload slots because this might cause the PHP memory to deplete very quickly, resulting in memory max-out. Remember: Photobucket and Imageshack specialize in image upload - so they have gigabytes of memory available for image proccessing. Most users only have about 8-16MB of memory to process their images on their web servers.

2. Since the upload and upload_view scripts are separate, one would have to be redirected to the gallery if you want to go there after upload. Also: the problem with internet explorer is: if you browse back from the gallery to the upload page you get a 'page unavailable error'. This is because IE sees the post (upload) as a page between the upload and gallery page. So you will have to click the browser back button twice, to get past the 'page unavailable' page.

I see where your coming from Koos.  So to do what I want the gallery and upload script would have to be integrated into one php file?

I think my first idea would be really good option to have though:

the ability to choose between clickable thumbnail code and just IMG tags wrapped around the image url:  [img]url_to_image.jpg[/img]

Offline

 

#8 2007-04-24 07:03:15

Dr.Jeckyl
Member
Registered: 2005-06-17
Posts: 230

Re: Automatic Image Upload with Thumbnails 1.3

Koos just answered my next suggestion of multiple uploads at once. understood and will make do. wink

Offline

 

#9 2007-04-24 16:54:11

MattF
Member
From: South Yorkshire, England
Registered: 2007-03-16
Posts: 415

Re: Automatic Image Upload with Thumbnails 1.3

nickfzx wrote:

I see where your coming from Koos.  So to do what I want the gallery and upload script would have to be integrated into one php file?

I think my first idea would be really good option to have though:

the ability to choose between clickable thumbnail code and just IMG tags wrapped around the image url:  url_to_image.jpg

Hell, I hate contradicting myself, but it can actually be done quite easily. big_smile I've just tried it with Gus and it's working fine, it would appear. big_smile The upload form section of the upload script can be copied and added above the table in the listview and gallery pages, then it just pulls in the upload script once you upload any files. (I'm assuming v1.3 hasn't altered much in regards to layout from the last version I used)?

I would think the upload slots would be better as a configureable option, BTW Koos. If the resources are available on the server, it seems a shame to limit it to one. I've done Gus with a configureable one to ten slots, (max), and upto just, (for standard'ish size webpage images and with default php memory settings), it's not thrown an error yet at 5 uploads per time on test. (Haven't thoroughly tested it at ten yet). If it were configureable, the slot count could always be lowered by the admin if they were experiencing problems.

Offline

 

#10 2007-04-24 16:58:58

nickfzx
Member
From: Oxford, England
Registered: 2006-05-18
Posts: 69
Website

Re: Automatic Image Upload with Thumbnails 1.3

MattF wrote:

nickfzx wrote:

I see where your coming from Koos.  So to do what I want the gallery and upload script would have to be integrated into one php file?

I think my first idea would be really good option to have though:

the ability to choose between clickable thumbnail code and just IMG tags wrapped around the image url:  url_to_image.jpg

Hell, I hate contradicting myself, but it can actually be done quite easily. big_smile I've just tried it with Gus and it's working fine, it would appear. big_smile The upload form section of the upload script can be copied and added above the table in the listview and gallery pages, then it just pulls in the upload script once you upload any files. (I'm assuming v1.3 hasn't altered much in regards to layout from the last version I used)?

I would think the upload slots would be better as a configureable option, BTW Koos. If the resources are available on the server, it seems a shame to limit it to one. I've done Gus with a configureable one to ten slots, (max), and upto just, (for standard'ish size webpage images and with default php memory settings), it's not thrown an error yet at 5 uploads per time on test. (Haven't thoroughly tested it at ten yet). If it were configureable, the slot count could always be lowered by the admin if they were experiencing problems.

wow...cool, is there anyway you could post what you did?  I would love to have it as a all in one solution with 5 upload slots.

Offline

 

#11 2007-04-24 17:31:37

MattF
Member
From: South Yorkshire, England
Registered: 2007-03-16
Posts: 415

Re: Automatic Image Upload with Thumbnails 1.3

nickfzx wrote:

wow...cool, is there anyway you could post what you did?  I would love to have it as a all in one solution with 5 upload slots.

It's not actually a mod of Koos script, (anymore). It does still use the image resizing portion from Koos's script upto just, however. smile The problem with using Gus would be that it has a different directory and image layout to Koos's script, (so existing upload directories and images would be to all intents invisible), and Koos's uploader is probably more stable, as I tend to be aiming for the feature set as much as anything else, (within reason), so Gus is going through development at most times. big_smile If you are feeling masochistic, big_smile I will be popping up what I hope is the final pre V2 version later for testing, but as I mentioned, if you want the guaranteed stable solution, Koos's is the one you want.

I wasn't meaning to hijack Koos thread, and apologies if I may have appeared as doing so. I was merely trying to convince Koos that they might not actually be such bad ideas. The concepts are working fine with both IE and FF. Just about to test with Opera as well, but they all appear to be happy enough. smile

Offline

 

#12 2007-04-24 17:42:17

nickfzx
Member
From: Oxford, England
Registered: 2006-05-18
Posts: 69
Website

Re: Automatic Image Upload with Thumbnails 1.3

cool...well I haven't deployed any version of Koos's script yet, except on my localhost for testing.  So I would love to try yours out too.  I will simply pick the best one for my needs once trying them both out.  And as I have no problems with server memory or things like that I may be bias towards gus if it holds up smile


@koos:
I found a little bug of sorts with 1.3.  When uploading an image with the filename "it's free.jpg" the filename translated into this "2_s_free.jpg"

It's great that it turned the space into a underscore but why was "it's" turned into "s",  It would be better if it turned it into "it_s" or "its"

Offline

 

#13 2007-04-24 18:04:52

MattF
Member
From: South Yorkshire, England
Registered: 2007-03-16
Posts: 415

Re: Automatic Image Upload with Thumbnails 1.3

No probs. big_smile I'll be popping up the last, (hopefully), test version later, before it officially becomes V2. big_smile Just running some final checks on it at the moment.

http://www.punres.net/viewtopic.php?id=3225

Last edited by MattF (2007-04-24 18:05:21)

Offline

 

#14 2007-04-25 19:02:08

FSX
Member
Registered: 2006-09-14
Posts: 593
Website

Re: Automatic Image Upload with Thumbnails 1.3

It's not necessary for me to make an add-on for this version of your mod. It has all the things I want big_smile.

Offline

 

#15 2007-04-25 20:43:07

Koos
Administrator
Registered: 2007-01-14
Posts: 524
Website

Re: Automatic Image Upload with Thumbnails 1.3

nickfzx wrote:

I think my first idea would be really good option to have though:

the ability to choose between clickable thumbnail code and just IMG tags wrapped around the image url:  url_to_image.jpg

Will consider this for the next version. I have also not completely ruled out multiple upload slots for future versions. I will try to test it when I get a chance.

nickfzx wrote:

I found a little bug of sorts with 1.3.  When uploading an image with the filename "it's free.jpg" the filename translated into this "2_s_free.jpg"

It's great that it turned the space into a underscore but why was "it's" turned into "s",  It would be better if it turned it into "it_s" or "its"

I tried this myself - uploaded a file named 'it's free.jpg' and it translated as it should, to: 2_its_free.jpg

Can anybody else perhaps confirm whether they get the same result as nickfzx?

FSX wrote:

It's not necessary for me to make an add-on for this version of your mod. It has all the things I want big_smile.

Good to hear.

Last edited by Koos (2007-04-25 20:47:56)

Offline

 

#16 2007-04-30 13:48:58

doki
Member
Registered: 2007-04-30
Posts: 225

Re: Automatic Image Upload with Thumbnails 1.3

Hi, how can I integrate the user upload image to user profile? ex. guest or other user can view a clickable thumbnails on the users profile view as shown in here:

http://nalan.org/profile.php?id=2

Last edited by doki (2007-04-30 13:50:00)

Offline

 

#17 2007-04-30 17:33:38

FSX
Member
Registered: 2006-09-14
Posts: 593
Website

Re: Automatic Image Upload with Thumbnails 1.3

Try to paste the  whole uploadimg_view.php file into the profile.

I have done the same with my addon (Gallery addon 1.2).

Offline

 

#18 2007-04-30 17:36:43

quaker
Member
From: Bama,USA
Registered: 2006-02-23
Posts: 968
Website

Re: Automatic Image Upload with Thumbnails 1.3

http://bunpai.com/gallery/2/member.png
that what im trying to do..
hehe
i got a members.php from elb. and im working on it..
http://bunpai.com/test1.php

Q


My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Offline

 

#19 2007-04-30 17:42:22

quaker
Member
From: Bama,USA
Registered: 2006-02-23
Posts: 968
Website

Re: Automatic Image Upload with Thumbnails 1.3

here is the code for members.php

Code:

<?php
/***********************************************************************

  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)

  This file is part of PunBB.

  PunBB is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published
  by the Free Software Foundation; either version 2 of the License,
  or (at your option) any later version.

  PunBB is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  MA  02111-1307  USA

************************************************************************/


define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';


if ($pun_user['g_read_board'] == '0')
    message($lang_common['No view']);


// Load the userlist.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/userlist.php';

// Load the search.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/search.php';


// Determine if we are allowed to view post counts
$show_post_count = ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST) ? true : false;

$username = (isset($_GET['username']) && $pun_user['g_search_users'] == '1') ? $_GET['username'] : '';
$show_group = (!isset($_GET['show_group']) || intval($_GET['show_group']) < -1 && intval($_GET['show_group']) > 2) ? -1 : intval($_GET['show_group']);
$sort_by = (!isset($_GET['sort_by']) || $_GET['sort_by'] != 'username' && $_GET['sort_by'] != 'registered' && ($_GET['sort_by'] != 'num_posts' || !$show_post_count)) ? 'username' : $_GET['sort_by'];
$sort_dir = (!isset($_GET['sort_dir']) || $_GET['sort_dir'] != 'ASC' && $_GET['sort_dir'] != 'DESC') ? 'ASC' : strtoupper($_GET['sort_dir']);


$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['User list'];
if ($pun_user['g_search_users'] == '1')
    $focus_element = array('userlist', 'username');

define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';

?>
<div class="blockform">
    <h2><span><?php echo $lang_search['User search'] ?></span></h2>
    <div class="box">
    <form id="userlist" method="get" action="members.php">
        <div class="inform">
            <fieldset>
                <legend><?php echo $lang_ul['User find legend'] ?></legend>
                <div class="infldset">
<?php if ($pun_user['g_search_users'] == '1'): ?>                    <label class="conl"><?php echo $lang_common['Username'] ?><br /><input type="text" name="username" value="<?php echo pun_htmlspecialchars($username) ?>" size="25" maxlength="25" /><br /></label>
<?php endif; ?>                    <label class="conl"><?php echo $lang_ul['User group']."\n" ?>
                    <br /><select name="show_group">
                        <option value="-1"<?php if ($show_group == -1) echo ' selected="selected"' ?>><?php echo $lang_ul['All users'] ?></option>
<?php

$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' ORDER BY g_id') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());

while ($cur_group = $db->fetch_assoc($result))
{
    if ($cur_group['g_id'] == $show_group)
        echo "\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
    else
        echo "\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
}

?>
                    </select>
                    <br /></label>
                    <label class="conl"><?php echo $lang_search['Sort by']."\n" ?>
                    <br /><select name="sort_by">
                        <option value="username"<?php if ($sort_by == 'username') echo ' selected="selected"' ?>><?php echo $lang_common['Username'] ?></option>
                        <option value="registered"<?php if ($sort_by == 'registered') echo ' selected="selected"' ?>><?php echo $lang_common['Registered'] ?></option>
<?php if ($show_post_count): ?>                        <option value="num_posts"<?php if ($sort_by == 'num_posts') echo ' selected="selected"' ?>><?php echo $lang_ul['No of posts'] ?></option>
<?php endif; ?>                    </select>
                    <br /></label>
                    <label class="conl"><?php echo $lang_search['Sort order']."\n" ?>
                    <br /><select name="sort_dir">
                        <option value="ASC"<?php if ($sort_dir == 'ASC') echo ' selected="selected"' ?>><?php echo $lang_search['Ascending'] ?></option>
                        <option value="DESC"<?php if ($sort_dir == 'DESC') echo ' selected="selected"' ?>><?php echo $lang_search['Descending'] ?></option>
                    </select>
                    <br /></label>
                    <p class="clearb"><?php echo $lang_ul['User search info'] ?></p>
                </div>
            </fieldset>
        </div>
        <p><input type="submit" name="search" value="<?php echo $lang_common['Submit'] ?>" accesskey="s" /></p>
    </form>
    </div>
</div>
<?php


// Create any SQL for the WHERE clause
$where_sql = array();
$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';

if ($pun_user['g_search_users'] == '1' && $username != '')
    $where_sql[] = 'u.username '.$like_command.' \''.$db->escape(str_replace('*', '%', $username)).'\'';
if ($show_group > -1)
    $where_sql[] = 'u.group_id='.$show_group;

// Fetch user count
$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'users AS u'.(!empty($where_sql) ? ' WHERE u.id>1 AND '.implode(' AND ', $where_sql) : '')) or error('Unable to fetch user list count', __FILE__, __LINE__, $db->error());
$num_users = $db->result($result);


// Determine the user offset (based on $_GET['p'])
$num_pages = ceil($num_users / 10);

$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
$start_from = 10 * ($p - 1);

// Generate paging links
$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'members.php?username='.urlencode($username).'&amp;show_group='.$show_group.'&amp;sort_by='.$sort_by.'&amp;sort_dir='.strtoupper($sort_dir));


?>
<div class="linkst">
    <div class="inbox">
        <p class="pagelink"><?php echo $paging_links ?></p>
    </div>
</div>

<div id="users1" class="blocktable">
    <h2><span>Member List</span></h2>
    <div class="box">
        <div class="inbox">
<?php

// Grab the users
$result = $db->query('SELECT u.id, u.username, u.use_avatar, u.title, u.num_posts, u.registered, u.jabber, g.g_id, g.g_user_title, g.g_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1'.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '').' ORDER BY '.$sort_by.' '.$sort_dir.' LIMIT '.$start_from.', 10') or error('Unable to fetch user list', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result))
{
    while ($user_data = $db->fetch_assoc($result))
    {
        if ($pun_config['o_avatars'] == '1' && $user_data['use_avatar'] == '1' && $pun_user['show_avatars'] != '0')
        {
            if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$user_data['id'].'.gif'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$user_data['id'].'.gif" '.$img_size[3].' alt="" style="float: left" />';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$user_data['id'].'.jpg'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$user_data['id'].'.jpg" '.$img_size[3].' alt="" style="float: left" />';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$user_data['id'].'.png'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$user_data['id'].'.png" '.$img_size[3].' alt="" style="float: left" />';
        }
        else
            $user_avatar = '';    
    
        $user_title_field = get_title($user_data);

?>        
        <div style="margin:5px">
        <h2><a href="<?php echo "profile.php?id=" . $user_data['id'] . '">' . $user_data['username']; ?></a></h2>
        <p style="float:right"><?php echo "<b>" . $lang_common['Registered'] . "</b>: " . format_time($user_data['registered'], true); ?></p>
        <?php echo $user_avatar; ?>
        <?php 
        // The CS nick is stored in the Jabber column. Who uses that anyways? :P
        $cs_nick = ($user_data['jabber']) ? $user_data['jabber'] : "None";
        echo "<b>" . $lang_common['Title'] . "</b>: " . $user_title_field . "<br />\n<b>" . $lang_common['Jabber'] . "</b>: " . $cs_nick . "<br />\n<b>" . $lang_common['Group'] . "</b>: " . $user_data['g_title'] . "<br />\n<b>" . $lang_common['Posts'] . "</b>: " . $user_data['num_posts']; ?>
        </div>
        <div class="clearer"></div>
<?php

    }
}
else
    echo "\t\t\t".'<tr>'."\n\t\t\t\t\t".'<td class="tcl" colspan="'.(($show_post_count) ? 4 : 3).'">'.$lang_search['No hits'].'</td></tr>'."\n";

?>
        </div>
    </div>
    
</div>

<div class="linksb">
    <div class="inbox">
        <p class="pagelink"><?php echo $paging_links ?></p>
    </div>
</div>
<?php

require PUN_ROOT.'footer.php';
?>

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Offline

 

#20 2007-04-30 19:03:29

FSX
Member
Registered: 2006-09-14
Posts: 593
Website

Re: Automatic Image Upload with Thumbnails 1.3

I shall try to make something like that. If I succeed I shaal post my results.

Offline

 

#21 2007-05-01 00:44:44

Koos
Administrator
Registered: 2007-01-14
Posts: 524
Website

Re: Automatic Image Upload with Thumbnails 1.3

New release available - v1.3.1

Made some important improvements - including better image thumbnail and resize quality.

Last edited by Koos (2007-05-01 19:36:49)

Offline

 

#22 2007-05-02 08:56:29

doki
Member
Registered: 2007-04-30
Posts: 225

Re: Automatic Image Upload with Thumbnails 1.3

FSX wrote:

Try to paste the  whole uploadimg_view.php file into the profile.

I have done the same with my addon (Gallery addon 1.2).

does the Gallery Addon work on the new release of this mod?( Image HostingVersion 1.3)

Offline

 

#23 2007-05-02 11:10:11

FSX
Member
Registered: 2006-09-14
Posts: 593
Website

Re: Automatic Image Upload with Thumbnails 1.3

I haven't tested it with 1.3 and there are some bugs in gallery addon.

Offline

 

#24 2007-05-02 11:22:59

doki
Member
Registered: 2007-04-30
Posts: 225

Re: Automatic Image Upload with Thumbnails 1.3

how can i put a link to the profile without installing the addon... let say "my gallery" when clinking to that link it will points to " Users uploaded images"

I hope somebody can help my on this...

Last edited by doki (2007-05-02 11:23:40)

Offline

 

#25 2007-05-02 11:38:23

MattF
Member
From: South Yorkshire, England
Registered: 2007-03-16
Posts: 415

Re: Automatic Image Upload with Thumbnails 1.3

doki wrote:

how can i put a link to the profile without installing the addon... let say "my gallery" when clinking to that link it will points to " Users uploaded images"

I hope somebody can help my on this...

Providing you mean put a link in the profile menu to point to the users gallery, the following should work. Just check the url syntax to call the gallery view. I believe it's right, but just double check the 'uploadimg.php?view=gallery' bit. The functions.php bit is all one line, BTW.


Code:

include/functions.php

 Around line ~400 find:

                <li<?php if ($page == 'privacy') echo ' class="isactive"'; ?>><a href="profile.php?section=privacy&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Section privacy'] ?></a></li>


 After add:

                <li<?php if ($page == 'gallery') echo ' class="isactive"'; ?>><a href="uploadimg.php?view=gallery"><?php echo $lang_profile['Section gallery'] ?></a></li>




lang/[language]/profile.php

 Around line ~14 find:

'Section admin'                =>    'Administration',


 After add:

'Section gallery'            =>    'Gallery',

Offline

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.