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
Pseudo-God
Mar 13, 2006

I just love oranges!

da keebsta knicca posted:

I am confused about how to setup and test a website before launch with SSL certs. Basically I am doing a redevelopment of a website for someone and we are about to launch in the next week. They are scared of the old the old developer so we just want to switch over the domain on launch day to point to the new server without telling them. I am confused about how to buy/setup and test the SSL certificate that will sit on our signup/payment page when I don't have control of the domain yet. I just want everything setup so when the domain name transfer propagates everything is there sitting waiting to go.
This is not a technical problem, so a technical solution should not be applied. Just tell the old dev to get hosed or something. This calls for a baseball bat, not a week of clandestine coding.

Adbot
ADBOT LOVES YOU

Pseudo-God
Mar 13, 2006

I just love oranges!

hayden. posted:

I'm converting a simple app I have to Codeigniter and a MVC structure is all new to me. I'm trying to figure out how to best structure this app.

It's a pretty simple to-do list that uses the nestedSortable jQuery plugin. My PHP queries/prints all the root level items, and whenever it runs into a folder it also prints all of the items within the folder.

My question stems from the contents of the folder needing to be within <ol> tags. Is this how I should approach printing a folder (within a controller)?

$this->load->view('templates/folderStart.php', $item); //has <ol> tag
$this->print_folder_items($whatever);
$this->load->view('templates/folderEnd.php', $item); //has </ol> tag

Just seems kind of messy.
Usually you would handle the printing and the layout in the view. Pass the items to the view, and you can put conditionals, HTML tags and the like in there. Don't fill up your controller with non-business logic.

Pseudo-God
Mar 13, 2006

I just love oranges!
What I also wanted to mention was that it's OK to put complex code in the view, as long as the presentation of the data is the main goal of the code. For example, putting code like the following is perfectly fine:
php:
<?
if(is_logged_in())
{
    $this->load->view("user_control_panel");
}
else
{
    $this->load->view("login_form");
}
?>
It's also OK to iterate through a variable amount of items, like database entries, but only as long as the data comes from the controller in a PHP container.

Pseudo-God
Mar 13, 2006

I just love oranges!

oiseaux morts 1994 posted:

So, I've had a toy idea for a Twitter account that I want to generate tweets and send them out on a (non-annoyingly) consistent basis, but I'm wrestling with the best way to do a high-level implementation.

I have a server sitting around I want to put to use, and my thought is to write something in PHP that will generate the tweet string, then make a POST request to the Twitter API. Presumably I'll need the PHP OAuth extension to integrate the account I need (as per v1.1 of the API) as well.

However, if I do it in PHP, I'll either have to make the request manually or set up a cron job. The other alternative is to write a Python script that would maintain an uptime and make the same RESTful requests as above.

Does this sound reasonable, or am I way off here?
Yeah, your implementation idea is fine. I am not sure how the authentication will work (as I have not worked with the twitter API), but the rest of your implementation is perfectly adequate.

Pseudo-God
Mar 13, 2006

I just love oranges!
Suggesting that you move away from IE8 is not a bad suggestion to be honest. If you don't have any ActiveX apps or some other ancient software, I would strongly advise you to upgrade to Chrome or IE10.

Pseudo-God
Mar 13, 2006

I just love oranges!
Who knows, IE is dumb like that. It's the source of lots of pain for anyone who works as a front-end developer.

Pseudo-God
Mar 13, 2006

I just love oranges!
And what about building apps with backbone.js and the rest of the front-end libraries, which obviously don't work without JavaScript? Are we supposed to code our business logic twice, just to support a tiny minority of users?

Adbot
ADBOT LOVES YOU

Pseudo-God
Mar 13, 2006

I just love oranges!

Nolgthorn posted:

I've built a whole API based on Websockets.

I built loosely around some specification I found online about a best practice for communication. Where if you wanted to wait for a response you sent an `id` attribute along with the request. Then there was also a `method` attribute which was required.

There was some other stuff like how to format error responses and how I should allow arrays of requests, which could be run in any order. What was I looking at. Because at the time there was no javascript library available that did all that stuff, and I'd like to either check again or build one.

It sounds like JSON RPC 2.0

http://www.jsonrpc.org/specification

I use it on my WebSocket apps. However, when I work with node.js I use socket.io, which has a lot of cool stuff built in.

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