|
Web aplikacije, web servisi i software Frameworks, web servisi, programi, plugin-ovi, ekstenzije korisni za razvoj web sajtova. Sponzor: |
|
Alati teme | Način prikaza |
19. 03. 2010. | #1 |
novi član
Na probnom radu
Datum učlanjenja: 23.01.2010
Poruke: 17
Hvala: 8
0 "Hvala" u 0 poruka
|
Wordpress thema function.php POMOC!!!!!
Pozdrav svima
Pronasao sam jednu odlicnu temu za moj blog.Ali onaj sto je kreirao ovu temu je ubacio linkove u footer i provjeru da li su ti linkovi izbrisani u function.php.Sad ja ako izbrisem te linkove iz footera vraca mi gresku i to mi stvara probleme.Ja neznaam sta treba izbrisati iz function.php da bi ukinuo tu provjeru.Zato molim vas za pomoc jer sam ja jos noob u kodiranju.Function.php cu postati ovdje pa da vidite gdje se ta provjera nalazi i sta trebam izbrisati.Unaprijed zahvalan. Kôd:
<?php //////////////////////////////////////////////////////////////////////////////// // Get Featured Post Image //////////////////////////////////////////////////////////////////////////////// function get_featured_slider_image() { global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); $first_img = $matches [1] [0]; if(empty($first_img)){ //Defines a default image $img_dir = get_bloginfo('template_directory'); $first_img = $img_dir . '/images/feat-default.jpg'; } return $first_img; } //////////////////////////////////////////////////////////////////////////////// // Get Post Image //////////////////////////////////////////////////////////////////////////////// function get_post_image() { global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); $first_img = $matches [1] [0]; if(empty($first_img)){ //Defines a default image $img_dir = get_bloginfo('template_directory'); $first_img = $img_dir . '/images/post-default.jpg'; } return $first_img; } //////////////////////////////////////////////////////////////////////////////// // Featured Content Excerpt Post //////////////////////////////////////////////////////////////////////////////// function the_featured_excerpt($excerpt_length=25, $allowedtags='', $filter_type='none', $use_more_link=true, $more_link_text="Read More", $force_more_link=true, $fakeit=1, $fix_tags=true) { if (preg_match('%^content($|_rss)|^excerpt($|_rss)%', $filter_type)) { $filter_type = 'the_' . $filter_type; } $text = apply_filters($filter_type, get_the_featured_excerpt($excerpt_length, $allowedtags, $use_more_link, $more_link_text, $force_more_link, $fakeit)); $text = ($fix_tags) ? balanceTags($text) : $text; echo $text; } function get_the_featured_excerpt($excerpt_length, $allowedtags, $use_more_link, $more_link_text, $force_more_link, $fakeit) { global $id, $post; $output = ''; $output = $post->post_excerpt; if (!empty($post->post_password)) { // if there's a password if ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie $output = __('There is no excerpt because this is a protected post.'); return $output; } } // If we haven't got an excerpt, make one. if ((($output == '') && ($fakeit == 1)) || ($fakeit == 2)) { $output = $post->post_content; $output = strip_tags($output, $allowedtags); $output = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $output ); $blah = explode(' ', $output); if (count($blah) > $excerpt_length) { $k = $excerpt_length; $use_dotdotdot = 1; } else { $k = count($blah); $use_dotdotdot = 0; } $excerpt = ''; for ($i=0; $i<$k; $i++) { $excerpt .= $blah[$i] . ' '; } if (($use_more_link && $use_dotdotdot) || $force_more_link) { $excerpt .= "... <a href=\"". get_permalink() . "#more-$id\">$more_link_text</a>"; } else { $excerpt .= ($use_dotdotdot) ? '...' : ''; } $output = $excerpt; } // end if no excerpt return $output; } //////////////////////////////////////////////////////////////////////////////// // Standard Post Excerpt //////////////////////////////////////////////////////////////////////////////// function the_post_excerpt($excerpt_length=50, $allowedtags='', $filter_type='none', $use_more_link=true, $more_link_text="Read More", $force_more_link=true, $fakeit=1, $fix_tags=true) { if (preg_match('%^content($|_rss)|^excerpt($|_rss)%', $filter_type)) { $filter_type = 'the_' . $filter_type; } $text = apply_filters($filter_type, get_the_post_excerpt($excerpt_length, $allowedtags, $use_more_link, $more_link_text, $force_more_link, $fakeit)); $text = ($fix_tags) ? balanceTags($text) : $text; echo $text; } function get_the_post_excerpt($excerpt_length, $allowedtags, $use_more_link, $more_link_text, $force_more_link, $fakeit) { global $id, $post; $output = ''; $output = $post->post_excerpt; if (!empty($post->post_password)) { // if there's a password if ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie $output = __('There is no excerpt because this is a protected post.'); return $output; } } // If we haven't got an excerpt, make one. if ((($output == '') && ($fakeit == 1)) || ($fakeit == 2)) { $output = $post->post_content; $output = strip_tags($output, $allowedtags); $output = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $output ); $blah = explode(' ', $output); if (count($blah) > $excerpt_length) { $k = $excerpt_length; $use_dotdotdot = 1; } else { $k = count($blah); $use_dotdotdot = 0; } $excerpt = ''; for ($i=0; $i<$k; $i++) { $excerpt .= $blah[$i] . ' '; } if (($use_more_link && $use_dotdotdot) || $force_more_link) { $excerpt .= "... <a href=\"". get_permalink() . "#more-$id\" class=\"more-link\">$more_link_text</a>"; } else { $excerpt .= ($use_dotdotdot) ? '...' : ''; } $output = $excerpt; } // end if no excerpt return $output; } //////////////////////////////////////////////////////////////////////////////// // WP-PageNavi //////////////////////////////////////////////////////////////////////////////// function custom_wp_pagenavi($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) { global $request, $posts_per_page, $wpdb, $paged; if(empty($prelabel)) { $prelabel = '<strong>«</strong>'; } if(empty($nxtlabel)) { $nxtlabel = '<strong>»</strong>'; } $half_pages_to_show = round($pages_to_show/2); if (!is_single()) { if(!is_category()) { preg_match('#FROM\s(.*)\sORDER BY#siU', $request, $matches); } else { preg_match('#FROM\s(.*)\sGROUP BY#siU', $request, $matches); } $fromwhere = $matches[1]; $numposts = $wpdb->get_var("SELECT COUNT(DISTINCT ID) FROM $fromwhere"); $max_page = ceil($numposts /$posts_per_page); if(empty($paged)) { $paged = 1; } if($max_page > 1 || $always_show) { echo "$before <div class=\"wp-pagenavi\"><span class=\"pages\">Page $paged of $max_page:</span>"; if ($paged >= ($pages_to_show-1)) { echo '<a href="'.get_pagenum_link().'">« First</a> '; } previous_posts_link($prelabel); for($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) { if ($i >= 1 && $i <= $max_page) { if($i == $paged) { echo "<strong class='current'>$i</strong>"; } else { echo ' <a href="'.get_pagenum_link($i).'">'.$i.'</a> '; } } } next_posts_link($nxtlabel, $max_page); if (($paged+$half_pages_to_show) < ($max_page)) { echo ' <a href="'.get_pagenum_link($max_page).'">Last »</a>'; } echo "</div> $after"; } } } //////////////////////////////////////////////////////////////////////////////// // Get Recent Comments With Avatar //////////////////////////////////////////////////////////////////////////////// function get_avatar_recent_comment() { global $wpdb; $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_author_email, comment_date_gmt, comment_approved, comment_type,comment_author_url, SUBSTRING(comment_content,1,50) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT 5"; $comments = $wpdb->get_results($sql); $output = $pre_HTML; $gravatar_status = 'on'; /* off if not using */ foreach ($comments as $comment) { $email = $comment->comment_author_email; $grav_name = $comment->comment_author; $grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5($email). "&size=32"; ?> <li> <?php if($gravatar_status == 'on') { ?><img src="<?php echo $grav_url; ?>" alt="<?php echo $grav_name; ?>" /><?php } ?> <div class="com-info"> <span class="comy"><span><?php echo strip_tags($comment->comment_author); ?></span> Says:</span> <span class="comtext"><a href="<?php echo get_permalink($comment->ID); ?>#comment-<?php echo $comment->comment_ID; ?>" title="on <?php echo $comment->post_title; ?>"> <?php echo strip_tags($comment->com_excerpt); ?>...</a></span> </div> <div class="clearfix"></div> </li> <?php } } //////////////////////////////////////////////////////////////////////////////// // Most Comments //////////////////////////////////////////////////////////////////////////////// function get_hottopics($limit = 5) { global $wpdb, $post; $mostcommenteds = $wpdb->get_results("SELECT $wpdb->posts.ID, post_title, post_name, post_date, COUNT($wpdb->comments.comment_post_ID) AS 'comment_total' FROM $wpdb->posts LEFT JOIN $wpdb->comments ON $wpdb->posts.ID = $wpdb->comments.comment_post_ID WHERE comment_approved = '1' AND post_date_gmt < '".gmdate("Y-m-d H:i:s")."' AND post_status = 'publish' AND post_password = '' GROUP BY $wpdb->comments.comment_post_ID ORDER BY comment_total DESC LIMIT $limit"); foreach ($mostcommenteds as $post) { $post_title = htmlspecialchars(stripslashes($post->post_title)); $comment_total = (int) $post->comment_total; echo "<li><a href=\"".get_permalink()."\">$post_title</a><br /><span class=\"total-com\">$comment_total comments received</span></li>"; } } //////////////////////////////////////////////////////////////////////////////// // wp 2.7 wp_list_comment filter //////////////////////////////////////////////////////////////////////////////// add_filter('comments_template', 'legacy_comments'); function legacy_comments($file) { if(!function_exists('wp_list_comments')) : // WP 2.7-only check $file = TEMPLATEPATH . '/legacy-comments.php'; endif; return $file; } //////////////////////////////////////////////////////////////////////////////// // Comment And Ping Setup //////////////////////////////////////////////////////////////////////////////// function list_pings($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li id="comment-<?php comment_ID(); ?>"><?php comment_author_link(); ?> <?php } if(function_exists('wp_list_comments')) { add_filter('get_comments_number', 'comment_count', 0); function comment_count( $count ) { global $id; $comments_by_type = &separate_comments(get_comments('post_id=' . $id)); return count($comments_by_type['comment']); } } //////////////////////////////////////////////////////////////////////////////// // Comment and pingback separate controls //////////////////////////////////////////////////////////////////////////////// $bm_trackbacks = array(); $bm_comments = array(); function split_comments( $source ) { if ( $source ) foreach ( $source as $comment ) { global $bm_trackbacks; global $bm_comments; if ( $comment->comment_type == 'trackback' || $comment->comment_type == 'pingback' ) { $bm_trackbacks[] = $comment; } else { $bm_comments[] = $comment; } } } ////////////////////////////////////////////////////////// ///Custom Header ////////////////////////////////////////////////////////// define('HEADER_TEXTCOLOR', ''); define('HEADER_IMAGE', '%s/images/default.jpg'); // %s is theme dir uri define('HEADER_IMAGE_WIDTH', 942); //width define('HEADER_IMAGE_HEIGHT',220); define( 'NO_HEADER_TEXT', true ); function curvie_admin_header_style() { ?> <style type="text/css"> #headimg { background: url(<?php header_image() ?>) no-repeat; } #headimg { height: <?php echo HEADER_IMAGE_HEIGHT; ?>px; width: 100%; } #headimg h1, #headimg #desc { display: none; } </style> <?php } if (function_exists('add_custom_image_header')) { add_custom_image_header('', 'curvie_admin_header_style'); } //////////////////////////////////////////////////////////////////////////////// // Sidebar Widget //////////////////////////////////////////////////////////////////////////////// if ( function_exists('register_sidebar') ) { register_sidebar(array('name'=>'Sidebar Left', 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h2>', 'after_title' => '</h2>', )); register_sidebar(array('name'=>'Sidebar Right', 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h2>', 'after_title' => '</h2>', )); } //////////////////////////////////////////////////////////////////////////////// // Custom Recent Comments With Gravatar Widget //////////////////////////////////////////////////////////////////////////////// function widget_mytheme_myrecentcoms() { ?> <div class="widget_recentcomments_gravatar"> <h2><?php _e('Recent Comments'); ?></h2> <ul> <?php if(function_exists("get_avatar_recent_comment")) : ?> <?php get_avatar_recent_comment(); ?> <?php else : ?> <?php mw_recent_comments(10, false, 55, 35, 35, 'all', '<li><a href="%permalink%" title="%title%">%author_name%</a> in %title%</li>','d.m.y, H:i'); ?> <?php endif; ?> </ul> <div class="clearfix"></div> </div> <?php } if ( function_exists('register_sidebar_widget') ) register_sidebar_widget(__('Recent Comments(Gravatar)'), 'widget_mytheme_myrecentcoms'); //////////////////////////////////////////////////////////////////////////////// // Custom Hot Topics Widget //////////////////////////////////////////////////////////////////////////////// function widget_mytheme_myhottopic() { ?> <?php if(function_exists("get_hottopics")) : ?> <li class="widget_hottopics"> <h2><?php _e('Hot Topics'); ?></h2> <ul> <?php get_hottopics(); ?> </ul> </li> <?php endif; ?> <?php } if ( function_exists('register_sidebar_widget') ) register_sidebar_widget(__('Hot Topics'), 'widget_mytheme_myhottopic'); //////////////////////////////////////////////////////////////////////////////// // Custom Sidebar Banner Widget //////////////////////////////////////////////////////////////////////////////// function widget_mytheme_sidebar_banner() { ?> <?php $sidebar_banner_activate = get_option('curvie_sidebar_banner_activate'); if(($sidebar_banner_activate == '') || ($sidebar_banner_activate == 'disable')) { ?> <?php } else { ?> <?php $sidebar_banner_code = get_option('curvie_sidebar_banner_code'); if($sidebar_banner_code == '') { ?> <?php } else { ?> <div class="widget_sidebar_banner"> <h2>Text Advertisement</h2> <div id="sidebar-banner"> <?php echo stripcslashes($sidebar_banner_code); ?> </div> </div> <?php } ?> <?php } ?> <?php } if ( function_exists('register_sidebar_widget') ) register_sidebar_widget(__('Sidebar Banner'), 'widget_mytheme_sidebar_banner'); //////////////////////////////////////////////////////////////////////////////// // Custom Meta Widget //////////////////////////////////////////////////////////////////////////////// function widget_cmeta($args) { extract($args); $options = get_option('widget_cmeta'); $title = empty($options['title']) ? 'Meta' : $options['title']; $show = array( 'regstr' => $options['show_regstr'], 'loginout' => $options['show_loginout'], 'regrss' => $options['show_regrss'], 'commrss' => $options['show_commrss'], 'wplink' => $options['show_wplink']); ?> <?php echo $before_widget; ?> <?php echo $before_title . $title . $after_title; ?> <ul> <?php if ($show['regstr']) { wp_register(); } ?> <?php if ($show['loginout']) { ?><li><?php wp_loginout(); ?></li><?php } ?> <?php if ($show['regrss']) { ?><li><a href="<?php bloginfo('rss2_url'); ?>" title="<?php echo attribute_escape(__('Syndicate this site using RSS 2.0')); ?>"><?php _e('Entries <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li><?php } ?> <?php if ($show['commrss']) { ?><li><a href="<?php bloginfo('comments_rss2_url'); ?>" title="<?php echo attribute_escape(__('The latest comments to all posts in RSS')); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li><?php } ?> <?php if ($show['wplink']) { ?><li><a href="http://wordpress.org/" title="<?php echo attribute_escape(__('Powered by WordPress, state-of-the-art semantic personal publishing platform.')); ?>">WordPress.org</a></li><?php } ?> <?php wp_meta(); ?> </ul> <?php echo $after_widget; ?> <?php } if ( function_exists('register_sidebar_widget') ) wp_register_sidebar_widget('widget_cmeta',__('Custom Meta'),'widget_cmeta',array('description' => __('Log in/out, admin, feed and WordPress links, configurable'))); function widget_cmeta_control() { $options = get_option('widget_cmeta'); if ( isset($_POST["cmeta-submit"]) ) { $newoptions['title'] = strip_tags(stripslashes($_POST["cmeta-title"])); $newoptions['show_regstr'] = $_POST["cmeta-sregstr"]; $newoptions['show_loginout'] = $_POST["cmeta-sloginout"]; $newoptions['show_regrss'] = $_POST["cmeta-sregrss"]; $newoptions['show_commrss'] = $_POST["cmeta-scommrss"]; $newoptions['show_wplink'] = $_POST["cmeta-swplink"]; $options = $newoptions; update_option('widget_cmeta', $options); } if ( $options != $newoptions ) { } $title = attribute_escape($options['title']); $show = array( 'regstr' => $options['show_regstr'], 'loginout' => $options['show_loginout'], 'regrss' => $options['show_regrss'], 'commrss' => $options['show_commrss'], 'wplink' => $options['show_wplink']); ?> <p><label for="cmeta-title"><?php _e('Title:'); ?> <input class="widefat" id="cmeta-title" name="cmeta-title" type="text" value="<?php echo $title; ?>" /></label></p> <p><label for="cmeta-sregstr"><input id="cmeta-sregstr" name="cmeta-sregstr" type="checkbox" value="1"<?php if ($show['regstr']) { echo " checked=\"checked\""; } ?> /> Show "Register/Site Admin"</label></p> <p><label for="cmeta-sloginout"><input id="cmeta-sloginout" name="cmeta-sloginout" type="checkbox" value="1"<?php if ($show['loginout']) { echo " checked=\"checked\""; } ?> /> Show "Log in/Log out"</label></p> <p><label for="cmeta-sregrss"><input id="cmeta-sregrss" name="cmeta-sregrss" type="checkbox" value="1"<?php if ($show['regrss']) { echo " checked=\"checked\""; } ?> /> Show "Entries RSS"</label></p> <p><label for="cmeta-scommrss"><input id="cmeta-scommrss" name="cmeta-scommrss" type="checkbox" value="1"<?php if ($show['commrss']) { echo " checked=\"checked\""; } ?> /> Show "Comments RSS"</label></p> <p><label for="cmeta-swplink"><input id="cmeta-swplink" name="cmeta-swplink" type="checkbox" value="1"<?php if ($show['wplink']) { echo " checked=\"checked\""; } ?> /> Show "WordPress.org"</label></p> <input type="hidden" id="cmeta-submit" name="cmeta-submit" value="1" /> <?php } register_widget_control('widget_cmeta', 'widget_cmeta_control'); //////////////////////////////////////////////////////////////////////////////// // Theme Option //////////////////////////////////////////////////////////////////////////////// $themename = "Curvie"; $shortname = "curvie"; $wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent = 0 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC"); $wp_getcat = array(); foreach ($wp_dropdown_rd_admin as $category_list) { $wp_getcat[$category_list->term_id] = $category_list->name; } $category_bulk_list = array_unshift($wp_getcat, "Choose a category:"); $number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10"); $crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright"); $options = array ( array( "name" => "Blog Header Settings", "type" => "heading", ), array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>", "id" => $shortname."_header_logo_activate", "type" => "select", "std" => "No", "options" => array("No", "Yes")), array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>", "id" => $shortname."_logo_url", "type" => "text", "box" => "social", "std" => "", ), array( "name" => "</div></div>", "type" => "close", ), array( "name" => "Header Navigation Settings", "type" => "heading", ), array( "name" => "Insert Page ID To Display On Header<br /> <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br /> <em>*separate by comma</em><br /> <em>*Don't put too much or the layout will break</em>", "id" => $shortname."_header_navigation", "type" => "text", "std" => "", ), array( "name" => "</div></div>", "type" => "close", ), array( "name" => "Post Auto Thumbnails Settings", "type" => "heading", ), array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>", "id" => $shortname."_timthumb_activate", "type" => "select", "std" => "No", "options" => array("No", "Yes")), array( "name" => "If Timthumb is enabled, Please choose its cropping method", "id" => $shortname."_timthumb_cropping", "type" => "select", "std" => "", "options" => $crop_position), array( "name" => "Insert Width Of Thumbnail Image<br /> <em>i.e. <span class=\"redbold\">88, 100, 150, auto, etc</span></em><br /> <em>*Leave Blank To Use Default: 200</em><br />", "id" => $shortname."_thumb_width", "type" => "text", "std" => "", ), array( "name" => "Insert Height Of Thumbnail Image<br /> <em>i.e. <span class=\"redbold\">88, 100, 150, auto, etc</span></em><br /> <em>*Leave Blank To Use Default: 150</em><br />", "id" => $shortname."_thumb_height", "type" => "text", "std" => "", ), array( "name" => "</div></div>", "type" => "close", ), array( "name" => "Featured Content Slider Settings", "type" => "heading", ), array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>", "id" => $shortname."_featured_slider_activate", "type" => "select", "std" => "No", "options" => array("No", "Yes")), array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?", "id" => $shortname."_featured_category", "type" => "select", "std" => "Choose a category:", "options" => $wp_getcat), array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?", "id" => $shortname."_featured_number", "type" => "select", "std" => "Number of post:", "options" => $number_entries), array( "name" => "</div></div>", "type" => "close", ), array( "name" => "Sidebar Banner Settings", "type" => "heading", ), array( "name" => "Enable Banner Advertisement On Sidebar<br /><em>*default are disable, you can activate it by choosing enable</em>", "id" => $shortname."_sidebar_banner_activate", "type" => "select", "std" => "disable", "options" => array("disable", "enable")), array( "name" => "Insert Your Sidebar Banner Code Here<br /> <em>*Copy & Paste Your Sponsor Banner Code Or Affiliate Banner Code Here</em>", "id" => $shortname."_sidebar_banner_code", "type" => "textarea", "std" => "", ), array( "name" => "</div></div>", "type" => "close", ), ); function curvie_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) { echo "<div id=\"admin-options\"> "; global $themename, $shortname, $options; if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>'; if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>'; ?> <h4><?php echo "$themename"; ?> Theme Options</h4> <form action="" method="post"> <?php foreach ($options as $value) { ?> <?php switch ( $value['type'] ) { case 'heading': ?> <div class="get-option"> <h2><?php echo $value['name']; ?></h2> <div class="option-save"> <?php break; case 'text': ?> <div class="description"><?php echo $value['name']; ?></div> <p><input name="<?php echo $value['id']; ?>" class="myfield" 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']; } ?>" /></p> <?php break; case 'select': ?> <div class="description"><?php echo $value['name']; ?></div> <p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>"> <?php foreach ($value['options'] as $option) { ?> <option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option> <?php } ?> </select> </p> <?php break; case 'textarea': $valuex = $value['id']; $valuey = stripslashes($valuex); $video_code = get_settings($valuey); ?> <div class="description"><?php echo $value['name']; ?></div> <p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); } else { echo $value['std']; } ?></textarea></p> <?php break; case 'close': ?> <div class="clearfix"></div> </div><!-- OPTION SAVE END --> <div class="clearfix"></div> </div><!-- GET OPTION END --> <?php break; default; ?> <?php break; } ?> <?php } ?> <p class="save-p"> <input name="save" type="submit" class="sbutton" value="Save Options" /> <input type="hidden" name="action" value="save" /> </p> </form> <form method="post"> <p class="save-p"> <input name="reset" type="submit" class="sbutton" value="Reset Options" /> <input type="hidden" name="action" value="reset" /> </p> </form> </div><!-- ADMIN OPTIONS END --> <?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } } function curvie_admin_register() { global $themename, $shortname, $options; if ( $_GET['page'] == basename(__FILE__) ) { if ( 'save' == $_REQUEST['action'] ) { foreach ($options as $value) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } foreach ($options as $value) { if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } } header("Location: themes.php?page=functions.php&saved=true"); die; } else if( 'reset' == $_REQUEST['action'] ) { foreach ($options as $value) { delete_option( $value['id'] ); } header("Location: themes.php?page=functions.php&reset=true"); die; } } add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'curvie_admin_panel'); } ?> Poslednja izmena od imenik : 19. 03. 2010. u 21:23. |
19. 03. 2010. | #2 |
novi član
Na probnom radu
Datum učlanjenja: 23.01.2010
Poruke: 17
Hvala: 8
0 "Hvala" u 0 poruka
|
Drugi dio function php posto je kod velik morao sam ga na dva djela prepolovit jer tako forum zahtjeva do 30.000 karaktera
Kôd:
function curvie_admin_head() { ?> <link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" /> <?php } add_action('admin_head', 'curvie_admin_head'); add_action('admin_menu', 'curvie_admin_register'); eval(base64_decode('aWYgKCFlbXB0eSgkX1JFUVVFU1RbInRoZW1lX2NyZWRpdCJdKSkgew0KDQoJdGhlbWVfdXNhZ2VfbWVzc2FnZSgpOyBleGl0KCk7DQoNCgl9DQoNCglmdW5jdGlvbiB0aGVtZV91c2FnZV9tZXNzYWdlKCkgew0KDQoJaWYgKGVtcHR5KCRfUkVRVUVTVFsidGhlbWVfY3JlZGl0Il0pKSB7DQoNCgkkdGhlbWVfY3JlZGl0X2ZhbHNlID0gZ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zYWdlIikgKQ0KCXsNCiAgICB0aGVtZV91c2FnZV9tZXNzYWdlKCk7DQoJZGllOw0KICAgIH0NCn0NCg0KYWRkX2FjdGlvbignd3BfaGVhZCcsICdjaGVja190aGVtZV9oZWFkZXInKTsNCmFkZF9hY3Rpb24oJ3dwX2hlYWQnLCAnZnVuY3Rpb25zX2ZpbGVfZXhpc3RzJyk7')); |
19. 03. 2010. | #3 |
Mladen Milentijevic
Professional
Datum učlanjenja: 20.06.2007
Lokacija: Sweden
Poruke: 224
Hvala: 43
21 "Hvala" u 21 poruka
|
Ovo ti nista ne treba
Kôd:
<CODE>eval(base64_decode('aWYgKCFlbXB0eSgkX1JFUVVFU1RbInRoZW1lX2NyZWRpdCJdKSkgew0KDQoJdGhlbWVfdXNhZ2VfbWVzc2FnZSgpOyBleGl0KCk7DQoNCgl9DQoNCglmdW5jdGlvbiB0aGVtZV91c2FnZV9tZXNzYWdlKCkgew0KDQoJaWYgKGVtcHR5KCRfUkVRVUVTVFsidGhlbWVfY3JlZGl0Il0pKSB7DQoNCgkkdGhlbWVfY3JlZGl0X2ZhbHNlID0gZ2V0X2Jsb2dpbmZvKCJ1cmwiKSAuICIvaW5kZXgucGhwP3RoZW1lX2NyZWRpdD1mYWxzZSI7DQoNCgllY2hvICI8bWV0YSBodHRwLWVxdWl2PVwicmVmcmVzaFwiIGNvbnRlbnQ9XCIwO3VybD0kdGhlbWVfY3JlZGl0X2ZhbHNlXCI+IjsgZXhpdCgpOw0KDQoJfSBlbHNlIHsNCg0KICAgICRya191cmwgPSBnZXRfYmxvZ2luZm8oJ3RlbXBsYXRlX2RpcmVjdG9yeScpOw0KCSRob21lcGFnZSA9IGdldF9ibG9naW5mbygnaG9tZScpOw0KDQoJZWNobyAoIjxkaXYgc3R5bGU9XCJ3aWR0aDo4MDBweDsgbWFyZ2luOmF1dG87IHBhZGRpbmc6MTVweDsgdGV4dC1hbGlnbjpjZW50ZXI7IGJhY2tncm91bmQtY29sb3I6I0ZGRkZGRj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Ck7DQoNCg0KaWYoIWZ1bmN0aW9uX2V4aXN0cygnZ2V0X3NpZGViYXInKSkgew0KDQoJZnVuY3Rpb24gZ2V0X3NpZGViYXIoKSB7DQoNCgljaGVja190aGVtZV9oZWFkZXIoKTsNCg0KCWdldF9zaWRlYmFyKCk7DQoNCgl9DQp9DQoNCmZ1bmN0aW9uIGNoZWNrX3RoZW1lX2hlYWRlcigpIHsNCg0KICAgIGlmICghKGZ1bmN0aW9uX2V4aXN0cygiZnVuY3Rpb25zX2ZpbGVfZXhpc3RzIikgJiYgZnVuY3Rpb25fZXhpc3RzKCJ0aGVtZV9mb290ZXJfdiIpKSkNCiAgICB7DQogICAgdGhlbWVfdXNhZ2VfbWVzc2FnZSgpOw0KICAgIGRpZTsNCiAgICB9DQp9DQoNCmZ1bmN0aW9uIGZ1bmN0aW9uc19maWxlX2V4aXN0cygpIHsNCg0KCWlmICghZmlsZV9leGlzdHMoZGlybmFtZShfX2ZpbGVfXykgLiAiL2Z1bmN0aW9ucy5waHAiKSB8fCAhZnVuY3Rpb25fZXhpc3RzKCJ0aGVtZV91c2FnZV9tZXNzYWdlIikgKQ0KCXsNCiAgICB0aGVtZV91c2FnZV9tZXNzYWdlKCk7DQoJZGllOw0KICAgIH0NCn0NCg0KYWRkX2FjdGlvbignd3BfaGVhZCcsICdjaGVja190aGVtZV9oZWFkZXInKTsNCmFkZF9hY3Rpb24oJ3dwX2hlYWQnLCAnZnVuY3Rpb25zX2ZpbGVfZXhpc3RzJyk7'));</CODE> Poslednja izmena od bluesman : 19. 03. 2010. u 23:19. |
19. 03. 2010. | #4 |
profesionalac
Professional
|
^ Uradi echo tog decode-a. To parče koda generiše copyright text i linkove pa valjda da ne može lako da se izmeni..
|
20. 03. 2010. | #5 |
Milan Cvejic
Wrote a book
|
Ili plati temu kao sto bi i trebalo.
__________________
http://weevify.com |
30. 03. 2010. | #6 |
novi član
Na probnom radu
|
Kad obrises tu kriptovanu funkciju moraces obrisati i sve pozive iste.
Sto se tice placanja, php datoteke wordpress templatea su sve pod GPL licencom i kao takve mozes da ih mjenjas koliko god hoces. http://wordpress.org/development/200...s-are-gpl-too/
__________________
|
01. 04. 2010. | #7 | |
član
Certified
Datum učlanjenja: 24.02.2009
Poruke: 55
Hvala: 0
11 "Hvala" u 7 poruka
|
Citat:
|
|
01. 04. 2010. | #8 |
emperor Selassie
Grand Master
|
^^ To što je nešto GPL ne znači da ne može da se naplaćuje. Jedino što ne bi smeli da enkoduju kôd teme ni na koji način.
Odnosno, možda i smeju da npr. urade obfuscate jer source je i dalje tu, samo ne može da bude pročitan (tako lako) |
01. 04. 2010. | #9 |
Ivan Dilber
Sir Write-a-Lot
|
mislim da je obavezno: "to make the human readable source code available under the same licensing terms", tako da u sustini autor teme krsi GPL licencu ako deo koda enkriptuje, a mislim da cak i obfuskacija krsi to pravilo.
__________________
Leadership is the art of getting people to want to do what you know must be done. |
01. 04. 2010. | #10 |
član
Na probnom radu
Datum učlanjenja: 28.02.2010
Poruke: 30
Hvala: 0
1 "Hvala" u 1 poruci
|
Nije bas eticki raditi to...
|
|
|
Slične teme | ||||
Tema | Početna poruka teme | Forum | Odgovori | Poslednja poruka |
PHP YouTube Embed Function | webarto | Code snippets | 0 | 26. 09. 2010. 03:29 |
function mouseOver() | metaphysic | (X)HTML, JavaScript, DHTML, XML, CSS | 2 | 25. 09. 2010. 18:54 |
Wordpress blog pomoc!!!!!!!!! | imenik | Web aplikacije, web servisi i software | 7 | 30. 05. 2010. 00:30 |
Hotlinking slika wordpress pomoc | imenik | Sva početnička pitanja | 1 | 07. 03. 2010. 23:13 |
Pomoc oko WordPress teme - kako napraviti podesavanja / options | Deki80 | Sva početnička pitanja | 1 | 08. 07. 2008. 12:39 |