Advertisement
Guest User

functions.php

a guest
Feb 11th, 2011
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.90 KB | None | 0 0
  1. <?php
  2.  
  3. //Adding Lead Generatino form for Sugar CRM
  4. add_action('init', 'my_form_processor');
  5. function my_form_processor() {
  6.     if (isset($_POST['lead-generation-form-submit'])) {
  7.         // Process data here
  8. // Process data here
  9.  
  10. // Load and initialize our sugar object
  11. require_once('/home/*****/public_html/wp-content/themes/metric/sugar/sugar.php');
  12. $sugar = new SugarCRMWebServices('username', 'password');
  13.  
  14. // Login  and create a new lead
  15. $sugar->login();
  16. $result = $sugar->createLead(array(
  17.     'lead_source' => 'Web Site',
  18.     'lead_source_description' => 'Inquiry form on the website',
  19.     'lead_status' => 'New',
  20.     'first_name' => $_POST['first_name'],
  21.     'last_name' => $_POST['last_name'],
  22.     'email1' => $_POST['email'],
  23.     'description' => $_POST['message']
  24. ));
  25.  
  26.     }
  27. }
  28. //End Lead form for Sugar CRM
  29.  
  30.  
  31. // Start the engine
  32. require_once(TEMPLATEPATH.'/lib/init.php');
  33.  
  34. // Add new image sizes
  35. add_image_size('Slideshow', 500, 260, TRUE);
  36. add_image_size('Mini', 90, 90, TRUE);
  37.  
  38. // Add widgeted footer section
  39. add_action('genesis_before_footer', 'metric_include_footer_widgets');
  40. function metric_include_footer_widgets() {
  41.     require(CHILD_DIR.'/footer-widgeted.php');
  42. }
  43.  
  44. // Customizes go to top text
  45. add_filter('genesis_footer_backtotop_text', 'footer_backtotop_filter');
  46. function footer_backtotop_filter($backtotop) {
  47.     $backtotop = '[footer_backtotop text="Top of Page"]';
  48.     return $backtotop;
  49. }
  50.  
  51. // Register widget areas
  52. genesis_register_sidebar(array(
  53.     'name'=>'Home Top Left',
  54.     'id' => 'home-top-left',
  55.     'description' => 'This is the top left section of the homepage.',
  56.     'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget'  => '</div>',
  57.     'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
  58. ));
  59. genesis_register_sidebar(array(
  60.     'name'=>'Home Top Right',
  61.     'id' => 'home-top-right',
  62.     'description' => 'This is the top right section of the homepage.',
  63.     'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget'  => '</div>',
  64.     'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
  65. ));
  66. genesis_register_sidebar(array(
  67.     'name'=>'Home Middle #1',
  68.     'id' => 'home-middle-1',
  69.     'description' => 'This is the first column of the middle section of the homepage.',
  70.     'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget'  => '</div>',
  71.     'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
  72. ));
  73. genesis_register_sidebar(array(
  74.     'name'=>'Home Middle #2',
  75.     'id' => 'home-middle-2',
  76.     'description' => 'This is the second column of the middle section of the homepage.',
  77.     'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget'  => '</div>',
  78.     'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
  79. ));
  80. genesis_register_sidebar(array(
  81.     'name'=>'Home Middle #3',
  82.     'id' => 'home-middle-3',
  83.     'description' => 'This is the third column of the middle section of the homepage.',
  84.     'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget'  => '</div>',
  85.     'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
  86. ));
  87. genesis_register_sidebar(array(
  88.     'name'=>'Footer #1',
  89.     'id' => 'footer-1',
  90.     'description' => 'This is the first column of the footer section.',
  91.     'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
  92. ));
  93. genesis_register_sidebar(array(
  94.     'name'=>'Footer #2',
  95.     'id' => 'footer-2',
  96.     'description' => 'This is the second column of the footer section.',
  97.     'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
  98. ));
  99. genesis_register_sidebar(array(
  100.     'name'=>'Footer #3',
  101.     'id' => 'footer-3',
  102.     'description' => 'This is the third column of the footer section.',
  103.     'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
  104. ));
  105. genesis_register_sidebar(array(
  106.     'name'=>'Footer #4',
  107.     'id' => 'footer-4',
  108.     'description' => 'This is the fourth column of the footer section.',
  109.     'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
  110. ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement