login  Naam:   Wachtwoord: 
Registreer je!
 Forum

Horizontale rule in wordpress template

Offline nick5m - 04/01/2011 17:14
Avatar van nick5mNieuw lid ik wil na elke post een horizontale balk hebben die voor scheiding zorgt tussen verschillende posts. Heeft iemand enig idee hoe ik dit doe? Bijgevoegd de functions page. Ik denk namelijk dat hij daar moet komen te staan.

  1. <?php
  2.  
  3. $art_config = parse_ini_file(TEMPLATEPATH."/config.ini", true);
  4.  
  5. $options = array (
  6. array( "name" => "HTML",
  7. "desc" => sprintf(__('<strong>XHTML:</strong> You can use these tags: <code>%s</code>', THEME_NS), 'a, abbr, acronym, em, b, i, strike, strong, span'),
  8. "id" => "art_footer_content",
  9. "std" => art_option('footer.defaultText'),
  10. "type" => "textarea")
  11. );
  12.  
  13. remove_action('wp_head', 'wp_generator');
  14. wp_enqueue_script('jquery');
  15.  
  16. define('WP_VERSION', $wp_version);
  17. define('THEME_NS', 'kubrick');
  18. if (class_exists('xili_language')):
  19. define('THEME_TEXTDOMAIN',THEME_NS);
  20. define('THEME_LANGS_FOLDER','/lang');
  21. else:
  22. load_theme_textdomain(THEME_NS, TEMPLATEPATH . '/lang');
  23. endif;
  24.  
  25. require_once(TEMPLATEPATH . '/core/parser.php');
  26. require_once(TEMPLATEPATH . '/core/navigation.php');
  27. require_once(TEMPLATEPATH . '/core/sidebars.php');
  28. require_once(TEMPLATEPATH . '/core/widgets.php');
  29.  
  30.  
  31. function art_option($name){
  32. global $art_config;
  33. $separator = '.';
  34. $name = trim($name);
  35. if (strpos($name, $separator) !== false) {
  36. $path = explode($separator, $name);
  37. $location = $path[0];
  38. if (isset($art_config[$location])){
  39. $group = $art_config[$location];
  40. $key = $path[1];
  41. if (isset($group[$key])){
  42. return $group[$key];
  43. }
  44. }
  45. } else {
  46. if (isset($art_config[$name])) {
  47. return $art_config[$name];
  48. }
  49. }
  50.  
  51. return false;
  52. }
  53.  
  54. $art_current_page_template = 'page';
  55. function art_page_template($templateName = null){
  56. global $art_current_page_template;
  57. if ($templateName !== null) {
  58. $art_current_page_template = $templateName;
  59. }
  60. return $art_current_page_template;
  61. }
  62.  
  63. $art_template_variables = null;
  64. function art_page_variables($variables = null){
  65. global $art_template_variables;
  66. if ($art_template_variables == null){
  67. $art_template_variables = array(
  68. 'template_url' => get_bloginfo('template_url') . '/',
  69. 'logo_url' => get_option('home'),
  70. 'logo_name' => get_bloginfo('name'),
  71. 'logo_description' => get_bloginfo('description'),
  72. 'menu_items' => art_get_menu_auto('primary-menu', art_option('menu.source'), art_option('menu.showSubitems')),
  73. 'sidebar1' => art_get_sidebar('default'),
  74. 'sidebarTop' => art_get_sidebar('top'),
  75. 'sidebarBottom' => art_get_sidebar('bottom'),
  76. 'sidebar2' => art_get_sidebar('secondary'),
  77. 'sidebarFooter' => art_get_sidebar('footer'),
  78. 'footerRSS' => art_get_footer_rss(),
  79. 'footerText' => art_get_footer_text()
  80. );
  81. }
  82. if (is_array($variables)) {
  83. $art_template_variables = array_merge($art_template_variables, $variables);
  84. }
  85. return $art_template_variables;
  86. }
  87.  
  88. function art_get_footer_text(){
  89. $result = art_option('footer.defaultText');
  90.  
  91. $footer_content = get_option('art_footer_content');
  92. if ($footer_content !== false) {
  93. $result = stripslashes($footer_content);
  94. }
  95.  
  96. return str_replace('%YEAR%', date('Y'), $result);
  97. }
  98.  
  99.  
  100. function art_get_footer_rss(){
  101. $result = '';
  102. if(art_option('footer.rss_show')){
  103. $result = art_parse(art_option('footer.rss_link'), array(
  104. 'rss_url' => get_bloginfo('rss2_url'),
  105. 'rss_title' => sprintf(__('%s RSS Feed', THEME_NS), get_bloginfo('name'))
  106. ));
  107. }
  108. return $result;
  109. }
  110.  
  111. function art_get_post_thumbnail($post_id = false){
  112. global $post, $id;
  113. $post_id = (int)$post_id;
  114. if (!$post_id) $post_id = $id;
  115. $is_post_list = !is_single() && !is_page();
  116. $width = art_option('metadata.thumbnail_width');
  117. $height = art_option('metadata.thumbnail_height');
  118. $size = array($width, $height);
  119. if (!$is_post_list) {
  120. $size = 'medium';
  121. }
  122. $result = '';
  123. $title = get_the_title();
  124. if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) {
  125. the_post_thumbnail($size, array('class' => 'alignleft', 'alt' => '', 'title' => $title));
  126. $result = ob_get_clean();
  127. } else {
  128. $postimage = get_post_meta($post->ID, 'post-image', true);
  129. if ($postimage) {
  130. $result = '<img src="'.$postimage.'" alt="" width="'.$width.'" height="'.$height.'" title="'.$title.'" class="wp-post-image alignleft" />';
  131. } else if (art_option('metadata.thumbnail_auto') && $is_post_list) {
  132. $attachments = get_children(array('post_parent' => $post_id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID'));
  133. if($attachments) {
  134. $attachment = array_shift($attachments);
  135. $img = wp_get_attachment_image_src($attachment->ID, $size);
  136. if (isset($img[0])) {
  137. $result = '<img src="'.$img[0].'" alt="" width="'.$img[1].'" height="'.$img[2].'" title="'.$title.'" class="wp-post-image alignleft" />';
  138. }
  139. }
  140. }
  141. }
  142. if($result !== ''){
  143. $result = '<a href="'.get_permalink($post->ID).'" title="'.$title.'">'.$result.'</a>';
  144. }
  145. return $result;
  146. }
  147.  
  148. function art_get_the_content($more_link_text = null, $stripteaser = 0) {
  149. $content = get_the_content($more_link_text, $stripteaser);
  150. $content = apply_filters('the_content', $content);
  151. return $content;
  152. }
  153.  
  154. function art_get_post_content() {
  155. global $post;
  156. if(is_single() || is_page()) {
  157. echo art_get_the_content(__('Read the rest of this entry &raquo;', THEME_NS));
  158. wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number'));
  159. } else {
  160. echo art_get_the_excerpt(__('Read the rest of this entry &raquo;', THEME_NS),
  161. get_permalink($post->ID),
  162. art_option('metadata.excerpt_words'),
  163. art_option('metadata.excerpt_use_tag_filter') ? explode(',',art_option('metadata.excerpt_allowed_tags')) : null,
  164. art_option('metadata.excerpt_min_remainder'),
  165. art_option('metadata.excerpt_auto'));
  166. }
  167. return ob_get_clean();
  168. }
  169.  
  170. function art_get_the_excerpt($read_more_tag, $perma_link_to = '', $all_words = 100, $allowed_tags = null, $min_remainder = 5, $auto = false) {
  171. global $post, $id;
  172. $more_token = '%%art-more%%';
  173. $show_more_tag = false;
  174. if (function_exists('post_password_required') && post_password_required($post)){
  175. return get_the_excerpt();
  176. }
  177. if (has_excerpt($id)) {
  178. $the_contents = get_the_excerpt();
  179. $show_more_tag = strlen($post->post_content) > 0;
  180. } else {
  181. $the_contents = art_get_the_content($more_token);
  182. if($the_contents != '') {
  183. if ($allowed_tags !== null) {
  184. $allowed_tags = '<' .implode('><',$allowed_tags).'>';
  185. $the_contents = strip_tags($the_contents, $allowed_tags);
  186. }
  187. $the_contents = strip_shortcodes($the_contents);
  188. if (strpos($the_contents, $more_token) !== false) {
  189. return str_replace($more_token, $read_more_tag, $the_contents);
  190. }
  191. if($auto && is_numeric($all_words)) {
  192. $token = "%art_tag_token%";
  193. $content_parts = explode($token, str_replace(array('<', '>'), array($token.'<', '>'.$token), $the_contents));
  194. $content = array();
  195. $word_count = 0;
  196. foreach($content_parts as $part)
  197. {
  198. if (strpos($part, '<') !== false || strpos($part, '>') !== false){
  199. $content[] = array('type'=>'tag', 'content'=>$part);
  200. } else {
  201. $all_chunks = preg_split('/([\s]+)/', $part, -1, PREG_SPLIT_DELIM_CAPTURE);
  202. foreach($all_chunks as $chunk) {
  203. if('' != trim($chunk)) {
  204. $content[] = array('type'=>'word', 'content'=>$chunk);
  205. $word_count += 1;
  206. } elseif($chunk != '') {
  207. $content[] = array('type'=>'space', 'content'=>$chunk);
  208. }
  209. }
  210. }
  211.  
  212. }
  213. if(($all_words < $word_count) && ($all_words + $min_remainder) <= $word_count) {
  214. $show_more_tag = true;
  215. $current_count = 0;
  216. $the_contents = '';
  217. foreach($content as $node) {
  218.  
  219. if($node['type'] == 'word') {
  220. $current_count += 1;
  221. }
  222. $the_contents .= $node['content'];
  223. if ($current_count == $all_words){
  224. break;
  225. }
  226. }
  227. }
  228. }
  229. }
  230. }
  231. $the_contents = force_balance_tags($the_contents);
  232. if ($show_more_tag) {
  233. $the_contents = $the_contents.' <a class="more-link" href="'.$perma_link_to.'">'.$read_more_tag.'</a>';
  234. }
  235. return $the_contents;
  236. }
  237.  
  238.  
  239. function art_get_post_title() {
  240. return art_parse_template("post_title", array(
  241. 'post_link' => get_permalink($post->ID),
  242. 'post_link_title' => sprintf(__('Permanent Link to %s', THEME_NS), the_title_attribute('echo=0')),
  243. 'post_title' => get_the_title(),
  244. 'template_url' => get_bloginfo('template_url')
  245. ));
  246. }
  247.  
  248. function art_get_post_icon($name){
  249. return art_parse(art_option('metadata.'.$name), array('template_url' => get_bloginfo('template_url')));
  250. }
  251.  
  252. if (!function_exists('get_the_date')) {
  253. function get_the_date($format = 'F jS, Y') {
  254. return get_the_time(__($format, THEME_NS));
  255. }
  256. }
  257.  
  258. function art_get_post_metadata($name) {
  259. $list = art_option('metadata.'.$name);
  260. $title = ($name == 'header' && art_option('metadata.title'));
  261. if (!$title && $list == "") return;
  262. $list_array = explode(",", $list);
  263. $result = array();
  264. for($i = 0; $i < count($list_array); $i++){
  265. $icon = $list_array[$i];
  266. switch($icon){
  267. case 'date':
  268. if(is_page()) break;
  269. $result[] = art_get_post_icon($icon) . get_the_date();
  270. break;
  271. case 'author':
  272. if(is_page()) break;
  273. the_author_posts_link();
  274. $result[] = art_get_post_icon($icon) . __('Author', THEME_NS) .' '. ob_get_clean();
  275. break;
  276. case 'comments':
  277. if(is_page() || is_single()) break;
  278. comments_popup_link(__('No Comments &#187;', THEME_NS), __('1 Comment &#187;', THEME_NS), __('% Comments &#187;', THEME_NS), '', __('Comments Closed', THEME_NS) );
  279. $result[] = art_get_post_icon($icon) . ob_get_clean();
  280. break;
  281. case 'category':
  282. if(is_page()) break;
  283. $result[] = art_get_post_icon($icon) .sprintf(__('Posted in %s', THEME_NS), get_the_category_list(', '));
  284. break;
  285. case 'tag':
  286. if(is_page() || !get_the_tags()) break;
  287. the_tags(__('Tags:', THEME_NS) . ' ', ', ', ' ');
  288. $result[] = art_get_post_icon($icon) . ob_get_clean();
  289. break;
  290. case 'edit':
  291. if (!current_user_can('edit_post', $post->ID)) break;
  292. edit_post_link(__('Edit', THEME_NS), '');
  293. $result[] = art_get_post_icon($icon) . ob_get_clean();
  294. break;
  295. }
  296. }
  297. if (!($title || count($result) > 0)) return '';
  298. return art_parse_template("post_metadata".$name, array(
  299. 'post_title' => art_get_post_title(),
  300. 'post'.$name.'icons' => implode(art_option('metadata.separator'), $result))) ;
  301. }
  302.  
  303. function art_post(){
  304. the_post();
  305. echo art_parse_template("post", array(
  306. 'post_class' => function_exists('get_post_class') ? implode(' ', get_post_class()) : '',
  307. 'post_id' => 'id="post-' . get_the_ID() . '"',
  308. 'post_thumbnail' => art_get_post_thumbnail(),
  309. 'post_title' => art_get_post_title(),
  310. 'post_metadataheader' => art_get_post_metadata('header'),
  311. 'post_content' => art_get_post_content(),
  312. 'post_metadatafooter' => art_get_post_metadata('footer')
  313. ));
  314. }
  315.  
  316. function art_post_box($title, $content){
  317. if ($title != "") {
  318. $title = '<h2 class="art-postheader">'. $title . '</h2>';
  319. }
  320. if (art_option('metadata.title')) {
  321. $content = $title . $content;
  322. $title = '';
  323. }
  324. echo art_parse_template("post", array(
  325. 'post_class' => '',
  326. 'post_id' => '',
  327. 'post_thumbnail' => '',
  328. 'post_title' => $title,
  329. 'post_metadataheader' => '',
  330. 'post_content' => $content,
  331. 'post_metadatafooter' => ''));
  332. }
  333.  
  334. function art_not_found_msg($caption = null, $content = null){
  335. if ($caption === null){
  336. $caption = __('Not Found', THEME_NS);
  337. }
  338. if($content === null){
  339. $content = '<p class="center">' . __('Sorry, but you are looking for something that isn&#8217;t here.', THEME_NS) . '</p>'
  340. . "\r\n" . art_get_search();
  341. }
  342. art_post_box($caption, $content);
  343. }
  344.  
  345. function art_get_block($title, $content, $id = '', $class = '' , $name = "block"){
  346. if (str_replace(array('&nbsp;', '', '\n', '\r', '\t'), '', $title) != ''){
  347. $title = art_parse_template($name . '_header', array('caption' => $title));
  348. }
  349. if ($id != ''){
  350. $id = 'id="' . $id . '"';
  351. }
  352. return art_parse_template($name, array(
  353. 'id' => $id,
  354. 'class' => $class,
  355. 'header' => $title,
  356. 'content' => $content,
  357. ));
  358. }
  359.  
  360. function art_get_search() {
  361. return art_parse_template("search",
  362. 'url' => get_bloginfo('url'),
  363. 'button' => __('Search', THEME_NS),
  364. 'query' => get_search_query()
  365. ));
  366. }
  367.  
  368. function art_page_navi($title = '', $comment = false) {
  369. $prev_link = null;
  370. $next_link = null;
  371. if($comment){
  372. $prev_link = get_previous_comments_link(__('Newer Entries &raquo;', THEME_NS));
  373. $next_link = get_next_comments_link(__('&laquo; Older Entries', THEME_NS));
  374. } elseif (is_single() || is_page()) {
  375. $next_link = get_previous_post_link('&laquo; %link');
  376. $prev_link = get_next_post_link('%link &raquo;');
  377. } else {
  378. $prev_link = get_previous_posts_link(__('Newer Entries &raquo;', THEME_NS));
  379. $next_link = get_next_posts_link(__('&laquo; Older Entries', THEME_NS));
  380. }
  381.  
  382. $content = '';
  383. if ($prev_link || $next_link) {
  384. $content = art_parse_template("pagination",
  385. 'next_link' => $next_link,
  386. 'prev_link' => $prev_link
  387. ));
  388. }
  389. if (!$content && !$title) return;
  390. art_post_box($title, $content);
  391. }
  392.  
  393. if (!function_exists('get_previous_comments_link')) {
  394. function get_previous_comments_link($label)
  395. {
  396. previous_comments_link($label);
  397. return ob_get_clean();
  398. }
  399. }
  400.  
  401. if (!function_exists('get_next_comments_link')) {
  402. function get_next_comments_link($label)
  403. {
  404. next_comments_link($label);
  405. return ob_get_clean();
  406. }
  407. }
  408.  
  409. if (!function_exists('get_previous_posts_link')) {
  410. function get_previous_posts_link($label)
  411. {
  412. previous_posts_link($label);
  413. return ob_get_clean();
  414. }
  415. }
  416.  
  417. if (!function_exists('get_next_posts_link')) {
  418. function get_next_posts_link($label)
  419. {
  420. next_posts_link($label);
  421. return ob_get_clean();
  422. }
  423. }
  424.  
  425. if (!function_exists('get_previous_post_link')) {
  426. function get_previous_post_link($label)
  427. {
  428. previous_post_link($label);
  429. return ob_get_clean();
  430. }
  431. }
  432.  
  433. if (!function_exists('get_next_post_link')) {
  434. function get_next_post_link($label)
  435. {
  436. next_post_link($label);
  437. return ob_get_clean();
  438. }
  439. }
  440.  
  441. function art_get_comment_author_link(){
  442. comment_author_link();
  443. return ob_get_clean();
  444. }
  445.  
  446. function art_get_edit_comment_link(){
  447. edit_comment_link('('.__('Edit', THEME_NS).')',' ','');
  448. return ob_get_clean();
  449. }
  450.  
  451. function art_get_comment_text(){
  452. comment_text();
  453. return ob_get_clean();
  454. }
  455.  
  456. function art_get_comment_reply_link($args, $depth){
  457. comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
  458. return ob_get_clean();
  459. }
  460.  
  461.  
  462. function art_comment($comment, $args, $depth)
  463. {
  464. $GLOBALS['comment'] = $comment; ?>
  465. <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
  466. <div id="comment-<?php comment_ID(); ?>">
  467. <?php art_post_box('', art_parse_template("comment", array(
  468. 'get_avatar' => get_avatar($comment, $size='48'),
  469. 'comment_author_link' => art_get_comment_author_link(),
  470. 'status' => $comment->comment_approved == '0' ? '<em>' . __('Your comment is awaiting moderation.', THEME_NS) . '</em><br />' : '',
  471. 'get_comment_link' => htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ,
  472. 'get_comment_date' => sprintf(__('%1$s at %2$s', THEME_NS), get_comment_date(), get_comment_time()),
  473. 'edit_comment_link' => art_get_edit_comment_link(),
  474. 'comment_text' => art_get_comment_text(),
  475. 'comment_reply_link' => art_get_comment_reply_link($args, $depth)))); ?>
  476. </div>
  477. <?php
  478. }
  479.  
  480. add_filter('comments_template', 'legacy_comments');
  481. function legacy_comments($file) {
  482. if(!function_exists('wp_list_comments')) : // WP 2.7-only check
  483. $file = TEMPLATEPATH.'/legacy-comments.php';
  484. endif;
  485. return $file;
  486. }
  487.  
  488. if ( function_exists('add_theme_support') ) {
  489. add_theme_support('post-thumbnails');
  490. add_theme_support('nav-menus');
  491. add_theme_support('automatic-feed-links');
  492. }
  493.  
  494. if (function_exists('register_nav_menus')) {
  495. register_nav_menus(
  496. 'primary-menu' => __( 'Primary Menu', THEME_NS),
  497. 'secondary-menu' => __( 'Secondary Menu', THEME_NS)
  498. )
  499. );
  500. }
  501.  
  502.  
  503. function art_add_admin() {
  504. global $options;
  505. if ( $_GET['page'] == basename(__FILE__) ) {
  506. if ('save' == $_REQUEST['action'] ) {
  507. foreach ($options as $value) {
  508. if($value['type'] != 'multicheck'){
  509. art_update_option( $value['id'], $_REQUEST[ $value['id'] ] );
  510. }else{
  511. foreach($value['options'] as $mc_key => $mc_value){
  512. $up_opt = $value['id'].'_'.$mc_key;
  513. art_update_option($up_opt, $_REQUEST[$up_opt] );
  514. }
  515. }
  516. }
  517. foreach ($options as $value) {
  518. if($value['type'] != 'multicheck'){
  519. if( isset( $_REQUEST[ $value['id'] ] ) ) { art_update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); }
  520. }else{
  521. foreach($value['options'] as $mc_key => $mc_value){
  522. $up_opt = $value['id'].'_'.$mc_key;
  523. if( isset( $_REQUEST[ $up_opt ] ) ) { art_update_option( $up_opt, $_REQUEST[ $up_opt ] ); } else { delete_option( $up_opt ); }
  524. }
  525. }
  526. }
  527. header("Location: themes.php?page=functions.php&saved=true");
  528. die;
  529. }
  530. }
  531. add_theme_page("Footer", "Footer", 'edit_themes', basename(__FILE__), 'art_admin');
  532. }
  533. add_action('admin_menu', 'art_add_admin');
  534.  
  535.  
  536.  
  537. function art_update_option($key, $value){
  538. update_option($key, (get_magic_quotes_gpc()) ? stripslashes($value) : $value);
  539. }
  540.  
  541.  
  542. function art_admin() {
  543. global $options;
  544. if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>'.art_option('theme.name') . ' settings saved.</strong></p></div>';
  545. ?>
  546. <div class="wrap">
  547. <h2>Footer</h2>
  548.  
  549. <form method="post">
  550.  
  551. <table class="optiontable" style="width:100%;">
  552.  
  553. <?php foreach ($options as $value) {
  554.  
  555. switch ( $value['type'] ) {
  556. case 'text':
  557. option_wrapper_header($value);
  558. ?>
  559. <input style="width:100%;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" />
  560. <?php
  561. option_wrapper_footer($value);
  562. break;
  563.  
  564. case 'select':
  565. option_wrapper_header($value);
  566. ?>
  567. <select style="width:70%;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
  568. <?php foreach ($value['options'] as $option) { ?>
  569. <option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
  570. <?php } ?>
  571. </select>
  572. <?php
  573. option_wrapper_footer($value);
  574. break;
  575.  
  576. case 'textarea':
  577. $ta_options = $value['options'];
  578. option_wrapper_header($value);
  579. ?>
  580. <textarea name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" style="width:100%;height:100px;"><?php
  581. if( get_settings($value['id']) !== false) {
  582. echo stripslashes(get_settings($value['id']));
  583. }else{
  584. echo $value['std'];
  585. }?></textarea>
  586. <?php
  587. option_wrapper_footer($value);
  588. break;
  589.  
  590. case "radio":
  591. option_wrapper_header($value);
  592.  
  593. foreach ($value['options'] as $key=>$option) {
  594. $radio_setting = get_settings($value['id']);
  595. if($radio_setting != ''){
  596. if ($key == get_settings($value['id']) ) {
  597. $checked = "checked=\"checked\"";
  598. } else {
  599. $checked = "";
  600. }
  601. }else{
  602. if($key == $value['std']){
  603. $checked = "checked=\"checked\"";
  604. }else{
  605. $checked = "";
  606. }
  607. }?>
  608. <input type="radio" name="<?php echo $value['id']; ?>" value="<?php echo $key; ?>" <?php echo $checked; ?> /><?php echo $option; ?><br />
  609. <?php
  610. }
  611.  
  612. option_wrapper_footer($value);
  613. break;
  614.  
  615. case "checkbox":
  616. option_wrapper_header($value);
  617. if(get_settings($value['id'])){
  618. $checked = "checked=\"checked\"";
  619. }else{
  620. $checked = "";
  621. }
  622. ?>
  623. <input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> />
  624. <?php
  625. option_wrapper_footer($value);
  626. break;
  627.  
  628. case "multicheck":
  629. option_wrapper_header($value);
  630.  
  631. foreach ($value['options'] as $key=>$option) {
  632. $pn_key = $value['id'] . '_' . $key;
  633. $checkbox_setting = get_settings($pn_key);
  634. if($checkbox_setting != ''){
  635. if (get_settings($pn_key) ) {
  636. $checked = "checked=\"checked\"";
  637. } else {
  638. $checked = "";
  639. }
  640. }else{
  641. if($key == $value['std']){
  642. $checked = "checked=\"checked\"";
  643. }else{
  644. $checked = "";
  645. }
  646. }?>
  647. <input type="checkbox" name="<?php echo $pn_key; ?>" id="<?php echo $pn_key; ?>" value="true" <?php echo $checked; ?> /><label for="<?php echo $pn_key; ?>"><?php echo $option; ?></label><br />
  648. <?php
  649. }
  650.  
  651. option_wrapper_footer($value);
  652. break;
  653.  
  654. case "heading":
  655. ?>
  656. <tr valign="top">
  657. <td colspan="2" style="text-align: center;"><h3><?php echo $value['name']; ?></h3></td>
  658. </tr>
  659. <?php
  660. break;
  661.  
  662. default:
  663.  
  664. break;
  665. }
  666. }
  667. ?>
  668.  
  669. </table>
  670.  
  671. <p class="submit">
  672. <input name="save" type="submit" value="Save changes" />
  673. <input type="hidden" name="action" value="save" />
  674. </p>
  675. </form>
  676. </div>
  677. <?php
  678. }
  679.  
  680. function option_wrapper_header($values){
  681. ?>
  682. <tr valign="top">
  683. <th scope="row" style="width:1%;white-space: nowrap;"><?php echo $values['name']; ?>:</th>
  684. <td>
  685. <?php
  686. }
  687.  
  688. function option_wrapper_footer($values){
  689. ?>
  690. </td>
  691. </tr>
  692. <tr valign="top">
  693. <td>&nbsp;</td><td><small><?php echo $values['desc']; ?></small></td>
  694. </tr>
  695. <?php
  696. }


hoor het wel

0 antwoorden

Gesponsorde links
Er zijn nog geen reacties op dit bericht.
Je moet ingelogd zijn om een reactie te kunnen posten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.529s