Changeset 2462200
- Timestamp:
- 01/25/2021 11:59:24 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
books-papers/trunk/classes/functions/bridge-replace_pub_updated.php
r2458777 r2462200 23 23 $id = "0"; 24 24 $sort = "null"; 25 $btitle = "null"; 25 26 foreach($options as $opt){ 26 27 $sub = substr($opt, 0, 4); … … 37 38 } else if ($sub == 'sort'){ 38 39 $sort = substr($opt, 5); 40 } else if (substr($opt, 0, 6) == 'btitle'){ 41 $btitle = substr($opt, 7); 39 42 } else if (substr($opt, 0, 2) == 'id'){ 40 43 $id = substr($opt, 3); … … 91 94 } 92 95 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) 94 97 { 95 98 $result_temp .= $this->fillConferenceElement($ar); … … 109 112 } 110 113 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) 112 115 { 113 116 $result_temp .= $this->fillBookElement($ar); … … 144 147 } 145 148 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) 148 151 { 149 152 $result_temp .= $this->fillMixedElement($pub); … … 182 185 } 183 186 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) 185 188 { 186 189 $result_temp .= $this->fillConferenceElement($ar); … … 201 204 } 202 205 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) 204 207 { 205 208 $result_temp .= $this->fillBookElement($ar); … … 238 241 } 239 242 $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) 241 244 { 242 245 $result_temp .= $this->fillConferenceElement($ar); … … 246 249 } 247 250 $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) 249 252 { 250 253 $result_temp .= $this->fillBookElement($ar); … … 256 259 $result_temp = ""; 257 260 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) 260 263 { 261 264 $result_temp .= $this->fillMixedElement($pub); … … 275 278 } else if ($subj == "conferences") { 276 279 $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) 278 281 { 279 282 $result_temp .= $this->fillConferenceElement($ar); … … 284 287 } else if ($subj == "books") { 285 288 $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) 287 290 { 288 291 $result_temp .= $this->fillBookElement($ar);
Note: See TracChangeset
for help on using the changeset viewer.