Changeset 6276

Show
Ignore:
Timestamp:
08/08/06 04:52:49 (2 years ago)
Author:
GamerZ
Message:

NEW: WP-EMail-Popup Now Have Nice Permalinks /emailpopup/ Or /emailpopuppage/
FIXED: WP-EMail-Popup Not Working With Other Nice Permalinks

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wp-email/trunk/email/email.php

    r6252 r6276  
    4848add_filter('generate_rewrite_rules', 'email_rewrite'); 
    4949function email_rewrite($wp_rewrite) { 
     50      // WP-EMail Rules 
    5051      $rewrite_rules2 = $wp_rewrite->generate_rewrite_rule($wp_rewrite->permalink_structure.'email'); 
    5152      array_splice($rewrite_rules2, 1); 
     
    5556      $r_link = str_replace('tb=1', 'email=1', $r_link); 
    5657    $email_rules = array($r_rule => $r_link, '(.+)/emailpage/?$' => 'index.php?pagename='.$wp_rewrite->preg_index(1).'&email=1'); 
    57     $wp_rewrite->rules = $email_rules + $wp_rewrite->rules; 
     58      $wp_rewrite->rules = $email_rules + $wp_rewrite->rules; 
     59      // WP-EMail PopUp Rules 
     60      $rewrite_rules3 = $wp_rewrite->generate_rewrite_rule($wp_rewrite->permalink_structure.'emailpopup'); 
     61      array_splice($rewrite_rules3, 1); 
     62      $r_rule2 = array_shift(array_keys($rewrite_rules3)); 
     63      $r_rule2 = str_replace('/trackback', '', $r_rule2); 
     64      $r_link2 = array_shift(array_values($rewrite_rules3)); 
     65      $r_link2 = str_replace('tb=1', 'emailpopup=1', $r_link2); 
     66      $emailpopup_rules = array($r_rule2 => $r_link2, '(.+)/emailpopuppage/?$' => 'index.php?pagename='.$wp_rewrite->preg_index(1).'&emailpopup=1'); 
     67      $wp_rewrite->rules = $emailpopup_rules + $wp_rewrite->rules; 
    5868} 
    5969 
     
    6373function email_variables($public_query_vars) { 
    6474      $public_query_vars[] = 'email'; 
     75      $public_query_vars[] = 'emailpopup'; 
    6576      $public_query_vars[] = 'wp-email'; 
    6677      return $public_query_vars; 
     
    123134### Function: Display E-Mail Popup Window 
    124135function email_popup($text_post = 'EMail This Post', $text_page = 'EMail This Page') { 
    125       global $id; 
    126       if(is_page()) { 
    127             echo '<a href="'.get_settings('home').'/wp-content/plugins/email/wp-email-popup.php?page_id='.$id.'" onclick="email_popup(this.href); return false" title="'.$text_page.'" rel="nofollow">'.$text_page.'</a>'; 
    128       } else { 
    129             echo '<a href="'.get_settings('home').'/wp-content/plugins/email/wp-email-popup.php?p='.$id.'" onclick="email_popup(this.href); return false" title="'.$text_post.'" rel="nofollow">'.$text_post.'</a>'; 
     136      $using_permalink = get_settings('permalink_structure'); 
     137      $permalink = get_permalink(); 
     138      if(!empty($using_permalink)) { 
     139            if(is_page()) { 
     140                  echo '<a href="'.$permalink.'emailpopuppage/" onclick="email_popup(this.href); return false" title="'.$text_page.'" rel="nofollow">'.$text_page.'</a>'; 
     141            } else { 
     142                  echo '<a href="'.$permalink.'emailpopup/" onclick="email_popup(this.href); return false" title="'.$text_post.'" rel="nofollow">'.$text_post.'</a>'; 
     143            } 
     144      } else { 
     145            echo '<a href="'.$permalink.'&amp;emailpopup=1" onclick="email_popup(this.href); return false" title="'.$text_post.'" rel="nofollow">'.$text_post.'</a>'; 
    130146      } 
    131147} 
     
    135151function email_popup_image() { 
    136152      global $id; 
     153      $using_permalink = get_settings('permalink_structure'); 
     154      $permalink = get_permalink(); 
    137155      if(file_exists(ABSPATH.'/wp-content/plugins/email/images/email.gif')) { 
    138156            $email_image = '<img src="'.get_settings('siteurl').'/wp-content/plugins/email/images/email.gif" alt="E-Mail This Post/Page" />'; 
     
    140158            $email_image = 'E-Mail'; 
    141159      } 
    142       if(is_page()) { 
    143             echo '<a href="'.get_settings('home').'/wp-content/plugins/email/wp-email-popup.php?page_id='.$id.'" onclick="email_popup(this.href); return false" title="EMail This Page" rel="nofollow">'.$email_image.'</a>'; 
    144       } else { 
    145             echo '<a href="'.get_settings('home').'/wp-content/plugins/email/wp-email-popup.php?p='.$id.'" onclick="email_popup(this.href); return false" title="EMail This Post" rel="nofollow">'.$email_image.'</a>'; 
     160      if(!empty($using_permalink)) { 
     161            if(is_page()) { 
     162                  echo '<a href="'.$permalink.'emailpopuppage/" onclick="email_popup(this.href); return false" title="EMail This Page" rel="nofollow">'.$email_image.'</a>'; 
     163            } else { 
     164                  echo '<a href="'.$permalink.'emailpopup/" onclick="email_popup(this.href); return false" title="EMail This Post" rel="nofollow">'.$email_image.'</a>'; 
     165            } 
     166      } else { 
     167            echo '<a href="'.$permalink.'&amp;emailpopup=1" onclick="email_popup(this.href); return false" title="EMail This Post/Page" rel="nofollow">'.$email_image.'</a>'; 
    146168      } 
    147169} 
     
    445467      if(intval(get_query_var('email')) == 1) { 
    446468            include(ABSPATH . 'wp-content/plugins/email/wp-email.php'); 
     469            exit; 
     470      } elseif(intval(get_query_var('emailpopup')) == 1) { 
     471            include(ABSPATH . 'wp-content/plugins/email/wp-email-popup.php'); 
    447472            exit; 
    448473      } 
  • wp-email/trunk/email/wp-email-popup.php

    r6252 r6276  
    2020### Session Start 
    2121session_start(); 
    22  
    23 ###  Load wp-blog-header.php 
    24 require('../../../wp-blog-header.php'); 
    2522 
    2623### Image Verification 
     
    333330<?php endif; ?> 
    334331      <p style="text-align: center; padding-top: 20px;"><a href="#" onclick="window.close();">Close This Window</a></p> 
     332      <?php wp_footer(); ?> 
    335333</body> 
    336334</html> 
  • wp-email/trunk/readme.html

    r6252 r6276  
    217217                              <b>Version 2.07 (01-10-2006)</b> 
    218218                              <ul> 
     219                                    <li>NEW: WP-EMail-Popup Now Have Nice Permalinks /emailpopup/ Or /emailpopuppage/</li> 
    219220                                    <li>NEW: Added rel="nofollow" To All Links Generated By WP-EMail</li> 
    220221                                    <li>NEW: Added noindex, nofollow To Robots Meta Tag In wp-email-popup.php</li> 
     
    223224                                    <li>FIXED: Error In Logging Due To Post ID Being Blank</li> 
    224225                                    <li>FIXED: Form Input Data Will No Longer Be Lost After Encountering An Error</li> 
     226                                    <li>FIXED: WP-EMail-Popup Not Working With Other Nice Permalinks</li> 
    225227                              </ul> 
    226228                        </li>