Plugin Directory

Changeset 2462200


Ignore:
Timestamp:
01/25/2021 11:59:24 AM (5 years ago)
Author:
frier
Message:

2021-01-25 update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • books-papers/trunk/classes/functions/bridge-replace_pub_updated.php

    r2458777 r2462200  
    2323    $id = "0";
    2424    $sort = "null";
     25    $btitle = "null";
    2526    foreach($options as $opt){
    2627        $sub = substr($opt, 0, 4);
     
    3738        } else if ($sub == 'sort'){
    3839            $sort = substr($opt, 5);
     40        } else if (substr($opt, 0, 6) == 'btitle'){
     41            $btitle = substr($opt, 7);
    3942        } else if (substr($opt, 0, 2) == 'id'){
    4043            $id = substr($opt, 3);
     
    9194            }
    9295            if($ids!=""){
    93                 foreach($wpdb->get_results("SELECT *" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbConferenceAuthor . " where conference_id=" . $this->dbConferences . ".id limit 1) as author" : "") . " FROM " . $this->dbConferences . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT article_id FROM " . $this->dbConferenceTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " AND `id` IN (" . $ids . ") ORDER BY $orderBy " . get_option('bnpp_list_order')) as $ar)
     96                foreach($wpdb->get_results("SELECT *" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbConferenceAuthor . " where conference_id=" . $this->dbConferences . ".id limit 1) as author" : "") . " FROM " . $this->dbConferences . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($btitle != "null" ? " AND book_title='" . $btitle . "'": "") . ($tag != "null" ? " AND id IN (SELECT conference_id FROM " . $this->dbConferenceTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " AND `id` IN (" . $ids . ") ORDER BY $orderBy " . get_option('bnpp_list_order')) as $ar)
    9497                {
    9598                    $result_temp .= $this->fillConferenceElement($ar);
     
    109112            }
    110113            if($ids!=""){
    111                 foreach($wpdb->get_results("SELECT *" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbBookAuthor . " where book_id=" . $this->dbBooks . ".id limit 1) as author" : "") . " FROM " . $this->dbBooks . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT article_id FROM " . $this->dbBookTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " AND `id` IN (" . $ids . ") ORDER BY $orderBy " . get_option('bnpp_list_order')) as $ar)
     114                foreach($wpdb->get_results("SELECT *" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbBookAuthor . " where book_id=" . $this->dbBooks . ".id limit 1) as author" : "") . " FROM " . $this->dbBooks . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT book_id FROM " . $this->dbBookTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " AND `id` IN (" . $ids . ") ORDER BY $orderBy " . get_option('bnpp_list_order')) as $ar)
    112115                {
    113116                    $result_temp .= $this->fillBookElement($ar);
     
    144147            }
    145148            foreach($wpdb->get_results("(SELECT id, title, year, pages, doi, url, issn, supplementary, file_link, date, is_public, char1, char2, char3, arxiv, 'ar' as type" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbArticleAuthor . " where article_id=" . $this->dbArticles . ".id limit 1) as author" : "") . " FROM " . $this->dbArticles . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT article_id FROM " . $this->dbArticleTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " AND `id` IN (" . $ids_a . "))
    146             UNION (SELECT id, title, year, pages, doi, url, issn, supplementary, file_link, date, is_public, char1, char2, char3, arxiv, 'co' as type" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbConferenceAuthor . " where conference_id=" . $this->dbConferences . ".id limit 1) as author" : "") . " FROM " . $this->dbConferences . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT article_id FROM " . $this->dbConferenceTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " AND `id` IN (" . $ids_c . "))
    147             UNION (SELECT id, title, year, pages, doi, url, issn, supplementary, file_link, date, is_public, char1, char2, char3, arxiv, 'bo' as type" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbBookAuthor . " where book_id=" . $this->dbBooks . ".id limit 1) as author" : "") . " FROM " . $this->dbBooks . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT article_id FROM " . $this->dbBookTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " AND `id` IN (" . $ids_b . ")) ORDER BY $orderBy " . get_option('bnpp_list_order')) as $pub)
     149            UNION (SELECT id, title, year, pages, doi, url, issn, supplementary, file_link, date, is_public, char1, char2, char3, arxiv, 'co' as type" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbConferenceAuthor . " where conference_id=" . $this->dbConferences . ".id limit 1) as author" : "") . " FROM " . $this->dbConferences . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($btitle != "null" ? " AND book_title='" . $btitle . "'": "") . ($tag != "null" ? " AND id IN (SELECT conference_id FROM " . $this->dbConferenceTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " AND `id` IN (" . $ids_c . "))
     150            UNION (SELECT id, title, year, pages, doi, url, issn, supplementary, file_link, date, is_public, char1, char2, char3, arxiv, 'bo' as type" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbBookAuthor . " where book_id=" . $this->dbBooks . ".id limit 1) as author" : "") . " FROM " . $this->dbBooks . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT book_id FROM " . $this->dbBookTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " AND `id` IN (" . $ids_b . ")) ORDER BY $orderBy " . get_option('bnpp_list_order')) as $pub)
    148151            {
    149152                $result_temp .= $this->fillMixedElement($pub);
     
    182185            }
    183186            if($ids!=""){
    184                 foreach($wpdb->get_results("SELECT *" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbConferenceAuthor . " where conference_id=" . $this->dbConferences . ".id limit 1) as author" : "") . " FROM " . $this->dbConferences . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT article_id FROM " . $this->dbConferenceTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " AND `id` IN (" . $ids . ") ORDER BY $orderBy " . get_option('bnpp_list_order')) as $ar)
     187                foreach($wpdb->get_results("SELECT *" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbConferenceAuthor . " where conference_id=" . $this->dbConferences . ".id limit 1) as author" : "") . " FROM " . $this->dbConferences . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($btitle != "null" ? " AND book_title='" . $btitle . "'": "") . ($tag != "null" ? " AND id IN (SELECT conference_id FROM " . $this->dbConferenceTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " AND `id` IN (" . $ids . ") ORDER BY $orderBy " . get_option('bnpp_list_order')) as $ar)
    185188                {
    186189                    $result_temp .= $this->fillConferenceElement($ar);
     
    201204            }
    202205            if($ids!=""){
    203                 foreach($wpdb->get_results("SELECT *" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbBookAuthor . " where book_id=" . $this->dbBooks . ".id limit 1) as author" : "") . " FROM " . $this->dbBooks . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT article_id FROM " . $this->dbBookTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " AND `id` IN (" . $ids . ") ORDER BY $orderBy " . get_option('bnpp_list_order')) as $ar)
     206                foreach($wpdb->get_results("SELECT *" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbBookAuthor . " where book_id=" . $this->dbBooks . ".id limit 1) as author" : "") . " FROM " . $this->dbBooks . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT book_id FROM " . $this->dbBookTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " AND `id` IN (" . $ids . ") ORDER BY $orderBy " . get_option('bnpp_list_order')) as $ar)
    204207                {
    205208                    $result_temp .= $this->fillBookElement($ar);
     
    238241            }
    239242            $result_temp = "";
    240             foreach($wpdb->get_results("SELECT *" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbConferenceAuthor . " where conference_id=" . $this->dbConferences . ".id limit 1) as author" : "") . " FROM " . $this->dbConferences . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT article_id FROM " . $this->dbConferenceTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " ORDER BY $orderBy " . get_option('bnpp_list_order')) as $ar)
     243            foreach($wpdb->get_results("SELECT *" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbConferenceAuthor . " where conference_id=" . $this->dbConferences . ".id limit 1) as author" : "") . " FROM " . $this->dbConferences . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($btitle != "null" ? " AND book_title='" . $btitle . "'": "") . ($tag != "null" ? " AND id IN (SELECT conference_id FROM " . $this->dbConferenceTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " ORDER BY $orderBy " . get_option('bnpp_list_order')) as $ar)
    241244            {
    242245                $result_temp .= $this->fillConferenceElement($ar);
     
    246249            }
    247250            $result_temp = "";
    248             foreach($wpdb->get_results("SELECT *" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbBookAuthor . " where book_id=" . $this->dbBooks . ".id limit 1) as author" : "") . " FROM " . $this->dbBooks . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT article_id FROM " . $this->dbBookTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " ORDER BY $orderBy " . get_option('bnpp_list_order')) as $ar)
     251            foreach($wpdb->get_results("SELECT *" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbBookAuthor . " where book_id=" . $this->dbBooks . ".id limit 1) as author" : "") . " FROM " . $this->dbBooks . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT book_id FROM " . $this->dbBookTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " ORDER BY $orderBy " . get_option('bnpp_list_order')) as $ar)
    249252            {
    250253                $result_temp .= $this->fillBookElement($ar);
     
    256259            $result_temp = "";
    257260            foreach($wpdb->get_results("(SELECT id, title, year, pages, doi, url, issn, supplementary, file_link, date, is_public, char1, char2, char3, arxiv, 'ar' as type" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbArticleAuthor . " where article_id=" . $this->dbArticles . ".id limit 1) as author" : "") . " FROM " . $this->dbArticles . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT article_id FROM " . $this->dbArticleTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . ") 
    258             UNION (SELECT id, title, year, pages, doi, url, issn, supplementary, file_link, date, is_public, char1, char2, char3, arxiv, 'co' as type" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbConferenceAuthor . " where conference_id=" . $this->dbConferences . ".id limit 1) as author" : "") . " FROM " . $this->dbConferences . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT article_id FROM " . $this->dbConferenceTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . ")
    259             UNION (SELECT id, title, year, pages, doi, url, issn, supplementary, file_link, date, is_public, char1, char2, char3, arxiv, 'bo' as type" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbBookAuthor . " where book_id=" . $this->dbBooks . ".id limit 1) as author" : "") . " FROM " . $this->dbBooks . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT article_id FROM " . $this->dbBookTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . ") ORDER BY $orderBy " . get_option('bnpp_list_order')) as $pub)
     261            UNION (SELECT id, title, year, pages, doi, url, issn, supplementary, file_link, date, is_public, char1, char2, char3, arxiv, 'co' as type" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbConferenceAuthor . " where conference_id=" . $this->dbConferences . ".id limit 1) as author" : "") . " FROM " . $this->dbConferences . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($btitle != "null" ? " AND book_title='" . $btitle . "'": "") . ($tag != "null" ? " AND id IN (SELECT conference_id FROM " . $this->dbConferenceTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . ")
     262            UNION (SELECT id, title, year, pages, doi, url, issn, supplementary, file_link, date, is_public, char1, char2, char3, arxiv, 'bo' as type" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbBookAuthor . " where book_id=" . $this->dbBooks . ".id limit 1) as author" : "") . " FROM " . $this->dbBooks . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT book_id FROM " . $this->dbBookTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . ") ORDER BY $orderBy " . get_option('bnpp_list_order')) as $pub)
    260263            {
    261264                $result_temp .= $this->fillMixedElement($pub);
     
    275278        } else if ($subj == "conferences") {
    276279            $result_temp = "";
    277             foreach($wpdb->get_results("SELECT *" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbConferenceAuthor . " where conference_id=" . $this->dbConferences . ".id limit 1) as author" : "") . " FROM " . $this->dbConferences . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT article_id FROM " . $this->dbConferenceTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " ORDER BY $orderBy " . get_option('bnpp_list_order')) as $ar)
     280            foreach($wpdb->get_results("SELECT *" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbConferenceAuthor . " where conference_id=" . $this->dbConferences . ".id limit 1) as author" : "") . " FROM " . $this->dbConferences . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($btitle != "null" ? " AND book_title='" . $btitle . "'": "") . ($tag != "null" ? " AND id IN (SELECT conference_id FROM " . $this->dbConferenceTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " ORDER BY $orderBy " . get_option('bnpp_list_order')) as $ar)
    278281            {
    279282                $result_temp .= $this->fillConferenceElement($ar);
     
    284287        } else if ($subj == "books") {
    285288            $result_temp = "";
    286             foreach($wpdb->get_results("SELECT *" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbBookAuthor . " where book_id=" . $this->dbBooks . ".id limit 1) as author" : "") . " FROM " . $this->dbBooks . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT article_id FROM " . $this->dbBookTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " ORDER BY $orderBy " . get_option('bnpp_list_order')) as $ar)
     289            foreach($wpdb->get_results("SELECT *" . ($orderBy=="author" ? ", (select case when author_id is null then author_name else (select last_name from wp_books_and_papers_authors where id=author_id) end from " . $this->dbBookAuthor . " where book_id=" . $this->dbBooks . ".id limit 1) as author" : "") . " FROM " . $this->dbBooks . " WHERE is_public IS NOT NULL" . ($year != "0" ? " AND year=" . $year : "") . ($tag != "null" ? " AND id IN (SELECT book_id FROM " . $this->dbBookTag . " WHERE tag_id IN (SELECT id FROM " . $this->dbTags . " WHERE tag='". $tag . "'))" : "") . " ORDER BY $orderBy " . get_option('bnpp_list_order')) as $ar)
    287290            {
    288291                $result_temp .= $this->fillBookElement($ar);
Note: See TracChangeset for help on using the changeset viewer.