I'm trying to traverse the whole PhoneGap thing to get a native app up and running. I am completely fine with creating html5 markup for the actual app, what I need help with is trying to pull in dynamic content from a website. In particular, there is some content on our website that also needs to be in the app. We use a program call Expression Engine that handles all of our content. The content that I would need to pull over would be:
Sermon Videos
Sermon Series
Locations
Plain text content
The majority of the app will be local, but there are some dynamic needs as you can see. I've read a couple things that say "JSON" is the way to go, but it looks pretty complicated as I'm not quite familiar with AJAX. Is this the only way or are there any options or resources anyone can point me to that might help. I'm not even sure if that method would work for our website. I appreciate any help you can provide.
They are correct. What you need to look into is AJAX/JSON and how to present your data to your app using these technologies.
Expression Engine would actually be quite a good choice for this as its template system is quite flexible. There are even add-on modules for delivering your content as JSON if you want t go that route.
A quick google led me to: http://samcroft.co.uk/2011/updated-loading-data-in-phonegap-using-jquery-1-5/
It's a bit more than you need since you will have your content in an existing CMS instead of creating a new database to store the data, but the concepts will hold true and I am sure you will be able to use it to find more tutorials that suit you better.
Related
I want to make apps for iPhone and Android, but as an enthusiastic PHP-programmer, I'm not really willing to learn Java or C++. So I ran into PhoneGap.
BUT... I don't really like programming in pure HTML and Javascript either! (all those hooks, commas in JQuery etc. are just too messy, in my opinion...and I hate CSS too).
The way I use PHP now, is that I have written a quite advanced framework, that processes clean xml-templates into HTML/Javascript. This way I can make my own custom HTML-tags, that do all the work of CSS, extra HTML and it creates all Javascript for me automatically...
It's a bit how Delphi for PHP and Prado work. Once the (visual!) PHP-components are done, I can use them over and over again... and only have to think about HTML, CSS and Javascript once, while building the component...
Okay, now my question: since I can't use PHP on the client with PhoneGap, but DO need the HTML, would it be a crazy idea to let my web-server create the HTML for me the first time the app runs, then store the HTML locally using PhoneGap, and then the next time the app is loaded, reuse the locally stored HTML ?
So my question is : can I create HTML on a webserver, and then store that HTML locally so my PhoneGap-app can use that? Or is the HTML in a PhoneGap app somehow 'compiled' and cannot be changed afterwards ?
Or is this a really stupid idea and should I abandon my nice PHP-components framework? What are your thoughts?
It's hard to give a meaningful answer to a question like this without some context. The big question that you've left unanswered is: What are you really trying to do? What will the apps that you create do, and what will make yours different and better than apps that are already out there? Do you want to sell these apps in the app store? Are you trying to collect and/or disseminate mission-specific information for your company?
On the face of it, writing a bunch of HTML and PHP that'll execute on your server just to generate a bunch of HTML and JavaScript that'll execute in a PhoneGap application seems like a lot of trouble. OTOH, if that's what you're most comfortable with, and if you can get it to do what you want, go for it.
If you give your framework a catchy name and make some bold assertions about how it's the newest, fastest best way to develop mobile applications, you can probably turn it into a book deal. ;-) Until that happens though, you'll have a hard time finding answers to questions about writing iPhone apps using PHP.
I have a website that I've developed, which includes hand-written php, html, css, and js. I also created the MySQL database.
I've recently brought someone on who is going to make the website look better, but his experience is limitted to working with Wordpress. I'm wondering if it makes sense for him to the the front-end "skin" work with Wordpress and for me to edit the files as needed so they submit data to my php files and connect to my database. If the php generated by Wordpress is reasonable, this seems doable in theory.
The other way would be to take the html genrated by his php and use that as my starting point for hooking into my php processing files and database.
He sent me a dump of the files created after he created a simple webpage and there seemed to be a lot of extra stuff in there.
Can anyone with experience in this comment? I'm hoping there's an easy way to do this.
Thanks.
The default procedure for me that always worked well:
You provide outlines/simple sketchups/your old layout, so the "designer" knows vaguely how you want it to be
You define what the site should do ("there should be a button to...", "there should be a list of..., when you click on it..."). So he knows what happens and what site follows another. That's important! He must understand the site.
The better you do the above, the better the results you get from the designer will be
The designer generates layouts in pure HTML with CSS: Example sites with example data, where everything you said before is integrated.
You cut up the HTML-code and integrate it yourself in your php-code
This procedure has also the benefit, that an external designer does not get in contact with your application's internal php-code (and cannot "steal" it). And you can dry up your internal code when you integrate the HTML you get.
I'm trying to create a website that will take data from some file as input to a javascript page that will then do some data crunching and spit out some html. Additionally, I want the website to allow users to upload their own data to then be displayed. I'm imagining something like where the top center of the page has the results of the javascript, and below is a list of uploads and clicking on one will update the top display with new data from that upload.
I obviously don't want to reinvent the wheel and roll my own user authentication and content management system, so I was looking at drupal. Is there some way to extend drupal to do this (or a module that already does)? Or is there a better way entirely that I'm not aware of? Thanks.
I don't know if there is a framework for this, but look into jQuery templating. Other javascript libraries also offer something similar. You might also want to look into the Cappuccino framework.
It seems you have a very specific JavaScript use case. It is necessary for all these things to take place on the client (i.e. browser) side with JavaScript? Can it not be done on server side? There are thousands of modules in Drupal and some of them might be able to fully/partially meet your requirements .
I'd suggest you buy a ebook/book version of the excellent https://www.packtpub.com/drupal-6-javascript-and-jquery/book by matt butcher. After reading this book you should be able to get a fair idea of the direction you need to head in.
I'm looking to translate a webpage in PHP 5 so I can save the translation and make it easily accessible via mydomain.com/lang/fr/category/article.html rather than users having to go through google translate.
I've found various easy ways to translate text via CURL, however what i'd really like to be able to do is translate an entire webpage but obviously ignore the tags.
The problem is that Google Translate messes up all the HTML tags, class names etc
Does anyone know of a php class that can translate an entire webpage whilst ignoring the tags?
I'm guessing it may be possible via advanced regular expressions or something like that, but i'm not sure.
I can't just curl Google's response as i'll have all the extra JS that they put in.
Any ideas?
I know it's not quite what you asked for, but a much simpler alternative would just be to include the free Google Translate widget on all your pages. That way visitors select the language they would like to view the site in and Google dynmaically does the rest (and persists their selection throughout the site). You then don't need to worry about trying to create and keep updated dozens of different HTML files for every page, each with it's own set of internal links (which, frankly, sounds like a nightmare to maintain).
I want to develop a site that will allow be to publish information to users, and give them and opportunity to subscribe to a mailing list so they can be updated each time I make a change to the site.
*Add new information, etc.
I also would like for the users to be able to add comments about reviews posted, and give me suggestions...Things that will encourage user interaction
I understand that this is possible with php...
But I do not know php, and to learn and test it I apparently need a domain to begin with...etc.
Is it possible that I use Xhtml/Html to get the same results?
--
I know I can use the
Mail
but that would also leave my email open to spam...Any suggestions?
And I do apologize if this question has been posted before, I did some research and found no such thing.
All helpful responses are appreciated.
XHTML and HTML are essentially the same thing, just xhtml is based on an xml standard (thats where the x comes from), therefore being a bit more stricter.
HTML/XHTML is generally used for structure of your webpage, where as PHP is a server based language, meaning it works behind the scenes.
You could use html, but it'd be hideously complex to make, so i'd say you'd be better of biting the bullet and making a start on your first php app:) Don't worry it's very easy to get your head around. You do not need a domain to get started with the development, simply install WAMP (for windows), or MAMP (if your apple freak like me), these programs act as self contained mini servers, very useful for development!
Then i'd suggest trying it all out using html for starters, just so you get used to the WAMP/MAMP sever, before heading over to http://devzone.zend.com/article/627 for a brilliant set of tutorials on PHP!
EDIT: Another poster mentioned wordpress, its a great platform too! But i always favour learning the basics so in the event of something going wrong, or not working the way you want it to, you'll know what to do, or at least have an idea. Therefore i'd stick with your own php solution as a starter, then progressing to wordpress, when you feel comfortable.
I hope this helps :)
(X)HTML is the markup language that's interpreted by the browser, to display your web pages.
PHP is a language, used on the server, that can :
Generate that HTML markup
Act as a 'glue' with other systems, such as a database, for data-persitence.
(X)HTML by itself it not dynamic : it's only used to display data.
And PHP by itself doesn't display much information : it generates them.
So, basically, you'll need to use both (X)HTML and PHP :
PHP for everything thats' dynamic
like interaction with a database, a form, ...
HTML (possibly generated by the PHP code) to display the data.
No, you will need some kind of server side scripting language to be able to interrogate a database, print out comments and send the generated HTML to the browser.
If you don't know how to use PHP, how about using an open source solution like WordPress, this is a bloging platform but offers all the things you listed.
I would suggest using WordPress because:
It is easy to learn, the documentation is excellent
There are thousands of free plugins to add functionality to your site
There is a plugin, Contact Form 7, that will allow your users to send your email while doing a good job of curbing spam
There is a built in RSS feed to push out to your users notices when your site is updated
WordPress can be installed on shared hosting, virtual private hosts, and almost any machine with the LAMP stack
If you are new to creating websites, WordPress has free themes which are a good starting place
Finally, to answer your question, XHTML and PHP do different things. XHTML is like the idea of a picture. You can see it, it has shapes, outlines, sometimes words, etc. Where as PHP is like film where viewers can see something, but there is something in the background that is updating and moving.
HTML is just a markup language used by the browser to format data to display to users.
Most hosting solutions provide form mailer scripts that just take an HTML form and email the fields to a specified email address which you can configure.
They also provide mailing list functionality.
So, maybe check for a (PHP) hosting solution that provide this functionality and you won't need to write any PHP until you require more complex, custom functionality.