Page 1 of 1

Need help with php / mySql

Posted: Tue Feb 01, 2011 6:57 am
by Ben Walker
Dear Pulsarians,
I'm finally going to do something I've been talking about for ages, which is to create a database of all the patches ever created for the Pulsar Modular. The idea is to have a database which is searchable by author, date, modular version, etc, and to try and make every patch ever created available for download (some of the patches hosted here and on the old Creamware site are not available at the moment).

I'm a fair way through the project at the moment (database exists, test page created), but I'm sure we have one or two php gurus here on the Z, and would appreciate a little help and advice every now and then.

If you think you could help me, let me know, and we can continue the discussion off list.

thanks,
Ben

Re: Need help with php / mySql

Posted: Tue Feb 01, 2011 1:44 pm
by dante
Can't help with the php, but I can make a suggestions re the data model. I think a table of 3rd party add-ons would be usefull. You could then add a patch-to-3PL union table ( patch_id / 3PL_ID combinations ) which would establish all the prerequisite add-ons for a given patch. A user could then go in and search for all patches which do or dont require certain add-ons, depending on which ones they have (or dont have).

Re: Need help with php / mySql

Posted: Tue Feb 01, 2011 2:03 pm
by iSiStOy
Well...

Prepare your db for dynamics queries, made by the web user.
Safe stored procedures in the database, to be accessed from php. If you can manage to do so...

Maybe also give a try to open source mongodb object db, if you prefer to drive things the object way in your web app and manage documents/medias structures, or even experiment "streaming" abilities: http://www.mongodb.org/

There are also text-search or meta-data structure indexing possibilities you might want to take a look at... I can't help you with these though, because I am a Microsoft geek...
Not a simple task, anyway... Potentially some good modelling/architectural research, before making your mind.

Glad to be of any help, if needed anyway!

Re: Need help with php / mySql

Posted: Thu Feb 03, 2011 4:56 am
by Ben Walker
dante wrote:Can't help with the php, but I can make a suggestions re the data model. I think a table of 3rd party add-ons would be usefull. You could then add a patch-to-3PL union table ( patch_id / 3PL_ID combinations ) which would establish all the prerequisite add-ons for a given patch. A user could then go in and search for all patches which do or dont require certain add-ons, depending on which ones they have (or dont have).
Yes, I'd thought of doing something like this.

However, don't forget that you only need to worry about this if the add-on is licensed. All modules are saved with the patch, so if the 3rd party module doesn't require a license, it will open fine anyway.

Therefore, I think a fully blown lookup of 3rd party modules is overkill at this stage - I think I'll just have an indication in the main record if the patch requires any of the paid thrid party modules (which are Adern, Wolf, Zarg, SpaceF, I think).

Also, I'm not going to distinguish between different versions of Flexor - it'll be a 'uses Flexor' or not flag.

Ben

Re: Need help with php / mySql

Posted: Thu Feb 03, 2011 5:43 am
by Ben Walker
iSiStOy wrote:Well...

Prepare your db for dynamics queries, made by the web user.
Safe stored procedures in the database, to be accessed from php. If you can manage to do so...

Maybe also give a try to open source mongodb object db, if you prefer to drive things the object way in your web app and manage documents/medias structures, or even experiment "streaming" abilities: http://www.mongodb.org/

There are also text-search or meta-data structure indexing possibilities you might want to take a look at... I can't help you with these though, because I am a Microsoft geek...
Not a simple task, anyway... Potentially some good modelling/architectural research, before making your mind.

Glad to be of any help, if needed anyway!
Thanks for all of that. I'm going to keep it really simple to start with - just one or two tables, and one page which allows you to query patches by:
name
author
date
Mod version
3rd party module use ( see last post)

so I think a simple mysql/php solution should be fine.

I'm happy with the database side of things (that's what I do in the real world), but if you can help with basic php, I'd be graateful.

thanks,
Ben

Re: Need help with php / mySql

Posted: Thu Feb 03, 2011 6:14 am
by FrancisHarmany
Please choose a framework. Joomla or Drupal or something similar (if you want PHP).
Also: I am assuming any Wiki implementation will/might suit your needs ? This would be nice if you want others to help you add/change content.

Oh, and, Real men use Python & PostgreSQL ;)

Re: Need help with php / mySql

Posted: Thu Feb 03, 2011 8:42 am
by Ben Walker
FrancisHarmany wrote:Please choose a framework. Joomla or Drupal or something similar (if you want PHP).
I may be wrong, but I think using a framework for this may be overkill. I just want a single new page where people can search for patches. If I use a framework, won't I have to move my whole site into the framework? How difficult can it me to write a single page? I got this far without no steenking framework! (Not all patches in Database yet, and obvious errors with dates to be fixed).

I'm happy to move to a framework if you can convince me it will make things quicker, but I fear that the initial effort would far outway the rewards for the simple task I'm trying to acheive....
FrancisHarmany wrote:Oh, and, Real men use Python & PostgreSQL ;)
Let's not even go there ;-)

Re: Need help with php / mySql

Posted: Thu Feb 03, 2011 9:28 am
by FrancisHarmany
Ok, for a single page it might be overkill!

I have not coded PHP in sometime but could probably help you out!

Perhaps Jquery would be nice in this case ? Look at this for example : http://tablesorter.com/docs/#Demo
You could add that to your test page and we'd have some extra features right away!

Re: Need help with php / mySql

Posted: Thu Feb 03, 2011 7:33 pm
by dante
Ben Walker wrote:
dante wrote:...a table of 3rd party add-ons would be usefull....
....you only need to worry about this if the add-on is licensed. All modules are saved with the patch, so if the 3rd party module doesn't require a license, it will open fine anyway....

Ben
True, but a many-to-many on patch to 3Pmod could also yield benefits other than user avoiding add-ons they dont have, they could also use to it navigate patches for add-ons that they do have and that are thier favourite eg 'Show me all patches that use Flexor and Zarg'. Also, later on, if you were to introduce a rating system where you or users vote on a plug, you could then have 'Give me the top 10 patches that uses Flexor' etc. Handy also if you are deciding which add-on to buy next.

Probably overkill if theres only a few dozen patches...but if it grows to 100's...you might need a more powerful relational model.

Combined with your yahooplayer samples, could be a great marketing tool allowing audition of the various add-ons.

Could be a smokin addition to the Modular community

Re: Need help with php / mySql

Posted: Thu Feb 03, 2011 9:30 pm
by jksuperstar
I only wanted to add my support of something like this. Absolutely!

I've voiced my opinion elsewhere that it'd be damn cool to have an automated dependency checker for these patches. The same or similar database could also be used for user developed devices, not limited to the modular patches. Tied into an automated installer (like synapse or apt-get...maybe call it dev-get or patch-get?), and it'd be easy to update your work area after a reinstall, a SCOPE update, or simply as a method for backup for both devices and patches.

In my mind, the database and the tool would work together.

Re: Need help with php / mySql

Posted: Fri Feb 04, 2011 12:17 am
by w_ellis
Very keen on this idea myself. The current mechanism for downloading 3rd party modules and devices is pretty tedious and it's never clear when something's been updated. The idea that loads of us are maintaining our own little repositories is a bit daft.

I think the easiest option would be an online VCS, e.g. bitbucket (http://www.atlassian.com/hosted/bitbucket/) or github (https://github.com/). We could store all available devices, modular modules, presets packs etc. and encourage developers to deploy updates to it as and when.

Quite happy to lend a hand wherever possible and even happy to contribute financially if it's needed... anything to reduce my pain on upgrades!

Re: Need help with php / mySql

Posted: Fri Feb 04, 2011 12:34 am
by FrancisHarmany
Good call on using github to host the files!!

Re: Need help with php / mySql

Posted: Fri Feb 04, 2011 12:45 am
by dante
LOL! He asked for help, now all we're doin is giving him more work :lol:

Re: Need help with php / mySql

Posted: Mon Feb 07, 2011 1:00 pm
by dante
Heres a suggested data model I had in mind. It has a bit of flexibility, as it stores multiple dependancies per patch, and each patch can have a main author and also co-authors if its a collaboration.
data model
data model
data-model.JPG (33.72 KiB) Viewed 4061 times

Re: Need help with php / mySql

Posted: Mon Feb 07, 2011 4:18 pm
by spacef
joomla could be an overkill, but the plugin "community builder" would allow such dynamic search. instead of users, you have mod patches... Not very easy to set up, it is long anyway, to create the fields you want to have to search, but doable. of course, require manual entry of the mod patch and would not allow memberships (as members are in fact the patches etc), but for the search function, this kind of plugs (community builder) can be a solution as it allows search with multiple "AND" "OR" and this kind of things.

There are other plugins on joomla that allwo deep search (directory plugins), they are quite expensive but would allow such search functions on a large number of fields. I only know joomla though (and when the site does not have a ton of plugin or heavy templates, joomla can be really fast if the server is fast). Anyway, not sure it allows to integrate data from another/pre existing database, so may be it is not the right solution as it would oblige to enter each patch manually in a new database, without any php (but if you want to build it yourself in php, i'm not the right person to ask).

Just an idea, to look at various tools for uses they were not made for, and it is very late too for me here, gonna crush in bed now :-) .

Re: Need help with php / mySql

Posted: Tue Feb 08, 2011 6:13 am
by spacef
There are also download plugins like i use on my site: you can set it so members can upload patches , comment , rate them, you can divide your patches between synths effects etc (the only thing that is missinbg on Z is a classification of the plugins, not the upload or search functions). Jdownloads is one of the best i tried.... for the search functions, Jdownloads may not be as deep as you want, but may be try what i have on site, or may be contact the developper with your request to see if it has a chance to be available for a future update (i haven't checked the latest versions though, may be it is there already). it's free too.

What would be intersting is that, when i search for a free Scope delay patch, then I can go to the delay section and have only the delays, and not synths or chorus, or pitchzers or whatevcer else might be done.... so download plugs and directories are interesting for this as you can create sections/subsections etc etc... not sure that's what you want to do , but anyway. just more ideas .. Good luck !!

Re: Need help with php / mySql

Posted: Tue Feb 08, 2011 7:29 am
by Ben Walker
I'm going to start out simple with this - the first step is just to build a listing of all the patches, and try and gather the actual files (patches, presets, readmes and MRC images (remember those?)) to go with them so we don't lose them. This will be searchable by author, description, Mod version, 3rd party module use, etc.

Any extras (github integration, Joomla plugins, etc) will come later.

The basic page is nearing completion, I've got about half the patches listed (I do have a complete list, but it needs to be formatted properly to go into the database).

There's a fair amount of work to do just to get the basic page ready, but I think I might have something ready by the end of the month.

Thanks, everyone, to your help and suggestions. It's encouraging to know that people are interested in this, even if the first cut won't be the all-singing all-dancing version that we're aiming for.

Ben