
Iluvatar+
Members-
Posts
100 -
Joined
-
Last visited
Everything posted by Iluvatar+
-
I am have build an auth controller in cakephp but for some reason when i try and redirect the once the user is authenticated it only allows access actions within that controller. I have tried to redirect it to another controller which which is what i want the user to authenticate them selfs for, but all i get in a blank screen. :S. <?php class UsersController extends AppController { var $name = "Users"; var $layout = "login"; var $helpers = array('Html', 'Form'); function index() { } function beforeFilter() { $this->__validateLoginStatus(); } function login() { if(empty($this->data) == false) { if(($user = $this->User->validateLogin($this->data['User'])) == true) { $this->Session->write('User', $user); $this->Session->setFlash('You\'ve successfully logged in.'); } else { $this->Session->setFlash('Sorry, the information you\'ve entered is incorrect.'); } } } function logout() { $this->Session->destroy('user'); $this->Session->setFlash('You\'ve successfully logged out.'); $this->redirect('login'); } function __validateLoginStatus() { if($this->action != 'login' && $this->action != 'logout') { if($this->Session->check('User') == false) { $this->redirect('login'); $this->Session->setFlash('The URL you\'ve followed requires you login.'); } } } } ?>
-
Yes, but it wont work nativity in cakephp
-
I have a php file with a ton of vars that i need to access in a number of controllers. How can i simply include this file into a controller in cakephp? ~John
-
I need to create several buttons that when clicked it updates a field in a table and then passes params to another page (action). I cant seem to figure a logical way of doing this without making things messy, any one have any ideas
-
Alright guys, I am using cakephp to build a cms, and i am having trouble finding out how to pass params through the url. I have been able to pass the one param which is the #id of the last record. However, my actions are in three steps, create a new record in the first step adding in data for a few fields in that record then i pass the #id of that record on to the next action were I have three options (pick layout: layout 1, layout 3 and layout 3). Now what I need is for each of these options (which are buttons) to pass on the #id from the previous action along with a new param (layout #id). Usally this would be a simple operation for me, however this cakephp is proving to be a right pain in my arse John
-
How do i get var's from a url in cakephp. Example: phpfreaks.com?id=33&name=john I want to bring vars into the current action from the previous action so i can select a corresponding record in a database table. Any idea's?
-
I really need to find out how to do this, i cant seem to find anything online. I want to relate a field in my main table to another table ("franchise_id = franchises") in the model of the main table. Anyone have any ideas?
-
I asked a similar question yesterday, however i am still confused on how to actually do this and it's driving my up the wall. Does anyone have any advice?
-
I dont quite follow you on this one. Thanks for the replies...
-
Sorry, I havn't explained my self correctly here. What I want is to have a main page (index) which contains more than one view. For instance, I have a admin box view and a view all posts view on the same page.
-
I am building a cms in cakephp, well i haven’t yet started but i have a good idea on what i want. I have never really used MVC before so it's quite confusing to say the least. I want a index page which can hold numerous controllers so I am able to have control over multiple tables in my database from just one view. Is this possible...? Also does anyone know of any good tutorials or help info that can guide me a bit better throughout this project?
-
I am about to begin a new project which needs a cms system which allows the user to create new pages and new menu items for their website. I have picked cakephp framework to work with for implementation. I was wondering if it was possible to develop something like this in cake a little more simplistically than using your own code. If anyone can pass over some ideas, links or anything that could help i would be a happy chappy!?
-
is'nt there a way to stop the function with out having to write any of the code?
-
Nothing happens at all, the animation continues.
-
Oh right sorry. Well basically i have tried a few methods one being $('#button').click(function() { slideShow().stop(); $(this).toggle(); }) $('#button2').click(function(){ slideShow(); })
-
I need a button to be placed into the slider which will stop the function and toggle to a new image which will start it.
-
I have taken a Jquery slider of some random website and i need to add a pause button into it and i was wondering if anyone can help. Here is the code <script type="text/javascript"> $(document).ready(function() { //Execute the slideShow slideShow(); }); function slideShow() { //Set the opacity of all images to 0 $('#gallery a').css({opacity: 0.0}); //Get the first image and display it (set it to full opacity) $('#gallery a:first').css({opacity: 1.0}); //Get the caption of the first image from REL attribute and display it $('#gallery .content').html($('#gallery a:first').find('img').attr('rel')); //Call the gallery function to run the slideshow, 6000 = change to next image after 6 seconds setInterval('gallery()',6000); } function gallery() { //if no IMGs have the show class, grab the first image var current = ($('#gallery a.show')? $('#gallery a.show') : $('#gallery a:first')); //Get next image, if it reached the end of the slideshow, rotate it back to the first image var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#gallery a:first') :current.next()) : $('#gallery a:first')); //Get next image caption var caption = next.find('img').attr('rel'); //Set the fade in effect for the next image, show class has higher z-index next.css({opacity: 0.0}) .addClass('show') .animate({opacity: 1.0}, 1000); //Hide the current image current.animate({opacity: 0.0}, 1000) .removeClass('show'); //Set the opacity to 0 and height to 1px $('#gallery .caption').animate({height: '1px'}, { queue:true, duration:300 }); //Animate the caption, opacity to 0.7 and heigth to 100px, a slide up effect $('#gallery .caption').animate({height: '266px'},500 ); //Display the content $('#gallery .content').html(caption); } </script>
-
Thanks worked like a charm!
-
I want it to provide an rss feed to the user for each blog post.
-
I have a blog i created and i want to be able to create a page that can deal with the rss feeds. I have never done it before so if any one can give me some sugestions thats would be great.
-
I have some how done it by mistake. I added the code as suggested by the facebook steps but you have to define a url for it to relate to. All i done was remove the url from the code snippet and left it blank and it worked. It must be a default method in the API that says if there is no url defined use the current url and relate that comment to that url.
-
I dont no if this should even go here but here it goes. I created a blog were each blog post is veiwed on the same page in regards to the id passed to it (as standard). What i really need to do is incorporate the facebook comment box onto the page but... it only relates to the document itself rather than it's dynamic content.