/wp-content/plugins/wapple-architect/admin/options-home.php

https://github.com/jedverity/m2m · PHP · 131 lines · 76 code · 24 blank · 31 comment · 27 complexity · 401ec8b66c7ff2c6beb4e1bb20faf3f6 MD5 · raw file

  1. <?php
  2. if (isset($_POST['info_update']))
  3. {
  4. $updateOption = false;
  5. // Save show excerpt on home page
  6. if(architect_save_option('architect_home_showexcerpt')) $updateOption = true;
  7. // Save home page excerpt override
  8. if(architect_save_option('architect_home_excerpt_override')) $updateOption = true;
  9. // Save remove captions
  10. if(architect_save_option('architect_home_removecaptions')) $updateOption = true;
  11. // Save home page show date
  12. if(architect_save_option('architect_home_showdate')) $updateOption = true;
  13. // Save home page show categories
  14. if(architect_save_option('architect_home_showcategories')) $updateOption = true;
  15. // Save home page image scale
  16. if(architect_save_option('architect_home_imagescale')) $updateOption = true;
  17. // Save home page image quality
  18. if(architect_save_option('architect_home_imagequality')) $updateOption = true;
  19. // Save home page transparency colour
  20. if(architect_save_option('architect_home_transcol')) $updateOption = true;
  21. // Save home show search
  22. if(architect_save_option('architect_home_showsearch')) $updateOption = true;
  23. // Save number of posts on home page
  24. if(architect_save_option('architect_home_posts_per_page')) $updateOption = true;
  25. // Show first image from post on home page
  26. if(architect_save_option('architect_home_firstimage')) $updateOption = true;
  27. // Save first image is a link to the article
  28. if(architect_save_option('architect_firstimageaslink')) $updateOption = true;
  29. // Save post titles
  30. if(architect_save_option('architect_showtitlelink')) $updateOption = true;
  31. // Save show more link
  32. if(architect_save_option('architect_home_showmore')) $updateOption = true;
  33. // Save older & newer posts link
  34. if(architect_save_option('architect_home_olderposts', array('stripTags' => true))) $updateOption = true;
  35. if(architect_save_option('architect_home_newerposts', array('stripTags' => true))) $updateOption = true;
  36. if(architect_save_option('architect_home_readmore', array('stripTags' => true))) $updateOption = true;
  37. }
  38. if(isset($updateOption) AND $updateOption == true)
  39. {
  40. echo "<div class='updated fade'><p><strong>Settings saved</strong></p></div>";
  41. }
  42. if(!isset($oldVersion) OR $oldVersion == false)
  43. {
  44. echo '<div class="wrap">';
  45. echo '<form method="post" action="admin.php?page=architect-home" enctype="multipart/form-data">';
  46. echo architect_admin_header('2', 'Wapple Architect Home Page Settings');
  47. } else
  48. {
  49. echo '<h3>Home Page Settings</h3>';
  50. }
  51. echo architect_table_start();
  52. // Show home page excerpt
  53. echo architect_admin_option('select', array('label' => 'Show excerpt on homepage', 'name' => 'architect_home_showexcerpt', 'options' => array('1' => 'Yes', '0' => 'No'), 'value' => get_option('architect_home_showexcerpt'), 'description' => 'Show a bit of your post on the homepage'));
  54. // Show home page excerpt override
  55. echo architect_admin_option('input', array('size' => 5, 'label' => 'Home page excerpt chars limit', 'name' => 'architect_home_excerpt_override', 'value' => get_option('architect_home_excerpt_override'), 'description' => 'Restrict home page excerpt to this number of chars'));
  56. // Remove captions from excerpts
  57. echo architect_admin_option('select', array('label' => 'Remove captions from excerpt', 'name' => 'architect_home_removecaptions', 'options' => array('1' => 'Yes', '0' => 'No'), 'value' => get_option('architect_home_removecaptions'), 'description' => 'Captions are a pain - you can remove them completely from your excerpt here'));
  58. // Show post date
  59. echo architect_admin_option('select', array('label' => 'Show post date on homepage', 'name' => 'architect_home_showdate', 'options' => array('1' => 'Yes', '0' => 'No'), 'value' => get_option('architect_home_showdate'), 'description' => 'Show the post date on the home page'));
  60. // Show categories at the bottom of the home page
  61. echo architect_admin_option('select', array('label' => 'Show categories on homepage', 'name' => 'architect_home_showcategories', 'options' => array('1' => 'Yes', '0' => 'No'), 'value' => get_option('architect_home_showcategories'), 'description' => 'Show a list of categories at the bottom of the home page'));
  62. // Image scale on home page
  63. $homepagescale = ARCHITECT_HOME_IMAGESCALE;
  64. if(get_option('architect_home_imagescale'))
  65. {
  66. $homepagescale = get_option('architect_home_imagescale');
  67. }
  68. echo architect_admin_option('input', array('size' => 2, 'label' => 'Image scale on homepage', 'name' => 'architect_home_imagescale', 'value' => $homepagescale, 'after' => '% ', 'description' => 'Define how wide you want post images resized to with relation to screen width'));
  69. // Image quality on home page
  70. $homepagequality = ARCHITECT_HOME_IMAGEQUALITY;
  71. if(get_option('architect_home_imagequality'))
  72. {
  73. $homepagequality = get_option('architect_home_imagequality');
  74. }
  75. echo architect_admin_option('input', array('size' => 2, 'label' => 'Image quality on homepage', 'name' => 'architect_home_imagequality', 'value' => $homepagequality, 'after' => '% ', 'description' => 'Define the quality of the image on the home page'));
  76. // Image transcol on home page
  77. echo architect_admin_option('input', array('size' => 6, 'label' => 'Image transcol on homepage', 'name' => 'architect_home_transcol', 'value' => get_option('architect_home_transcol'), 'before' => '# ', 'description' => 'Define the transparency colour of the image on the home page'));
  78. // Show search on home page
  79. echo architect_admin_option('select', array('label' => 'Show search on home page', 'name' => 'architect_home_showsearch', 'options' => array('1' => 'Yes', '0' => 'No'), 'value' => get_option('architect_home_showsearch'), 'description' => 'Show search box on the home page (appears at bottom)'));
  80. // Number of posts on home page
  81. $posts_per_page = get_option('posts_per_page');
  82. $option_posts_per_page = get_option('architect_home_posts_per_page');
  83. if($option_posts_per_page)
  84. {
  85. $posts_per_page = $option_posts_per_page;
  86. }
  87. echo architect_admin_option('input', array('size' => 2, 'label' => '# Posts on homepage', 'name' => 'architect_home_posts_per_page', 'value' => $posts_per_page, 'description' => 'Define the number of posts on the home page'));
  88. // Show the first image from the post on the home page
  89. echo architect_admin_option('select', array('label' => 'Show first image in post as thumbnail', 'name' => 'architect_home_firstimage', 'options' => array('1' => 'Yes', '0' => 'No'), 'value' => get_option('architect_home_firstimage'), 'description' => 'Show the first image from the post as a thumbnail'));
  90. // First image is a link to the post
  91. echo architect_admin_option('select', array('label' => 'First image is a link to the post', 'name' => 'architect_firstimageaslink', 'options' => array('1' => 'Yes', '0' => 'No'), 'value' => get_option('architect_firstimageaslink'), 'description' => 'The first image in the post is also a link to the post'));
  92. // Show normal post link
  93. echo architect_admin_option('select', array('label' => 'Display a normal style link to a post', 'name' => 'architect_showtitlelink', 'options' => array('1' => 'Yes', '-1' => 'No'), 'value' => get_option('architect_showtitlelink'), 'description' => 'Display a normal link to the post'));
  94. // Show more link
  95. echo architect_admin_option('select', array('label' => 'Show read more link on home page', 'name' => 'architect_home_showmore', 'options' => array('1' => 'Yes', '0' => 'No'), 'value' => get_option('architect_home_showmore'), 'description' => 'Show more link on home page'));
  96. // Older articles link
  97. echo architect_admin_option('input', array('size' => 10, 'label' => 'Older articles link', 'name' => 'architect_home_olderposts', 'value' => stripslashes(get_option('architect_home_olderposts')), 'description' => 'User defined older links on homepage'));
  98. // Newer articles link
  99. echo architect_admin_option('input', array('size' => 10, 'label' => 'Newer articles link', 'name' => 'architect_home_newerposts', 'value' => stripslashes(get_option('architect_home_newerposts')), 'description' => 'User defined newer links on homepage'));
  100. echo architect_admin_option('input', array('size' => 10, 'label' => 'Read more link', 'name' => 'architect_home_readmore', 'value' => stripslashes(get_option('architect_home_readmore')), 'description' => 'User defined "read more" link on homepage'));
  101. echo '</table>';
  102. if(!isset($oldVersion) OR $oldVersion == false)
  103. {
  104. echo '<table class="form-table" cellspacing="2" cellpadding="5" width="100%"><tr><td><p class="submit"><input class="button-primary" type="submit" name="info_update" value="Save Changes" /></p></td></tr></table>';
  105. echo '</form></div>';
  106. }
  107. ?>