-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunctions.php
More file actions
executable file
·623 lines (536 loc) · 21.4 KB
/
Copy pathfunctions.php
File metadata and controls
executable file
·623 lines (536 loc) · 21.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
<?php
/* load theme options */
function get_options_by_cat()
{
global $wp_query;
$cat_obj = $wp_query->get_queried_object();
$thisCat = $cat_obj->term_id;
$options_ = get_option('scapegoat_category_options');
$options = get_option('scapegoat_theme_options');
if(!is_home() && !is_front_page() || is_paged()) {
$cat_data = get_the_category();
$cat_data = (array) $cat_data[0];
if(!isset($cat_data["term_id"]))
$cat_data = (array)get_category($thisCat);
while(isset($cat_data["term_id"]) && $cat_data["term_id"] != null && $cat_data["term_id"] != "") {
if(isset($options_[$cat_data["term_id"]]))
{
$options = $options_[$cat_data["term_id"]];
$options["opt_id"] = $cat_data["term_id"];
break;
}elseif(isset($options_[$cat_data["parent"]]))
{
$options = $options_[$cat_data["parent"]];
$options["opt_id"] = $cat_data["parent"];
break;
}elseif(isset($cat_data["parent"]))
{
$cat_data = (array)get_category($cat_data["parent"]);
}
}
}
return $options;
}
/* Mobile Detect */
include 'functions/mobile_detect.php';
/* localization */
load_theme_textdomain('scapegoat', TEMPLATEPATH .'/languages');
/* add "editor-style.css" for the admin-interface */
add_editor_style();
function similar_articles($id)
{
$id = (int) $id;
if($id > 0)
{
$tags = wp_get_post_tags($id);
if ($tags) {
$args=array(
'tag_in' => array($tags),
'post_not_in' => array($post->ID),
'showposts' => 5,
'ignore_sticky_posts' => 1
);
$my_query = new WP_Query($args);
return $my_query;
}
}
else
{
return false;
}
}
/* add a favicon for the admin area */
function favicon4admin() {
echo '<link rel="Shortcut Icon" type="image/x-icon" href="' . get_bloginfo('template_directory') . '/favicon.ico" />';
}
add_action( 'admin_head', 'favicon4admin' );
/* load "login.css" for the login */
function custom_login() {
echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo('template_directory') . '/login.css" />';
}
add_action('login_head', 'custom_login');
/* add custom theme-options */
require_once ( get_stylesheet_directory() . '/theme-options.php' );
/* add twitter and wiki profile */
function add_twitter_contactmethod( $contactmethods ) {
/* Add Twitter */
$contactmethods['twitter'] = __('Twitter (without @)','scapegoat');
/* Add Wiki */
$contactmethods['wiki'] = __('Wiki (Username)','scapegoat');
return $contactmethods;
}
add_filter('user_contactmethods','add_twitter_contactmethod',10,1);
/* Allowing Html in user-description */
remove_filter('pre_user_description', 'wp_filter_kses');
add_filter( 'pre_user_description', 'wp_filter_post_kses' );
/* Block WordPress Filters */
$filters = array('pre_term_description', 'pre_link_description', 'pre_link_notes', 'pre_user_description');
foreach ( $filters as $filter ) {
remove_filter($filter, 'wp_filter_kses');
}
foreach ( array( 'term_description' ) as $filter ) {
remove_filter( $filter, 'wp_kses_data' );
}
/* register post formats */
add_theme_support (
'post-formats',
array (
'status'
)
);
/* add custom image-sizes */
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support('post-thumbnails');
add_image_size('featured', 1140, 320, true);
add_image_size('teaser', 840, 560, true);
}
/* register all menus */
add_action( 'init', 'register_my_menus' );
function register_my_menus() {
register_nav_menus(
array(
'header' => __('Header','scapegoat'),
'footer' => __('Footer','scapegoat')
)
);
}
function fallback_menu() {
wp_page_menu(
array(
'show_home' => __('Start','scapegoat')
)
);
}
/* add css class for li with submenu */
class My_Walker_SubNav_Menu extends Walker_Nav_Menu {
public function display_element($el, &$children, $max_depth, $depth = 0, $args, &$output) {
$id = $this->db_fields['id'];
if(isset($children[$el->$id])) $el->classes[] = 'has-children';
parent::display_element($el, $children, $max_depth, $depth, $args, $output);
}
}
/*
* Add accesskey for menu elements only in the top menu.
* You can change or set accesskeys for menu elements in the XFN-field in the menu editor.
*/
class My_Walker_Nav_Menu extends My_Walker_SubNav_Menu {
function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
global $wp_query;
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
$class_names = $value = '';
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
$classes[] = 'menu-item-' . $item->ID;
$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
$class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';
$id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
$id = $id ? ' id="' . esc_attr( $id ) . '"' : '';
$output .= $indent . '<li' . $id . $value . $class_names .'>';
$attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';
$attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
$attributes .= ! empty( $item->xfn ) ? ' accesskey="' . esc_attr( $item->xfn ) .'"' : '';
$attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';
// First applying the filters. After that, underline the accesskey in the title if present...
$item_title = apply_filters( 'the_title', $item->title, $item->ID );
if( ! empty( $item->xfn ) ) {
$letterpos = strpos($item_title, esc_attr( $item->xfn ) );
$item_title = substr($item_title, 0, $letterpos)."<u>".substr($item_title, $letterpos, 1)."</u>".substr($item_title, $letterpos+1);
}
$item_output = $args->before;
$item_output .= '<a'. $attributes .'>';
$item_output .= $args->link_before . $item_title . $args->link_after;
$item_output .= '</a>';
$item_output .= $args->after;
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
}
}
/* register sidebars */
add_action( 'widgets_init', 'my_register_sidebars' );
function my_register_sidebars() {
register_sidebar(
array(
'id'=>'main-sidebar',
'name'=>__('Main-Sidebar','scapegoat'),
'description' => __('The default sidebar.','scapegoat'),
'before_widget' => '<aside id="%1$s" class="widget widget-sidebar %2$s" role="group"><div class="widget-inner">',
'after_widget' => '</div></aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
)
);
register_sidebar(
array(
'id'=>'footer-sidebar',
'name'=>__('Footer-Sidebar','scapegoat'),
'description' => __('Widgets for the Footer-section.','scapegoat'),
'before_widget' => '<aside id="%1$s" class="widget widget-footer %2$s" role="group"><div class="widget-inner">',
'after_widget' => '</div></aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
)
);
$options = get_option('scapegoat_category_options');
foreach($options as $id => $option)
{
register_sidebar(
array(
'id'=>'main-'.$id.'-sidebar',
'name'=>__('Main-'.$id.'-Sidebar','scapegoat'),
'description' => __('The default sidebar for pages with category-id '.$id.'.','scapegoat'),
'before_widget' => '<aside id="%1$s" class="widget widget-sidebar %2$s" role="group"><div class="widget-inner">',
'after_widget' => '</div></aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
)
);
}
}
/* Add support for custom headers */
define('NO_HEADER_TEXT', true );
define('HEADER_IMAGE', '%s/images/default_header.jpg');
define('HEADER_IMAGE_WIDTH', 1140);
define('HEADER_IMAGE_HEIGHT', 320);
register_default_headers(array(
'ruins' => array(
'url' => '%s/images/default_header.jpg',
'thumbnail_url' => '%s/images/default_header.jpg',
'description' => __('Default', 'scapegoat')
)
));
function header_style() {
?><style type="text/css">
.custom-header {
background: url(<?php header_image(); ?>) center top;
background-size: auto 100%;
}
</style><?php
}
function admin_header_style() {
?><style type="text/css">
#headimg {
width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
background: no-repeat;
}
.default-header label img {
width: 360px;
height: auto;
}
</style><?php
}
add_custom_image_header('header_style', 'admin_header_style');
/* add custom caption-function */
function custom_caption($attr, $content = null) {
// New-style shortcode with the caption inside the shortcode with the link and image tags.
if ( ! isset( $attr['caption'] ) ) {
if ( preg_match( '#((?:<a [^>]+>\s*)?<img [^>]+>(?:\s*</a>)?)(.*)#is', $content, $matches ) ) {
$content = $matches[1];
$attr['caption'] = trim( $matches[2] );
}
}
$output = apply_filters('img_caption_shortcode', '', $attr, $content);
if ( $output != '' )
return $output;
extract(shortcode_atts(array(
'id' => '',
'align' => 'alignnone',
'width' => '',
'caption' => ''
), $attr));
if ( 1 > (int) $width || empty($caption) )
return $content;
if ( $id ) $id = 'id="' . esc_attr($id) . '" ';
return '<figure '. $id .'class="wp-caption '. $align .'" style="width: '. ($width) .'px">'. do_shortcode($content) .'<span class="wp-caption-text">'. $caption .'</span></figure>';
}
add_shortcode('wp_caption', 'custom_caption');
add_shortcode('caption', 'custom_caption');
/* custom excerpt */
function custom_wp_trim_excerpt($text) {
$raw_excerpt = $text;
if ( '' == $text ) {
/* Retrieve the post content */
$text = get_the_content('');
/* Delete all shortcode tags from the content */
$text = strip_shortcodes( $text );
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]>', $text);
/* MODIFY THIS. Add the allowed HTML tags separated by a comma */
$allowed_tags = '<p>,<h1>,<h2>,<h3>,<h4>,<h5>,<h6>,<blockquote>,<pre>,<code>,<hr />,<br>,<br />';
$text = strip_tags($text, $allowed_tags);
/* MODIFY THIS. change the excerpt word count to any integer you like */
$excerpt_word_count = 60;
$excerpt_length = apply_filters('excerpt_length', $excerpt_word_count);
/* MODIFY THIS. change the excerpt endind to something else */
$excerpt_end = '... <a href="'. get_permalink($post->ID) . '">' . __("more","scapegoat") .' →</a>';
$excerpt_more = apply_filters('excerpt_more', ' ' . $excerpt_end);
$words = preg_split("/[\n\r\t ]+/", $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY);
if ( count($words) > $excerpt_length ) {
array_pop($words);
$text = implode(' ', $words);
$text = $text . $excerpt_more;
} else {
$text = implode(' ', $words);
}
}
return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);
}
remove_filter('get_the_excerpt', 'wp_trim_excerpt');
add_filter('get_the_excerpt', 'custom_wp_trim_excerpt');
/* pagination */
function wp_pagination_navi($num_page_links = 5, $min_max_offset = 2){
global $wp_query;
/* Do not show paging on single pages */
if( !is_single() ){
$current_page = intval(get_query_var('paged'));
$total_pages = $wp_query->max_num_pages;
$left_offset = floor(($num_page_links - 1) / 2);
$right_offset = ceil(($num_page_links -1) / 2);
if( empty($current_page) || $current_page == 0 ) {
$current_page = 1;
}
// More than one page -> render pagination
if ( $total_pages > 1 ) {
echo '<div class="data" data-pages="'.$total_pages.'" data-page_now="'.$current_page.'"></div><nav class="pagination_navi">';
if ( $current_page > 1 ) {
echo '<a href="' .get_pagenum_link($current_page-1) .'" title="previous">«</a>';
}
for ( $i = 1; $i <= $total_pages; $i++) {
if ( $i == $current_page ){
// Current page
echo '<a href="'.get_pagenum_link($current_page).'" class="current-page" title="page '.$i.'" >'.($current_page).'</a>';
} else {
// Pages before and after the current page
if ( ($i >= ($current_page - $left_offset)) && ($i <= ($current_page + $right_offset)) ){
echo '<a href="'.get_pagenum_link($i).'" title="page '.$i.'" >'.$i.'</a>';
} elseif ( ($i <= $min_max_offset) || ($i > ($total_pages - $min_max_offset)) ) {
// Start and end pages with min_max_offset
echo '<a href="'.get_pagenum_link($i).'" title="page '.$i.'" >'.$i.'</a>';
} elseif ( (($i == ($min_max_offset + 1)) && ($i < ($current_page - $left_offset + 1))) ||
(($i == ($total_pages - $min_max_offset)) && ($i > ($current_page + $right_offset ))) ) {
// Dots after/before min_max_offset
echo '<span class="dots">...</span>';
}
}
}
if ( $current_page != $total_pages ) {
echo '<a href="'.get_pagenum_link($current_page+1).'" title="next">»</a>';
}
echo '</nav>'; //Close pagination
}
}
}
/* submenu */
function submenu() {
global $post;
if(!is_home()) {
if ($post->post_parent) {
$ancestors=get_post_ancestors($post->ID);
$root=count($ancestors)-1;
$parent = $ancestors[$root];
} else {
$parent = $post->ID;
}
$children = wp_list_pages("title_li=&child_of=". $parent ."&echo=0");
if ($children) { ?>
<aside class="widget widget-sidebar widget_pages">
<div class="widget-inner">
<h3 class="widget-title"><?php _e('Submenu','scapegoat'); ?></h3>
<ul id="subnavi">
<?php echo $children; ?>
</ul>
</div>
</aside>
<?php }
}
}
/* breadcrumb */
function breadcrumb() {
$delimiter = '<span class="breadcrumb-seperator">»</span>';
$home = __('Start','scapegoat');
$before = '<span class="breadcrumb-item">';
$after = '</span>';
if(!is_home() && !is_front_page() || is_paged()) {
echo '<nav id="breadcrumb">';
global $post;
$homeLink = get_bloginfo('url');
echo '<a href="' . $homeLink . '">' . $home . '</a> ' . $delimiter . ' ';
if ( is_category() ) {
global $wp_query;
$cat_obj = $wp_query->get_queried_object();
$thisCat = $cat_obj->term_id;
$thisCat = get_category($thisCat);
$parentCat = get_category($thisCat->parent);
if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ' ' . $delimiter . ' '));
echo $before . single_cat_title('', false) . $after;
} elseif ( is_day() ) {
echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $delimiter . ' ';
echo '<a href="' . get_month_link(get_the_time('Y'),get_the_time('m')) . '">' . get_the_time('F') . '</a> ' . $delimiter . ' ';
echo $before . get_the_time('d') . $after;
} elseif ( is_month() ) {
echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $delimiter . ' ';
echo $before . get_the_time('F') . $after;
} elseif ( is_year() ) {
echo $before . get_the_time('Y') . $after;
} elseif ( is_single() && !is_attachment() ) {
if ( get_post_type() != 'post' ) {
$post_type = get_post_type_object(get_post_type());
$slug = $post_type->rewrite;
echo '<a href="' . $homeLink . '/' . $slug['slug'] . '/">' . $post_type->labels->singular_name . '</a> ' . $delimiter . ' ';
echo $before . get_the_title() . $after;
} else {
$cat = get_the_category(); $cat = $cat[0];
echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
echo $before . get_the_title() . $after;
}
} elseif ( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() ) {
$post_type = get_post_type_object(get_post_type());
echo $before . $post_type->labels->singular_name . $after;
} elseif ( is_attachment() ) {
$parent = get_post($post->post_parent);
$cat = get_the_category($parent->ID); $cat = $cat[0];
echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
echo '<a href="' . get_permalink($parent) . '">' . $parent->post_title . '</a> ' . $delimiter . ' ';
echo $before . get_the_title() . $after;
} elseif ( is_page() && !$post->post_parent ) {
echo $before . get_the_title() . $after;
} elseif ( is_page() && $post->post_parent ) {
$parent_id = $post->post_parent;
$breadcrumbs = array();
while ($parent_id) {
$page = get_page($parent_id);
$breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>';
$parent_id = $page->post_parent;
}
$breadcrumbs = array_reverse($breadcrumbs);
foreach ($breadcrumbs as $crumb) echo $crumb . ' ' . $delimiter . ' ';
echo $before . get_the_title() . $after;
} elseif ( is_search() ) {
echo $before . __('Search','scapegoat') . ' "' . get_search_query() . '"' . $after;
} elseif ( is_tag() ) {
echo $before . __('Tag','scapegoat') . ' "' . single_tag_title('', false) . '"' . $after;
} elseif ( is_author() ) {
global $author;
$userdata = get_userdata($author);
echo $before . __('Author','scapegoat') . ' "' . $userdata->display_name . '"' . $after;
} elseif ( is_404() ) {
echo $before . __('404','scapegoat') . $after;
}
if ( get_query_var('paged') ) {
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ' (';
echo __('Page','scapegoat') . ' ' . get_query_var('paged');
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ')';
}
echo '</nav>';
}
}
/* widget specially for images */
class banner extends WP_Widget {
function banner() {
parent::__construct(
'banner',
__('Banner','scapegoat'),
array(
'description' => __('A simple Widget for Images.','scapegoat')
)
);
}
function widget($args, $instance) {
extract($args);
$title = apply_filters('widget_title', $instance['title']);
echo $before_widget;
if ($title)
echo $before_title . $title . $after_title;
if ($instance['picture'] && $instance['link']) { ?>
<a href="<?php echo $instance['link']; ?>">
<img style="width:100%;display:block;" src="<?php echo $instance['picture']; ?>">
</a>
<?php } elseif ($instance['picture']) { ?>
<img style="width:100%;display:block;" src="<?php echo $instance['picture']; ?>">
<?php }
echo $after_widget;
}
function update($new_instance, $old_instance) {
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['picture'] = strip_tags($new_instance['picture']);
$instance['link'] = strip_tags($new_instance['link']);
return $instance;
}
function form($instance) {
$title = esc_attr($instance['title']); ?>
<p>
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:','scapegoat'); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" />
</p>
<?php $picture = attribute_escape($instance['picture']); ?>
<p>
<label for="<?php echo $this->get_field_id('picture'); ?>"><?php _e('Image url:','scapegoat') ?></label>
<input class="widefat" id="<?php echo $this->get_field_id('picture'); ?>" name="<?php echo $this->get_field_name('picture'); ?>" type="text" value="<?php echo $picture ?>" />
</p>
<?php $link = attribute_escape($instance['link']); ?>
<p>
<label for="<?php echo $this->get_field_id('link'); ?>"><?php _e('Link url:','scapegoat') ?></label>
<input class="widefat" id="<?php echo $this->get_field_id('link'); ?>" name="<?php echo $this->get_field_name('link'); ?>" type="text" value="<?php echo $link ?>" />
</p>
<?php
}
}
add_action('widgets_init', create_function('', 'return register_widget("banner");'));
/* custom comment-list */
function custom_comment($comment, $args, $depth) {
global $comment_counter;
if ($comment->comment_parent < 1) {
$comment_counter ++;
}
$GLOBALS['comment'] = $comment;
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
<?php if ($comment->comment_parent < 1) {echo '<span class="comment-number">' . $comment_counter . '</span>';} ?>
<div id="comment-<?php comment_ID(); ?>" class="comment-body">
<div class="comment-info">
<div class="comment-author vcard">
<!--<?php echo get_avatar( $comment->comment_author_email, 48 ); ?>-->
<cite class="fn">
<?php printf(__('%s','scapegoat'), get_comment_author_link()) ?>
</cite>
</div>
<div class="comment-meta commentmetadata">
<a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ) ?>">
<?php printf(__('%1$s'), get_comment_date('d.m.Y')) ?>
</a>
<span class="reply">
<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
</span>
<?php /* edit_comment_link(__('(Edit)'),' ','') */ ?>
</div>
</div><!--comment-info-->
<div class="comment-text">
<?php if ($comment->comment_approved == '0') : ?>
<span class="unlock"><?php _e('Your comment will be public soon.','scapegoat') ?></span>
<br />
<?php endif; ?>
<?php comment_text() ?>
</div><!--comment-text-->
</div><!--comment-body-->
<?php
}
?>