vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Subdirectory Creation upon Registration (https://vborg.vbsupport.ru/showthread.php?t=78584)

defi 03-23-2005 12:10 AM

Subdirectory Creation upon Registration
 
Okay, basically, what I'm trying to do is autocreate a subdirectory of the user's registered username which is created after activation on vbulletin 3.0.7;

In register, I placed this code:
Code:

//make directory
            mkdir($username, 0777);

in between:
Code:

// activate account
                        $username = unhtmlspecialchars($userinfo['username']);

and,
Code:

if ($vboptions['welcomemail'] AND !$userinfo['posts'])
                        {
                                eval(fetch_email_phrases('welcomemail'));
                                vbmail($userinfo['email'], $subject, $message);
                        }

The problem is that it doesn't create the directory at all - no errors even pop-up when the account is registered and confirmed???

Does anyone have any ideas or suggestions?

cinq 03-23-2005 12:42 AM

You have to define the path in which you want the directory ( with the username ) created :)

sabret00the 03-23-2005 08:30 AM

Quote:

Originally Posted by cinq
You have to define the path in which you want the directory ( with the username ) created :)

told him so as much on aim last night, then i woke up to see a message that he sorted it.

i suggested;
PHP Code:

//make directory
            
mkdir($username0777); 

should've been
PHP Code:

//make directory
$path "/home/sitename/html/forums/" $username;
            
mkdir($path0777); 

but not sure if that code worked for him or no.

defi 03-23-2005 04:59 PM

It got me on the right path,however, I did the following code through my own research;
Code:

//make directory PLEASE...
                mkdir("/home/thatcomm/public_html/$username");
                chmod("/home/thatcomm/public_html/$username", 0777);

Which basically is defining the register.php to make a new directory based off the registered username, and then in turn chmod it to make a new redirect index.php file being created in that same directory using an fopen and fwrite variable(s).

The code works, however when the page goes to insert the redirection code, because of the Javascript nature of the redirect, I get a parse error - I'm probably going to have to make it stripslashes and insert it from a default field in a MySQL table. We'll see.


All times are GMT. The time now is 04:47 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.02135 seconds
  • Memory Usage 1,722KB
  • 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
  • (4)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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