Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
Module Settings adding to a text file, possible?
jamesd116



Joined: 05 Jun 2006
Posts: 1559
Location: Rochester Pa

Posted: 08/25/09 19:33 
In the you tube settigs in the admin cp under settings this curremtly is set up as a you tube address what I would want to do is use this area for admin to ad an option to a text file which will be in a drop down file is this possible and if so how?


_________________
One day the court system will learn that a childs mother is not the only option...... Question is will it be too late by that time...
Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 08/25/09 21:22 
Just to clarify, you have a text file that already exists and you want to add something to it on save?


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
jamesd116



Joined: 05 Jun 2006
Posts: 1559
Location: Rochester Pa

Posted: 08/25/09 22:03 
That would be correct if possile, although I have been trying a db version of it which I may be able to finish figuring out tomorrow. So yes if its possible how do you do this.
Which way is better a text file ) I take it this is what we call a flat file)
or a db and some how pull the dropdown list


_________________
One day the court system will learn that a childs mother is not the only option...... Question is will it be too late by that time...
Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 08/26/09 16:22 
Either way works. I would just use arrayFile to grab the contents of the file, and writeToFile to overwrite the file with the content you want when you're done (or you could append it using that parameter).

Kyle


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
jamesd116



Joined: 05 Jun 2006
Posts: 1559
Location: Rochester Pa

Posted: 08/26/09 18:11 
lol you lost me I saw the arrays in the functibn list but it confused me majorly.... lets try the db i know how to create the db so in the form controller how do i pull the info from the db and create a dropdown menu


_________________
One day the court system will learn that a childs mother is not the only option...... Question is will it be too late by that time...
Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 08/26/09 19:49 
You'll need to query the table you want and use the resulting array for the options.

Kyle


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 09/01/09 11:26 
If possible, it is almost always better to use the database unless you need the absolute max performance out of your code. Make sure too that if you DO write to any files, that you use Jamroom's writeToFile() function (instead of rolling your own solution with fopen/fwrite/close), since writeToFile() handles concurrency and file locking so you won't run into a race condition.

Hope this helps!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.