BanList
this mod shows you a page with list of the banned users.
image:
http://img525.imageshack.us/img525/7379/untitled2wz7.jpg
Download:
Click Here!
Have Fun!!!
_______________
Best Regards,
« Last edit by Dietrich on Thu May 31, 2007 2:43 pm. »
Page: 1
| Author | Post |
|---|---|
|
#1 Mon May 21, 2007 1:31 pm
|
|
|
Member
Registered: Apr 2007
Posts: 29
Location: Haifa, IL
|
My First mod is here!
BanList this mod shows you a page with list of the banned users. image: http://img525.imageshack.us/img525/7379/untitled2wz7.jpg Download: Click Here! Have Fun!!! _______________ Best Regards, « Last edit by Dietrich on Thu May 31, 2007 2:43 pm. » |
|
#2 Mon May 21, 2007 1:54 pm
|
|
|
Developer
Registered: Apr 2004
Posts: 2180
Location: Belgium
|
Normally I don't check anyones modifications, but since you wanted to become UseBB 2 developer and asked to check your coding skills... I did. This is the result.
First, the templates. I see you're using width attributes for table cells. We don't use HTML or inline markup. This means this should all be defined in CSS. Then, the PHP code itself. You have added no comments and even removed the ones which are used for every page invocation. I don't see why. die(mysql_error()) UseBB has its own error handling, NEVER use anything like mysql_error() or call die() yourself. if(mysql_numrows($result)=="0"){You're using MySQL functions in the code. UseBB uses a small abstraction system that calls mysql or mysqli functions. You should NEVER call mysql(i)_*() yourself. Apart from this, you are comparing an integer return value with a string...? while(@($bandata = $db->fetch_result($result))){You should not use @ here, it has no single use and only slows down processing. Next to this, you have not taken care of the original code style used in UseBB 1. All this doesn't really surprise me, as I said most of the people who come here to ask for developer rights don't have the right skills or are able to do or complete what they promised. You still have a long way to go. I hope I have made my point of view a bit clear. _______________ |
|
#3 Mon May 21, 2007 2:09 pm
|
|
|
Member
Registered: Apr 2007
Posts: 29
Location: Haifa, IL
|
oops, i forgot to put the ORDIE out from there =\ in the start there was a provlem.. i checked them out =\
srry, i will do an update in a few minutes... well, somthing else, what is the command for mysqlnumrows? _______________ Best Regards, « Last edit by Gil Berger on Mon May 21, 2007 2:11 pm. » |
|
#4 Mon May 21, 2007 2:18 pm
|
|
|
Member
Registered: Apr 2007
Posts: 29
Location: Haifa, IL
|
(Double.. srry)
i uploaded an update, you can visit... and hey, this is my first mod =\. _______________ Best Regards, |
|
#5 Mon May 21, 2007 2:40 pm
|
|
|
Developer
Registered: Apr 2004
Posts: 2180
Location: Belgium
|
There is no alternative for mysql_numrows(), you should use the SQL COUNT() function. PDO in PHP 5 doesn't even have a count method like this anymore so you don't have any other option.
Btw, your code wouldn't have worked always anyway since you were using mysql_*() function calls while for MySQL >= 4.1 you should use the mysqli extension. It doesn't really matter if this is your first mod or not, your HTML, CSS and PHP knowledge is far too low to develop for UseBB 2. That's what I wanted to reflect in the previous post. _______________ |
|
#6 Mon May 21, 2007 3:20 pm
|
|
Moderator
![]() Registered: Oct 2005
Posts: 425
Location: canada
|
I'm no expert or anything, but just to mention it.
When you are trying to modify/extend something, you should always check [or ask!] for functions that may already exist within the script itself. To check, you should look over the code that's already there. Find out where it gets what it does, and how it does it. If you're looking for a pre-defined function, look in functions.php, it is probably there. To check to see which mysql(i) functions are available, check db_mysql(i).php. You would still need to understand the code, in order to use the function, but still, you can always ask someone, and i'm sure they can help you. _______________ |
|
#7 Mon May 21, 2007 3:25 pm
|
|
|
Developer
Registered: Apr 2004
Posts: 2180
Location: Belgium
|
Knowing how the base system works and what functionality it contains is the first thing you should do. There used to be API documentation but I stopped updating it since less people used it and there isn't really an "API" in v1.
UseBB 2 will have new API documentation for this purpose. _______________ |
|
#8 Tue May 22, 2007 5:25 am
|
|
|
Member
Registered: Apr 2007
Posts: 29
Location: Haifa, IL
|
Ok, sorry again, i'm learning the system slowly
![]() well, i saw the function "num_rows", im updating again the BanList. there is more things that i must change? _______________ Best Regards, |
|
#9 Tue May 22, 2007 5:51 am
|
|
|
Member
Registered: Apr 2007
Posts: 29
Location: Haifa, IL
|
(please visit banlist.php, i changed him
)_______________ Best Regards, |
|
#10 Tue May 22, 2007 2:49 pm
|
|
|
Developer
Registered: Apr 2004
Posts: 2180
Location: Belgium
|
You are still comparing integers to strings and not using the right coding style.
The fact that you compare an integer return value to a string says enough about your PHP knowledge, in other programming languages such as Java or C similar code just wouldn't work. That's a downside of PHP, you can write dirty and technically not correct code but it may still work. _______________ |
|
#11 Wed May 23, 2007 5:01 am
|
|
|
Member
Registered: Apr 2007
Posts: 29
Location: Haifa, IL
|
=\
i didn't unuderstand so good the thongs you say.. do you mean the "numrows"? if you mean to put "NULL" and not "0", i can do this.. sorry :O _______________ Best Regards, |
|
#12 Wed May 23, 2007 12:37 pm
|
|
|
Developer
Registered: Apr 2004
Posts: 2180
Location: Belgium
|
http://be.php.net/manual/en/language.types.php
Knowing what "types" are is one of the first things you need to know when learning a language, even in PHP though where you don't need to declare variables and their types. You said you knew 10 different programming languages... In the other languages I know (Java, Visual Basic, Pascal, COBOL, etc) you all need to declare variables with their types (COBOL is a slight exception here, it uses fields and no variables). To answer your question, "NULL" and "0" are both strings, NULL is... NULL and 0 is an integer. db::num_rows() also returns an integer so you quite logically compare it with an integer and not a string or anything else. I guess we can end this "discussion" here, I don't like people that tell lies just to become a part of an Open Source development team. _______________ |
|
#13 Wed May 23, 2007 1:21 pm
|
|
|
Member
Registered: Apr 2007
Posts: 29
Location: Haifa, IL
|
In hebrew i know everything XD
_______________ Best Regards, |
|
#14 Wed May 23, 2007 1:32 pm
|
|
Moderator
![]() Registered: Oct 2005
Posts: 425
Location: canada
|
Sorry Gil, Dietrich has a point. I took basic courses on Java, VB.NET, and C++. The first thing you learn, is data types and how to declare and compare them.
Maybe you should try and learn an application language, and get the feel for the syntax of the code. Perhaps even buy a book. _______________ |
|
#15 Thu May 24, 2007 12:37 pm
|
|
|
Developer
Registered: Apr 2004
Posts: 2180
Location: Belgium
|
Topic closed now. I hope Gil Berger has learnt something from this and the previous topic, both about programming languages and the fact that lying may not always work.
_______________ |
Page: 1
UseBB Community is powered by UseBB 1 Forum Software