Title: Eric P's Replies | WordPress.org

---

# Eric P

  [  ](https://wordpress.org/support/users/eric-p/)

 *   [Profile](https://wordpress.org/support/users/eric-p/)
 *   [Topics Started](https://wordpress.org/support/users/eric-p/topics/)
 *   [Replies Created](https://wordpress.org/support/users/eric-p/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/eric-p/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/eric-p/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/eric-p/engagements/)
 *   [Favorites](https://wordpress.org/support/users/eric-p/favorites/)

 Search replies:

## Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)

 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [get name of page template on a page](https://wordpress.org/support/topic/get-name-of-page-template-on-a-page/)
 *  [Eric P](https://wordpress.org/support/users/eric-p/)
 * (@eric-p)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/get-name-of-page-template-on-a-page/#post-1024022)
 * I cooked this up … It may be useful as a plugin? Any interest as a plugin, give
   me a shout … eric pecoraro _at_ shepard dot com
 * It involves some overhead, so it would obviously be used for development only.
   Not tested thoroughly, but it works on my system.
 *     ```
       <?php
       // this can live in /themes/mytheme/functions.php, or maybe as a dev plugin?
       function get_template_name () {
       	foreach ( debug_backtrace() as $called_file ) {
       		foreach ( $called_file as $index ) {
       			if ( !is_array($index[0]) AND strstr($index[0],'/themes/') AND !strstr($index[0],'footer.php') ) {
       				$template_file = $index[0] ;
       			}
       		}
       	}
       	$template_contents = file_get_contents($template_file) ;
       	preg_match_all("(Template Name:(.*)\n)siU",$template_contents,$template_name);
       	$template_name = trim($template_name[1][0]);
       	if ( !$template_name ) { $template_name = '(default)' ; }
       	$template_file = array_pop(explode('/themes/', basename($template_file)));
       	return $template_file . ' > '. $template_name ;
       }
       ?>
       ```
   
 * Useage (in /themes/mytheme/footer.php would work)
 *     ```
       <?php
       if (is_user_logged_in()) {
       	echo ' | '. get_template_name() ;
       }
       ?>
       ```
   
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [get name of page template on a page](https://wordpress.org/support/topic/get-name-of-page-template-on-a-page/)
 *  [Eric P](https://wordpress.org/support/users/eric-p/)
 * (@eric-p)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/get-name-of-page-template-on-a-page/#post-1024021)
 * `print_r( debug_backtrace() )`
 * will return an array of all physical files called by the script. Could write 
   a plugin, or a function to show just the template files based on a condition 
   of “/themes/” of the found files…
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [[Plugin: Contact Form 7] Form Submits but with spinning arrow and no verification of required fields](https://wordpress.org/support/topic/plugin-contact-form-7-form-submits-but-with-spinning-arrow-and-no-verification-of-required-fields/)
 *  [Eric P](https://wordpress.org/support/users/eric-p/)
 * (@eric-p)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/plugin-contact-form-7-form-submits-but-with-spinning-arrow-and-no-verification-of-required-fields/page/2/#post-1043374)
 * [@msuhockey13](https://wordpress.org/support/users/msuhockey13/)
 * **Good catch!** What was I thinking! I was all thunked out at the time ;).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Plugin: My FTP] MyFTP- Can be very dangerous on shared hosting accounts](https://wordpress.org/support/topic/plugin-my-ftp-myftp-can-be-very-dangerous-on-shared-hosting-accounts/)
 *  [Eric P](https://wordpress.org/support/users/eric-p/)
 * (@eric-p)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/plugin-my-ftp-myftp-can-be-very-dangerous-on-shared-hosting-accounts/#post-1159673)
 * **“It’s worse than that, he’s dead Jim, DEAD.”
    “Danger, danger, danger Will 
   Robinson!!” WordPress Red Alert! PHP Shared Server Red Alert! “The sky is falling!”
 * This situation is not unique to your host. It is a *nix security issue that is
   ongoing.
 * The real danger with MyFTP is that you don’t have to be a PHP hack to hack other
   sites on your server.
 * Also, and I won’t go into details here, but you can bring a whole server down
   with this plugin without being a stellar hacker. I love the concept, but the 
   author should build in some php safeguards to MyFTP, which would be easy enough
   to do.
 * That being said, there are things that your host can do:
    - [http://shiflett.org/articles/shared-hosting](http://shiflett.org/articles/shared-hosting)
    - [http://www.php-editors.com/apache_manual/misc/security_tips.html](http://www.php-editors.com/apache_manual/misc/security_tips.html)
    - [http://www.webhostingtalk.com/archive/index.php/t-218775.html](http://www.webhostingtalk.com/archive/index.php/t-218775.html)
 * Also, probably the best quick fix is to set the permissions to 711 on the parent
   directory of all the WordPress installs.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Get child theme directory path](https://wordpress.org/support/topic/get-child-theme-directory-path/)
 *  [Eric P](https://wordpress.org/support/users/eric-p/)
 * (@eric-p)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/get-child-theme-directory-path/#post-1224409)
 * Good stuff. Thanks.
 * I put:
 * define(‘child_template_directory’, dirname( get_bloginfo(‘stylesheet_url’)) );
 * in a my child theme functions.php. Seems to make sense there…
 *   Forum: [Requests and Feedback](https://wordpress.org/support/forum/requests-and-feedback/)
   
   In reply to: [[Plugin: Search and Replace] Great plugin!](https://wordpress.org/support/topic/plugin-search-and-replace-great-plugin/)
 *  [Eric P](https://wordpress.org/support/users/eric-p/)
 * (@eric-p)
 * [17 years ago](https://wordpress.org/support/topic/plugin-search-and-replace-great-plugin/#post-1000530)
 * Absoposalutely a great plugin! Saved me hours & hours! Thanks!!!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [[Plugin: Contact Form 7] Form Submits but with spinning arrow and no verification of required fields](https://wordpress.org/support/topic/plugin-contact-form-7-form-submits-but-with-spinning-arrow-and-no-verification-of-required-fields/)
 *  [Eric P](https://wordpress.org/support/users/eric-p/)
 * (@eric-p)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/plugin-contact-form-7-form-submits-but-with-spinning-arrow-and-no-verification-of-required-fields/#post-1043282)
 * Okay, I’ve been racking my brain on this and I almost gave up on cf7. I even 
   made a copy of an exact site that was working and moved it to a new URL (on the
   same server) and it broke. Then I reinstalled PHP. Then I, then I, then I, then
   I <insert senseless straw grabbing here>. Nothing but the spinning arrow.
 * It’s obviously an AJAX issue, maybe related to a URL/domain setting?
 * In any case, my ugly fix (that actually works) is as follows:
 * in /wp-content/plugins/contact-form-7/contact-form-7.js,
 * comment out the document ready function as follows (starting with the top line):
 *     ```
       /* jQuery(document).ready(function() { */
           try {
               jQuery('div.wpcf7 > form').ajaxForm({
                   beforeSubmit: wpcf7BeforeSubmit,
                   dataType: 'json',
                   success: wpcf7ProcessJson
               });
           } catch (e) {
           }
           try {
               jQuery('div.wpcf7 > form').each(function(i, n) {
                   wpcf7ToggleSubmit(jQuery(n));
               });
           } catch (e) {
           }
       /* }); */
       ```
   
 * This essentially breaks the background functionality of the AJAX, and forces 
   the form to reload with the appended string like #wpcf7-f5-p523-o1, but at least
   it works until something better comes along!
 * cf7 is hands down the best form plugin out there, else I wouldn’t put so much
   effort into keeping it installed!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Plugin: Search Unleashed] problem after 2.7 upgrade](https://wordpress.org/support/topic/plugin-search-unleashed-problem-after-27-upgrade/)
 *  [Eric P](https://wordpress.org/support/users/eric-p/)
 * (@eric-p)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/plugin-search-unleashed-problem-after-27-upgrade/#post-928512)
 * Nice catch tomchen1989. I used your fix interim.
 * The author has since fixed this issue in version Version: 0.2.27. I was having
   the same problem and this version works for me.

Viewing 8 replies - 1 through 8 (of 8 total)