The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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. |
#2
|
|||
|
|||
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.
|
#3
|
|||
|
|||
Quote:
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? |
#4
|
|||
|
|||
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. |
#5
|
|||
|
|||
Quote:
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 |
#6
|
|||
|
|||
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). |
#7
|
|||
|
|||
Quote:
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... |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|