Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

VerySolidSnake posted:

I deployed a PHP application in an intranet. Like Wordpress, I would like them to be able to hit an "Update" button that will update their application to the latest version.

Would I just create a directory on my public server with the source files that would copy over to their server when they press update? What commands or tools should I be using to pull off something like this?

curl is pretty much all you need. I think copy can take http URLS as well, which is probably even easier.

Adbot
ADBOT LOVES YOU

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Spasms posted:

I have a mobile web page that is listing 8 categories, each one containing about 50-100 divs listed one after another, each div containing an image, and a bunch of text. The data is all stored in a database and pulled into the model and the controller passes the appropriate data to view when the page loads based on the user's filters and some other information.

The page is currently taking a long time to load because of the abundance of information being pulled from the database. The plan is to initially show 5 items in each category with a link at the bottom of the category to view the total list of items in that category.

The idea is that when the link is clicked, the additional items will be pulled from the database and appended to the current 5 items using a jQuery post or get call without reloading the page. I was considering showing the first entire category/items and loading the next category when the user scrolls to the bottom of the page Twitter style but I'm not sure if this is the best idea for a mobile website.

I am having trouble wrapping my head around what needs to happen between the "display all" link being clicked, the data being appended in the view and the most efficient way to do it. I am open to other methods of achieving the same initial load speed improvement. Any suggestions, resources, examples would be appreciated.


code:
jQuery('#getNextButton').click( function() {

jQuery.get('nextFive.php?startIndex=5', function (data){
  jQuery('#someDiv').append( parseDataIfNeeded(data) );
});

});
Obviously that's not best practice jQuery, but that's how you do it given one list and one button.


The "load some, then let the user request the rest" is a good way of doing the UX here. Gives enough data up front to be snappy, and enough for the user to see if the do want more in a category without loading tons of data they might not want. I'd go with loading more than five at a time, but that will depend mor on user testing / use cases than actual data size (unless each thing in the list is huuuuuuuge)

Lumpy fucked around with this message at 16:46 on Nov 19, 2011

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

biochemist posted:

Ok, so this is probably pretty simple but I've been stumbling.

I'm just trying to call a mySQL database with some information in it, put them in variables, and display them on a website. I've figured out how to access the database, but it's the SQL queries that are killing me.

It has been said by the two guys ahead of me, but I'm saying it a third time: Don't write your own SQL in PHP. It's like leaving your front and back door wide open before you go on vacation.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

biochemist posted:


Oh, a little edit: I could skip the SQL database entirely and it might even work better if I could have my page template contain all of the formatting and variable calls, but assign them in the actual post. The post content is called with
code:
<?php the_content(); ?>

There is an excellent WordPress thread and I'm sure they will be able to help you do exactly what you want in WP-eqsue fashion using it's internal way of getting things.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Forgall posted:

Is there a way to connect to postgres server from php using ssl client certificate authentication instead of password?

Copying and pasting your question into Google indicates yes, there is.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply