Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-04-2012, 02:08 AM
MrSeth MrSeth is offline
 
Join Date: Oct 2012
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Custom Photo Sharing Page

Hi Guys,

As you can see registered users ( i turned off the registered part for this post so you can see how it works) are allowed to upload photo's and they are pinned to that photo wall/gallery.

This was created with php and jquery....

I was wondering if it was possible to mod it so it will display which users uploaded which files put their name under the photo along with a "like" option....

It would be ideal to have comments also, but I don't want to get the cart ahead of the horse and want to see if this is even a plausible idea.
Reply With Quote
  #2  
Old 11-04-2012, 03:18 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, of course it's possible, but I guess if you wrote the code for that custom page then you'd have to modify it to display the extra information. I don't think we can help you with that without seeing how it was done, and even then it might be too complicated to answer in this forum.
Reply With Quote
  #3  
Old 11-04-2012, 06:54 PM
MrSeth MrSeth is offline
 
Join Date: Oct 2012
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
Well, of course it's possible, but I guess if you wrote the code for that custom page then you'd have to modify it to display the extra information. I don't think we can help you with that without seeing how it was done, and even then it might be too complicated to answer in this forum.


So how can we take this a step further with me sharing the code to you and you giving me the options of how I can get there?
Reply With Quote
  #4  
Old 11-04-2012, 07:17 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, sounds like maybe you've incorporated code you got from somewhere else? If it saves information about each image to a database, then you could modify that code to save the username (and comment) and then change the part that reads the image info to get that data and add it to the display.

If it doesn't use a database (maybe it just looks for images in a certain directory), then you'd need to find a way to save the username and comment, either to a database table or maybe create a second file for each image that contains some text information.
Reply With Quote
  #5  
Old 11-04-2012, 09:59 PM
MrSeth MrSeth is offline
 
Join Date: Oct 2012
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
If it doesn't use a database (maybe it just looks for images in a certain directory), then you'd need to find a way to save the username and comment, either to a database table or maybe create a second file for each image that contains some text information.
That is correct.

Files are just uploaded VIA PHP to a directory which re sizes the files/changes quality/creates a thumbnail.

The jquery command just calls upon that directory to (auto)populate a certain <div>

where the files are then displayed on that template/page.


I guess I'll have to do the same thing with php to:

1btaining the username somehow?
2. upload username to a database
3. use jquery to call upon those fields on the database
Reply With Quote
  #6  
Old 11-04-2012, 10:22 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You're including global.php, right? Or at least I remember you asking about limiting it to members. If you include vbulletin's global.php in showcase.php, then you can get the username from $vbulletin->userinfo['username']. And I think the file upload fields are a form, so if you add a text field to that form you should be able to get the contents of it in $_POST['name'] (using whatever name you put in the text field tag, of course).

I guess getting it back is the hard part. If you store it in the db you could write a php script to get it back, then call that php script from jquery using the file name as a key? Or else save the filename in the db as well, then change your javascript to get the filename from the same php script that is getting the username. (I hope that makes some sense).
Reply With Quote
  #7  
Old 11-05-2012, 12:04 AM
MrSeth MrSeth is offline
 
Join Date: Oct 2012
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
You're including global.php, right? Or at least I remember you asking about limiting it to members. If you include vbulletin's global.php in showcase.php, then you can get the username from $vbulletin->userinfo['username']. And I think the file upload fields are a form, so if you add a text field to that form you should be able to get the contents of it in $_POST['name'] (using whatever name you put in the text field tag, of course).

I guess getting it back is the hard part. If you store it in the db you could write a php script to get it back, then call that php script from jquery using the file name as a key? Or else save the filename in the db as well, then change your javascript to get the filename from the same php script that is getting the username. (I hope that makes some sense).
I don't have global.php included at the moment, either in the template or the source upload .php file(s)....

Which makes me wonder how I'm getting away with this command working to hide upload to non logged in users.

Code:
<vb:if condition="$bbuserinfo[userid] != 0">
// upload form code goes here
<vb:else />
You must be logged in to post pictures.
</vb:if>

So to reiterate: If i wanna try with the directory upload method.

1. edit my upload.php source file to accept a comment box.
2. store these comments on my database & somehow link them to the specific uploaded files in the directory.
3. edit my j query to pull and link the comment to each uploaded picture...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:54 PM.


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.06394 seconds
  • Memory Usage 2,222KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete