2009-02-08, 08:29 PM
This looks very good. Wish you had released it a month ago. It would have saved me some time coding it. 
Great job.

Great job.
Mini SQL Plugin
|
2009-02-08, 08:29 PM
This looks very good. Wish you had released it a month ago. It would have saved me some time coding it.
![]() Great job.
2009-02-08, 11:31 PM
![]() ![]() You could add a small readme explaining how to install it, even if uploading is all you have to do. I was a bit confused at first since there were two files called mini_sql.php. Some minor nitpicks with your code (feel free to ignore all of them): In mini_sql/mini_sql*.php there is a broken windows/mac? linebreak in the first if
PHP probably ignores all \r\n outside of strings, but maybe you want to fix it anyway. The IN_MYBB check is also completely missing in the plugin mini_sql.php file, you should probably add it back.
There is no guarantee that group id 17 will be the server group (or that it exists at all), so in worst case that entry will be invalid. Also why do you think that your setting belongs to this group and has to be right at the top of it (disporder 1)?
You can use MYBB_ROOT or MYBB_ROOT.$mybb->config['admin_dir'].'/' depending on where you want to look for a file. Minor nitpicks with your style (this is where programmers tend to get touchy so please ignore it completely): mini_sql/mini_sql.php is a bit hard to read, since you break out of php ?> only to get html / javascript intermixed with <?php ?> statements followed by <?php again. Isn't doing this more cumbersome than having to escape a " quote here and there? Your indentation and codestyle is inconsistent, you mix spaces with tabs, sometimes you write if(x) sometimes if (x) and while even becomes while ( x ). I also have a feature request: For forums that do not have a dedicated database, but share one database with other applications, it would be nice if the List of Table(s) could be restricted to tables with the MyBB table prefix. Similar to how it is done in Backups -> New Backup -> Select Forum Tables except that in this case it should probably a filters as in [X] Show only forum tables. I also have a bug to report: Show forum columns does not work right for me, I get a warning instead.
Using PHP 5 and MySQL 5... it does show the columns despite this though.
2009-02-09, 02:50 AM
Quote:There is no guarantee that group id 17 will be the server group (or that it exists at all), so in worst case that entry will be invalid. Also why do you think that your setting belongs to this group and has to be right at the top of it (disporder 1)? Well, when I choose 17 since I think It always be there and I did not find a feature in admin panel that delete the server configuration group. But my main reason was I did not put the User Interface in settings table but in files, so it just dummy value. But then I was wrong. So, I will fix it in next realase. Quote:You can use MYBB_ROOT or MYBB_ROOT.$mybb->config['admin_dir'].'/' depending on where you want to look for a file. You're right, I just noticed that $mybb global variable contains this settings. I never check it ![]() Quote:mini_sql/mini_sql.php is a bit hard to read, since you break out of php ?> only to get html / javascript intermixed with <?php ?> statements followed by <?php again. Isn't doing this more cumbersome than having to escape a " quote here and there? Sorry, I read too many wordpress plugin so I got influenced ![]() Quote:Your indentation and codestyle is inconsistent, you mix spaces with tabs, sometimes you write if(x) sometimes if (x) and while even becomes while ( x ). yeah... ![]() Quote:For forums that do not have a dedicated database, but share one database with other applications, it would be nice if the List of Table(s) could be restricted to tables with the MyBB table prefix. Similar to how it is done in Backups -> New Backup -> Select Forum Tables except that in this case it should probably a filters as in [X] Show only forum tables. OK, Quote:I also have a bug to report: My box using Linux with MySQL 5 and PHP 5. I don't know is there any different between SHOW COLUMNS and SHOW FIELDS? MySQL 4/5?. Many thanks frostschutz ![]()
2009-02-09, 03:03 AM
For the right GID I do a quick query based on the name.
$query = $db->simple_select("settinggroups", "gid", "name='posting'"); $gid = $db->fetch_field($query, "gid"); The you can use $gid in the array...foolproof really. You may have to look in mysql in order to know all the names for the setting groups though. He is right that there is an inconsistency that exists between install and users. What might be gid 17 on one forum will be 22 on another.
2009-02-09, 11:46 AM
(2009-02-09, 03:03 AM)labrocca Wrote: For the right GID I do a quick query based on the name. thanks for the tips labrocca ![]()
2009-04-27, 01:01 AM
Can do SQLite 2 ?
2009-04-27, 03:48 PM
(2009-04-27, 01:01 AM)qlan Wrote: Can do SQLite 2 ? Means ?? (2009-02-09, 03:03 AM)labrocca Wrote: For the right GID I do a quick query based on the name. Hey Jesse, Great tip, I am using this technique in my future planed plugins, but the problem is it doesnot support myBB installed on local computer, OR perhaps my MyBB copy have errors, NOT sure about it ![]()
2009-04-28, 01:12 PM
![]()
2009-05-02, 11:27 PM
Thanks Mate. I might use this, it saves me time going into phpmyadmin.
Your friendly neighbourhood lurker.
|
« Next Oldest | Next Newest »
|