vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Making users long in before uploading photos. (https://vborg.vbsupport.ru/showthread.php?t=290036)

MrSeth 11-01-2012 10:02 PM

Making users long in before uploading photos.
 
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 10:04 PM

group permissions, also guests should never be allowed to upload anything ever

MrSeth 11-01-2012 10:37 PM

Quote:

Originally Posted by ForceHSS (Post 2377682)
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?

kh99 11-01-2012 10:58 PM

How did you create that page? If you used templates, you can do this:

Code:

<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):

Code:

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 12:53 AM

Quote:

Originally Posted by kh99 (Post 2377695)
How did you create that page? If you used templates, you can do this:

Code:

<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):

Code:

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?

Code:

<vb:if condition="$bbuserinfo[userid] != 0">
// This part shown to members only
</vb:if>

--------------- Added [DATE]1351822013[/DATE] at [TIME]1351822013[/TIME] ---------------

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?

kh99 11-02-2012 11:46 AM

Quote:

Originally Posted by MrSeth (Post 2377715)
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:

Code:

<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.


All times are GMT. The time now is 05:41 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.04440 seconds
  • Memory Usage 1,724KB
  • 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
  • (6)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete