PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.

#51 2007-06-06 12:11:27

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

Re: Automatic Image Upload with Thumbnails 1.3

FSX wrote:

With that you can read the dictory. But Ex_cuse wants to view a numbers of images from more users at the time like:

Code:

User 1:
image image image


User 2:
image image image


User 3:
image image image

Apologies. Misinterpreted/misread that one. big_smile

What's the id/image naming system of the images?

Offline

 

#52 2007-06-06 12:24:34

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

Re: Automatic Image Upload with Thumbnails 1.3

You can get the userid with $_GET['id'] from the url and with $punuser['id'] you can get the userid from the database (not sure of this one). All images have a prefix of the userid in their filename.

I shall search the code for the system.

Offline

 

#53 2007-06-06 13:32:39

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

Re: Automatic Image Upload with Thumbnails 1.3

FSX wrote:

You can get the userid with $_GET['id'] from the url and with $punuser['id'] you can get the userid from the database (not sure of this one). All images have a prefix of the userid in their filename.

I shall search the code for the system.

I can post the code for doing the id to username conversion. That's no problem. It's already incorporated in Gus. In fact, if you have a look at the pubgallery script in there, you'll find most of what you need, (other than the multiple $_GET['uid'] and list relative prefixed files parts). That just needs a bit of code to tally the uid to the filename listing. (This is why I went for separate user dirs). It makes things like this a bit easier.

The image names. Are they prefixed [uid]_imagename.ext or just [uid]imagename.ext?

Last edited by MattF (2007-06-06 13:34:56)

Offline

 

#54 2007-06-06 13:37:12

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

Re: Automatic Image Upload with Thumbnails 1.3

Just [uid]_image.png

Offline

 

#55 2007-06-06 13:44:42

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

Re: Automatic Image Upload with Thumbnails 1.3

FSX wrote:

Just [uid]_image.png

Cheers.

Offline

 

#56 2007-06-06 21:25:37

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

Re: Automatic Image Upload with Thumbnails 1.3

Ex_cuse wrote:

Now im wondering if its possible that there is just one "gallery" where all uploaded pictues from all users are in?
I think it's a bit of annoying klicking through all users to look at their images..

Hi Ex_cuse.

The following modification for v1.3.2 will allow you to use:

uploadimg_view.php?view=gallery&id=all
and
uploadimg_view.php?view=list&id=all

Code:

#
#---------[ 1. OPEN ]-----------------------------------------------------------
#

uploadimg_view.php


#
#---------[ 2. FIND (line: 368) ]-----------------------------------------------
#

    if($file != "." && $file != ".." && prefix($file,$file_prefix)) 


#
#---------[ 3. REPLACE WITH ]--------------------------------------------------
#

if ($searchadmin == "all") {
$cond = ($file != "." && $file != ".." && filetype($fdir.$file) != "dir");
$prefix_length = "0";
}
else {
$cond = ($file != "." && $file != ".." && prefix($file,$file_prefix));
}

    if($cond) 


#
#---------[ 4. FIND (line: 65) ]-----------------------------------------------
#

        $result_view = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE id = '.$preid);
        $krydit = $db->fetch_assoc($result_view);
        $displayname = $krydit ['username'];


#
#---------[ 5. REPLACE WITH ]--------------------------------------------------
#

if (is_numeric($preid)) {
        $result_view = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE id = '.$preid);
        $krydit = $db->fetch_assoc($result_view);
        $displayname = $krydit ['username'];
        }
        
else {
        $displayname = "All users";
}


#
#---------[ 6. SAVE/UPLOAD ]-------------------------------------------------
#

Upload file to forum root.

Last edited by Koos (2007-06-10 14:00:20)

Offline

 

#57 2007-06-06 21:39:55

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

Re: Automatic Image Upload with Thumbnails 1.3

Thats cool!. I hope My Add-on will be usefull when you release the next version of your mod.

Btw: Your xhtml is not very valid. Just tags that are not closed like: <br> must be <br />.

Last edited by FSX (2007-06-06 21:42:38)

Offline

 

#58 2007-06-06 22:04:50

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

Re: Automatic Image Upload with Thumbnails 1.3

FSX wrote:

Btw: Your xhtml is not very valid. Just tags that are not closed like: <br> must be <br />.

Really? As far as I know it is not necessary.

One source I found even warns against using the <br/> tag:

Use <br/> Tags VERY Sparsely

<br/> tags are usually unnecessary. Most of the time, people use <br/> tags because they have a wide width for their browser and they think they are doing others a favor - but not everybody uses the same browser dimensions, so let the browser handle the width formatting. Use <p></p> tags instead of <br/> tags.

Last edited by Koos (2007-06-10 14:02:18)

Offline

 

#59 2007-06-07 07:31:03

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

Re: Automatic Image Upload with Thumbnails 1.3

It doen't really mather if you close the tags or not. But it xhtml it's a rule and blalabla.

Here you can find xhtml validator for firefox:
https://addons.mozilla.org/nl/firefox/addon/249

Offline

 

#60 2007-06-09 07:19:20

h0ly lag
New member
From: Nevada
Registered: 2007-06-09
Posts: 3

Re: Automatic Image Upload with Thumbnails 1.3

Hi koos. I really love this mod! smile I was wondering if you could tell me how after you uplaod a image and are taken to the page where is tells you the image code, for example

Code:

[url=http://uhmods.com/forums/imgupload/49_opethstilllife.gif][img]http://uhmods.com/forums/imgupload/thumbs/49_opethstilllife.gif[/img][/url]

Can you assist me in editing whatever pages I need to make it so you gives me just the img tag for the full sized image, not the thumbnail. Like this

Code:

[img]http://uhmods.com/forums/imgupload/49_opethstilllife.gif[/img]

Last edited by h0ly lag (2007-06-09 07:20:55)

Offline

 

#61 2007-06-09 10:10:29

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

Re: Automatic Image Upload with Thumbnails 1.3

In the uploadimg.php around line 260 and 534 you can find the parts where the bbcode is located.

Offline

 

#62 2007-06-09 21:45:23

h0ly lag
New member
From: Nevada
Registered: 2007-06-09
Posts: 3

Re: Automatic Image Upload with Thumbnails 1.3

Yup it was line 242, 243 and 492, 493. Thanks man!

Last edited by h0ly lag (2007-06-09 23:18:04)

Offline

 

#63 2007-06-15 23:54:56

MEDiAHORAN
New member
Registered: 2007-06-15
Posts: 4

Re: Automatic Image Upload with Thumbnails 1.3

I just can't get this mod to work at all http://etern.mine.nu/uploadimg.php it results in a blank page. Any ideas? I have loaded the gd-library succesfully. I've download another mod also http://etern.mine.nu/gallery_upload.php (you're free to try) but when I upload a picture it's the picture isn't there. Hmm maybe I should use an .htaccess file...

Last edited by MEDiAHORAN (2007-06-15 23:59:53)

Offline

 

#64 2007-06-16 08:22:03

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

Re: Automatic Image Upload with Thumbnails 1.3

Have you set the permissions of your "upload" and "uploads/thumbs" dictory to 777?

And I can't acces your site.

Offline

 

#65 2007-06-16 11:40:35

MEDiAHORAN
New member
Registered: 2007-06-15
Posts: 4

Re: Automatic Image Upload with Thumbnails 1.3

FSX wrote:

Have you set the permissions of your "upload" and "uploads/thumbs" dictory to 777?

And I can't acces your site.

Hehe my site is only up when my computer is on, I'm looking for a 24/7 hosting (my friend probably has a computer for that purpose) but how do I set permissions to 777? I'm running apache on my computer (Windows XP) and how do I set chmod to 777?

Offline

 

#66 2007-06-17 17:40:45

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

Re: Automatic Image Upload with Thumbnails 1.3

h0ly lag wrote:

Yup it was line 242, 243 and 492, 493. Thanks man!

You might also want to edit lines 894-896 of uploadimg_view.php

MEDiAHORAN wrote:

I just can't get this mod to work at all http://etern.mine.nu/uploadimg.php it results in a blank page. Any ideas? I have loaded the gd-library succesfully. I've download another mod also http://etern.mine.nu/gallery_upload.php (you're free to try) but when I upload a picture it's the picture isn't there. Hmm maybe I should use an .htaccess file...

Is the page totally blank? Does uploadimg_view.php and uploadimg_stats.php also give a blank page?

MEDiAHORAN wrote:

Hehe my site is only up when my computer is on, I'm looking for a 24/7 hosting (my friend probably has a computer for that purpose) but how do I set permissions to 777? I'm running apache on my computer (Windows XP) and how do I set chmod to 777?

You can change permissions by right clicking the folder and selecting properties -> security

Offline

 

#67 2007-06-17 20:28:52

MEDiAHORAN
New member
Registered: 2007-06-15
Posts: 4

Re: Automatic Image Upload with Thumbnails 1.3

Koos wrote:

h0ly lag wrote:

Yup it was line 242, 243 and 492, 493. Thanks man!

You might also want to edit lines 894-896 of uploadimg_view.php

MEDiAHORAN wrote:

I just can't get this mod to work at all http://etern.mine.nu/uploadimg.php it results in a blank page. Any ideas? I have loaded the gd-library succesfully. I've download another mod also http://etern.mine.nu/gallery_upload.php (you're free to try) but when I upload a picture it's the picture isn't there. Hmm maybe I should use an .htaccess file...

Is the page totally blank? Does uploadimg_view.php and uploadimg_stats.php also give a blank page?

MEDiAHORAN wrote:

Hehe my site is only up when my computer is on, I'm looking for a 24/7 hosting (my friend probably has a computer for that purpose) but how do I set permissions to 777? I'm running apache on my computer (Windows XP) and how do I set chmod to 777?

You can change permissions by right clicking the folder and selecting properties -> security

uploadimg_view.php gives a blank page but  uploadimg_stats.php doesn't. The security thing has full access under the security tab but I think it is my .htaccess file that is wrong.

Offline

 

#68 2007-06-17 20:46:07

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

Re: Automatic Image Upload with Thumbnails 1.3

Or else download uploadimg_view.php again and replace it with the old file. It could be the file it corrupted.

Offline

 

#69 2007-06-18 15:08:16

MEDiAHORAN
New member
Registered: 2007-06-15
Posts: 4

Re: Automatic Image Upload with Thumbnails 1.3

FSX wrote:

Or else download uploadimg_view.php again and replace it with the old file. It could be the file it corrupted.

Hmm I've already tried that sad I've also tried version 1.3.1 to no avail...

Last edited by MEDiAHORAN (2007-06-18 15:11:14)

Offline

 

#70 2007-06-28 18:40:38

winger
New member
Registered: 2007-05-06
Posts: 1

Re: Automatic Image Upload with Thumbnails 1.3

Where do I need to put my uploadimg.php file? In the / Root of my forums?

Offline

 

#71 2007-06-28 19:06:00

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

Re: Automatic Image Upload with Thumbnails 1.3

Yes, in the root folder of your forum ^^.

Offline

 

#72 2007-08-01 13:14:39

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

Re: Automatic Image Upload with Thumbnails 1.3

Koos wrote:

Ex_cuse wrote:

Now im wondering if its possible that there is just one "gallery" where all uploaded pictues from all users are in?
I think it's a bit of annoying klicking through all users to look at their images..

Hi Ex_cuse.

The following modification for v1.3.2 will allow you to use:

uploadimg_view.php?view=gallery&id=all
and
uploadimg_view.php?view=list&id=all

Hi Koos,

How can I add pagination on list view(all) and gallery view(all). This is useful if there are too many pictures uploaded by the users.

thanks

Offline

 

#73 2007-08-01 14:54:17

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

Re: Automatic Image Upload with Thumbnails 1.3

I have a pagination in the post image list in my gallery add-on (add-on for this mod). Maybe you can use that.

Offline

 

#74 2007-08-10 18:02:18

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

Re: Automatic Image Upload with Thumbnails 1.3

doki wrote:

Koos wrote:

Ex_cuse wrote:

Now im wondering if its possible that there is just one "gallery" where all uploaded pictues from all users are in?
I think it's a bit of annoying klicking through all users to look at their images..

Hi Ex_cuse.

The following modification for v1.3.2 will allow you to use:

uploadimg_view.php?view=gallery&id=all
and
uploadimg_view.php?view=list&id=all

Hi Koos,

How can I add pagination on list view(all) and gallery view(all). This is useful if there are too many pictures uploaded by the users.

thanks

Hi Doki - pagination will already be included with gallery view(all). You can add pagination to the 'list view' by making the following modifications:

Code:

#
#---------[ 1. OPEN ]-----------------------------------------------------------
#

uploadimg_view.php


#
#---------[ 2. FIND (line: 662) ]-----------------------------------------------
#

<p class="pagelink">
<?php
echo "<a href='uploadimg_view.php?view=gallery$addthis'>".$lang_uploadimg['View as gallery']."</a>";
?>
</p>


#
#---------[ 3. BEFORE, ADD ]--------------------------------------------------
#

        <p class="pagelink">
        
        <?php
        
$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'uploadimg_view.php?view=list'.$addthis.'&NumSort='.$NumSort.'&SortBy='.$sortbyopp);
echo $paging_links;
?>

</p>


#
#---------[ 4. FIND (line: 585) ]-----------------------------------------------
#

$othernum = 0;


// alternate row counter
$count = 0;


// output file info
for($y = 0; $y < count($file_array); $y++)
//while (list($key, $val) = each($Fname_array))
{


#
#---------[ 5. REPLACE WITH ]--------------------------------------------------
#

$images_per_page_list = "50";

$num_pages = ceil(count($file_array) / $images_per_page_list);
if (!empty($_GET['p'])){
$p = $_GET['p'];
}
else {
$p = 1;
}

$koos2 = (($p-1)*$images_per_page_list) + $images_per_page_list;

if ($koos2 > count($file_array)){
$koos2 = count($file_array);
}


// output file info
for($y = (($p-1)*$images_per_page_list); $y < $koos2; $y++)
{

$othernum = 0;


// alternate row counter
$count = 0;


#
#---------[ 6. SAVE/UPLOAD ]-------------------------------------------------
#

Upload file to forum root.

You can set the images per page for the 'list view' by changing the '$images_per_page_list ' variable.

Offline

 

#75 2007-08-11 00:50:16

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

Re: Automatic Image Upload with Thumbnails 1.3

Hi Doki - pagination will already be included with gallery view(all). You can add pagination to the 'list view' by making the following modifications:

Hi koos, I overlook the pagination on gallery view smile . By the way I already add the pagination for list view and it works great. thanks a lot.

Last edited by doki (2007-08-11 00:51:08)

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.