[Include] C-SMF - Connect from Simple Machines Forums to SA-MP!
#21

Quote:
Originally Posted by ded
Посмотреть сообщение
OT:

Someone mentioned this before, but, if it's possible (I'm not sure) the ability to create forum accounts from ingame would own so much ass! An example usage would be like, a new player registers in-game and automatically creates a forum account with the same details, obviously you'd have to have an email address, etc. etc. TELL ME IT'S POSSIBLE?!?! :P
It's possible.
Reply
#22

We are using vBulletin, looking forward to a vB release!
Reply
#23

Quote:
Originally Posted by ded
Посмотреть сообщение
Lol, Simon. Making my day and shit. Ok, ok ... next question. Who can make it happen?
pawn Код:
stock CreateAccount(_name[], Password__[], Email[]) {
     new hash[60], formated[128];
     strmid(hash, Password__, 0, strlen(Password__), sizeof hash);
     strins(hash, _name, 0, sizeof hash);
     for(new s; s < strlen(hash); s++) hash[s] = tolower(hash[s]);
     format(formated, 128, "INSERT INTO %s (realName, passwd, emailAddress, memberName) VALUES('%s', sha1('%s'), '%s', '%s')",  MEMBERTABLE, _name,hash, Email, _name);
     mysql_query(formated, -1, -1, SMFConnection);
}
That was tested, it works perfectly, i'm able to login and do what I wan't do. Enjoy.

PS: Insert this into the CSMF, it will bring no errors that way.
Reply
#24

Quote:
Originally Posted by ded
Посмотреть сообщение
Oh, nice. Will this work regardless of what settings the forum has? For example ... if I make users verify their email before they can login ,etc. etc.? This will just register normally, right? By normal I mean.. just like going to the forum and doing it?
I never really thought about that, do you mind checking that? I'm really busy with something. I installed vBulletin to my localhost, and i'm just more than busy trying to figure it out. So I really don't have time to check it.
Reply
#25

Show me where you used the function.
Reply
#26

Quote:
Originally Posted by ded
Посмотреть сообщение
This was something for a quick test of it, I wonder if it has anything to do with the email. I know probably it should be formatted within the command as a parameter, this was just a quick check.

Код:
CMD:register(playerid,params[])
{
    if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,red,"FIZ: You are already registered and logged in.");
    if (udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,red,"FIZ: This account already exists, please use '/login [password]'.");
    if (strlen(params) == 0) return SendClientMessage(playerid,red,"FIZ: Correct usage: '/register [password]'");
    if (strlen(params) < 5 || strlen(params) > 20) return SendClientMessage(playerid,red,"ACCOUNT: Password length must be greater than four characters");
    if (udb_Create(PlayerName2(playerid),params))
	{
    	new file[256],name[MAX_PLAYER_NAME], tmp3[100];
    	new strdate[20], year,month,day;	getdate(year, month, day);
		GetPlayerName(playerid,name,sizeof(name)); format(file,sizeof(file),"/fizzio/users/%s.sav",udb_encode(name));
     	GetPlayerIp(playerid,tmp3,100);	dini_Set(file,"ip",tmp3);
//    	dini_Set(file,"password",params);
	    dUserSetINT(PlayerName2(playerid)).("registered",1);
   		format(strdate, sizeof(strdate), "%d/%d/%d",day,month,year);
		dini_Set(file,"RegisteredDate",strdate);
		dUserSetINT(PlayerName2(playerid)).("loggedin",1);
		dUserSetINT(PlayerName2(playerid)).("banned",0);
		dUserSetINT(PlayerName2(playerid)).("level",0);
		dUserSetINT(PlayerName2(playerid)).("Regular",0);
		dUserSetINT(PlayerName2(playerid)).("Developer",0);
		dUserSetINT(PlayerName2(playerid)).("Bank",0);
		dUserSetINT(PlayerName2(playerid)).("Cookies",1);
	    dUserSetINT(PlayerName2(playerid)).("LastOn",0);
    	dUserSetINT(PlayerName2(playerid)).("money",0);
    	dUserSetINT(PlayerName2(playerid)).("kills",0);
	   	dUserSetINT(PlayerName2(playerid)).("deaths",0);
	   	dUserSetINT(PlayerName2(playerid)).("hours",0);
	   	dUserSetINT(PlayerName2(playerid)).("minutes",0);
	   	dUserSetINT(PlayerName2(playerid)).("seconds",0);
        dUserSetINT(PlayerName2(playerid)).("SpawnColour",255);
	   	dUserSetINT(PlayerName2(playerid)).("xAccount",0);
		dUserSetINT(PlayerName2(playerid)).("CarKey",0);
		dUserSetINT(PlayerName2(playerid)).("Licence",0);
	    PlayerInfo[playerid][LoggedIn] = 1;
	    PlayerInfo[playerid][Registered] = 1;
	    SendClientMessage(playerid, MANAGEMENT, "FIZ: You are now registered, and have been automatically logged in");
		CreateAccount(name, params, "accounts.fiz@gmail.com");
		return 1;
	}
    return 1;
}
That's strange, just to double check if it's the function, add CreateAccount in OnGameModeInit or something, and add a random name and password for the parameters.
Reply
#27

i have add this in my gamemode only i i restart my server then hi can not find the gamemode more
Reply
#28

Quote:
Originally Posted by wr4h4ck
Посмотреть сообщение
i have add this in my gamemode only i i restart my server then hi can not find the gamemode more
What...?


-

@ded

I have no clue what's wrong with the code I sent you.
Reply
#29

Version updated, new functions added.

pawn Код:
native GetForumNews();
native GetForumSMTP_Username();
native GetForumSMTP_Port();
native GetCategoryNameByID(_id);
native GetBoardNameByID(_id);
native GetBoardIDByName(_name[]);
native GetBoardCategoryByID(_id);
native GetBoardCategoryByName(_name[]);
Reply
#30

Some uses IPB aswell
Reply
#31

Does this support SMF 2.0?
Reply
#32

There's a few problems with this system

CreateForumAccount: It formats the query into a 128 byte size buffer. Obviously with e-mail addresses and all other whatnot, this limit can easily be exceeded.

CheckForumUserNameAndPassword: doesn't work

Many of the queries have incorrect field names (well, in terms of SMF 2.0 at least).
Reply
#33

Quote:
Originally Posted by Jay_
Посмотреть сообщение
There's a few problems with this system

CreateForumAccount: It formats the query into a 128 byte size buffer. Obviously with e-mail addresses and all other whatnot, this limit can easily be exceeded.

CheckForumUserNameAndPassword: doesn't work

Many of the queries have incorrect field names (well, in terms of SMF 2.0 at least).
I've tested this on 1.1. That is probably the problem.
Reply
#34

Ah I see. With a bit of tweaking I've got it working on 2.x. Just having some issues with the password encryption. Will get that sorted and post the edit here when I've got it working.
Reply
#35

Okay the CheckUserNameAndPassword function is definitely not working - not on SMF 2.0 or 1.x.
Reply
#36

Yeah, i want to use this on SMF 2.0 too
Reply
#37

Somebody has a SMF 2.0 compatible one? [srry for bump]
Reply
#38

anyone?
Reply
#39

Anyone know why i get the query when i use GetForumNews() ??
Reply
#40

Think someone could update this to the latest SMF version, 2.0.1?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)