Changeset 484003
- Timestamp:
- 01/03/2012 06:52:08 PM (14 years ago)
- Location:
- link-to-your-content/trunk
- Files:
-
- 2 edited
-
link_to_your_content.php (modified) (21 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
link-to-your-content/trunk/link_to_your_content.php
r463297 r484003 4 4 Plugin URI: http://www.maymond.com/link-to-your-content 5 5 Description: This plugin gives you an easy way to link to your media library, posts, pages, custom post types and taxonomies. 6 Version: 1. 46 Version: 1.5 7 7 Author: Ray Milstrey 8 8 Author URI: http://www.maymond.com … … 44 44 global $wpdb; global $ltyc_db_version; 45 45 // Set the database version number 46 $ltyc_db_version = "1. 4";46 $ltyc_db_version = "1.5"; 47 47 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 48 48 … … 117 117 // Sanitize and validate input. Accepts an array, return a sanitized array. 118 118 function ltyc_options_validate($input) { 119 $input['ltyc_db_version'] = ' 0.2';119 $input['ltyc_db_version'] = '1.5'; 120 120 // Our values are either a 0 or 1 121 121 $input['ltyc_taxonomy'] = ( $input['ltyc_taxonomy'] == 1 ? 1 : 0 ); … … 155 155 // Panel display 156 156 function ltyc_panel_display($type='posts') { 157 $panel_display ;157 $panel_display = ''; 158 158 if($type == 'cptypes') { $panel_display .= $this->ltyc_cpt_toggle(); } 159 159 if($type == 'taxonomies') { $panel_display .= $this->ltyc_tax_toggle(); } … … 184 184 // Toggle between sites in the network 185 185 function ltyc_site_toggle() { 186 global $wpdb; $siteToggle ;186 global $wpdb; $siteToggle = ''; 187 187 if(function_exists('switch_to_blog') && switch_to_blog(1)) { $this->ltycOptions = get_option('ltyc_options'); restore_current_blog(); } 188 188 … … 207 207 // Content type tabs 208 208 function ltyc_content_tabs() { 209 global $wpdb; $contentTabs; 209 global $wpdb; $contentTabs = ''; 210 if(function_exists('switch_to_blog') && switch_to_blog(1)) { $this->ltycOptions = get_option('ltyc_options'); restore_current_blog(); } 211 else { $this->ltycOptions = get_option('ltyc_options'); } 210 212 211 213 $contentTabs .= '<ul>'."\n"; … … 231 233 function ltyc_cpt_toggle() { 232 234 global $wpdb; 233 $cptSelect ; $loopCounter = 0;235 $cptSelect = ''; $loopCounter = 0; 234 236 if(function_exists('switch_to_blog') && switch_to_blog(1)) { $this->ltycOptions = get_option('ltyc_options'); restore_current_blog(); } 235 237 else { $this->ltycOptions = get_option('ltyc_options'); } … … 241 243 if($loopCounter == 0 && !isset($this->customPostType)) { $this->customPostType = $post_type; } 242 244 $cptObj = get_post_type_object($post_type); 245 if(!is_object($cptObj)) { $cptObj->labels->name = ucfirst($post_type); } 243 246 244 247 $cptSelect .= '<option value="'.$post_type.'~'.$wpdb->blogid.'"'; … … 257 260 function ltyc_tax_toggle() { 258 261 global $wpdb; 259 $taxSelect ; $loopCounter = 0;262 $taxSelect = ''; $loopCounter = 0; 260 263 if(function_exists('switch_to_blog') && switch_to_blog(1)) { $this->ltycOptions = get_option('ltyc_options'); restore_current_blog(); } 261 264 else { $this->ltycOptions = get_option('ltyc_options'); } … … 267 270 if($loopCounter == 0 && !isset($this->taxonomy)) { $this->taxonomy = $taxonomy; } 268 271 $taxObj = get_taxonomy($taxonomy); 272 if(!is_object($taxObj)) { $taxObj->labels->name = ucfirst($taxonomy); } 269 273 270 274 $taxSelect .= '<option value="'.$taxonomy.'~'.$wpdb->blogid.'"'; … … 397 401 else { 398 402 $this->queryBlog = $wpdb->prefix; 399 $json_response[' cptypes_panel'] = $this->ltyc_panel_display('cptypes');403 $json_response['taxonomies_panel'] = $this->ltyc_panel_display('taxonomies'); 400 404 } 401 405 … … 411 415 // Creates the page heirarchy output 412 416 function ltyc_page_heirarchy_output($entryId, $type) { 413 global $wpdb; $documentSubList ;417 global $wpdb; $documentSubList = ''; 414 418 switch($type) { 415 419 case 'pages' : … … 433 437 foreach($subEntryResults as $subEntry) { 434 438 if($type == 'taxonomies') { 435 $currentLevel = count(get_ancestors($subEntry['term_id'], $this->taxonomy)); 436 $subEntryTitle = $subEntry['name']; 437 $subEntryId = $subEntry['term_id']; 438 $subEntryPermalink = get_term_link($subEntry['slug'], $this->taxonomy); 439 if(taxonomy_exists($this->taxonomy) === true) { 440 $currentLevel = count(get_ancestors($subEntry['term_id'], $this->taxonomy)); 441 $subEntryTitle = $subEntry['name']; 442 $subEntryId = $subEntry['term_id']; 443 $subEntryPermalink = get_term_link($subEntry['slug'], $this->taxonomy); 444 } 445 else { 446 $currentLevel = $this->ltyc_tax_ancestors($subEntry['term_id']); 447 $subEntryTitle = $subEntry['name']; 448 $subEntryId = $subEntry['term_id']; 449 if(function_exists('switch_to_blog') && switch_to_blog($this->currentBlog)) { 450 $subEntryPermalink = get_bloginfo('url').'/?'.$this->taxonomy.'='.$subEntry['slug']; 451 restore_current_blog(); 452 } 453 else { 454 $subEntryPermalink = get_bloginfo('url').'/?'.$this->taxonomy.'='.$subEntry['slug']; 455 } 456 } 439 457 } 440 458 else { … … 457 475 } 458 476 } 477 478 // Recursive function for getting the top ancestor for taxonomies 479 function ltyc_tax_ancestors($term_id, &$currentLevel = 0) { 480 global $wpdb; 481 $ancestorCheck = $wpdb->prepare('SELECT parent FROM '.$this->queryBlog.'term_taxonomy WHERE term_id = '.$term_id.''); 482 $ancestor = $wpdb->get_var($ancestorCheck); 483 if($ancestor != 0) { 484 $currentLevel++; 485 $ancestorRecursion = $this->ltyc_tax_ancestors($ancestor, $currentLevel); 486 } 487 return $currentLevel; 488 } 459 489 460 490 // Pagination control when viewing documents lists 461 491 function ltyc_pagination($type) { 462 global $wpdb; $cpt_page_link ; $tax_page_link;492 global $wpdb; $cpt_page_link = ''; $tax_page_link = ''; 463 493 // Get the list of documents count based on the current view 464 494 if($type == 'posts') { … … 476 506 $cpt_page_link = '&cpt='.$this->customPostType; 477 507 } 508 else { 509 $paginationTitle = 'Select '.ucfirst($this->customPostType).':'; 510 $entriesTest = 'SELECT post_parent FROM '.$this->queryBlog.'posts WHERE post_type = "'.$this->customPostType.'" AND post_status = "publish" ORDER BY menu_order ASC'; 511 $entryTest = $wpdb->get_results($entriesTest, ARRAY_A); 512 $hierarchical = 0; 513 foreach($entryTest as $entry) { 514 if($entry['post_parent'] != 0) { $hierarchical = 1; } 515 } 516 if($hierarchical == 1) { $cpt_hierarchical = 1; } 517 else { $cpt_hierarchical = 0; } 518 $cpt_page_link = '&cpt='.$this->customPostType; 519 } 478 520 } else if($type == 'taxonomies') { 479 521 $queryCount = 'SELECT term_id FROM '.$this->queryBlog.'terms NATURAL JOIN '.$this->queryBlog.'term_taxonomy WHERE '.$this->queryBlog.'term_taxonomy.taxonomy = "'.$this->taxonomy.'"'; … … 482 524 $paginationTitle = 'Select '.$tax_obj->labels->singular_name.':'; 483 525 $tax_hierarchical = $tax_obj->hierarchical; 526 $tax_page_link = '&tax='.$this->taxonomy; 527 } 528 else { 529 $paginationTitle = 'Select '.ucfirst($this->taxonomy).':'; 530 $tax_hierarchical = $tax_obj->hierarchical; 531 $entriesTest = 'SELECT parent FROM '.$this->queryBlog.'terms NATURAL JOIN '.$this->queryBlog.'term_taxonomy WHERE '.$this->queryBlog.'term_taxonomy.taxonomy = "'.$this->taxonomy.'" ORDER BY name ASC'; 532 $entryTest = $wpdb->get_results($entriesTest, ARRAY_A); 533 foreach($entryTest as $entry) { 534 if($entry['parent'] != 0) { $hierarchical = 1; } 535 } 536 if($hierarchical == 1) { $tax_hierarchical = 1; } 537 else { $tax_hierarchical = 0; } 484 538 $tax_page_link = '&tax='.$this->taxonomy; 485 539 } … … 496 550 $this->pageOffset = 20; //25 497 551 $pageCount = ceil($totalResults / $this->pageOffset); 498 $paginationDisplay ;552 $paginationDisplay = ''; 499 553 500 554 if(isset($this->page) && ctype_digit($this->page) && $this->page >= 1 && $this->page > $pageCount) { $this->page = $pageCount; } … … 553 607 // Outputs the list of documents that have been uploaded 554 608 function ltyc_document_list($type, $page, $pageOffset) { 555 global $wpdb; $documentList ;609 global $wpdb; $documentList = ''; global $wp_post_types; 556 610 // Get the list of documents based on the current view 557 611 if($type == 'posts') { 558 $entries = 'SELECT post_title, guid, ID, post_mime_type FROM '.$this->queryBlog.'posts WHERE post_type = "post" AND post_status = "publish" ORDER BY post_date DESC LIMIT '.(($page * $pageOffset) - $pageOffset).', '.$pageOffset;612 $entries = 'SELECT post_title, guid, ID, post_mime_type, post_parent FROM '.$this->queryBlog.'posts WHERE post_type = "post" AND post_status = "publish" ORDER BY post_date DESC LIMIT '.(($page * $pageOffset) - $pageOffset).', '.$pageOffset; 559 613 } else if($type == 'pages') { 560 $entries = 'SELECT post_title, guid, ID, post_mime_type FROM '.$this->queryBlog.'posts WHERE post_type = "page" AND post_status = "publish" AND post_parent = 0 ORDER BY menu_order ASC';614 $entries = 'SELECT post_title, guid, ID, post_mime_type, post_parent FROM '.$this->queryBlog.'posts WHERE post_type = "page" AND post_status = "publish" AND post_parent = 0 ORDER BY menu_order ASC'; 561 615 } else if($type == 'cptypes') { 562 616 if(post_type_exists($this->customPostType) === true) { … … 564 618 $cpt_hierarchical = $cpt_obj->hierarchical; 565 619 if($cpt_hierarchical == 0) { 566 $entries = 'SELECT post_title, guid, ID, post_mime_type FROM '.$this->queryBlog.'posts WHERE post_type = "'.$this->customPostType.'" AND post_status = "publish" AND post_parent = 0 ORDER BY menu_order ASC LIMIT '.(($page * $pageOffset) - $pageOffset).', '.$pageOffset;620 $entries = 'SELECT post_title, guid, ID, post_mime_type, post_parent FROM '.$this->queryBlog.'posts WHERE post_type = "'.$this->customPostType.'" AND post_status = "publish" AND post_parent = 0 ORDER BY menu_order ASC LIMIT '.(($page * $pageOffset) - $pageOffset).', '.$pageOffset; 567 621 } 568 622 else { 569 $entries = 'SELECT post_title, guid, ID, post_mime_type FROM '.$this->queryBlog.'posts WHERE post_type = "'.$this->customPostType.'" AND post_status = "publish" AND post_parent = 0 ORDER BY menu_order ASC'; 623 $entries = 'SELECT post_title, guid, ID, post_mime_type, post_parent FROM '.$this->queryBlog.'posts WHERE post_type = "'.$this->customPostType.'" AND post_status = "publish" AND post_parent = 0 ORDER BY menu_order ASC'; 624 } 625 } 626 else { 627 $entries = 'SELECT post_parent FROM '.$this->queryBlog.'posts WHERE post_type = "'.$this->customPostType.'" AND post_status = "publish" ORDER BY menu_order ASC'; 628 $entryTest = $wpdb->get_results($entries, ARRAY_A); 629 foreach($entryTest as $entry) { 630 if($entry['post_parent'] != 0) { $cpt_hierarchical = true; } 631 } 632 if($cpt_hierarchical === true) { 633 $entries = 'SELECT post_title, guid, ID, post_mime_type, post_parent FROM '.$this->queryBlog.'posts WHERE post_type = "'.$this->customPostType.'" AND post_status = "publish" AND post_parent = 0 ORDER BY menu_order ASC'; 634 } 635 else { 636 $entries = 'SELECT post_title, guid, ID, post_mime_type, post_parent FROM '.$this->queryBlog.'posts WHERE post_type = "'.$this->customPostType.'" AND post_status = "publish" AND post_parent = 0 ORDER BY menu_order ASC LIMIT '.(($page * $pageOffset) - $pageOffset).', '.$pageOffset; 570 637 } 571 638 } … … 575 642 $tax_hierarchical = $tax_obj->hierarchical; 576 643 if($tax_hierarchical == 0) { 577 $entries = 'SELECT term_id, name, slug FROM '.$this->queryBlog.'terms NATURAL JOIN '.$this->queryBlog.'term_taxonomy WHERE '.$this->queryBlog.'term_taxonomy.taxonomy = "'.$this->taxonomy.'" AND '.$this->queryBlog.'term_taxonomy.parent = 0 ORDER BY name ASC LIMIT '.(($page * $pageOffset) - $pageOffset).', '.$pageOffset;644 $entries = 'SELECT term_id, name, slug, '.$this->queryBlog.'term_taxonomy.parent FROM '.$this->queryBlog.'terms NATURAL JOIN '.$this->queryBlog.'term_taxonomy WHERE '.$this->queryBlog.'term_taxonomy.taxonomy = "'.$this->taxonomy.'" AND '.$this->queryBlog.'term_taxonomy.parent = 0 ORDER BY name ASC LIMIT '.(($page * $pageOffset) - $pageOffset).', '.$pageOffset; 578 645 } 579 646 else { 580 $entries = 'SELECT term_id, name, slug FROM '.$this->queryBlog.'terms NATURAL JOIN '.$this->queryBlog.'term_taxonomy WHERE '.$this->queryBlog.'term_taxonomy.taxonomy = "'.$this->taxonomy.'" AND '.$this->queryBlog.'term_taxonomy.parent = 0 ORDER BY name ASC'; 647 $entries = 'SELECT term_id, name, slug, '.$this->queryBlog.'term_taxonomy.parent FROM '.$this->queryBlog.'terms NATURAL JOIN '.$this->queryBlog.'term_taxonomy WHERE '.$this->queryBlog.'term_taxonomy.taxonomy = "'.$this->taxonomy.'" AND '.$this->queryBlog.'term_taxonomy.parent = 0 ORDER BY name ASC'; 648 } 649 } 650 else { 651 $entries = 'SELECT parent FROM '.$this->queryBlog.'term_taxonomy NATURAL JOIN '.$this->queryBlog.'terms WHERE '.$this->queryBlog.'term_taxonomy.taxonomy = "'.$this->taxonomy.'" ORDER BY name ASC'; 652 $entryTest = $wpdb->get_results($entries, ARRAY_A); 653 foreach($entryTest as $entry) { 654 if($entry['parent'] != 0) { $tax_hierarchical = true; } 655 } 656 if($tax_hierarchical === true) { 657 $entries = 'SELECT term_id, name, slug, '.$this->queryBlog.'term_taxonomy.parent FROM '.$this->queryBlog.'terms NATURAL JOIN '.$this->queryBlog.'term_taxonomy WHERE '.$this->queryBlog.'term_taxonomy.taxonomy = "'.$this->taxonomy.'" AND '.$this->queryBlog.'term_taxonomy.parent = 0 ORDER BY name ASC'; 658 } 659 else { 660 $entries = 'SELECT term_id, name, slug, '.$this->queryBlog.'term_taxonomy.parent FROM '.$this->queryBlog.'terms NATURAL JOIN '.$this->queryBlog.'term_taxonomy WHERE '.$this->queryBlog.'term_taxonomy.taxonomy = "'.$this->taxonomy.'" AND '.$this->queryBlog.'term_taxonomy.parent = 0 ORDER BY name ASC LIMIT '.(($page * $pageOffset) - $pageOffset).', '.$pageOffset; 581 661 } 582 662 } 583 663 } else if($type == 'docs') { 584 $entries = 'SELECT post_title, guid, ID, post_mime_type FROM '.$this->queryBlog.'posts WHERE post_type = "attachment" AND (SUBSTRING(post_mime_type, 1, 11) = "application" OR SUBSTRING(post_mime_type, 1, 4) = "text") ORDER BY post_title ASC LIMIT '.(($page * $pageOffset) - $pageOffset).', '.$pageOffset;664 $entries = 'SELECT post_title, guid, ID, post_mime_type, post_parent FROM '.$this->queryBlog.'posts WHERE post_type = "attachment" AND (SUBSTRING(post_mime_type, 1, 11) = "application" OR SUBSTRING(post_mime_type, 1, 4) = "text") ORDER BY post_title ASC LIMIT '.(($page * $pageOffset) - $pageOffset).', '.$pageOffset; 585 665 } else if($type == 'images') { 586 $entries = 'SELECT post_title, guid, ID, post_mime_type FROM '.$this->queryBlog.'posts WHERE post_type = "attachment" AND SUBSTRING(post_mime_type, 1, 5) = "image" ORDER BY post_title ASC LIMIT '.(($page * $pageOffset) - $pageOffset).', '.$pageOffset;666 $entries = 'SELECT post_title, guid, ID, post_mime_type, post_parent FROM '.$this->queryBlog.'posts WHERE post_type = "attachment" AND SUBSTRING(post_mime_type, 1, 5) = "image" ORDER BY post_title ASC LIMIT '.(($page * $pageOffset) - $pageOffset).', '.$pageOffset; 587 667 } else { 588 $entries = 'SELECT post_title, guid, ID, post_mime_type FROM '.$this->queryBlog.'posts WHERE post_type = "post" AND post_status = "publish" ORDER BY post_title ASC LIMIT '.(($page * $pageOffset) - $pageOffset).', '.$pageOffset;668 $entries = 'SELECT post_title, guid, ID, post_mime_type, post_parent FROM '.$this->queryBlog.'posts WHERE post_type = "post" AND post_status = "publish" ORDER BY post_title ASC LIMIT '.(($page * $pageOffset) - $pageOffset).', '.$pageOffset; 589 669 } $entryResults = $wpdb->get_results($entries, ARRAY_A); 590 670 … … 593 673 $cpt_obj = get_post_type_object($this->customPostType); 594 674 } 595 if(taxonomy_exists($this->customPostType) === true) { 675 else { 676 foreach($entryResults as $entry) { 677 if($entry['post_parent'] != 0) { $cpt_hierarchical = true; } 678 } 679 } 680 if(taxonomy_exists($this->taxonomy) === true) { 596 681 $tax_obj = get_taxonomy($this->taxonomy); 597 682 } 598 if($type == 'pages' || ($type == 'cptypes' && isset($cpt_obj->hierarchical) && $cpt_obj->hierarchical == true)){683 else { 599 684 foreach($entryResults as $entry) { 600 $documentList .= '<tr>'."\n"; 601 $documentList .= '<td width="480">'.$entry['post_title'].'</td>'."\n"; 602 $documentList .= '<td width="30"><a href="'.get_permalink($entry['ID']).'" title="'.$entry['post_title'].'" class="selectDocument">Select</a></td>'."\n"; 603 $documentList .= '</tr>'."\n"; 604 $documentList .= $this->ltyc_page_heirarchy_output($entry['ID'], $type); 605 } 606 } 607 else if($type == 'taxonomies') { 608 if(isset($tax_obj->hierarchical) && $tax_obj->hierarchical == true) { 685 if($entry['parent'] != 0) { $tax_hierarchical = true; } 686 } 687 } 688 if($type == 'pages' || ($type == 'cptypes' && (isset($cpt_obj->hierarchical) && $cpt_obj->hierarchical == true) || (isset($cpt_hierarchical) && $cpt_hierarchical == true))) { 689 if(is_array($entryResults)) { 609 690 foreach($entryResults as $entry) { 610 691 $documentList .= '<tr>'."\n"; 611 $documentList .= '<td width="480">'.$entry[' name'].'</td>'."\n";612 $documentList .= '<td width="30"><a href="'.get_ term_link($entry['slug'], $this->taxonomy).'" title="'.$entry['name'].'" class="selectDocument">Select</a></td>'."\n";692 $documentList .= '<td width="480">'.$entry['post_title'].'</td>'."\n"; 693 $documentList .= '<td width="30"><a href="'.get_permalink($entry['ID']).'" title="'.$entry['post_title'].'" class="selectDocument">Select</a></td>'."\n"; 613 694 $documentList .= '</tr>'."\n"; 614 $documentList .= $this->ltyc_page_heirarchy_output($entry['term_id'], $type); 615 } 616 } 617 else { 695 $documentList .= $this->ltyc_page_heirarchy_output($entry['ID'], $type); 696 } 697 } 698 } 699 else if($type == 'taxonomies') { 700 if((isset($tax_obj->hierarchical) && $tax_obj->hierarchical == true) || (isset($tax_hierarchical) && $tax_hierarchical == true)) { 701 if(is_array($entryResults)) { 702 foreach($entryResults as $entry) { 703 $documentList .= '<tr>'."\n"; 704 $documentList .= '<td width="480">'.$entry['name'].'</td>'."\n"; 705 if(taxonomy_exists($this->taxonomy) === true) { 706 $documentList .= '<td width="30"><a href="'.get_term_link($entry['slug'], $this->taxonomy).'" title="'.$entry['name'].'" class="selectDocument">Select</a></td>'."\n"; 707 } 708 else { 709 if(function_exists('switch_to_blog') && switch_to_blog($this->currentBlog)) { 710 $documentList .= '<td width="30"><a href="'.get_bloginfo('url').'/?'.$this->taxonomy.'='.$entry['slug'].'" title="'.$entry['name'].'" class="selectDocument">Select</a></td>'."\n"; 711 restore_current_blog(); 712 } 713 else { 714 $documentList .= '<td width="30"><a href="'.get_bloginfo('url').'/?'.$this->taxonomy.'='.$entry['slug'].'" title="'.$entry['name'].'" class="selectDocument">Select</a></td>'."\n"; 715 } 716 } 717 $documentList .= '</tr>'."\n"; 718 $documentList .= $this->ltyc_page_heirarchy_output($entry['term_id'], $type); 719 } 720 } 721 } 722 else { 723 if(is_array($entryResults)) { 724 foreach($entryResults as $entry) { 725 $documentList .= '<tr>'."\n"; 726 $documentList .= '<td width="480">'.$entry['name'].'</td>'."\n"; 727 if(taxonomy_exists($this->taxonomy) === true) { 728 $documentList .= '<td width="30"><a href="'.get_term_link($entry['slug'], $this->taxonomy).'" title="'.$entry['name'].'" class="selectDocument">Select</a></td>'."\n"; 729 } 730 else { 731 if(function_exists('switch_to_blog') && switch_to_blog($this->currentBlog)) { 732 $documentList .= '<td width="30"><a href="'.get_bloginfo('url').'/?'.$this->taxonomy.'='.$entry['slug'].'" title="'.$entry['name'].'" class="selectDocument">Select</a></td>'."\n"; 733 restore_current_blog(); 734 } 735 else { 736 $documentList .= '<td width="30"><a href="'.get_bloginfo('url').'/?'.$this->taxonomy.'='.$entry['slug'].'" title="'.$entry['name'].'" class="selectDocument">Select</a></td>'."\n"; 737 } 738 } 739 $documentList .= '</tr>'."\n"; 740 } 741 } 742 } 743 } 744 else { 745 if(is_array($entryResults)) { 618 746 foreach($entryResults as $entry) { 619 747 $documentList .= '<tr>'."\n"; 620 $documentList .= '<td width="480">'.$entry['name'].'</td>'."\n"; 621 $documentList .= '<td width="30"><a href="'.get_term_link($entry['slug'], $this->taxonomy).'" title="'.$entry['name'].'" class="selectDocument">Select</a></td>'."\n"; 748 if($entry['post_mime_type'] == '') { 749 $documentList .= '<td width="480">'.$entry['post_title'].'</td>'."\n"; 750 $permalink = get_permalink($entry['ID']); 751 } 752 else { 753 $mimePos = strrpos($entry['guid'], "."); 754 $attachmentType = strtoupper(substr($entry['guid'], ($mimePos + 1))); 755 $documentList .= '<td width="430">'.$entry['post_title'].'</td>'."\n"; 756 $documentList .= '<td width="50">('.$attachmentType.')</td>'."\n"; 757 $permalink = $entry['guid']; 758 } 759 $documentList .= '<td width="30"><a href="'.$permalink.'" title="'.$entry['post_title'].'" class="selectDocument">Select</a></td>'."\n"; 622 760 $documentList .= '</tr>'."\n"; 623 761 } 624 }625 }626 else {627 foreach($entryResults as $entry) {628 $documentList .= '<tr>'."\n";629 if($entry['post_mime_type'] == '') {630 $documentList .= '<td width="480">'.$entry['post_title'].'</td>'."\n";631 $permalink = get_permalink($entry['ID']);632 }633 else {634 $mimePos = strrpos($entry['guid'], ".");635 $attachmentType = strtoupper(substr($entry['guid'], ($mimePos + 1)));636 $documentList .= '<td width="430">'.$entry['post_title'].'</td>'."\n";637 $documentList .= '<td width="50">('.$attachmentType.')</td>'."\n";638 $permalink = $entry['guid'];639 }640 $documentList .= '<td width="30"><a href="'.$permalink.'" title="'.$entry['post_title'].'" class="selectDocument">Select</a></td>'."\n";641 $documentList .= '</tr>'."\n";642 762 } 643 763 } -
link-to-your-content/trunk/readme.txt
r463297 r484003 4 4 Tags: document, doc, pdf, xls, image, jpg, png, attachment, link, media library, post, page, custom post type, taxonomy, tinymce 5 5 Requires at least: 3.0 6 Tested up to: 3.3 beta27 Stable tag: 1. 46 Tested up to: 3.3 7 Stable tag: 1.5 8 8 9 9 Gives you the ability to easily link to the various forms of content you have. … … 38 38 == Changelog == 39 39 40 = 1.5 = 41 * Updated for WordPress 3.3 with a fix for working with custom post types and custom taxonomies created with a plugin on a multi-site network. 42 40 43 = 1.4 = 41 44 * Fixed an issue with linking to posts and pages in certain versions of IE. … … 48 51 49 52 == Upgrade Notice == 53 54 = 1.5 = 55 * WordPress 3.3 and mutli-site compatibility update. 50 56 51 57 = 1.4 = … … 61 67 62 68 1. User defined pagination value. 63 2. The ability to search for content. 64 3. ??? 65 4. Add to list per user feedback. (Translations are always welcome) 69 2. External links (http, mailto). 70 3. The ability to search for content. 71 4. ??? 72 5. Add to list per user feedback. (Translations are always welcome)
Note: See TracChangeset
for help on using the changeset viewer.