Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
2 users currently in General Chat: Ailure, Dark Vampriel | 1 guest
Acmlm's Board - I2 Archive - General Chat - 2.0 Coding Style | |
Pages: 1 2Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
||bass
Programmer Admin
Level: 44

Posts: 787/817
EXP: 570813
For next: 40472

Since: 03-15-04
From: Salem, Connecticut

Since last post: 26 days
Last activity: 11 days
Posted on 08-28-05 03:21 AM Link | Quote
I'd like opinions on this...

For those among you who know php, what would you think if the 2.0 source code looked like this:

EDIT: Blame the board/IE/Jesus/Buddah for messing up the tabs in this post, sorry.



if(!function_exists(libdec)){die('The required libraries have not been defined.');}

class core_user
{
private $msq_userdata;

/**
* Class constructor
*
* @param int $int_uid
*/
public function __construct($int_uid)
{
$int_uid=intval($int_uid);
self::$msq_userdata=mysql_query("SELECT * FROM `users` WHERE `id`='$int_uid'");
if(mysql_num_rows(self::$msq_userdata))
{
self::$msq_userdata=mysql_fetch_array();
}
}

/**
* Checks for a user with with the username and password specified
*
* @param string $str_username
* @param string $str_password
* @return userid if username/password combination is valid, false if not
*/
public static function loaduser($str_username,$str_password)
{
$str_username=addslashes($str_username);
$msq_user=mysql_query("SELECT * FROM `users` WHERE `name`='$str_username' AND `password`='".md5($str_password)."'");
if(mysql_num_rows($msq_user))
{
$msa_user=mysql_fetch_array($msq_user);
$retval=$msa_user[id];
}
else{$retval=false;}
return($retval);
}

/**
* Creates a new user DB entry with the username, password and email specified
*
* @param string $str_username
* @param string $str_password
* @param string $str_email
* @return newuser id if username is available, false if not
*/
public static function newuser($str_username,$str_password,$str_email)
{
self::
$str_username=addslashes($str_username);
$str_email=addslashes($str_email);
if(self::searchvalue("name",$str_username)==false)
{
mysql_query("INSERT INTO `users` SET `name`='$str_username', `password`='".md5($str_password)."', `email`='$str_email'");
$retval=mysql_insert_id();
}
else{$retval=false;}
return($retval);
}

/**
* Searches for a value within the user table
*
* @param string $str_valname
* @param string $str_value
* @return mysql resource if value $str_value can be found in field $str_valname, false if not
*/
public static function searchvalue($str_valname,$str_value)
{
$arr_fields = core_core::get_dbfields("users");
if(array_search($str_valname,$arr_fields))
{
$str_value=addslashes($str_value);
$msq_result=mysql_query("SELECT * FROM `users` WHERE `$str_valname`='$str_value'");
if(mysql_num_rows($msq_result)==0){$retval=false;}
else{$retval=$msq_result;}
}
else{$retval=false;}
return($retval);
}

/**
* Gets a value from the user
*
* @param string $str_valname
* @return field value if field $str_valname exists, false if not (be careful of return val false vs. 0 or '')
*/
public function get_value($str_valname)
{
if(array_key_exists($str_valname)){$retval=self::$msq_userdata[$str_valname];}
else{$retval=false;}
return $retval;
}

/**
* Sets a value to the user
*
* @param string $str_valname
* @param string $var_value
* @return true if $str_valname exists, false if not
*/
public function set_value($str_valname,$var_value)
{
if(array_key_exists($str_valname))
{
self::$msq_userdata[$str_valname]=$var_value;
$retval=true;
}
else{$retval=false;}
return $retval;
}

/**
* Commits user data to the DB
*/
public function commit()
{
$str_outfields="`".implode("`,`",array_keys(self::$msq_userdata))."`";
$str_outdata="'".implode("','",self::$msq_userdata)."'";
$str_command="UPDATE `users` ($str_outfields) VALUES ($str_outdata) WHERE `id`=".self::$msq_userdata[id];
die($str_command); //debug for now
//mysql_query($command);
}
}

?>



(edited by ||bass on 08-27-05 06:21 PM)
(edited by ||bass on 08-27-05 06:22 PM)
(edited by ||bass on 08-27-05 06:24 PM)
SyntaxLegend

Double metal axe
Level: 25

Posts: 214/222
EXP: 78264
For next: 11356

Since: 04-21-04
From: Australia

Since last post: 20 days
Last activity: 10 hours
Posted on 08-28-05 05:20 AM Link | Quote
It looks good, especially with comments and looks like a professional system.
neotransotaku

Baby Mario
戻れたら、
誰も気が付く
Level: 87

Posts: 3834/4016
EXP: 6220548
For next: 172226

Since: 03-15-04
From: Outside of Time/Space

Since last post: 11 hours
Last activity: 1 hour
Posted on 08-28-05 05:45 AM Link | Quote
Looks good, appending the type should keep variables in order. Let's hope the board SQL will also be standardized...
Lenophis

Super Koopa
Level: 44

Posts: 683/830
EXP: 584360
For next: 26925

Since: 03-15-04
From: Duluth, MN

Since last post: 4 hours
Last activity: 3 hours
Posted on 08-28-05 07:11 AM Link | Quote
Your indendation sucks donkey balls. Other than that, the comments are a nice welcome. I'll assume the board is fucking up the indentation for now.
||bass
Programmer Admin
Level: 44

Posts: 789/817
EXP: 570813
For next: 40472

Since: 03-15-04
From: Salem, Connecticut

Since last post: 26 days
Last activity: 11 days
Posted on 08-28-05 07:14 AM Link | Quote
Originally posted by Lenophis
Your indendation sucks donkey balls. Other than that, the comments are a nice welcome. I'll assume the board is fucking up the indentation for now.
Yea, it would be safe to assume considering THE THIRD LINE OF THE POST SAYS EXACTALLY THAT.

READ.
Xkeeper
The required libraries have not been defined.
Level: NAN

Posts: 3497/-863
EXP: NAN
For next: 0

Since: 03-15-04

Since last post: 2 hours
Last activity: -753366 sec.
Posted on 08-28-05 07:14 AM Link | Quote
By the way, the HTML tag you want is "<PRE>". Preserves formatting, doesn't autowrap, keeps whitespace at start.


(edited by Xkeeper on 08-27-05 10:15 PM)
Devin

Red Koopa
Level: 20

Posts: 129/136
EXP: 38569
For next: 3870

Since: 03-21-04
From: thar

Since last post: 1 day
Last activity: 6 hours
Posted on 08-28-05 07:15 AM Link | Quote
Looks pretty sweet. Any word on how the overall look and feel will differ from AB1?


(edited by Devin on 08-27-05 10:16 PM)
Lenophis

Super Koopa
Level: 44

Posts: 684/830
EXP: 584360
For next: 26925

Since: 03-15-04
From: Duluth, MN

Since last post: 4 hours
Last activity: 3 hours
Posted on 08-28-05 07:23 AM Link | Quote
Originally posted by ||bass
Yea, it would be safe to assume considering THE THIRD LINE OF THE POST SAYS EXACTALLY THAT.

READ.

I did read...Don'tyouloveitwhenyouseebigwordslikethisandcan'ttellwhattheysay? Your attempt at sarcasm fails, this is the internet after all.

BTW, how can IE be blamed for this when I use FF? *is perplexed*

In any event, since I can't make heads or tails of it right now, I'll reserve more comments about it for later.
Legion
banning people for no reason sure is fun
Level: 101

Posts: 5158/5657
EXP: 10399737
For next: 317938

Since: 03-15-04
From: The Crossroads is under attack!

Since last post: 5 days
Last activity: 5 days
Posted on 08-28-05 07:44 AM Link | Quote
Lenophis, simmer down and be more civil please.
||bass
Programmer Admin
Level: 44

Posts: 790/817
EXP: 570813
For next: 40472

Since: 03-15-04
From: Salem, Connecticut

Since last post: 26 days
Last activity: 11 days
Posted on 08-28-05 07:59 AM Link | Quote
Originally posted by Lenophis
BTW, how can IE be blamed for this when I use FF? *is perplexed*
I don't know. How can Jesus or the Buddah be to blame? The whole point of the comment was that I don't know and don't care why it doesn't work.

duh...
neotransotaku

Baby Mario
戻れたら、
誰も気が付く
Level: 87

Posts: 3838/4016
EXP: 6220548
For next: 172226

Since: 03-15-04
From: Outside of Time/Space

Since last post: 11 hours
Last activity: 1 hour
Posted on 08-28-05 08:40 AM Link | Quote
well, maybe for 2.0, you'll set pre tag to ignore br in the global CSS or find a way to not insert br when you run into a pre tag
Xkeeper
The required libraries have not been defined.
Level: NAN

Posts: 3498/-863
EXP: NAN
For next: 0

Since: 03-15-04

Since last post: 2 hours
Last activity: -753366 sec.
Posted on 08-28-05 08:44 AM Link | Quote
Originally posted by neotransotaku
well, maybe for 2.0, you'll set pre tag to ignore br in the global CSS or find a way to not insert br when you run into a pre tag
the BR tags that pre inserts don't work, for some reason.
(this is a new line)

(there's a blank line above this)
(see?)
||bass
Programmer Admin
Level: 44

Posts: 791/817
EXP: 570813
For next: 40472

Since: 03-15-04
From: Salem, Connecticut

Since last post: 26 days
Last activity: 11 days
Posted on 08-28-05 09:01 AM Link | Quote
I'm going to start a 2.0 feature request thread soon. Imm going to take the 2.0 dev forum off staff only and make it public soon.
Xkeeper
The required libraries have not been defined.
Level: NAN

Posts: 3501/-863
EXP: NAN
For next: 0

Since: 03-15-04

Since last post: 2 hours
Last activity: -753366 sec.
Posted on 08-28-05 09:03 AM Link | Quote
Originally posted by ||bass
I'm going to start a 2.0 feature request thread soon. Imm going to take the 2.0 dev forum off staff only and make it public soon.
This made me wonder -- if you're recoding the whole thing, why not calli t ||bassboard? If none of the code is Acmlm's, then it's not exactly an Acmlmboard anymore, is it?
Ronin

Bot
Level: 20

Posts: 75/267
EXP: 37090
For next: 5349

Since: 08-22-05

Since last post: 10 days
Last activity: 4 days
Posted on 08-28-05 09:03 AM Link | Quote
My first input would definitely be:

ADD SEARCHING

It's a pain to look through hundreds of threads trying to find a small topic, or even a reference, and unless there's an official thread, it's hard to find everything.


(edited by Ronin on 08-28-05 12:04 AM)
(edited by Ronin on 08-28-05 12:05 AM)
Xkeeper
The required libraries have not been defined.
Level: NAN

Posts: 3502/-863
EXP: NAN
For next: 0

Since: 03-15-04

Since last post: 2 hours
Last activity: -753366 sec.
Posted on 08-28-05 09:07 AM Link | Quote
Searching is there.

It's just staff only. They can't figure out how to make it not suck.
Xeolord

- B l u e s -
Power Metal > All
Level: 81

Posts: 3182/3418
EXP: 4884196
For next: 108653

Since: 03-15-04
From: Yeah

Since last post: 15 hours
Last activity: 15 hours
Posted on 08-28-05 09:14 AM Link | Quote
Originally posted by Xkeeper
Originally posted by ||bass
I'm going to start a 2.0 feature request thread soon. Imm going to take the 2.0 dev forum off staff only and make it public soon.
This made me wonder -- if you're recoding the whole thing, why not calli t ||bassboard? If none of the code is Acmlm's, then it's not exactly an Acmlmboard anymore, is it?


||board would look cooler, erm ... I guess?

Ronin: Marquee's should die.

And yeah, I've got plenty of suggestions and ideas for 2.0.
||bass
Programmer Admin
Level: 44

Posts: 792/817
EXP: 570813
For next: 40472

Since: 03-15-04
From: Salem, Connecticut

Since last post: 26 days
Last activity: 11 days
Posted on 08-28-05 09:16 AM Link | Quote
You want searching? Fine, suggest a way I can search through 300,000+ posts worth of text without lagging the sql server so bad that tRO and the other 30 sites on the server dont slow to a crawl.
Xkeeper
The required libraries have not been defined.
Level: NAN

Posts: 3503/-863
EXP: NAN
For next: 0

Since: 03-15-04

Since last post: 2 hours
Last activity: -753366 sec.
Posted on 08-28-05 09:20 AM Link | Quote
Originally posted by ||bass
You want searching? Fine, suggest a way I can search through 300,000+ posts worth of text without lagging the sql server so bad that tRO and the other 30 sites on the server dont slow to a crawl.
With the way you coded that highly inefficient piece of shit Yiffy Kitten abused I wouldn't expect you to.

Rather than just tell you outright, why don't you mabye get a clue from phpBBs out there? Some of them have over that amount and can still search through it without taking a major hit.



knuck

Hinox
Banned until 19-58-5815: trolling, flaming, spamming, being a general fucktard...
Level: 62

Posts: 1471/1818
EXP: 1894574
For next: 90112

Since: 03-15-04

Since last post: 14 hours
Last activity: 9 hours
Posted on 08-28-05 09:21 AM Link | Quote
Originally posted by Xkeeper
This made me wonder -- if you're recoding the whole thing, why not calli t ||bassboard? If none of the code is Acmlm's, then it's not exactly an Acmlmboard anymore, is it?
He got a point.
About the search, this leads me to think that the problem is the server, not the code. Then why couldn't we use it on Erk's?
Pages: 1 2Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - General Chat - 2.0 Coding Style | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.020 seconds.