View Full Version : Making users long in before uploading photos.
MrSeth
11-01-2012, 11:02 PM
I created a new page on my foru that allows any visitor to upload a picture.
However, I only want registered users to be able to upload photots.
Is there a way I can accomplish this?
ForceHSS
11-01-2012, 11:04 PM
group permissions, also guests should never be allowed to upload anything ever
MrSeth
11-01-2012, 11:37 PM
group permissions, also guests should never be allowed to upload anything ever
How can I make that images on that page public but only set the uploading feature for members?
How did you create that page? If you used templates, you can do this:
<vb:if condition="$bbuserinfo[userid] != 0">
// This part shown to members only
</vb:if>
If your processupload.php script includes global.php, then you would also want to do something like this at the beginning (after including global.php):
if ($vbulletin->userinfo['userid'] == 0)
{
print_no_permission();
}
because you don't want to depend on the fact that the html page doesn't include the upload form.
MrSeth
11-02-2012, 01:53 AM
How did you create that page? If you used templates, you can do this:
<vb:if condition="$bbuserinfo[userid] != 0">
// This part shown to members only
</vb:if>
If your processupload.php script includes global.php, then you would also want to do something like this at the beginning (after including global.php):
if ($vbulletin->userinfo['userid'] == 0)
{
print_no_permission();
}
because you don't want to depend on the fact that the html page doesn't include the upload form.
I did use a template, where in the coding should this go? In any certain div,heading,body etc?
<vb:if condition="$bbuserinfo[userid] != 0">
// This part shown to members only
</vb:if>
--------------- Added 1351822013 at 1351822013 ---------------
EDIT:::::
I figured it out! Thanks so much.
How can i code it so that only user that are not logged in will see a message like
"You must be logged in to post pictures"
Is there a library of VB codes?
How can i code it so that only user that are not logged in will see a message like
"You must be logged in to post pictures"[/B]
You could do this:
<vb:if condition="$bbuserinfo[userid] != 0">
// upload form code goes here
<vb:else />
You must be logged in to post pictures.
</vb:if>
I don't think there is any complete documentation of things you can check in 'if' conditions. While there are some that are generally useful (like the $bbuserinfo array), you pretty much have to refer to the vb code to know exactly what you can do.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.