SitePoint Sponsor |
|
User Tag List
Results 101 to 125 of 230
-
May 5, 2006, 09:11 #101
Originally Posted by kyberfabrikken
-
May 5, 2006, 09:11 #102
- Join Date
- Nov 2002
- Posts
- 841
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Edman
-
May 5, 2006, 13:42 #103
- Join Date
- Apr 2005
- Posts
- 274
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Selkirk
Pretty much everyone I know of who uses forums such as phpBB, or hell, even vBulletin, does so because of the literally hundreds upon hundreds of modifications that are freely available that literally allow you to make a board the way you want it to. Who's making these modifications? How much support would an app that requires someone to learn proper programming to modify get instead of one which can be used to start learning programming?
What does proper programming mean? You can easily satisfy the half-arsed programmer crowd, you just have to build something simple. But if you're bulding something for the hardcore programmers, the result will be that half of them won't care, and the other half will disagree with your methods for the most obscure of reasons.
-
May 5, 2006, 15:25 #104
- Join Date
- Sep 2004
- Location
- Zagreb, Croatia
- Posts
- 830
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by 33degrees
-
May 5, 2006, 17:53 #105
Vanilla is nice and looks different from vBulletin and clones. I hope they release 1.0 asap. I'm not a programmer but the code is also looking pro.
http://getvanilla.com/Tweep List adds an avatar menu to Twitter (open source)
Word Stats shows your most used words on Twitter
-
May 5, 2006, 18:17 #106
- Join Date
- Feb 2004
- Location
- United States
- Posts
- 98
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Unless your going to go commercial with your code I see no reason as to why you can't code how you want, uncommented, sloppy, badly formatted, whatever. It usually won't be a problem if its only you looking at it. I can write a several thousand line piece of software without any documentation and still understand the whole thing (since it was a result of my thinking).
Now if your going commercial, I can see why you may want to use better coding habbits.
-
May 5, 2006, 19:13 #107
- Join Date
- Apr 2004
- Location
- Melbourne, Australia
- Posts
- 902
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Selkirk
Originally Posted by Edman
Be careful before you jump to conclusions about open source PHP code though. I've seen commercial code that is just as bad if not worse. The difference is that they aren't open so most people don't get the chance to see and criticize them."I disapprove of what I say,
but I will defend to the death my right to say it."
-
May 5, 2006, 19:36 #108
- Join Date
- Jun 2002
- Location
- Wellington, NZ
- Posts
- 363
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by McGruff
I would say that there are arguably more PHP resources out there than for any other scripting language. Sitepoint, Webmonkey, phpbuilder.com you name it, there's been a PHP tute on there.
Try building a website out of Zope & Plone - the documentation is so scant it isn't funny!
All this said, I'm not a contributer, I don't code for or document any of these products (I intend to) and until I do, I'm in no position to complain.- UK2NZ: mY bLoG
- Support Disclosure (and be amazed by it)
-
May 6, 2006, 00:47 #109
- Join Date
- Jan 2006
- Posts
- 35
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Edman
There seems to be an endless amount of opinions on the proper MVC-implementation, for example.
-
May 6, 2006, 01:22 #110
- Join Date
- Feb 2003
- Posts
- 156
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
So... do good (as defined in this context) PHP programmers just suck at creating Opensource projects? Or do they suck at making them popular? Do they lack all the other skills necessary to keep a project alive and grow it? Or is it that they rather work on paying projects (don't think that is it, because the PHP-based products that were being sold, that I've seen were even worse than their opensource counterparts)? Maybe they prefer to consult and do individual work, which hapens to shield them from public evaluation...?
What do you think?
-
May 6, 2006, 04:15 #111
- Join Date
- May 2005
- Location
- Finland
- Posts
- 608
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by phptek
Or, in other words, the majority of PHP resources are exactly the same quality as the majority of PHP forum software.
-
May 6, 2006, 05:45 #112
- Join Date
- Mar 2004
- Location
- Adelaide, Australia
- Posts
- 124
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Ezku
PHP is consistently seen as an "amateur" language because primarily amateurs use it and hence produce exceedingly amateur code. This in turn means that the majority of times when a person sees PHP code it's a pile of festering, malignant ooze spawning global variables and heredoc syntax.
The good news is that those amateurs who really are interested will quickly become good programmers due to actively improving their skills.
Originally Posted by R. U. Serious
This space for rent.
-
May 6, 2006, 07:27 #113
- Join Date
- Jun 2004
- Location
- Copenhagen, Denmark
- Posts
- 6,157
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by 33degrees
Originally Posted by BerislavLopac
There are two justifications for superglobals in PHP - one being that they are (or were meant to at least) read-only. You generally won't write to $_POST or $_GET, which of course makes so much worse when somebody actually does it. And second, it's a language-feature.
Still - I don't ever write code which access said superglobals directly at the application-level. Instead I wrap it in a request-object. Most serious PHP projects does something similar.
-
May 6, 2006, 07:52 #114
im not a php programer but im using SMF on my forum
http://forums.talktechno.com/
might not be as good as vB but its free so
IPB imo is rubbish
-
May 6, 2006, 16:07 #115
- Join Date
- Feb 2004
- Location
- Montreal
- Posts
- 77
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I hate to make a shameless plug, but feel free to check out http://k4bb.org. It is my brother's software. I'll say right away that there is a lot of room for improvement, but there are also some good things in there.
-
May 7, 2006, 01:39 #116
- Join Date
- Feb 2004
- Location
- Las Vegas
- Posts
- 98
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Lately I been toying with a few forum software.
I wasn't impressed by them except for MyBB.
http://www.Mybboard.com
Take a look and tell me your opinion on it's code base. I am an average coder and I would like to hear what you gurus think.
I also plan to use Vanilla really soon on a couple projects to see how well it does.
-
May 7, 2006, 01:59 #117Take a look and tell me your opinion on it's code base.
- you can count on the fingers of your hand how many lines of comments there is
- eval() function everywhere
- 10 levels of indentation?! (if else, loops etc)
- no classes in sight
PHP Code:<?php
define("KILL_GLOBALS", 1);
$templatelist = "index,index_whosonline,index_welcomemembertext,index_welcomeguest,index_whosonline_memberbit,forumbit_depth1_cat,forumbit_depth1_forum,forumbit_depth2_cat,forumbit_depth2_forum,forumbit_depth1_forum_lastpost,forumbit_depth2_forum_lastpost,index_modcolumn,forumbit_moderators,forumbit_subforums,index_welcomeguesttext";
$templatelist .= ",index_birthdays_birthday,index_birthdays,index_pms,index_loginform,index_logoutlink,index_stats,forumbit_depth3";
require "./global.php";
require "./inc/functions_post.php";
$plugins->run_hooks("index_start");
// Load global language phrases
$lang->load("index");
if($mybb->user['uid'] != 0)
{
eval("\$logoutlink = \"".$templates->get("index_logoutlink")."\";");
}
else
{
eval("\$loginform = \"".$templates->get("index_loginform")."\";");
}
if($mybb->settings['showwol'] != "no" && $mybb->usergroup['canviewonline'] != "no")
{
// Get the online users
$timesearch = time() - $mybb->settings['wolcutoffmins']*60;
$comma = "";
$query = $db->query("SELECT s.sid, s.ip, s.uid, s.time, s.location, u.username, u.invisible, u.usergroup, u.displaygroup FROM ".TABLE_PREFIX."sessions s LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid) WHERE s.time>'$timesearch' ORDER BY u.username ASC, s.time DESC");
$membercount = 0;
$guestcount = 0;
$anoncount = 0;
$doneusers = array();
while($user = $db->fetch_array($query))
{
$botkey = strtolower(str_replace("bot=", "", $user['sid']));
if($user['uid'] > 0)
{
if($doneusers[$user['uid']] < $user['time'] || !$doneusers[$user['uid']])
{
if($user['invisible'] == "yes")
{
$anoncount++;
}
$membercount++;
if($user['invisible'] != "yes" || $mybb->usergroup['canviewwolinvis'] == "yes" || $user['uid'] == $mybb->user['uid'])
{
if($user['invisible'] == "yes")
{
$invisiblemark = "*";
}
else
{
$invisiblemark = "";
}
$user['username'] = formatname($user['username'], $user['usergroup'], $user['displaygroup']);
eval("\$onlinemembers .= \"".$templates->get("index_whosonline_memberbit", 1, 0)."\";");
$comma = ", ";
}
$doneusers[$user['uid']] = $user['time'];
}
}
elseif(strstr($user['sid'], "bot=") !== false && $session->bots[$botkey])
{
$onlinemembers .= $comma.formatname($session->bots[$botkey], $botgroup);
$comma = ", ";
$botcount++;
}
else
{
$guestcount++;
}
}
$onlinecount = $membercount + $guestcount;
if($onlinecount != 1)
{
$onlinebit = $lang->online_online_plural;
}
else
{
$onlinebit = $lang->online_online_singular;
}
if($membercount != 1)
{
$memberbit = $lang->online_member_plural;
}
else
{
$memberbit = $lang->online_member_singular;
}
if($anoncount != 1)
{
$anonbit = $lang->online_anon_plural;
}
else
{
$anonbit = $lang->online_anon_singular;
}
if($guestcount != 1)
{
$guestbit = $lang->online_guest_plural;
}
else
{
$guestbit = $lang->online_guest_singular;
}
$lang->online_note = sprintf($lang->online_note, mynumberformat($onlinecount), $onlinebit, $mybb->settings['wolcutoffmins'], mynumberformat($membercount), $memberbit, mynumberformat($anoncount), $anonbit, mynumberformat($guestcount), $guestbit);
eval("\$whosonline = \"".$templates->get("index_whosonline")."\";");
}
// Get birthdays
if($mybb->settings['showbirthdays'] != "no")
{
$bdaycount = 0;
$bdaytime = time();
$bdaydate = mydate("j-n", $bdaytime, "", 0);
$year = mydate("Y", $bdaytime, "", 0);
$query = $db->query("SELECT uid, username, birthday FROM ".TABLE_PREFIX."users WHERE birthday LIKE '$bdaydate-%'");
$comma = "";
while($bdayuser = $db->fetch_array($query))
{
$bday = explode("-", $bdayuser['birthday']);
if($year > $bday['2'] && $bday['2'] != "")
{
$age = " (".($year - $bday['2']).")";
}
else
{
$age = "";
}
eval("\$bdays .= \"".$templates->get("index_birthdays_birthday", 1, 0)."\";");
$bdaycount++;
$comma = ", ";
}
if($bdaycount > 0)
{
eval("\$birthdays = \"".$templates->get("index_birthdays")."\";");
}
}
// Get Forum Statistics
if($mybb->settings['showindexstats'] != "no")
{
$stats = $cache->read("stats");
if(!$stats['lastusername'])
{
$newestmember = "no-one";
}
else
{
$newestmember = "<a href=\"member.php?action=profile&uid=".$stats['lastuid']."\">".$stats['lastusername']."</a>";
}
$lang->stats_posts_threads = sprintf($lang->stats_posts_threads, mynumberformat($stats['numposts']), mynumberformat($stats['numthreads']));
$lang->stats_numusers = sprintf($lang->stats_numusers, mynumberformat($stats['numusers']));
$lang->stats_newestuser = sprintf($lang->stats_newestuser, $newestmember);
// Most users online
$mostonline = $cache->read("mostonline");
if($onlinecount > $mostonline['numusers'])
{
$time = time();
$mostonline['numusers'] = $onlinecount;
$mostonline['time'] = $time;
$cache->update("mostonline", $mostonline);
}
$recordcount = $mostonline['numusers'];
$recorddate = mydate($mybb->settings['dateformat'], $mostonline['time']);
$recordtime = mydate($mybb->settings['timeformat'], $mostonline['time']);
$lang->stats_mostonline = sprintf($lang->stats_mostonline, mynumberformat($recordcount), $recorddate, $recordtime);
eval("\$forumstats = \"".$templates->get("index_stats")."\";");
}
// Get Forums
$query = $db->query("SELECT f.*, t.subject AS lastpostsubject FROM ".TABLE_PREFIX."forums f LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid = f.lastposttid) WHERE active!='no' ORDER BY f.pid, f.disporder");
while($forum = $db->fetch_array($query))
{
$fcache[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;
}
$forumpermissions = forum_permissions();
// Get forum moderators
if($mybb->settings['modlist'] != "off")
{
$query = $db->query("SELECT m.uid, m.fid, u.username FROM ".TABLE_PREFIX."moderators m LEFT JOIN ".TABLE_PREFIX."users u ON (m.uid=u.uid) ORDER BY u.username");
while($moderator = $db->fetch_array($query))
{
$moderatorcache[$moderator['fid']][] = $moderator;
}
}
$excols = "index";
$permissioncache['-1'] = "1";
$bgcolor = "trow1";
if($mybb->settings['subforumsindex'] != 0)
{
$showdepth = 3;
}
else
{
$showdepth =2;
}
$forums = getforums();
function getforums($pid="0", $depth=1, $permissions="")
{
global $fcache, $moderatorcache, $forumpermissions, $theme, $mybb, $mybbforumread, $settings, $mybbuser, $excols, $templates, $bgcolor, $lang, $showdepth, $forumpass, $collapsed, $plugins;
if(is_array($fcache[$pid]))
{
while(list($key, $main) = each($fcache[$pid]))
{
while(list($key, $forum) = each($main))
{
$perms = $forumpermissions[$forum['fid']];
if($perms['canview'] == "yes" || $mybb->settings['hideprivateforums'] == "no")
{
$plugins->run_hooks("index_forum");
if($depth == 3)
{
eval("\$forumlisting .= \"".$templates->get("forumbit_depth3", 1, 0)."\";");
$comma = ", ";
$donecount++;
if($donecount == $mybb->settings['subforumsindex'])
{
if(count($main) > $donecount)
{
$forumlisting .= $comma;
$forumlisting .= sprintf($lang->more_subforums, (count($main) - $donecount));
}
return $forumlisting;
}
continue;
}
if($mybb->user['uid'] != 0)
{
$lastvisit = $mybb->user['lastvisit'];
}
else
{
$lastvisit = $_COOKIE['mybb']['lastvisit'];
}
$forumread = mygetarraycookie("forumread", $forum['fid']);
if($forum['lastpost'] > $lastvisit && $forum['lastpost'] > $forumread && $forum['lastpost'] != 0)
{
$folder = "on";
$altonoff = $lang->new_posts;
}
else
{
$folder = "off";
$altonoff = $lang->no_new_posts;
}
if($forum['open'] == "no")
{
$folder = "offlock";
$altonoff = $lang->forum_locked;
}
$forumread = 0;
if($forum['type'] == "c")
{
$forumcat = "_cat";
}
else
{
$forumcat = "_forum";
}
$hideinfo = 0;
if($forum['type'] == "f" && $forum['linkto'] == "")
{
if($forum['password'] != "" && $_COOKIE['forumpass'][$forum['fid']] != md5($mybb->user['uid'].$forum['password']))
{
$hideinfo = 1;
}
elseif($forum['lastpost'] == 0 || $forum['lastposter'] == "")
{
$lastpost = "<span style=\"text-align: center;\">".$lang->lastpost_never."</span>";
}
else
{
$lastpostdate = mydate($mybb->settings['dateformat'], $forum['lastpost']);
$lastposttime = mydate($mybb->settings['timeformat'], $forum['lastpost']);
$lastposter = $forum['lastposter'];
$lastposttid = $forum['lastposttid'];
$lastpostsubject = $fulllastpostsubject = $forum['lastpostsubject'];
if(strlen($lastpostsubject) > 25)
{
$lastpostsubject = substr($lastpostsubject, 0, 25) . "...";
}
$lastpostsubject = htmlspecialchars_uni(dobadwords($lastpostsubject));
$fulllastpostsubject = htmlspecialchars_uni(dobadwords($fulllastpostsubject));
eval("\$lastpost = \"".$templates->get("forumbit_depth$depth$forumcat"."_lastpost")."\";");
}
}
if($forum['linkto'] != "" || $hideinfo == 1)
{
$lastpost = "<center>-</center>";
$posts = "-";
$threads = "-";
}
else
{
$posts = mynumberformat($forum['posts']);
$threads = mynumberformat($forum['threads']);
}
if($mybb->settings['modlist'] != "off")
{
$moderators = "";
$parentlistexploded = explode(",", $forum['parentlist']);
while(list($key, $mfid) = each($parentlistexploded))
{
if($moderatorcache[$mfid])
{
reset($moderatorcache[$mfid]);
while(list($key2, $moderator) = each($moderatorcache[$mfid]))
{
$moderators .= "$comma<a href=\"member.php?action=profile&uid=$moderator[uid]\">".$moderator['username']."</a>";
$comma = ", ";
}
}
}
$comma = "";
if($moderators)
{
eval("\$modlist = \"".$templates->get("forumbit_moderators")."\";");
}
else
{
$modlist = "";
}
}
if($mybb->settings['showdescriptions'] == "no")
{
$forum['description'] = "";
}
$expdisplay = "";
$cname = "cat_".$forum['fid']."_c";
if($collapsed[$cname] == "display: show;")
{
$expcolimage = "collapse_collapsed.gif";
$expdisplay = "display: none;";
}
else
{
$expcolimage = "collapse.gif";
}
if($bgcolor == "trow2")
{
$bgcolor = "trow1";
}
else
{
$bgcolor = "trow2";
}
if($fcache[$forum['fid']] && $depth < $showdepth)
{
$newdepth = $depth + 1;
$forums = getforums($forum['fid'], $newdepth, $perms);
if($depth == 2 && $forums)
{
eval("\$subforums = \"".$templates->get("forumbit_subforums")."\";");
$forums = "";
}
}
eval("\$forumlisting .= \"".$templates->get("forumbit_depth$depth$forumcat")."\";");
}
$forums = $subforums = "";
}
}
}
return $forumlisting;
}
$plugins->run_hooks("index_end");
eval("\$index = \"".$templates->get("index")."\";");
outputpage($index);
?>
now compare that to my previous post (few posts back)
which one is easier to follow? performs faster?
-
May 7, 2006, 02:12 #118
- Join Date
- Sep 2005
- Location
- Zurconion Soon!
- Posts
- 1,549
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by agoossens
-
May 8, 2006, 05:48 #119
- Join Date
- Oct 2005
- Location
- Switzerland
- Posts
- 597
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by kyberfabrikken
-
May 8, 2006, 06:22 #120
- Join Date
- Apr 2005
- Posts
- 274
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by R. U. Serious
Secondly, many many of the very very good programmers stop being programmers. Instead they are hired by large companies to lead teams. Or they find a way to start their own business. If you're a freelancer, you need 2 years of client building, then just start off finding people to work for you. In a year max you'll simply act as a middle man and a quality assurance person. Open source what?
Thirdly, very good programmers often enjoy working on open source products far more complicated than a forum. Let's face it, anyone with 1 year of commercial PHP experience and no prior computer science education can sit down and write a forum. It's not difficult at all. It is, however, a lot of boring code.
-
May 8, 2006, 08:01 #121
- Join Date
- Dec 2005
- Posts
- 276
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by z0s0
"Never imagine yourself not to be otherwise than what
it might appear to others that what you were or might
have been was not otherwise than what you had been
would have appeared to them to be otherwise."
-
May 8, 2006, 08:17 #122
- Join Date
- Oct 2005
- Location
- Switzerland
- Posts
- 597
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You never know the scope in which you are working. That's one of the characteristics of spaghetti code.
-
May 8, 2006, 11:47 #123
- Join Date
- Oct 2005
- Location
- Herts, UK
- Posts
- 113
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by eldacar
-
May 8, 2006, 15:56 #124
- Join Date
- Dec 2005
- Posts
- 5
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I don't think the use of globals in PHP is not always a bad thing. There are instances where it just makes sense. For example the database class in most PHP software is used almost globally in everything. Now you can pass it all your other classes as params on the constructor or you can use global. Either way you are producing the same effect
Taken from wikipedia even
However, in a few cases, global variables can be suitable for use. They can be used to avoid having to pass frequently-used variables continuously throughout several functions
However use of many globals is probably a bad idea but some things like your $db maybe a function class are going to be passed one way or another.
For example method without globals if I made a syntax error sue me I'm just getting my point across.
PHP Code:class Thread
{
function Thread(&$db)
{
$this->db=$db;
}
}
PHP Code:class Thread
{
function Thread()
{
global $db;
$this->db=$db;
}
}
Reading more I seem some of the most uneeded practices I've ever seen. Yeah I'm going to never grab $_POST, $_GET ect.
Instead I'm going to have something stupid like this
PHP Code:class Globals
{
function Globals()
{
// This is our way to not use globals YES
}
function getPost($name)
{
return $_POST[$name];
}
}
But hey you guys know best but don't seem to be pumping out your own forum.
Of course I'm one to talk I have yet to complete mine but I'm only one person. Of course when I do finish and someone asks about it I'm sure it'll be hated on for some bad practice of some kind by the "experts".
-
May 8, 2006, 16:04 #125
- Join Date
- May 2005
- Location
- Finland
- Posts
- 608
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by TonyBaird
Now, seriously, I don't think there's a good reason to build a class that initializes itself from globals such as you posed. There are tons of ways to get around arduously passing the database connection instance to the constructor. And is it really that bad anyway? Applying a bit of DRY gets you a long way.
Bookmarks