Hi Cricket, You lost me now, i still have all my normal code "how it was before", i havent changed any coding apart from adding to it...."CODE AS ABOVE", after i added the DB column i did a test submit and the link didnt show up in either the DB or the email.... i cant understand what needs doing with my code above...I have also just added to the booking form "how did you hear about DVV" section and this also is not showing up in the email..????
What is going on...i still know its something simple but i just cant get my head round it... Am i correct in saying that adding to the form, i would need to change the "view" (how the form looks) and the controller (how the form works)..?? really confused.. Above in the code i pasted in-- are the views & controller that i modified to include the new form sections for the site,,,all i want is for the new sections to show in the email...arrhhhhhhhh.. Cheers for helping so far. Brook On Apr 20, 5:12 pm, cricket <[email protected]> wrote: > Did you ever check to see if it's being submitted? > > if (!empty($this->data)) > { > die(debug($this->data)); > > Also, check after you do the find() > > $link= $this->Link->findById($this->Link->id); > > // delete this line later > die(debug($link)); > > $this->set(compact('link')); > > On Wed, Apr 20, 2011 at 5:15 AM, dvvbrook79 > > > > <[email protected]> wrote: > > Hi again Cricket, > > To make helping me easier, ive included below the files what i have > > now after adding the column to the database...so here go's > > > (THIS IS THE "submit_link.ctp") > > > <h1><?php __('LinkSubmission'); ?></h1> > > > <p><?php __('Alinkwas submitted on DisneyVillaVacations.com.'); ?> > > <?php __('You can approve/reject thislinkon the website by > > clicking the followinglink:'); ?></p> > > > <p><a href="<?php echo $html->url(array('controller' => 'links', > > 'action' => 'submissions', 'admin' => true), true); ?>"><?php __('Link > > Submissions'); ?></a></p> > > > <table> > > <tr> > > <td><?php __('Category'); ?>:</td> > > <td><?php echo $link['LinkCategory']['title']; ?></td> > > </tr> > > <tr> > > <td><?php __('Title'); ?>:</td> > > <td><?php echo $link['Link']['title']; ?></td> > > </tr> > > <tr> > > <td><?php __('URL'); ?>:</td> > > <td><?php echo $html->link($link['Link']['url'], $link['Link'] > > ['url']); ?></td> > > </tr> > > <tr> > > <td><?php __('Description'); ?>:</td> > > <td><?php echo $link['Link']['description']; ?></td> > > </tr> > > <tr> > > <td><?php __('ReciprocalLink'); ?>:</td> > > <td><?php echo $link['Link']['reciprocallink']; ?></td> > > </tr> > > </table> > > > (THIS IS THE "links_controller.php") > > > <?php > > class LinksController extends AppController { > > > var $name = 'Links'; > > var $uses = array('Link', 'LinkCategory', 'Page'); > > var $helpers = array('Recaptcha'); > > var $components = array('Email', 'Recaptcha'); > > var $paginate = array ( > > 'limit' => 15, > > 'page' => 1, > > 'order' => array ('Link.created' => 'ASC'), > > 'conditions' => array ('Link.approved' => 1) > > ); > > > function beforeFilter() { > > > // Set up authentication > > parent::beforeFilter(); > > > // Allow access to public functions > > $this->Auth->allowedActions = array( > > 'index', 'category', 'submit' > > ); > > > } > > > function index() { > > > // Get community page content > > $page = $this->Page->find('first', array('conditions' => array > > ('slug' => 'links'))); > > $this->set('page', $page); > > $this->set('title_for_layout', $page['Page']['title']); > > > // Display all categories > > $link_categories = $this->LinkCategory->find('all'); > > $this->set('link_categories', $link_categories); > > > } > > > function category($slug) { > > > // Find Category > > $link_category = $this->LinkCategory->findBySlug($slug); > > $this->set('link_category', $link_category); > > > // Find Links in Category > > $this->set('links', $this->paginate($this->LinkCategory->Link, > > array ('Link.link_category_id' => $link_category['LinkCategory'] > > ['id']))); > > > // Title > > $this->set('title_for_layout', $link_category['LinkCategory'] > > ['title']); > > > } > > > function submit() { > > > // Title > > $this->set('title_for_layout', __('SubmitLink', true)); > > > // Load category list > > $link_categories = $this->Link->LinkCategory->find('list', > > array ( > > 'order' => 'LinkCategory.title' > > )); > > $this->set('linkCategories', $link_categories); > > > // Handle formsubmission > > if (!empty($this->data)) { > > > // Check CAPTCHA was matched > > if (!$this->Recaptcha->validate()) { > > $this->Link->validate['captcha'] = array ( > > 'rule' => array('comparison', '=', 0), > > 'message' => 'You did not enter the CAPTCHA > > correctly.' > > ); > > $this->set('captcha_incorrect', true); > > } > > > // Save and redirect to received message > > $this->Link->create(); > > $this->data['Link']['approved'] = 0; > > if ($this->Link->save($this->data)) { > > > // Sendemailto admin > > $this->set('link', $this->Link->findById($this->Link- > >>id)); > > $this->Email->from = > > __('DisneyVillaVacations.com', true) . ' <' . > > Configure::read('Admin.email') . '>'; > > $this->Email->to = > > Configure::read('Admin.email'); > > $this->Email->subject = __('DisneyVillaVacations.com > > -LinkSubmission', true); > > $this->Email->template = 'submit_link'; > > $this->Email->sendAs = 'both'; > > $this->Email->send(); > > > // Redirect back > > $this->Session->setFlash('Yourlinkhas been > > submitted, and is awaiting approval.'); > > $this->redirect(array('action' => 'index')); > > > } > > > } > > > } > > > (THIS IS THE "submit.ctp") > > > <h2><?php __('SubmitLink'); ?></h2> > > > <p><?php __('If you would like to add your website to our links, > > please fill in the form below.'); ?> > > <?php __('Please note that links are moderated and must be > > approved before they appear on the website.'); ?></p> > > > <?php echo $form->create('Link', array('action' => 'submit')); ?> > > > <?php > > echo $form->inputs(array ( > > 'legend' => false, > > 'Link.link_category_id' => array ( > > 'label' => __('Category', true) > > ), > > 'Link.title', > > 'Link.url' => array( > > 'label' => __('URL', true) > > ), > > > 'Link.description', > > 'Link.reciprocallink' > > > )); > > ?> > > > <?php if (isset($captcha_incorrect)): ?> > > <p><?php __('You have entered the CAPTCHA incorrectly. Please > > try again.'); ?></p> > > <?php else: ?> > > <p><?php __('Please enter the words you see below:'); ?></p> > > <?php endif; ?> > > > <?php echo $recaptcha->show(); ?> > > > <?php echo $form->end(__('SubmitLink', true)); ?> > > > Further to my lastemail, i have now added the DB column but > > "reciprocallink" still not showing up in theemail....Hope this makes > > it easier,,, > > > Cheers again for helping.. > > > Brook > > > On Apr 20, 4:04 am, cricket <[email protected]> wrote: > >> On Tue, Apr 19, 2011 at 5:25 PM, dvvbrook79 > > >> <[email protected]> wrote: > >> > Hi Cricket, > > >> > Thanks for the help, much appreciated... > > >> > Would option 2 go into the "links controller"....?? I just tried > >> > adding the db column, but it didnt show up... but i know why as i > >> > changed some code back to how it was, so im sure it should work when i > >> > update it...i have updated the DB to include the column > >> > "reciprocallink"....Is it the "controller" and the "view" that need > >> > updating?? or will i have to update a model as well....?? > > >> I can't make heads nor tails about what you're asking. > > > -- > > Our newest site for the community: CakePHP Video > > Tutorialshttp://tv.cakephp.org > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help > > others with their CakePHP related questions. > > > To unsubscribe from this group, sendemailto > > [email protected] For more options, visit this group > > athttp://groups.google.com/group/cake-php- Hide quoted text - > > - Show quoted text - -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
