Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-21-2008, 08:48 PM
DPtheGod's Avatar
DPtheGod DPtheGod is offline
 
Join Date: May 2007
Location: Everett, WA
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Question concerning download managing

Greetings!

I am looking to set up a system for my website similar to NarutoFan. Basically, I want to be able to have a login script for my main page where people can log in, if they are currently not logged in the forum. I am running vBulletin 3.6.8 right now. I want the script to be able to make it so people can submit a payment, and the system records that a payment was received, and they can gain access to the videos and podcasts section. Then for purchasing them on DVD and also the material based merchandise, just a checkout system. Also, I want to make it so anyone who is not a paying customer cannot access the downloads if they happen to find where the files are located on the server.

Would anyone know where I could start on this?
Reply With Quote
  #2  
Old 03-22-2008, 07:07 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Include the vBulletin backend, and then check the usergroup when people try to access that page.

Do you know PHP well?
Reply With Quote
  #3  
Old 03-22-2008, 08:06 PM
DPtheGod's Avatar
DPtheGod DPtheGod is offline
 
Join Date: May 2007
Location: Everett, WA
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am decent with it, but I am a n00b with MySQL lol. So, I'd really have no idea where to begin. What all would I have to do to include the vBulletin backend? That is something I am unfamiliar with, unfortunetely.
Reply With Quote
  #4  
Old 03-23-2008, 03:01 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$curdir getcwd();
chdir('/PATH/TO/FORUMS');
require_once(
'./global.php');
chdir($curdir); 
Reply With Quote
  #5  
Old 03-23-2008, 07:12 AM
DPtheGod's Avatar
DPtheGod DPtheGod is offline
 
Join Date: May 2007
Location: Everett, WA
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the help.

Although, I am getting this error when trying use a login script I got on here a while back:

Code:
Warning: main(login_inc2.php) [function.main]: failed to open stream: No such file or directory in /home/hiroanim/public_html/menu.php on line 167

Fatal error: main() [function.require]: Failed opening required 'login_inc2.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/hiroanim/public_html/menu.php on line 167
I have the login_inc2.php file both in my forums directory, and the root directory, and I am using this code to call it:

PHP Code:
<?php
   
require_once('login_inc2.php');
?>
I was curious if you noticed anything wrong with it?

This code is frustrating lol

Edit: Nevermind! I have gotten it to work! Thank you for the help!

Also, I have one more question. Let's say I have a directory on my server that has a bunch of render image files, and I only want people who have obtained access either sending a payment in or reaching a certain usergroup from posting, but someone who does have access gives out the file name and location on the server, is it possible to restrict anyone not in the usergroup from accessing the file?

I know how to set it up so that the page is restricted from people who are not in the usergroup, but I want to be sure that paying customers can't send out the full url of the files to non-paying customers and have them steal all of the premium renders.
Reply With Quote
  #6  
Old 03-23-2008, 07:54 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DPtheGod View Post
Also, I have one more question. Let's say I have a directory on my server that has a bunch of render image files, and I only want people who have obtained access either sending a payment in or reaching a certain usergroup from posting, but someone who does have access gives out the file name and location on the server, is it possible to restrict anyone not in the usergroup from accessing the file?

I know how to set it up so that the page is restricted from people who are not in the usergroup, but I want to be sure that paying customers can't send out the full url of the files to non-paying customers and have them steal all of the premium renders.
The easiest way would be to lock down that directory with .htaccess:
Code:
Order allow, deny
And then use a script to check the usergroup before grabbing and outputting the file (via PHP).
Reply With Quote
  #7  
Old 03-24-2008, 06:22 AM
DPtheGod's Avatar
DPtheGod DPtheGod is offline
 
Join Date: May 2007
Location: Everett, WA
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you for your help with the htaccess file. I set it up, and I can't access anything as a guess, which I like. However, I set up a page with the following code:

PHP Code:
<?php
if ($vbulletin->userinfo['usergroupid'] == '6' )
    {
    echo 
"Welcome to the premium section!";
             } else {
             echo 
"You do not have permission for this page"; }
    
?>

<a href="Avatars.rar">A</a>
And when I load that page in my main page using a php include, it doesn't let me download the rar file. Do I have to include some type of php code inside of the htacces? Or did I mess up my coding? Also, is there a way to detect if the user is a secondary member of that usergroup?

Thank you for all of your help so far, it means a lot to me.

Edit: I've fixed the code, and have it working:

PHP Code:
<?php
if ($vbulletin->userinfo['usergroupid'] == '6' )
    {
    echo 
"Welcome to the premium section!<br /><a href='/depu/Avatars.rar'>A</a>";
             } else {
             echo 
"You do not have permission for this page"; }
    
?>
But it is giving me this error:

Quote:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Is there something else I have to include in my htaccess file?
Reply With Quote
  #8  
Old 03-25-2008, 05:11 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to fetch the file (with the file() functions), and then output the appropriate headers along with the data.
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 07:40 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.04652 seconds
  • Memory Usage 2,248KB
  • Queries Executed 13 (?)
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
  • (2)bbcode_code
  • (4)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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_postinfo_query
  • fetch_postinfo
  • 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