'2012 Summary - whole year of blogging summarized', 'pl'=>'2012 Summary - podsumowanie całego roku blogowania' ); $y2012summary_trans[2]=array( 'en'=>'This plugin generates a brief summary of your blog for year 2012.', 'pl'=>'Ten plugin generuje krótkie podsumowanie blogowania w roku 2012.' ); $y2012summary_trans[3]=array( 'en'=>'See how many posts you wrote durig the ending year, which were the most popular, who was the most active commenter etc.', 'pl'=>'Zobacz ile napisałeś postów, które były najczęściej komentowane, kto był najbardziej aktywnym czytelnikiem w mijającym roku itp.' ); $y2012summary_trans[4]=array( 'en'=>'And then share the stats with your readers - copy the data to a new draft with a single click.', 'pl'=>'Następnie podziel się statystykami ze swoimi czytelnikami - skopiuj statystyki do nowego wpisu przy pomocy jednego kliknięcia.' ); $y2012summary_trans[5]=array( 'en'=>'Summary of 2012', 'pl'=>'Podsumowanie roku 2012' ); $y2012summary_trans[6]=array( 'en'=>'A draft of the new post has been created. You can now ', 'pl'=>'Szkic nowego wpisu został stworzony.. Możesz go teraz ' ); $y2012summary_trans[7]=array( 'en'=>'edit it', 'pl'=>'edytować' ); $y2012summary_trans[8]=array( 'en'=>'and then publish.', 'pl'=>'a następnie opublikować.' ); $y2012summary_trans[9]=array( 'en'=>'Regenerate summary', 'pl'=>'Wygeneruj ponownie' ); $y2012summary_trans[10]=array( 'en'=>'Generate summary', 'pl'=>'Wygeneruj podsumowanie' ); $y2012summary_trans[11]=array( 'en'=>'Questions? Mail me: blog@lioman.de or @lioman. You can also check out my blog at www.lioman.de', 'pl'=>'Questions? Mail me: blog@lioman.de or @lioman. You can also check out my blog at www.lioman.de' ); $y2012summary_trans[12]=array( 'en'=>'comments', 'pl'=>'komentarzy' ); $y2012summary_trans[13]=array( 'en'=>'posts', 'pl'=>'wpisów' ); $y2012summary_trans[14]=array( 'en'=>'In 2012 you wrote %s posts and added %s pages to this blog, with %s attachments in total.', 'pl'=>'W 2012 napisałeś %s wpisów oraz dodałeś %s podstron do tego bloga. W sumie zawierały %s załączników.' ); $y2012summary_trans[15]=array( 'en'=>'The number of posts in each month', 'pl'=>'Liczba postów w poszczególnych miesiącach' ); $y2012summary_trans[16]=array( 'en'=>'The number of posts in each day of week', 'pl'=>'Liczba postów w poszczególnych dniach tygodnia' ); $y2012summary_trans[17]=array( 'en'=>'At what hours you publish new posts', 'pl'=>'Godziny o których publikowałeś nowe wpisy' ); $y2012summary_trans[18]=array( 'en'=>'In 2012 your posts were commented %s times, from which %s comments (%s percent) were written by registered users/authors.', 'pl'=>'W 2012 roku Twoje posty zostały skomentowane %s razy, w tym %s komentarzy (%s procent) zostało napisanych przez zarejestrowanych użytkowników/autorów.' ); $y2012summary_trans[19]=array( 'en'=>'TOP 10 commenters in 2012', 'pl'=>'TOP 10 komentujących w 2012' ); $y2012summary_trans[20]=array( 'en'=>'TOP 10 most commented posts in 2012', 'pl'=>'TOP 10 najczęściej komentowanych wpisów w 2012' ); $y2012summary_trans[21]=array( 'en'=>'The number of comments in each month', 'pl'=>'Liczba komentarzy w poszczególnych miesiącach' ); $y2012summary_trans[22]=array( 'en'=>'On what days people comment', 'pl'=>'Dni w które czytelnicy najczęściej komentują' ); $y2012summary_trans[23]=array( 'en'=>'At what hours people comment', 'pl'=>'O których godzinach czytelnicy komentują' ); $y2012summary_trans[24]=array( 'en'=>'This blog has many authors. Here is the number of posts each one wrote:', 'pl'=>'Na tym blogu jest wielu autorów. Oto liczba wpisów opublikowanych przez każdego z nich:' ); $y2012summary_trans[25]=array( 'en'=>'And the number of comments each one wrote:', 'pl'=>'Liczba komentarzy napisanych przez każdego z autorów:' ); $y2012summary_trans[26]=array( 'en'=>'Summary generated by 2012 Summary plugin', 'pl'=>'Zestawienie wygenerowane przez wtyczkę 2012 Summary.' ); $y2012summary_trans[27]=array( 'en'=>'Create a new blog post with this summary', 'pl'=>'Stwórz nowy wpis z tym podsumowaniem' ); $y2012summary_trans[28]=array( 'en'=>'2012 Summary', 'pl'=>'Podsumowanie roku 2012' ); $y2012summary_trans[29]=array( 'en'=>array('your','you','

 

'), 'pl'=>array('napisałeś','dodałeś','publikowałeś','

 

','Twoje') ); $y2012summary_trans[30]=array( 'en'=>array('the','I',''), 'pl'=>array('napisałem','dodałem','publikowałem','','Moje') ); function y2012summary_menu_add() { add_submenu_page('index.php', '2012 Summary', '2012 Summary', 'read', 'y2012summary', 'y2012summary'); } function y2012summary() { global $y2012summary_trans,$y2012summary_lang,$y2012summary_translations; if (!current_user_can('read')) { wp_die( __('You do not have sufficient permissions to access this page.') ); } echo '

'.$y2012summary_trans[1][$y2012summary_lang].'

'.$y2012summary_trans[2][$y2012summary_lang].'

'.$y2012summary_trans[3][$y2012summary_lang].'

'.$y2012summary_trans[4][$y2012summary_lang].'

'; if($_POST['y2012summary_generate']==TRUE){ y2012summary_generate(); } elseif($_POST['y2012summary_draft']==TRUE){ $my_post = array( 'post_title' => $y2012summary_trans[5][$y2012summary_lang], 'post_content' => base64_decode($_POST['y2012summary_draftcontent']), 'post_status' => 'draft', 'post_author' => $user_ID, ); // Insert the post into the database $postid=wp_insert_post( $my_post ); echo '

 

'.$y2012summary_trans[6][$y2012summary_lang].' '.$y2012summary_trans[7][$y2012summary_lang].' '.$y2012summary_trans[8][$y2012summary_lang].'

'; echo'

 

 

'; } else { echo '
'; } echo '

 

 


'.$y2012summary_trans[11][$y2012summary_lang].'

'; echo '
'; } function y2012summary_generate(){ global $wpdb,$y2012summary_trans,$y2012summary_lang,$y2012summary_translations; $y2012summary_noposts = $wpdb->get_row("SELECT count($wpdb->posts.ID) as howmany FROM $wpdb->posts WHERE year(post_date)=2012 and post_type='post' and post_status='publish'"); $y2012summary_nopages = $wpdb->get_row("SELECT count($wpdb->posts.ID) as howmany FROM $wpdb->posts WHERE year(post_date)=2012 and post_type='page' and post_status='publish'"); $y2012summary_noattach = $wpdb->get_row("SELECT count($wpdb->posts.ID) as howmany FROM $wpdb->posts WHERE year(post_date)=2012 and $wpdb->posts.post_type='attachment'"); $y2012summary_noauthors = $wpdb->get_row("SELECT count($wpdb->users.ID) as howmany FROM $wpdb->users"); $y2012summary_nocomm = $wpdb->get_row("SELECT count($wpdb->comments.comment_ID) as howmany FROM $wpdb->comments WHERE year($wpdb->comments.comment_date)=2012 and $wpdb->comments.comment_type!='trackback' and $wpdb->comments.comment_approved=1"); $y2012summary_commbyauthors = $wpdb->get_results("SELECT count($wpdb->comments.comment_ID) as howmany, $wpdb->comments.user_id FROM $wpdb->comments WHERE year($wpdb->comments.comment_date)=2012 and $wpdb->comments.comment_type!='trackback' and $wpdb->comments.comment_approved=1 and $wpdb->comments.user_id>0 group by $wpdb->comments.user_id"); $y2012summary_nocommr = $wpdb->get_row("SELECT count($wpdb->comments.comment_ID) as howmany FROM $wpdb->comments WHERE year($wpdb->comments.comment_date)=2012 and comment_type!='trackback' and $wpdb->comments.user_id>0 and $wpdb->comments.comment_approved=1"); $y2012summary_months = $wpdb->get_results("SELECT count($wpdb->posts.ID) as howmany, month($wpdb->posts.post_date) as postmonth FROM $wpdb->posts WHERE year(post_date)=2012 and $wpdb->posts.post_type='post' group by postmonth order by postmonth asc"); $y2012summary_hours = $wpdb->get_results("SELECT count($wpdb->posts.ID) as howmany, hour($wpdb->posts.post_date) as posthour FROM $wpdb->posts WHERE year(post_date)=2012 and $wpdb->posts.post_type='post' group by posthour order by posthour asc"); $y2012summary_days = $wpdb->get_results("SELECT count($wpdb->posts.ID) as howmany, dayname($wpdb->posts.post_date) as postday, dayofweek($wpdb->posts.post_date) as postday2 FROM $wpdb->posts WHERE year(post_date)=2012 and $wpdb->posts.post_type='post' group by postday order by postday2 asc"); $y2012summary_postsbyauthors = $wpdb->get_results("SELECT count($wpdb->posts.ID) as howmany, $wpdb->posts.post_author FROM $wpdb->posts WHERE year(post_date)=2012 and $wpdb->posts.post_type='post' group by $wpdb->posts.post_author order by howmany desc"); $y2012summary_topcom = $wpdb->get_results("SELECT $wpdb->posts.comment_count, $wpdb->posts.post_title, $wpdb->posts.ID FROM $wpdb->posts WHERE year($wpdb->posts.post_date)=2012 and $wpdb->posts.post_type='post' order by comment_count desc limit 10"); $y2012summary_commenters = $wpdb->get_results("SELECT count($wpdb->comments.comment_ID) as howmany,$wpdb->comments.comment_author FROM $wpdb->comments WHERE year($wpdb->comments.comment_date)=2012 and comment_type!='trackback' and $wpdb->comments.comment_approved=1 and user_id=0 group by $wpdb->comments.comment_author order by howmany desc limit 10"); $y2012summary_commentsday = $wpdb->get_results("SELECT count($wpdb->comments.comment_ID) as howmany, dayname($wpdb->comments.comment_date) as commentday, dayofweek($wpdb->comments.comment_date) as commentday2 FROM $wpdb->comments WHERE year($wpdb->comments.comment_date)=2012 and comment_type!='trackback' and $wpdb->comments.comment_approved=1 group by commentday order by commentday2 asc"); $y2012summary_commentmonths = $wpdb->get_results("SELECT count($wpdb->comments.comment_ID) as howmany, month($wpdb->comments.comment_date) as commentmonth FROM $wpdb->comments WHERE year($wpdb->comments.comment_date)=2012 and comment_type!='trackback' and $wpdb->comments.comment_approved=1 group by commentmonth order by commentmonth asc"); $y2012summary_commenthours = $wpdb->get_results("SELECT count($wpdb->comments.comment_ID) as howmany, hour($wpdb->comments.comment_date) as commenthour FROM $wpdb->comments WHERE year($wpdb->comments.comment_date)=2012 and comment_type!='trackback' and $wpdb->comments.comment_approved=1 group by commenthour order by commenthour asc"); foreach ($y2012summary_commenters as $y2012summary_commenter) { $y2012summary_commentdata.='
  • '.$y2012summary_commenter->comment_author.': '.$y2012summary_commenter->howmany.' '.$y2012summary_trans[12][$y2012summary_lang].'
  • '; } foreach ($y2012summary_months as $y2012summary_month) { $y2012summary_monthdata.=''.__(date("F",mktime(0,0,0,$y2012summary_month->postmonth,1,2012))).':
      '.$y2012summary_month->howmany.' ('.round($y2012summary_month->howmany/$y2012summary_noposts->howmany*100,2).'%)'; } foreach ($y2012summary_commentmonths as $y2012summary_commentmonth) { $y2012summary_commentmonthdata.=''.__(date("F",mktime(0,0,0,$y2012summary_commentmonth->commentmonth,1,2012))).':
      '.$y2012summary_commentmonth->howmany.' ('.round($y2012summary_commentmonth->howmany/$y2012summary_nocomm->howmany*100,2).'%)'; } foreach ($y2012summary_hours as $y2012summary_hour) { $y2012summary_hourdata.=''.$y2012summary_hour->posthour.':
      '.$y2012summary_hour->howmany.' ('.round($y2012summary_hour->howmany/$y2012summary_noposts->howmany*100,2).'%)'; } foreach ($y2012summary_commenthours as $y2012summary_commenthour) { $y2012summary_commenthourdata.=''.$y2012summary_commenthour->commenthour.':
      '.$y2012summary_commenthour->howmany.' ('.round($y2012summary_commenthour->howmany/$y2012summary_nocomm->howmany*100,2).'%)'; } foreach ($y2012summary_days as $y2012summary_day) { $y2012summary_daydata.=''.__($y2012summary_day->postday).':
      '.$y2012summary_day->howmany.' ('.round($y2012summary_day->howmany/$y2012summary_noposts->howmany*100,2).'%)'; } foreach ($y2012summary_commentsday as $y2012summary_commentday) { $y2012summary_commentdaydata.=''.__($y2012summary_commentday->commentday).':
      '.$y2012summary_commentday->howmany.' ('.round($y2012summary_commentday->howmany/$y2012summary_nocomm->howmany*100,2).'%)'; } foreach ($y2012summary_topcom as $y2012summary_post) { $y2012summary_postdata.='
  • '.$y2012summary_post->post_title.': '.$y2012summary_post->comment_count.' '.$y2012summary_trans[12][$y2012summary_lang].'
  • '; } foreach ($y2012summary_postsbyauthors as $y2012summary_author) { $y2012summary_authorprofile=get_userdata($y2012summary_author->post_author); $y2012summary_authordata.='
  • '.$y2012summary_authorprofile->display_name.': '.$y2012summary_author->howmany.' '.$y2012summary_trans[13][$y2012summary_lang].'
  • '; } foreach ($y2012summary_commbyauthors as $y2012summary_commauthor) { $y2012summary_authorprofile2=get_userdata($y2012summary_commauthor->user_id); $y2012summary_commauthordata.='
  • '.$y2012summary_authorprofile2->display_name.': '.$y2012summary_commauthor->howmany.' '.$y2012summary_trans[12][$y2012summary_lang].'
  • '; } $y2012summary_text.='

    '.sprintf($y2012summary_trans[14][$y2012summary_lang],$y2012summary_noposts->howmany,$y2012summary_nopages->howmany,$y2012summary_noattach->howmany).'

     

    '.$y2012summary_trans[15][$y2012summary_lang].':

    '.$y2012summary_monthdata.'

     

    '.$y2012summary_trans[16][$y2012summary_lang].':

    '.$y2012summary_daydata.'

    '.$y2012summary_trans[17][$y2012summary_lang].':

    '.$y2012summary_hourdata.'

     

    '.sprintf($y2012summary_trans[18][$y2012summary_lang],$y2012summary_nocomm->howmany,$y2012summary_nocommr->howmany,round($y2012summary_nocommr->howmany/$y2012summary_nocomm->howmany*100,2)).'

     

    '.$y2012summary_trans[19][$y2012summary_lang].':

     

    '.$y2012summary_trans[20][$y2012summary_lang].':

     

    '.$y2012summary_trans[21][$y2012summary_lang].':

    '.$y2012summary_commentmonthdata.'

     

    '.$y2012summary_trans[22][$y2012summary_lang].':

    '.$y2012summary_commentdaydata.'

    '.$y2012summary_trans[23][$y2012summary_lang].':

    '.$y2012summary_commenthourdata.'
    '; if($y2012summary_noauthors->howmany>1){ $y2012summary_text.='

    '.$y2012summary_trans[24][$y2012summary_lang].'

     

    '.$y2012summary_trans[25][$y2012summary_lang].'

     

    '; } $y2012summary_draft=base64_encode(str_replace($y2012summary_trans[29][$y2012summary_lang],$y2012summary_trans[30][$y2012summary_lang],$y2012summary_text).'

    '.$y2012summary_trans[26][$y2012summary_lang].'

    '); echo '

     

     

    '.$y2012summary_trans[28][$y2012summary_lang].'

     

    '; echo $y2012summary_text; echo '
    '; echo '

     

    '; } ?>