SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    SitePoint Addict
    Join Date
    Apr 2005
    Posts
    274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    After spending approx. 3 hours plowing through several files that go up as far as 4000 lines in vBulletin just to try to find exactly where and how is the $bbuserinfo array set, here's my reivew of the software: <advisor edit>Please watch your language</advisor edit>

    ARRRRGGHHHH *frustration*
    Last edited by Helge; May 31, 2006 at 10:54.

  2. #2
    Spacebug Beansprout's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    464
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Edman
    After spending approx. 3 hours plowing through several files that go up as far as 4000 lines in vBulletin just to try to find exactly where and how is the $bbuserinfo array set, here's my reivew of the software:

    ARRRRGGHHHH *frustration*
    grep '$bbuserinfo = array();'

    Or similar?
    Last edited by Helge; May 31, 2006 at 10:55.
    Thermal Degree - web design with standards! (View our portfolio)
    Vidahost - shared and reseller linux hosting with real support
    Use my free file uploader!
    5.99 .com/net/org/biz/us/name domains; 2.99 .info!

  3. #3
    Spacebug Beansprout's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    464
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, I feel your pain. Windows Grep is a really useful tool as is a PHP IDE such as Zend Studio, which will index all the functions and variables (although I don't think it'll tell you where the variable is used/created)
    Thermal Degree - web design with standards! (View our portfolio)
    Vidahost - shared and reseller linux hosting with real support
    Use my free file uploader!
    5.99 .com/net/org/biz/us/name domains; 2.99 .info!

  4. #4
    Ex-SitePointer
    Join Date
    May 2006
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Edman
    I'm trying to find the place where they actually give the variable a value.

    You see, firstly, you look at index.php, then you find out the startup file is global.php, however, global.php includes init.php, which in turn uses functions from functions.php, then includes session.php which calls a function that find the userinfo from cookies.

    Right now I have a DB error coming from somewhere (a cronjob), but I can't even find where in the system it is executing this query.
    Every database error code in vBulletin tells you exactly what file the error occurs in. Quite simple when you look at them, click view source in your browser. If you inquired at vBulletin support we would have told you this. Show us the query and we can tell you exactly where it occurs. That is why people pay for vBulletin, support.

    As far as $bbuserinfo(), it is initialized on line 912 of includes/class_core.php. It is a pointer to a structure of $vbulletin->userinfo.

    Unfortunately a lot of legacy stuff has to be in there when you are supporting almost 100,000 customers using versions of PHP from 4.1.0 and up and MySQL 3.23.53 and higher. We can't just force all of our customers to upgrade because we want to do things differently. Hell, we still have customers using vBulletin 2.3.X simply because they do not want to upgrade their server software, that still has some PHP 3 support in it.

    Is vBulletin the most optimized and streamlined product for an individual website? Probably not. It is a piece of mass produced software that has to satisfy literally hundreds of thousands of needs in a single contained package. A balance has to be achieved between all those needs and the software does that nicely. As it continues to move to features found in newer versions of PHP and MySQL, then it will become more so.
    vBulletin Sales and Support
    p.s. I couldn't log into my old account.

  5. #5
    SitePoint Addict
    Join Date
    Apr 2005
    Posts
    274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Every database error code in vBulletin tells you exactly what file the error occurs in. Quite simple when you look at them, click view source in your browser. If you inquired at vBulletin support we would have told you this. Show us the query and we can tell you exactly where it occurs. That is why people pay for vBulletin, support.
    Not if the previous owner wrote a hack 2 years ago that inserted an extra cron job. I know the error happens when executing cron jobs, BUT, it isn't in the cron job files, it IS a cron job that gets executed, and to be honest, I never really ended up figuring out where that gets modified, ever. I just can't find it. It takes literally ages to find, and I didn't have the time, somebody on the forums agreed to help and managed to find it.

    As far as $bbuserinfo(), it is initialized on line 912 of includes/class_core.php. It is a pointer to a structure of $vbulletin->userinfo.
    Well, here's one interesting thing. I was trying to integrate the registration form of my custom CMS with vB's user table (and believe it or not, there is not just one user table that needs an insert upon registration!), turns out the user was logging in to a completely messed up page because the language ID was wrong. Now why oh why couldn't the system resort to a default language if it knows the current language it is selecting doesn't exist? Especially seeing how there is only one (!!) language on the boards!

    And why oh why are the phrases selected from the database on every single page load?? On my forum, for example, they change, literally, never. Why can't you just cache them in a file instead?

    Unfortunately a lot of legacy stuff has to be in there when you are supporting almost 100,000 customers using versions of PHP from 4.1.0 and up and MySQL 3.23.53 and higher. We can't just force all of our customers to upgrade because we want to do things differently. Hell, we still have customers using vBulletin 2.3.X simply because they do not want to upgrade their server software, that still has some PHP 3 support in it.
    I don't see how those limitations and throwing in the name of a completely different piece of software requires you to execute 9734534 eval() calls on every single page, and program the thing that it uses 871623123123 functions stored in 50 files in the includes folder.

    Do you never get lost in the includes folder? Say you looked through the script, saw a function, needed it modified, how long does it take you to find that function? maybe it's in one of the functions_[name].php files, maybe functions.php, maybe init.php, maybe a function_[name].php file that is included by another functions_[name].php file, maybe sessions.php?

    Every time I have to do a simple code edit, it takes me a good half an hour. Not to do the actual edit, but to find WHERE to do that edit! I can't imagine how this is hurting productivity at your company. That, or you really need to know this thing by heart.


    That said, it's nice to see you post. vB still is my favourite piece of forum software, sometimes it just gets on my nerves.

  6. #6
    Ex-SitePointer
    Join Date
    May 2006
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Edman
    Do you never get lost in the includes folder? Say you looked through the script, saw a function, needed it modified, how long does it take you to find that function? maybe it's in one of the functions_[name].php files, maybe functions.php, maybe init.php, maybe a function_[name].php file that is included by another functions_[name].php file, maybe sessions.php?

    Every time I have to do a simple code edit, it takes me a good half an hour. Not to do the actual edit, but to find WHERE to do that edit! I can't imagine how this is hurting productivity at your company. That, or you really need to know this thing by heart.
    I don't look through all the files, nor do I have it memorized. The entire code is phpDoc'ed and the API is posted for all customers at http://members.vbulletin.com/api. I just use that page, expand the categories and use CTRL-F in my browser to find what I am looking for. All the hook locations for plugins are listed in includes/xml/hooks_vbulletin.xml so they are centrally located. All the bitfields used to make forums and permissions are in includes/xml/bitfield_vbulletin.xml.

    I do have an advante though, I have 6 years of access to the code, a couple dozen versions of vBulletin on DVD and you learn over time how things are done.

    You might try this extension here: http://www.vbulletin.org/forum/showt...ghlight=phpdoc
    It puts the code documentation right in your AdminCP. You can make your own copy of the phpDOC html files using the 3.5.X source code as well.

    As for the functions, vBulletin is a large engine. It is capable of a lot more than simple forums and as I said before it is built to satisfy a wide range of needs in the market.
    vBulletin Sales and Support
    p.s. I couldn't log into my old account.

  7. #7
    SitePoint Addict
    Join Date
    Apr 2005
    Posts
    274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you have that for vB 3.0.x? I can't afford to upgrade to vB 3.5, too many hacks. Upgrading has been estimated to take 3 to 4 days, which is approx. $1000 worth of my time.

    I'm actually one of the people who runs vB 2.3.x (on another site), since again, too many hacks and too little time.

  8. #8
    SitePoint Member
    Join Date
    Jan 2005
    Location
    Noland
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Edman
    Do you have that for vB 3.0.x? I can't afford to upgrade to vB 3.5, too many hacks. Upgrading has been estimated to take 3 to 4 days, which is approx. $1000 worth of my time.
    What about you try their support? They have been very helpful for me. And the time you have spent in this thread so far will soon exceed 1000$.

    AFAIK there is no phpdoc documentation for 3.0 because it was just added for 3.0.

    Upgrading from 3.0 to 3.5 with about 10 in-.php-files-hacks has taken me a few hours max, it's really not that hard. Check where the old code was, check new code, find the appropriate hooks, slap some code into a few plugins and test it and you're done.

    If you have a list of hacks added check on vbulletin.org there's often (supported) plugins for 3.5 with the same functionality.

    Not if the previous owner wrote a hack 2 years ago that inserted an extra cron job. I know the error happens when executing cron jobs, BUT, it isn't in the cron job files, it IS a cron job that gets executed, and to be honest, I never really ended up figuring out where that gets modified, ever. I just can't find it. It takes literally ages to find, and I didn't have the time, somebody on the forums agreed to help and managed to find it.
    How exactly is that vBulletin's fault?

    And I'm pretty sure you don't need to "hack" anything to add vBulletin cron jobs becuase it's done using the admincp.

    Well, here's one interesting thing. I was trying to integrate the registration form of my custom CMS with vB's user table (and believe it or not, there is not just one user table that needs an insert upon registration!),
    Like Wayne Luke said, vBulletin satisfies SO many needs it's supposed to have lots of tables. You can't have 1001 features with just 1 table for forums, users, threads and posts.

    The registration.php will give you a hint I guess. And there's always the option to use registration.php instead of your custom script.

    And why oh why are the phrases selected from the database on every single page load?? On my forum, for example, they change, literally, never. Why can't you just cache them in a file instead?
    You can cache them in 3.5 maybe also in 3.0. Caching requires access to the file system which might require chmod 777 files on your server which you maybe don't want. So there is no way this should be a default enabled option. And unless you're using a PHP cache pulling from the database might be faster.

    I don't see how those limitations and throwing in the name of a completely different piece of software requires you to execute 9734534 eval() calls on every single page, and program the thing that it uses 871623123123 functions stored in 50 files in the includes folder.
    eval()s are the needed evil if you want to support templates and plugins in the very open and flexible way vBulletin does. What about you show us your way of duplication the functionality of the template and plugin system with eval()s instead of whining how bad everything is? Maybe it's time for a job or project change.

    Do you never get lost in the includes folder? Say you looked through the script, saw a function, needed it modified, how long does it take you to find that function? maybe it's in one of the functions_[name].php files, maybe functions.php, maybe init.php, maybe a function_[name].php file that is included by another functions_[name].php file, maybe sessions.php?
    I think you are just a troll, there is a search option for the love of god.

    Every time I have to do a simple code edit, it takes me a good half an hour. Not to do the actual edit, but to find WHERE to do that edit! I can't imagine how this is hurting productivity at your company. That, or you really need to know this thing by heart.
    You shouldn't be editing code.

    After spending approx. 3 hours plowing through several files that go up as far as 4000 lines in vBulletin just to try to find exactly where and how is the $bbuserinfo array set, here's my reivew of the software: It's a ******* piece of ****!
    Why would you want to know that?

  9. #9
    Ex-SitePointer
    Join Date
    May 2006
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No there isn't any PHPDoc code for 3.0... It came with 3.5, as well as a new developer tool call a datamanager. You don't need to know what the vBulletin user record and its associated tables look like. Just pass the datamanager an email address, username, and password and it will create the appropriate table entries. As little as six lines of code to create a user record for vBulletin from your outside application. The datamanagers support and expandable user record using our custom profile solution as well as bitfield addons.

    Like I said though, vBulletin is complex. Moreso if you heavily edit the code. vBulletin 3.5 and higher tries to limit the need to edit code with plugin and product imports, expandable xml-based navigation systems, expandable bit-field permissions system, and the data managers. The upcoming 3.6, includes more features in this area to make developing on the vBulletin engine a lot easier. The system isn't perfect but it feels a lot of needs.
    vBulletin Sales and Support
    p.s. I couldn't log into my old account.

  10. #10
    SitePoint Addict
    Join Date
    Apr 2005
    Posts
    274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    eval()s are the needed evil if you want to support templates and plugins in the very open and flexible way vBulletin does. What about you show us your way of duplication the functionality of the template and plugin system with eval()s instead of whining how bad everything is? Maybe it's time for a job or project change.
    This is where your vB fanboyism met ignorance. Making such a template system is trivial. Even re-building vB to do this would take no longer than a couple of weeks for a programmer. All you need to do is is parse the templates/hooks as pure PHP and cache it in files, then use the same functions already there to include data instead of eval()'ing it. Some 90% of the concepts discussed in this forum are more difficult.

    No there isn't any PHPDoc code for 3.0... It came with 3.5, as well as a new developer tool call a datamanager. You don't need to know what the vBulletin user record and its associated tables look like. Just pass the datamanager an email address, username, and password and it will create the appropriate table entries. As little as six lines of code to create a user record for vBulletin from your outside application. The datamanagers support and expandable user record using our custom profile solution as well as bitfield addons.
    That's a golden tool really, but I can I do it externally, without starting up the whole vB?

    As in, can I drop 2 lines in my code
    PHP Code:
    require_once './vbulletin/include/User.php';
    $userid User_add($db$params); 
    and it would call a function called User_add() in a file called User.php, takes the database connection as a parameter and has the registration data in $params, and just inserts the bloody user and returns me the userid.

    I also had to integrate my commenting system with the forums. Now wow, adding a post in the forums seriously has never been more difficult. Why is there no Posts_add($db, $text, $options) function?

  11. #11
    SitePoint Member
    Join Date
    Jan 2005
    Location
    Noland
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Edman
    This is where your vB fanboyism met ignorance. Making such a template system is trivial. Even re-building vB to do this would take no longer than a couple of weeks for a programmer. All you need to do is is parse the templates/hooks as pure PHP and cache it in files, then use the same functions already there to include data instead of eval()'ing it. Some 90% of the concepts discussed in this forum are more difficult.
    I wrote such an plugin for vBulletin you can find it on vBulletin.org.

    Again it requires to give vBulletin access to the file system which might not be what's wanted, in addition saving templates to files brings LOADS of other problems if you use more than 1 server in addition it might even be slower due to the huge number of other templates. It's not that easy.

    Go ahead and write a code for it I'm sure they'll have a look at it. But don't even try to use an include() for every template or other ridiculous stuff.

    Quote Originally Posted by Edman
    That's a golden tool really, but I can I do it externally, without starting up the whole vB?
    Need to include global.php as far as I know for the whole MySQL connection and so on. Yeah I know it SUCKS LOL

    Yes it returns userid and has data checking.

    Quote Originally Posted by Edman
    I also had to integrate my commenting system with the forums. Now wow, adding a post in the forums seriously has never been more difficult. Why is there no Posts_add($db, $text, $options) function?
    Because with systems that are complex you can't reduce anything to your goddam

    $forum = new forum($id), it's just NOT working no matter how much OOP magic you throw in. There is too many option and special cases you have to take care of.

    And there is a similar class for new posts like there is for new users but it's slightly more complicated and passing the $db isn't possible afaik.



    --

    I have still to see a forum with the possibility of vBulletin that has your nice OOP code that is very well understandable. I think it is just NOT possible to do such a thing.

    Yeah all the forums you linked with all the nice oh-so-cool PHP 5.1 OOP have the following limitations:
    -features (I have yet to see a forum like vBulletin, phpBB and invision board don't even come close)
    -requires newer PHP versions
    -requires to give PHP file access
    -tiny community
    -no support

  12. #12
    SitePoint Addict
    Join Date
    Apr 2005
    Posts
    274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wrote such an plugin for vBulletin you can find it on vBulletin.org.
    Then why did you bother asking wether something like that can be built?

    in addition saving templates to files brings LOADS of other problems if you use more than 1 server
    Like having to save template cahces on several machines? Like that's a problem. A much bigger problem is creating a MySQL cluster because templates are called from the DB every time.

    Go ahead and write a code for it.
    I'm not going to. That's the whole point of having this discussion.

    Because with systems that are complex you can't reduce anything to your goddam

    $forum = new forum($id), it's just NOT working no matter how much OOP magic you throw in. There is too many option and special cases you have to take care of.
    But that I did have to write. I had no choice, I didn't want to pollute my code, I wanted to make sure I can integrate with vB and tomorrow integrate with IPB or phpBB, so I wrote a bunch of functions, stuffed them in a class so I know what I'm calling from where
    PHP Code:
    require_once './class/vBulletin_Integration.php';
    $vB = new vBulletin_Integration;
    list(
    $postid$threadid) = $vB->make_post('thread'$article$forumid); 
    Took me about an hour, copy-pasted the vB code, edited out stuff I needed to make it work (globals mostly). Most of that hour was spent hunting down functions used throughout the code. I didn't bother passing in the database as I didn't need it to be that clean.

  13. #13
    SitePoint Member
    Join Date
    Jan 2005
    Location
    Noland
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by immersion
    check out k4bb
    i think that that has good code, but check it out
    I bet it lacks features of vBulletin and is thus not an option for a lot of people. And how well does it scale? The search scales too?

    Quote Originally Posted by Edman
    Then why did you bother asking wether something like that can be built?
    Because it has limitations and I'm mainly using it for performance. About 0.1% of the vB owners need to worry about the boards performance and there is a very knowlegdeable (or however that's spelled) community helping you out if you need to.

    Quote Originally Posted by Edman
    Like having to save template cahces on several machines? Like that's a problem. A much bigger problem is creating a MySQL cluster because templates are called from the DB every time.
    Creating a MySQL cluster isn't a vBulletin problem.


    Quote Originally Posted by Edman
    I'm not going to. That's the whole point of having this discussion.
    There are 1001 ways to do it better but I'm not gonna post one of it! Yeah! I could actually help somebody but I won't because I'm too good for you!

    Quote Originally Posted by Edman
    But that I did have to write. I had no choice, I didn't want to pollute my code, I wanted to make sure I can integrate with vB and tomorrow integrate with IPB or phpBB, so I wrote a bunch of functions, stuffed them in a class so I know what I'm calling from where
    Again, creating an additional layer to abstract different bulletin systems, what has that to do with vBulletin? In 3.5 there's nearly every part is accessible using a new API.

    Just because you want to have your 5000 lines of code hidden in

    $world = new World($db);
    echo $world->create_everthing();

    there's no need to claim that vB is **** just because it uses some PHP outside classes GASP. And globals, oh my god.

  14. #14
    SitePoint Wizard
    Join Date
    Oct 2001
    Posts
    2,686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've splitet this vB discussion from the PHP forum software that isn't an utter disgrace?. It had drifted enough of topic.

    Please keep the discussion civilized.

    -H

  15. #15
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Edman
    I also had to integrate my commenting system with the forums. Now wow, adding a post in the forums seriously has never been more difficult. Why is there no Posts_add($db, $text, $options) function?
    Because of the versions you are using. Even the vBulletin developers will admit that vB 1.X and 2.X were not very well written. They used a lot of kludges. vBulletin 1.X was basically one giant hack but it worked. With vBulletin 3, the developers worked to get rid of as many kludges and workarounds as possible while still maintaining the widest amount of acceptance, which required some code for PHP 3 and PHP 4. With vBulletin 3.5, we dropped PHP 3 and PHP 4 support and moved to PHP 4.1. Still not the best but hey, you have users to support. Oh and in 3.5, we finally dropped support for MySQL 3.23.33.

    In vBulletin 3.5, the developers also started moving towards an OOP based system. Not completely but it is on its way. Until that point, the version requirements didn't support what was needed. 3.5 introduces all sorts of tools for developers. Including classes called datamanagers to create posts, threads, forums, users, and more on the fly. In a few lines of code. It also includes better handling of the datastore, MySQL replication support, MySQLi support, Plugins support and more.

    This process is being continued in vBulletin 3.6 which is currently being beta tested on vBulletin.com right now. By continuing to use vBulletin 2.X and 3.X, you miss out on these and there is no way to go back and retrofit 3-5 year old code with these changes. What you keep asking for is actually being developed in later versions. I don't see how you can fault the software for that.

    The considerations are different when you are programming for 1 website, 100 websites or 100,000. vBulletin has to work on every operating system, multiple different webserving platforms, dozens of version of PHP and MySQL as well as in Multibyte languages and other issues that globalization bring.

    p.s. I got my old account back thanks to VGarcia.
    Wayne Luke
    ------------



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •