DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • November 19, 2018, 03:52:37 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1] 2   Go Down
  Print  
Author Topic: registration date on account creation  (Read 5945 times)
0 Members and 1 Guest are viewing this topic.
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« on: May 05, 2005, 07:30:16 AM »

so this is what i have so far, which basically adds up to nothing since it doesnt work.

Code:
<?php
require_once("common.php");

function 
regdate_getmoduleinfo(){
      
$info = array(
         
"name"=>"Registration Date",
         
"author"=>"Sixf00t4",
         
"version"=>"20050505",
         
"category"=>"Administrative",
         
"download"=>"http://dragonprime.net/users/sixf00t4/regdate.zip",
         
"vertxtloc"=>"http://dragonprime.net/users/sixf00t4/",
            
"prefs"=>array(
            
"Registration Date,title",
                
"regdate"=>"When did this user register?,text|",
                ),
      );
   return 
$info;
}
function 
regdate_install(){
   
module_addhook("process-create");
   
module_addhook("create-form");
   return 
true;
}
function 
regdate_uninstall(){
   return 
true;
}
function 
regdate_dohook($hookname){
   global 
$session;
   switch (
$hookname){
       case 
"process-create":
            
$date=date("d-m-Y");
            
set_module_pref("regdate",$date,"regdate");
        break;
       case 
"create-form":
            
$date=date("d-m-Y");
            
output("<input type=hidden name='regdate' value=$date>",true);
        break;
    }
}
function 
regdate_run(){
}
?>
Logged

CortalUX
Dwellings Project
Mod God
*****
Offline Offline

Posts: 796


Wogga! Meep!


View Profile WWW
« Reply #1 on: May 05, 2005, 07:40:17 AM »

Why do you need the create-form hook?
Also, sometimes date needs 'time()' as a second parameter.
Edit: It might be nice for a bio-option, admin-willing. Maybe using check_ so it's only displayed if admins ok it.
« Last Edit: May 05, 2005, 07:40:57 AM by CortalUX » Logged
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #2 on: May 05, 2005, 07:51:27 AM »

well, i didnt think i needed it at first either.  when i got the error that process-create didnt return an array, and saw things like "name, pass1, pass2" etc, i was thinking that i had to pass them through the create-form array/modulehook to be able to use them in process-create.  

basically, i have no idea what i am doing, and have no examples to work with.
Logged

CortalUX
Dwellings Project
Mod God
*****
Offline Offline

Posts: 796


Wogga! Meep!


View Profile WWW
« Reply #3 on: May 05, 2005, 07:53:59 AM »

Ok, if you want I can look at this... not trying to steal your thunder:P
Might take me a while to do it, I'm on dialup.
Edit: Just moving onto a pc with ftp.
« Last Edit: May 05, 2005, 08:08:48 AM by CortalUX » Logged
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #4 on: May 05, 2005, 08:27:30 AM »

go for it, Mr. CortalUX, coder extraordinaire.
Logged

Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #5 on: May 05, 2005, 08:42:02 AM »

Dude, first off... you forgot the check-create hook... While not necessary, you may still wish to include it...

Basically, check:
Code:
case "check-create":
$date = $args['regdate'];
if ($date == NULL){
$args['blockaccount'] = true;
$args['msg'] = translate_inline("I am sorry, bur for some unknown reason, your account was unable to get a registration date for itself. Please try again.");
}
break;
As well, I do have a notion about these hooks. Upon process-create, all information is filtered into the account, save for the acctid. The acctid is needed in order to use the set_module_pref function. What I suggest, is debugging some info after process-create, such as:

Code:
debug("Acctid: ".$session['user']['acctid']);
debug("Login: ".$session['user']['login']);

If these then return no values, then it will be almost impossible to use these two hooks, in order to generate this kind of function. Smiley

Although, I also highly doubt you will be able to be using the debug, as this area of the script is only viewed once in a character's lifetime. Smiley

I take all of this arduos work, and the mere fact that NO modules use these hooks, as saying that they probably do not work.
« Last Edit: May 05, 2005, 08:43:25 AM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

CortalUX
Dwellings Project
Mod God
*****
Offline Offline

Posts: 796


Wogga! Meep!


View Profile WWW
« Reply #6 on: May 05, 2005, 08:47:37 AM »

* CortalUX starts work.
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #7 on: May 05, 2005, 08:50:40 AM »

* CortalUX starts work.

Hehe, I have tried for a while to work on it all, never reaching an end.

As well, there is no real use for this type of script... for one simple reason, if any: What about your veteran players? Or the players that started 5 hours before this mod went into place? Just gonna let them go without a date...? Without the main purpose of the mod...?

I could see this mod at the beginning of a server, but as most have been running since PR1 and before (in the case of 97 servers transferring to 1.0.0+), I doubt anything that would come out of these hooks could be deemed useful or pure vanity, if that would be needed.
« Last Edit: May 05, 2005, 08:51:08 AM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

CortalUX
Dwellings Project
Mod God
*****
Offline Offline

Posts: 796


Wogga! Meep!


View Profile WWW
« Reply #8 on: May 05, 2005, 09:15:35 AM »

I've got this working, so neer-neer Tongue
I've added a few more features.
I'm adding a readme and pm-ing to sixf00t4.

Thing is, just because all of our servers don't need it, new servers are being started all the time.
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #9 on: May 05, 2005, 09:16:44 AM »

I've got this working, so neer-neer Tongue

I never stated that I didn't get this working... Wink

It's just that there is no real utility for these three hooks. As well, I doubt there is a single server out there, that decided to install third-party mods upon installing 1.0.0+. There may be some, but I doubt a fresh installer would wish to jumble into the mix any problems.
« Last Edit: May 05, 2005, 09:18:09 AM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #10 on: May 05, 2005, 10:00:48 AM »

sure you have players that will all have the same registration date, but eventually they will fade, and you will see new signups taken place, you have to consider the evolution of it all.

and there have been a few metions of modules that would depend on these hooks.  such as the birthdate mod, age mod, possibly default language right off the bat, country, maybe a generated security image to create a new login, the possibilities are endless.

you're too pessimistic and short, Sichae.  And i'm not (just) talking about your height Wink

Rock on cortal.  Was it difficult?  If it works, by all means, release it as yours, you did it.
Logged

robert
Old Dog
Mod God
*****
Offline Offline

Posts: 1047


LoGD Buff!


View Profile WWW
« Reply #11 on: May 05, 2005, 10:11:33 AM »

I mentioned once before and sixf00t4 just repeated it - veteran/current players will be SOL and not benifit from the introduction of the mod - BUT ALL new players afterward will get to see thier sign on date.

I too have received requests from players who just out of curiosity wanted to know when they started playing. I believe in due time this mod when introduced will benifit those few players and maybe, just maybe will serve a future purpose somehow.  Cool

Besides, its great to see mods being created out the norm of buffing a player to a jillion mega stats.  Cool
« Last Edit: May 05, 2005, 10:15:14 AM by robert » Logged

CortalUX
Dwellings Project
Mod God
*****
Offline Offline

Posts: 796


Wogga! Meep!


View Profile WWW
« Reply #12 on: May 05, 2005, 10:30:40 AM »

Look at this thread.
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #13 on: May 05, 2005, 12:06:20 PM »

you're too pessimistic and short, Sichae.  And i'm not (just) talking about your height Wink

I actually resent that...

So, goodbye all. I am done.
Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

CortalUX
Dwellings Project
Mod God
*****
Offline Offline

Posts: 796


Wogga! Meep!


View Profile WWW
« Reply #14 on: May 05, 2005, 12:17:48 PM »

I actually resent that...

So, goodbye all. I am done.
I meant the neer neer jokingly; and I'm sure that sixf00t4 did too.
Please don't go! You've done loads for us, this community, and this game. You've been great, we'd really miss you, and the community would lose a great person.
If really you do want to go, this won't persuade you- but please stay.  Cry
Logged
Pages: [1] 2   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
48 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search