• Web Dev Questions That Don't Need Their Own Thread v4
    5,001 replies, posted
[QUOTE=Killervalon;41762054]What do they need it for? Anti-piracy or something?[/QUOTE] It's to confirm your identity or something (???). [editline]8th August 2013[/editline] I was planning on getting a Kimsufi but guess not.
[QUOTE=SataniX;41758027][code]DELETE FROM `table_name` WHERE `column`='value' OR `column2` = 'value' [/code] is that what you mean?[/QUOTE] (Same column) I actually figured I could do it with an IN operator [code]DELETE FROM table_name WHERE column IN (value,value);[/code]
So I'm trying out CodeIgniter for the rebuild of my game site but I think I may be missing something. I'm using the 'template system' so URLs will do [php]$this->load->view('templates/header', $data); $this->load->view('pages/'.$strPath, $data); $this->load->view('templates/footer', $data);[/php] My issue is that the title tag is obviously set in the header, but the title may be dynamic (based on what is loaded from pages) so it isn't set until the second view loaded. Is there a way around this? Am I doing something wrong here? Every single example I find is setting the title in the controller- which is great, except when you visit /play/125 and the title needs to be row 125's 'name' value
[QUOTE=Banana Lord.;41775145]So I'm trying out CodeIgniter for the rebuild of my game site but I think I may be missing something. I'm using the 'template system' so URLs will do [php]$this->load->view('templates/header', $data); $this->load->view('pages/'.$strPath, $data); $this->load->view('templates/footer', $data);[/php] My issue is that the title tag is obviously set in the header, but the title may be dynamic (based on what is loaded from pages) so it isn't set until the second view loaded. Is there a way around this? Am I doing something wrong here? Every single example I find is setting the title in the controller- which is great, except when you visit /play/125 and the title needs to be row 125's 'name' value[/QUOTE] From what I can understand you can have $data as an associative array Then have "title" => "$title"; [PHP] $title = "Your title"; $data = array("title" => "$title"); $this->load->view("templates/header",$data); [/PHP] I may or may not have misunderstood what you wrote Sorry about that
It's fine, I think I worded it poorly. Let me try again :P [php]$this->load->view('pages/'.$strPath, $data);[/php] I want the title set when I load that file (that file will set the title based on the content requested), but it obviously is being set when the header is loaded the line before. Unless I'm missing something with how CodeIgniter works, there's no way around this?
[QUOTE=Banana Lord.;41775340]It's fine, I think I worded it poorly. Let me try again :P [php]$this->load->view('pages/'.$strPath, $data);[/php] I want the title set when I load that file (that file will set the title based on the content requested), but it obviously is being set when the header is loaded the line before. Unless I'm missing something with how CodeIgniter works, there's no way around this?[/QUOTE] Err The line before? Just out of curiosity, what is on that line?
[QUOTE=gokiyono;41775354]Err The line before? Just out of curiosity, what is on that line?[/QUOTE] [php]$this->load->view('templates/header', $data);[/php] This line loads all of the HTML (doctype, html, head, body, layout, navbar) and then lets pages/whatever.php load whatever HTML content should be on the page. pages/whatever.php will be doing whatever is needed to display its content (database queries, for example) and then outputting it. The title also needs to be set from this page though, so I can get it to say "playing *game name*" based on the data from the database queries
[QUOTE=Banana Lord.;41775372][php]$this->load->view('templates/header', $data);[/php] This line loads all of the HTML (doctype, html, head, body, layout, navbar) and then lets pages/whatever.php load whatever HTML content should be on the page.[/QUOTE] How embarrassing, sorry about that (it has been a long day) [editline]if[/editline] I supposed you can't have a $_SESSION in your /pages and then [PHP] $title = $_SESSION["Your title"]; $data = array("title" => "$title"); $this->load->view("templates/header",$data); [/PHP] Or am I going to embarrass myself further?
It's fine, that [i]might[/i] work but it's really dirty and I'm pretty sure it would lag behind (so the current page would display the previous pages title, because the session would be set after the page loads)
[QUOTE=Banana Lord.;41775145] Every single example I find is setting the title in the controller- which is great, except when you visit /play/125 and the title needs to be row 125's 'name' value[/QUOTE] Does CodeIgniter not pass the rest of the URI to the controller? i.e. (pseudo-ish code) [php] function play($id) { if($id) $title = DB::from('games')->find($id)->name; else $title = 'Play Games'; // load view with title variable } [/php] I've never used CodeIgniter so please excuse me if this post is irrelevant.
I feel really silly now :( thank you!
[QUOTE=Banana Lord.;41775917]I feel really silly now :( thank you![/QUOTE] Let's feel silly together
Quick question about hosts- I used to have a VPS but it's really a pain to set up NGINX/PHP-FPM (I can't do it correctly anyway it seems, always permission issues) so I've decided to go back to shared web hosting as there's no real need for a VPS anymore. I currently am hosting at NFOServers, who are awesome, but their platform is being a real pain- I can't use wildcard subdomains (this is an absolute must), they won't install mod_cloudflare, and I can't host anything larger than 200MB (otherwise throttled at 50KB/sec). Basically, I'm looking for (quality) budget shared hosting. Please don't suggest HostGator or Godaddy. I'm honestly looking for something with a lower profile and better reputation.
[QUOTE=Banana Lord.;41776636]Quick question about hosts- I used to have a VPS but it's really a pain to set up NGINX/PHP-FPM (I can't do it correctly anyway it seems, always permission issues) so I've decided to go back to shared web hosting as there's no real need for a VPS anymore. I currently am hosting at NFOServers, who are awesome, but their platform is being a real pain- I can't use wildcard subdomains (this is an absolute must), they won't install mod_cloudflare, and I can't host anything larger than 200MB (otherwise throttled at 50KB/sec). Basically, I'm looking for (quality) budget shared hosting. Please don't suggest HostGator or Godaddy. I'm honestly looking for something with a lower profile and better reputation.[/QUOTE] I've heard good things about [URL="http://justhost.com/"]JustHost[/URL], but if I were you, I would host it on a VPS.
JustHost comes across as your casual crap host that throws up a template and overloads their servers. A VPS is too much for what I need now. I don't know how to [i]efficiently[/i] set up Apache and jailed PHP processes, nor do I want to deal with finding a good php.ini setup.
[QUOTE=Banana Lord.;41776949]JustHost comes across as your casual crap host that throws up a template and overloads their servers. A VPS is too much for what I need now. I don't know how to [i]efficiently[/i] set up Apache and jailed PHP processes, nor do I want to deal with finding a good php.ini setup.[/QUOTE] I thought that too when I first saw them, but a few people I know have used them and said that they're fine. They're quite a big host anyway.
anyone have any recommendations for a minimal file upload/download and navigation? think dropbox's web interface me and a couple of mates have a btsync network set up and figured it'd be great to have access, at the very least, to http downloads of the files on the shared network so that we could grab files easily via phone (sans having to sync everything up with the btsync app) and university lab machines (where we can't exactly install btsync) otherwise, I figured if it comes to it I suppose it'd make a neat venture into webdev, but alas I'm not very well versed in it so I doubt I could get very far ;c
[QUOTE=Em See;41782961]anyone have any recommendations for a minimal file upload/download and navigation? think dropbox's web interface me and a couple of mates have a btsync network set up and figured it'd be great to have access, at the very least, to http downloads of the files on the shared network so that we could grab files easily via phone (sans having to sync everything up with the btsync app) and university lab machines (where we can't exactly install btsync) otherwise, I figured if it comes to it I suppose it'd make a neat venture into webdev, but alas I'm not very well versed in it so I doubt I could get very far ;c[/QUOTE] I made dirp, but never included file upload support: [URL]https://github.com/filp/dirp[/URL] ( demo: [URL]http://ssh.pt/cc/dirp[/URL] ).
[QUOTE=StinkyJoe;41783151]I made dirp, but never included file upload support: [URL]https://github.com/filp/dirp[/URL] ( demo: [URL]http://ssh.pt/cc/dirp[/URL] ).[/QUOTE] damnit man, that's sexy - I'll totally use it when I can get my head around sorting out an uploading system in the mean time I took [URL="http://encode-explorer.siineiolekala.net/"]a php file manager that I found[/URL] and started playing around with how it looks a little [IMG]http://i.imgur.com/1cWEIUh.png[/IMG]
Does anyone know of a non-convoluted promises library? Seriously, every single one I've looked into is overly complicated and long as well as extremely hard/impossible to follow.
[QUOTE=Jelly;41785046]Does anyone know of a non-convoluted promises library? Seriously, every single one I've looked into is overly complicated and long as well as extremely hard/impossible to follow.[/QUOTE] rsvp.js? [url]https://github.com/tildeio/rsvp.js[/url] Never used it, but it describes itself as "tiny".
[QUOTE=Banana Lord.;41775145]So I'm trying out CodeIgniter for the rebuild of my game site but I think I may be missing something. I'm using the 'template system' so URLs will do [php]$this->load->view('templates/header', $data); $this->load->view('pages/'.$strPath, $data); $this->load->view('templates/footer', $data);[/php] My issue is that the title tag is obviously set in the header, but the title may be dynamic (based on what is loaded from pages) so it isn't set until the second view loaded. Is there a way around this? Am I doing something wrong here? Every single example I find is setting the title in the controller- which is great, except when you visit /play/125 and the title needs to be row 125's 'name' value[/QUOTE] By the way, give Laravel a try at some point.
[QUOTE=StinkyJoe;41785945]rsvp.js? [url]https://github.com/tildeio/rsvp.js[/url] Never used it, but it describes itself as "tiny".[/QUOTE] Seems to be a clusterfuck like all the others. [url]https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/promise.js[/url] Look at that mess.
[QUOTE=Shadow801;41786018]By the way, give Laravel a try at some point.[/QUOTE] Aww crap, is this framework going to be better than CodeIgniter?
[QUOTE=Banana Lord.;41787408]Aww crap, is this framework going to be better than CodeIgniter?[/QUOTE] CodeIgniter is already pretty archaic, it was somewhat superseded by Kohana ages ago. Laravel is the new, cool kid on the block as far as PHP frameworks go, and already surpasses CI in both features and community support.
[QUOTE=Banana Lord.;41787408]Aww crap, is this framework going to be better than CodeIgniter?[/QUOTE] My cousin keeps telling me to go Symfony, as it's his favorite option (He works with WebDev).
[QUOTE=Killervalon;41787888]My cousin keeps telling me to go Symfony, as it's his favorite option (He works with WebDev).[/QUOTE] I've been working with Symfony for quite some time now, at work. I've stopped writing personal projects in PHP thanks to it - take that as you will.
[QUOTE=StinkyJoe;41787785]CodeIgniter is already pretty archaic, it was somewhat superseded by Kohana ages ago. Laravel is the new, cool kid on the block as far as PHP frameworks go, and already surpasses CI in both features and community support.[/QUOTE] Crap. Guess I know what I'm doing tonight! :suicide:
[QUOTE=Jelly;41785046]Does anyone know of a non-convoluted promises library? Seriously, every single one I've looked into is overly complicated and long as well as extremely hard/impossible to follow.[/QUOTE] Why not use [url=https://github.com/kriskowal/q]q[/url]?
Yeah okay I took a quick look at Laravel and it looks like you have to do a lot of CLI stuff and makes things much more complicated than they need to be. [editline]10th August 2013[/editline] Yeah Kohana seems like it's hard to use too, CodeIgniter was pretty well documented and only took a few hours to completely get everything working as I wanted (once I stopped being silly like my earlier posts with the title).
Sorry, you need to Log In to post a reply to this thread.