vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Member's Photo Gallery (https://vborg.vbsupport.ru/showthread.php?t=33034)

JJR512 12-07-2001 10:00 PM

I have written what I consider to be my first "big" hack...well, maybe it's only medium. :) It's certainly my most ambitious project to date.

Basically, what it is is a gallery of photos of your members. Obviously, the hack does not include these photos! :D You need to get your members to submit to you a photo of themselves. You then need to use an image editing app to create a smaller thumbnail image. Create a new directory and upload the photos to it (you don't absolutely need a unique directory for the photos, but it's good for organization). You can make this directory anywhere; I have mine as a first-level directory inside my www root folder, but you can stick it inside your forums root directory or anywhere else. For each member you include in the Photo Gallery, you specify the URL to both images anyway, so it really doesn't matter.

This hack involves adding a new table to your database. Please make a backup of your database first! You are solely responsible for protecting your message board.

At this time, adding a member to the Photo Gallery involves direct database manipulation, such as through phpMyAdmin or direct query. This is easy, and full instructions are provided. I hope to be able to come up with some way to do this through the Admin CP, but that will require some more learning on my part (or assistance from one of you! ;)).

I have tested this on my board, and do not have any problems. However, since this is my biggest project so far, and the first one I've written that includes sql syntax that I devised, it's possible that I have not written this hack in the most optimal or efficient way possible. I don't consider this to be beta, though, as it is fully operational; however, if someone has any pointers on writing better code, please let me know. :)

Demo: My own Photo Gallery
Note: The server my site is hosted on has been having a lot of problems lately, so if it doesn't load or you get MySql errors, please try again a little later. Sorry!

Plans for the Future
1. Add a simple way to add a member to the Photo Gallery through the Admin CP.
2. Making the thumbnail gallery multi-page capable so a user can specify the number of thumbnails seen per page. --DONE!
3. Adding a search function.
4. Integrating into a member's profile, to either show the thumbnail there as well, or else link to it.
5. Got other ideas? Let me hear them.

Everything you need should be in the attached .ZIP file. Have fun! :)

Gamingforce 12-08-2001 07:45 AM

Nice hack!

Btw, do you know how to put the $photouserid of that person on the full page?

EDIT: I tried everything to get $photouserid onto the main_pgfull template but it doesn't display. Do you know what code I would add to main_photogallery.pho to have $photouserid display on the main_pgfull template as well?

MarkB 12-08-2001 09:23 AM

Do you have an example installation you can show? :)

James Cridland 12-08-2001 09:45 AM

Great idea! I've not played with this hack, but I wonder why it needs database manipulation.

For example, my username is "James Cridland", which is a valid filename. A PHP routine like (from memory) if file_exists("/pictures/James Cridland.jpg") would be able to check whether there's a photo uploaded for me, surely?

Therefore, just a little bit of code to check whether my picture exists - and a thumbnail if you want those - could produce a little camera icon for the member or a message in their profile: and you don't have to touch your database...

James

afterlab 12-08-2001 11:11 AM

Dude, sweet hack ya got there. I'll install it later today and tell ya how it goes. Thanks for the excellent hack.

Michael2 12-08-2001 04:44 PM

He has it on his website, just go there and click "photo gallery" at the top.

JJR512 12-08-2001 06:32 PM

Yes, sorry, there is a demo...it is my site: http://forums.jjr512.com/main_photogallery.php?s=
I put it in the instructions, but forgot to mention it here. :)

James Cridland, that didn't really occur to me at the time, I guess mainly because this hack was a conversion of my older pure HTML photo gallery, which of course was just a bunch of <img> tags. But there is actually a good reason why I, personally, wouldn't want the hack to be like that: Sometimes, a member will provide a new photo. Whereas their old photo was named member.jpg, I would name their new photo member2.jpg. The reason for this is the members of my board form a pretty tight community, and I don't mind hosting more than one photo for someone or using my resources...if they want to show their photos stored on my site somewhere else, I don't mind, because it hasn't been a problem yet. So I keep their original photo with the original name to preserve any offsite links, basically.

With your version, the database would still be involved, of course, just to find the other details that I include, like your title, registration date, etc. Of course, you don't have to include all that stuff. But it's not very much data that gets added to the database, just a user id and two URLs.

Gamingforce, if all you need is the userid # to show up or be used on the full photo page, use $photoid.

Jakeman 12-08-2001 08:15 PM

nice idea... i think it would be a lot better if there was an alphabet on the top where you click on a letter and it lists all users starting with that letter (like the way vb handles the memberlist).

Gamingforce 12-08-2001 10:22 PM

Thanks a lot JJR512!

I installed it on my board with a lot of changes.

First, this script works in conjunction with the profile picture script. Basically on the member picture listing, their avatar is shown instead of the thumbnail and when a person clicks on that avatar, it leads to the picture they uploaded for their profile. I personally thought this was pretty cool, because a member can change their photo gallery picture by just changing their profile picture (which comes with an upload script). The only work i have to do is type in the member number to add.

The php file executes this database command: INSERT INTO photogallery VALUES ($memberid, 'null', 'null', '');

xware 12-09-2001 02:20 PM

good hack!
I made a addon with it and integrated it with upload photo hack .
I have installed this hack first.

yesterday I installed JJR512's this hack,
and i think it's not need to update database manipulation if you have installed the upload photo hack.
So i make a new script to INSERT INTO photogallery table the old uploaded photos.
of cause i edit the here's upload script to aoto insert and erase photogallery table too.
It works well and easy.
thanks!! :p

JJR512 12-09-2001 03:27 PM

I had considered making it possible for a member to add his/her own photo to the photo gallery, but didn't know if everyone would like that ability. Some boards might have people that would upload inappropriate photos.

xware 12-09-2001 04:43 PM

ok.
I make a new edit now.
this hack can't display in pagenav.
If you have many member photos,It's too slowly to display and the page is too long! ;) (I have 108 member photos)
I made a edit in main_photogallery.php and integrated pagenav to it.
In default my gallery display 10 photos perpage. If you want see more now can hit "1" "2"..."last page" and so on.
works well,thanks again. :p
My members love this hack. :D

212rikanmofo 12-09-2001 07:42 PM

love this hack, exactly what i need, a member profile/gallery section, can you add the ability to let other members rate them too? also can the user update his pic, and have more than 1 picture they can put up? and can they like edit all ther information? If you would like to see an example go here...

http://www.asianxo.com and goto the profile section, something how they have there, how users can upload and add pics and change info and rate other users... love the hack tho!

JJR512 12-10-2001 04:46 AM

I have performed an extensive re-write on this code based on some ideas from above. Mainly, I've included the pagenav functionality, as discussed by xware. Now, the default number of thumbnails per page will be 10, and if you have more than 10 members in your photo gallery, the pagenav feature will show up. You can change the default # per page, if you want, in the main_photogallery.php file; it's documented near the top.

xware, I'd be interested to see how you did it, just for comparison. :)

I've also added the letters function, as the built-in member list has, per the suggestion of Jakeman. :)

The new .ZIP file is attached to the original post above, but here is a shortcut: https://vborg.vbsupport.ru/attachmen...&postid=205482

MarkB 12-10-2001 05:46 AM

[QUOTE]Originally posted by JJR512
I had considered making it possible for a member to add his/her own photo to the photo gallery, but didn't know if everyone would like that ability. Some boards might have people that would upload inappropriate photos.

xware 12-10-2001 04:09 PM

ok,JJR512,here is your want .
;)
I edited the main_pg.txt and main_photogallery.php
you can use pagenav in display.
I think you can do better. ;)
wait....

DarkReaper 12-10-2001 08:45 PM

All that's needed for this to be truly 1337 is the ability for members to upload their own pictures in the same way they can upload avatars. A report picture thing might be ok, but there isn't one for avatars, and I've never seen them abused...

212rikanmofo 12-11-2001 01:11 AM

agreed, the ability for users to upload there own pictures and update ther own profile and can you make it so other members can rate other users like a rating system? and also can a member upload more than 1 pic to use in there profile? like at http://www.asianxo.com love this hack, great job! :D

TheComputerGuy 12-11-2001 09:29 AM

Find:
case 'gallery.php':
$userinfo[activity] = 'gallery';
break;

I can not find this

ToraTora! 12-11-2001 11:23 AM

Since BradC was the one who made up the photo upload in the first place.. he might be interested to know that it is being used in another script ya know :)

and he added the moderation part to his latest version. If I am not mistaken it was just adding another field in the database, and when the picture is uploaded it is set to I think "1" which means "Needs to be reviewed" and then.. the admins gets an email or sees that one needs to be moderated on the homepage (using vbportal) and then he can set it to "2" for "Approved" or "3" for not approved.

and as for the photo ranking.. or rating the picture, brad actually has had that set up for a long time. Last I heard once get gets it completed he was going to sell it to a few people who wanted to buy it.

TheComputerGuy 12-11-2001 06:20 PM

[QUOTE]Originally posted by ToraTora!
and as for the photo ranking.. or rating the picture, brad actually has had that set up for a long time. Last I heard once get gets it completed he was going to sell it to a few people who wanted to buy it.

ToraTora! 12-11-2001 10:41 PM

I was just commenting on the things that were discussed above.. and on page 1.

Brad created the photo upload script as we know, he has already made a lot of changes, and is working on a photo gallery script, but does not really matter cause I doubt when it is finished that he will give it away.. unless he includes it in his photo ranking script.

And this is a Gallery script by JJR512 no objections to that.. I just wanted to let Brad know that his script was being used with other scripts. He was pleased to hear that his script can still be usefull to everyone. He just wishes he got more thanks for releasing it, cause of all the time spent into it. :)

Does not matter glad that JJR512 has decided to release his photo gallery script. :)

JJR512 12-11-2001 11:41 PM

You know, at first, I wasn't sure what you were trying to say in Post 20, ToraTora!. You said that BradC might be interested to know that someone else was using his photo upload hack. I really didn't understand that at all.

But your next post, Post 22, seems to clear things up, and I am not too happy if I understand you correctly. No sir, not happy at all.

You are talking about BradC's "photo upload" hack. And you mentioned that you told BradC that his script was being used with other scripts, and that BradC was perhaps a little disappointed that he didn't get any credit for that part.

Well let me make this perfectly clear. My hack does not include any photo upload feature at all, nor any of the other features you say BradC had put into his photo upload hack. Just look at the code for it and you would see it. Yet I feel that I am being accused of copying someone else's hack, of putting that hack into my own and giving no credit for it. THAT'S NOT TRUE! :mad:

Now since you already told BradC that I was using his script in mine but gave him no credit, why don't you go tell him that you were 100% wrong, that my hack doesn't have any photo upload feature nor any of the other features you mentioned from his hack. My hack is actually very simple; it's basically the memberlist.php file that comes with vBulletin, with the queries changed, some extra stuff taken out, and the output variables changed appropriately.

DarkReaper 12-12-2001 01:14 AM

:rolleyes:

Maybe you could email him explaining it also, and saying you'd be interested in adding the ability for members to upload their pictures in your hack, and asking if you could use his code...

ToraTora! 12-12-2001 01:25 AM

Sorry for the mis understanding.. I was not saying that you copied, used, or anything with his hack.. sorry for the misunderstadning on that!..

no.. I was refering to the addon for it.. from post 10

https://vborg.vbsupport.ru/showthrea...769#post205769

all I did was told him that the script was being usefull as an addon for other things. He does not care whatsoever, he released it making it open for the public to use and abuse.. lol.

I did not mean anything by the part about "being used in or with another script" I was referring to making them work together, which is a great idea. These two are different in every way. Sorry if I confused anyone by my last two posts on that part. What I was referring to was.. to let others know.. (I will edit it out) that the use, and everything is fine.. hell I don't know why I mentioned it, I guess so that others won't take the script, maybe redo a few things and release it as their own. WHICH YOU HAVE NOT DONE IN ANYWAYS.

Sorry...

Nam 12-12-2001 10:14 PM

I was going to install photo upload first then using this one, I've seen the post that say you can use both, how does this work? Which script should I install first? I'm using version 2.2.1, please let me know, thanks.

TheComputerGuy 12-12-2001 10:53 PM

Find:
case 'gallery.php':
$userinfo[activity] = 'gallery';
break;

anyone help me find this...

JJR512 12-13-2001 01:34 AM

TheComputerGuy, it's in online.php. In an original, unhacked online.php, it's lines 580-582, or at least in mine. I checked it straight out of vbulletin.zip.

Nemesis77 12-13-2001 02:00 AM

INSERT INTO photogallery VALUES (xxx, 'full-photo-URL', 'thumb-photo-URL', '');

Where xxx is the id number of user you are adding to the Photo Gallery,

What am I supposed to replace the xxx with? the id for only one user of leave it as xxx for all users?

JJR512 12-13-2001 02:08 AM

That is the userid number of the one specific user you are adding to the photo gallery.

Nemesis77 12-13-2001 05:35 AM

Is there anyway to se this up so users can be added through the admin cp install of having to run a quary in phpmyadmin for each user?

JJR512 12-13-2001 05:08 PM

There isn't YET, but I am hoping to add that to it, or that someone else can write that part. I have no experience writing for the admin cp at all, so I'll have to figure it out as I do it.

Nemesis77 12-13-2001 09:46 PM

OK Thanks for the reply. Great Hack BTW

smnoel 12-14-2001 01:19 PM

This hack is great. I would like it where members can upload their own pics and have a small caption.

Hoping someone will implement these things.

Sara

JJR512 12-15-2001 03:44 AM

The caption idea is basically already there. Notice that in the new table, there is a field called "comments". Anything put in that field will show up as the last thing in the list of user's details (name, registration date, post count, etc.). If you want it to be more like a true caption, and have it under the photo, just edit the main_pgbit template.

Lionel 12-24-2001 02:01 AM

Wouldn't it be possible that if some is using the upload photo hack to simply add the insert statement to include it in the gallery?

This way, while the member is uploading his picture he is also populating the gallery.

And for the thumbnail we could add the same image but with the width="100". Or while doing the upload we use imagemagick...

Just a thought.

JJR512 12-24-2001 06:27 AM

You wouldn't want to use the full-size image for the thumbnail image, too...that would kind of defeat the purpose of having a thumbnail index in the first place, which is to present many small, quick-loading images on one page. Using HTML width and height tags to make an image display smaller doesn't actually make the file size smaller, of course, so you would have a bunch of big image files being loaded on one page, which would be a pain in the butt for dialup users.

I haven't looked at the photo upload hack, so I don't really know how it works, but if you can upload one file, I'm sure you can upload two.

This is part of the original reason why I never thought to include a way for users to add their own photos. Many of the users on my board do not have the knowledge or capability to make their own thumbnail images, so either I or one of my assistants has always done this for them. Many of my members are just casual computer users; they come to my board for the general chit-chat in a friendly atmosphere...it's kind of like going to a bar to talk to your friends, not because you're a hardcore drinker.

JJR512 12-24-2001 06:29 AM

Just for the record, though, if I get a chance to work on this, I will...but I'm not actively working on it right now. I have another hack (the any-forum news hack) that I'm working on, in between playing games and doing holiday-related stuff. It's hard for me to get motivated to work on this feature when I know I'm never going to use myself, know what I mean?

Lionel 12-24-2001 12:35 PM

I am going to try to play with imagemagick a little bit to generate the thumbnails.

Merry Xmas to you and thanks for hack.

BTW there are plenty any forums news hacks. I am using 3 of them on my site frontpage.

JJR512 12-24-2001 02:47 PM

Really? There are other hacks that let you post news items in any or all forums? I've never seen any, and when I posted mine, nobody else said it had already been done or that they already did it. I'm having trouble getting your page at http://www.haitiwebs.com/ to load, so I can't see them... can you give me links?


All times are GMT. The time now is 11:44 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01410 seconds
  • Memory Usage 1,835KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete