1
timman
Action after registration complete... Need some help
  • 2005/2/14 13:03

  • timman

  • Just popping in

  • Posts: 18

  • Since: 2005/1/16


I'm already trying to find a module and hack for such a long time that I now urgently need a solution to my problem.

There are some things to be done:

1) the website field in the registration should be checked if excists. It should be unique, so I thought about this:


function ls_a($wh,$url){  
$occupied=0;  
         if (
$handle opendir($wh)) {
               while (
false !== ($file readdir($handle))) { 
                       if (
$file != "." && $file != ".." ) { 
                                     if(
$file == $url){ 
                                         
$bezet 1;
                                     }
                       } 
               }
               
closedir($handle); 
         }
         return 
$occupied;
       } 


$restriction '/[^A-z0-9_]/';

if (
$submit){
    
$bezet=ls_a('../',$url);
    if (!
eregi(" "$url)){
        if (!
preg_match($restriction,$url)){
            if (
$bezet == 0){
                
$doorgaan ='true'
            }
            else{
                
$stop "The sitename already excists
"
;
                
$continue ='false'
            }
        }
        else{
        
$stop "Please do not use spaces or special characters in your sitename"
        
$continue ='false'
        }
    }
    else{
    
$stop "Please do not use spaces in your sitename
"
;
    
$continue ='false'
    }
}
?>

    
    


    echo $stop ?>

    sitename:(poink.be/)


    o:


    template:
demo1


    email owner:



    
    
    

    



The executemkdir.php:

$site =strtolower($url);

       function 
cp($wf$wto){   
               
mkdir($wto,0777);
               
$arr=ls_a($wf);
               foreach (
$arr as $fn){
                           if(
$fn){
                               
$fl="$wf/$fn";
                               
$flto="$wto/$fn";
                           if(
is_dir($fl))    cp($fl,$flto);
                               else 
copy($fl,$flto);
                       }
               }
       }

       function 
ls_a($wh){    
         if (
$handle opendir($wh)) {
               while (
false !== ($file readdir($handle))) { 
                       if (
$file != "." && $file != ".." ) { 
                                     if(!
$files$files="$file";
                                     else 
$files="$filen$files"
                       } 
               }
               
closedir($handle); 
         }
         
$arr=explode("n",$files);
         return 
$arr;
       } 

$oldname "../" $keuze "/";
$newname "../" $site "/";
cp($oldname$newname) ;
       
       
$bestand '../' $site '/settings.php';
include 
$bestand;
$admin_email $email;
$title $site;

$jt fopen$bestand'w+' );
fwrite$jtstripslashes("$title='$title';?>$meta_name_keywords='$meta_name_keywords';?>$meta_name_description='$meta_name_description';?>$username='$username';?>$password='$password';?>$admin_email='$admin_email';?>$url_img='$url_img';?>$path_img='$path_img';?>$body_bg_color='$body_bg_color';?>$header_bg_color='$header_bg_color';?>$content_bg_color='$content_bg_color';?>$menu_bg_color='$menu_bg_color';?>$footer_bg_color='$footer_bg_color';?>$table_width='$table_width';?>$table_height='$table_height';?>$cell_padding='$cell_padding';?>$url='$url';?>$boodschap='$boodschap';?>" ) );
fclose$jt );



?>


Ok, this is rough, but the idea is that after I approved registration a subdir with the $url should be created. It already works (I tried to translate some vars because they were in dutch)

The question is: can I put the first snippet in the register.php of xoops, and where?

2
timman
Re: Action after registration complete... Need some help
  • 2005/2/15 17:00

  • timman

  • Just popping in

  • Posts: 18

  • Since: 2005/1/16


Well, I don't know what it is. Is it the way I ask my questions? Nobody seems to go into this. For someone with PhP knowledge this should be a piece of cake.

Login

Who's Online

432 user(s) are online (61 user(s) are browsing Support Forums)


Members: 0


Guests: 432


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Sep 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits