'2010 Summary - whole year of blogging summarized', 'pl'=>'2010 Summary - podsumowanie całego roku blogowania' ); $y2010summary_trans[2]=array( 'en'=>'This plugin generates a brief summary of your blog for year 2010.', 'pl'=>'Ten plugin generuje krótkie podsumowanie blogowania w roku 2010.' ); $y2010summary_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.' ); $y2010summary_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.' ); $y2010summary_trans[5]=array( 'en'=>'Summary of 2010', 'pl'=>'Podsumowanie roku 2010' ); $y2010summary_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 ' ); $y2010summary_trans[7]=array( 'en'=>'edit it', 'pl'=>'edytować' ); $y2010summary_trans[8]=array( 'en'=>'and then publish.', 'pl'=>'a następnie opublikować.' ); $y2010summary_trans[9]=array( 'en'=>'Regenerate summary', 'pl'=>'Wygeneruj ponownie' ); $y2010summary_trans[10]=array( 'en'=>'Generate summary', 'pl'=>'Wygeneruj podsumowanie' ); $y2010summary_trans[11]=array( 'en'=>'Questions? Suggestions? Mail me: wpsummary@topa.pl or @tomasztopa. You can also check out my blog at www.tomasz.topa.pl', 'pl'=>'Pytania? Sugestie? Napisz na wpsummary@topa.pl lub skontaktuj się na Twitterze @tomasztopa. Zapraszam również na mojego bloga www.tomasz.topa.pl' ); $y2010summary_trans[12]=array( 'en'=>'comments', 'pl'=>'komentarzy' ); $y2010summary_trans[13]=array( 'en'=>'posts', 'pl'=>'wpisów' ); $y2010summary_trans[14]=array( 'en'=>'In 2010 you wrote %s posts and added %s pages to this blog, with %s attachments in total.', 'pl'=>'W 2010 napisałeś %s wpisów oraz dodałeś %s podstron do tego bloga. W sumie zawierały %s załączników.' ); $y2010summary_trans[15]=array( 'en'=>'The number of posts in each month', 'pl'=>'Liczba postów w poszczególnych miesiącach' ); $y2010summary_trans[16]=array( 'en'=>'The number of posts in each day of week', 'pl'=>'Liczba postów w poszczególnych dniach tygodnia' ); $y2010summary_trans[17]=array( 'en'=>'At what hours you publish new posts', 'pl'=>'Godziny o których publikowałeś nowe wpisy' ); $y2010summary_trans[18]=array( 'en'=>'In 2010 your posts were commented %s times, from which %s comments (%s percent) were written by registered users/authors.', 'pl'=>'W 2010 roku Twoje posty zostały skomentowane %s razy, w tym %s komentarzy (%s procent) zostało napisanych przez zarejestrowanych użytkowników/autorów.' ); $y2010summary_trans[19]=array( 'en'=>'TOP 10 commenters in 2010', 'pl'=>'TOP 10 komentujących w 2010' ); $y2010summary_trans[20]=array( 'en'=>'TOP 10 most commented posts in 2010', 'pl'=>'TOP 10 najczęściej komentowanych wpisów w 2010' ); $y2010summary_trans[21]=array( 'en'=>'The number of comments in each month', 'pl'=>'Liczba komentarzy w poszczególnych miesiącach' ); $y2010summary_trans[22]=array( 'en'=>'On what days people comment', 'pl'=>'Dni w które czytelnicy najczęściej komentują' ); $y2010summary_trans[23]=array( 'en'=>'At what hours people comment', 'pl'=>'O których godzinach czytelnicy komentują' ); $y2010summary_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:' ); $y2010summary_trans[25]=array( 'en'=>'And the number of comments each one wrote:', 'pl'=>'Liczba komentarzy napisanych przez każdego z autorów:' ); $y2010summary_trans[26]=array( 'en'=>'Summary generated by 2010 Summary plugin by Tomasz Topa', 'pl'=>'Zestawienie wygenerowane przez wtyczkę 2010 Summary, którą przygotował Tomasz Topa.' ); $y2010summary_trans[27]=array( 'en'=>'Create a new blog post with this summary', 'pl'=>'Stwórz nowy wpis z tym podsumowaniem' ); $y2010summary_trans[28]=array( 'en'=>'2010 Summary', 'pl'=>'Podsumowanie roku 2010' ); $y2010summary_trans[29]=array( 'en'=>array('your','you','

 

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

 

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

'.$y2010summary_trans[1][$y2010summary_lang].'

'.$y2010summary_trans[2][$y2010summary_lang].'

'.$y2010summary_trans[3][$y2010summary_lang].'

'.$y2010summary_trans[4][$y2010summary_lang].'

'; if($_POST['y2010summary_generate']==TRUE){ y2010summary_generate(); } elseif($_POST['y2010summary_draft']==TRUE){ $my_post = array( 'post_title' => $y2010summary_trans[5][$y2010summary_lang], 'post_content' => base64_decode($_POST['y2010summary_draftcontent']), 'post_status' => 'draft', 'post_author' => $user_ID, ); // Insert the post into the database $postid=wp_insert_post( $my_post ); echo '

 

'.$y2010summary_trans[6][$y2010summary_lang].' '.$y2010summary_trans[7][$y2010summary_lang].' '.$y2010summary_trans[8][$y2010summary_lang].'

'; echo'

 

 

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

 

 


'.$y2010summary_trans[11][$y2010summary_lang].'

'; echo '
'; } function y2010summary_generate(){ global $wpdb,$y2010summary_trans,$y2010summary_lang,$y2010summary_translations; $y2010summary_noposts = $wpdb->get_row("SELECT count($wpdb->posts.ID) as howmany FROM $wpdb->posts WHERE year(post_date)=2010 and post_type='post' and post_status='publish'"); $y2010summary_nopages = $wpdb->get_row("SELECT count($wpdb->posts.ID) as howmany FROM $wpdb->posts WHERE year(post_date)=2010 and post_type='page' and post_status='publish'"); $y2010summary_noattach = $wpdb->get_row("SELECT count($wpdb->posts.ID) as howmany FROM $wpdb->posts WHERE year(post_date)=2010 and $wpdb->posts.post_type='attachment'"); $y2010summary_noauthors = $wpdb->get_row("SELECT count($wpdb->users.ID) as howmany FROM $wpdb->users"); $y2010summary_nocomm = $wpdb->get_row("SELECT count($wpdb->comments.comment_ID) as howmany FROM $wpdb->comments WHERE year($wpdb->comments.comment_date)=2010 and $wpdb->comments.comment_type!='trackback' and $wpdb->comments.comment_approved=1"); $y2010summary_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)=2010 and $wpdb->comments.comment_type!='trackback' and $wpdb->comments.comment_approved=1 and $wpdb->comments.user_id>0 group by $wpdb->comments.user_id"); $y2010summary_nocommr = $wpdb->get_row("SELECT count($wpdb->comments.comment_ID) as howmany FROM $wpdb->comments WHERE year($wpdb->comments.comment_date)=2010 and comment_type!='trackback' and $wpdb->comments.user_id>0 and $wpdb->comments.comment_approved=1"); $y2010summary_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)=2010 and $wpdb->posts.post_type='post' group by postmonth order by postmonth asc"); $y2010summary_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)=2010 and $wpdb->posts.post_type='post' group by posthour order by posthour asc"); $y2010summary_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)=2010 and $wpdb->posts.post_type='post' group by postday order by postday2 asc"); $y2010summary_postsbyauthors = $wpdb->get_results("SELECT count($wpdb->posts.ID) as howmany, $wpdb->posts.post_author FROM $wpdb->posts WHERE year(post_date)=2010 and $wpdb->posts.post_type='post' group by $wpdb->posts.post_author order by howmany desc"); $y2010summary_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)=2010 and $wpdb->posts.post_type='post' order by comment_count desc limit 10"); $y2010summary_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)=2010 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"); $y2010summary_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)=2010 and comment_type!='trackback' and $wpdb->comments.comment_approved=1 group by commentday order by commentday2 asc"); $y2010summary_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)=2010 and comment_type!='trackback' and $wpdb->comments.comment_approved=1 group by commentmonth order by commentmonth asc"); $y2010summary_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)=2010 and comment_type!='trackback' and $wpdb->comments.comment_approved=1 group by commenthour order by commenthour asc"); foreach ($y2010summary_commenters as $y2010summary_commenter) { $y2010summary_commentdata.='
  • '.$y2010summary_commenter->comment_author.': '.$y2010summary_commenter->howmany.' '.$y2010summary_trans[12][$y2010summary_lang].'
  • '; } foreach ($y2010summary_months as $y2010summary_month) { $y2010summary_monthdata.=''.__(date("F",mktime(0,0,0,$y2010summary_month->postmonth,1,2010))).':
      '.$y2010summary_month->howmany.' ('.round($y2010summary_month->howmany/$y2010summary_noposts->howmany*100,2).'%)'; } foreach ($y2010summary_commentmonths as $y2010summary_commentmonth) { $y2010summary_commentmonthdata.=''.__(date("F",mktime(0,0,0,$y2010summary_commentmonth->commentmonth,1,2010))).':
      '.$y2010summary_commentmonth->howmany.' ('.round($y2010summary_commentmonth->howmany/$y2010summary_nocomm->howmany*100,2).'%)'; } foreach ($y2010summary_hours as $y2010summary_hour) { $y2010summary_hourdata.=''.$y2010summary_hour->posthour.':
      '.$y2010summary_hour->howmany.' ('.round($y2010summary_hour->howmany/$y2010summary_noposts->howmany*100,2).'%)'; } foreach ($y2010summary_commenthours as $y2010summary_commenthour) { $y2010summary_commenthourdata.=''.$y2010summary_commenthour->commenthour.':
      '.$y2010summary_commenthour->howmany.' ('.round($y2010summary_commenthour->howmany/$y2010summary_nocomm->howmany*100,2).'%)'; } foreach ($y2010summary_days as $y2010summary_day) { $y2010summary_daydata.=''.__($y2010summary_day->postday).':
      '.$y2010summary_day->howmany.' ('.round($y2010summary_day->howmany/$y2010summary_noposts->howmany*100,2).'%)'; } foreach ($y2010summary_commentsday as $y2010summary_commentday) { $y2010summary_commentdaydata.=''.__($y2010summary_commentday->commentday).':
      '.$y2010summary_commentday->howmany.' ('.round($y2010summary_commentday->howmany/$y2010summary_nocomm->howmany*100,2).'%)'; } foreach ($y2010summary_topcom as $y2010summary_post) { $y2010summary_postdata.='
  • '.$y2010summary_post->post_title.': '.$y2010summary_post->comment_count.' '.$y2010summary_trans[12][$y2010summary_lang].'
  • '; } foreach ($y2010summary_postsbyauthors as $y2010summary_author) { $y2010summary_authorprofile=get_userdata($y2010summary_author->post_author); $y2010summary_authordata.='
  • '.$y2010summary_authorprofile->display_name.': '.$y2010summary_author->howmany.' '.$y2010summary_trans[13][$y2010summary_lang].'
  • '; } foreach ($y2010summary_commbyauthors as $y2010summary_commauthor) { $y2010summary_authorprofile2=get_userdata($y2010summary_commauthor->user_id); $y2010summary_commauthordata.='
  • '.$y2010summary_authorprofile2->display_name.': '.$y2010summary_commauthor->howmany.' '.$y2010summary_trans[12][$y2010summary_lang].'
  • '; } $y2010summary_text.='

    '.sprintf($y2010summary_trans[14][$y2010summary_lang],$y2010summary_noposts->howmany,$y2010summary_nopages->howmany,$y2010summary_noattach->howmany).'

     

    '.$y2010summary_trans[15][$y2010summary_lang].':

    '.$y2010summary_monthdata.'

     

    '.$y2010summary_trans[16][$y2010summary_lang].':

    '.$y2010summary_daydata.'

    '.$y2010summary_trans[17][$y2010summary_lang].':

    '.$y2010summary_hourdata.'

     

    '.sprintf($y2010summary_trans[18][$y2010summary_lang],$y2010summary_nocomm->howmany,$y2010summary_nocommr->howmany,round($y2010summary_nocommr->howmany/$y2010summary_nocomm->howmany*100,2)).'

     

    '.$y2010summary_trans[19][$y2010summary_lang].':

     

    '.$y2010summary_trans[20][$y2010summary_lang].':

     

    '.$y2010summary_trans[21][$y2010summary_lang].':

    '.$y2010summary_commentmonthdata.'

     

    '.$y2010summary_trans[22][$y2010summary_lang].':

    '.$y2010summary_commentdaydata.'

    '.$y2010summary_trans[23][$y2010summary_lang].':

    '.$y2010summary_commenthourdata.'
    '; if($y2010summary_noauthors->howmany>1){ $y2010summary_text.='

    '.$y2010summary_trans[24][$y2010summary_lang].'

     

    '.$y2010summary_trans[25][$y2010summary_lang].'

     

    '; } $y2010summary_draft=base64_encode(str_replace($y2010summary_trans[29][$y2010summary_lang],$y2010summary_trans[30][$y2010summary_lang],$y2010summary_text).'

    '.$y2010summary_trans[26][$y2010summary_lang].'

    '); echo '

     

     

    '.$y2010summary_trans[28][$y2010summary_lang].'

     

    '; echo $y2010summary_text; echo '
    '; echo '

     

    '; } ?>