Forum Replies Created

Viewing 15 replies - 46 through 60 (of 309 total)
  • Forum: Plugins
    In reply to: Real Estate plugin released
    Thread Starter Roger Theriault

    (@rogertheriault)

    On my own site I just use a custom template that frames my Florida Association of Realtors (FAR) MLS search page; it really depends on what your MLS, or local board, or your broker, provides.

    @franganghi – if the plugin doesn’t have the necessary code to load the translation (correctly written), or more importantly it doesn’t have its output strings encased in the __() and _e() functions, then a translation file will not help. If you’re the plugin author, then you should be able to correct those issues. If you’re not the author, you may want to contact the author about enabling the plugin for translation.

    “progressive search”, “ajax”, “suggest”, “active filtering”…

    jQuery: https://plugins.jquery.com/project/chained-combobox
    and there are other methods

    Make sure the paths in the .po file makes sense… they should be relative, not pointing to your hard disk.

    "X-Poedit-Basepath: .\n"

    and

    #: foo.php:71
    msgid "Hello World!"
    msgstr "Spiacente :-)"

    and in your plugin you’ll need something like:

    // load language / localization file
    add_action('init','myuniqueplugin_init');
    function myuniqueplugin_init() {
    	// time to get any translations
    	load_plugin_textdomain( 'my-plugin-textdomain', false, dirname(plugin_basename(__FILE__)) );
    }

    and of course, in your wp-config.php:

    define ('WPLANG', 'it_IT');

    In the Manage / Ads page, when you add a new Ad, in the zones field type

    myzone

    and then in your post content you can put

    [!AdServe:myzone!]

    or in your theme’s index.php, sidebar.php, or wherever… you can put

    <?php AdServe("myzone"); ?>

    You can define multiple zones, which means these are different places where ads might go. Just do the same thing again, changing “myzone” to “another-zone” for example.

    The code I posted should detect even inactive plugins and presumes you know which one you’re looking for; some of the other functions only work with active plugins. A perusal of wp-admin/plugins.php may help in understanding how to accumulate a list of plugins, and determining their status. By the way, get_plugins() with no arguments is supposed to return a list of all detected plugins.

    Part of the Codex problem is search. Sometimes Google is better for that, it even has Trac changelog pages indexed. Assuming you have worked out the right terms to search for ?? But there’s nothing better than the actual code.

    You need to help us out here… are you filtering the_content?

    Otherwise, there’s a common issue where you’ll get some error messages if you inadvertently output anything before the headers have been sent. Make sure the first line in your php files is <?php and the last one is ?>.

    I wrote this for my plugin… feel free to change the function name so you don’t collide with mine. Not guaranteed 100% if a user has customized the plugin’s directory name.

    Usage: gre_is_plugin_there(‘/great-real-estate’)

    function gre_is_plugin_there($plugin_dir) {
    	$plugins = get_plugins($plugin_dir);
    	if ($plugins) return true;
    	return false;
    }

    @rahul286 and Alphawolf… I don’t really know if this is a bug, or even an important discrepancy… plus, I haven’t seen this error on my sites. In fact, when I go to an edit page and hover over the media buttons the tip pops up just fine with no complaints from FireBug; still, this issue may only manifest when certain other JavaScript libraries or plugins are loaded… or when someone’s plugin is attempting to call the tTips function for its own purpose.

    The code in common.js which defines the tTips function doesn’t precisely match the recommended aliasing method in the link I posted above.

    common.js line 43:

    }(jQuery));

    the recommended aliasing method from the jQuery team:

    })(jQuery);

    Try moving the “)” and see if that corrects the issue (without breaking anything, of course). If so, please post something here… and if you can, file a WordPress bug report.

    Forum: Plugins
    In reply to: hook for blog text filter

    the_content

    Your “stable tag” in the readme file dictates where the “official” release comes from. I think the system will use that to point to the tag if it’s available, but it seems that it decides that “trunk” is the official release if the given tag does not exist.

    So if you use anything other than “trunk”, if that tag doesn’t exist, it defaults back to “trunk”. (Just guessing, only the folks who wrote the scripts would know for sure).

    I’m betting the “trunk/readme.txt” dictates which tag directory is used for the ZIP file. But hopefully someone who knows more will clarify if this is not correct.

    I haven’t done this on my own site with jQuery but I’ve written a fair amount of jQuery AJAX code… and the code below has been tested on my development site.

    I suggest reviewing the documentation on the “load()” function: https://docs.jquery.com/Ajax/load#urldatacallback

    Keep in mind that instead of $() you’ll want to use jQuery(). So the example on that page is
    jQuery("#links").load("/Main_Page #p-Getting-Started li");

    Exactly how you integrate a query in your site will depend a great deal on how your site is designed and what you’re attempting to do. And for SEO, and any amount of pay-per-click advertising, you probably only want to do this as an “enhancement”. For example, show a snippet of a post when someone mouseovers a link on an archive page. The jQuery examples tend to be simple, but if you peruse through them you’ll discover bits and pieces you can combine.

    To do that, you’ll need to pair the load() function with an event handler and a hidden div that pops up, and another event handler for when the mouse moves away. But here’s a simpler example, if you include this in your header.php just before the “</head>” line, when you mouse over a WordPress sidebar link, the link’s content div should replace the ever-present “content” div already on your page (wait a second, it may not be instantaneous, and it only works on links inside the div with the id “sidebar”):

    <script type="text/javascript" src="/wp-includes/js/jquery/jquery.js"></script>
    <script type="text/javascript">
    jQuery(document).ready(function(){
        jQuery("#sidebar a").mouseover(function () {
            jQuery("#content").load(jQuery(this).attr("href") + " #content");
        });
    });
    </script>

    Now, this code is crude… it doesn’t care whether you’ve got an external or internal link, and the jQuery library include may be redundant… it’s not the correct way to include it, for that I suggest the Codex. So I really don’t recommend using it as is! But it’s a working example that should work on most WordPress sites with standard Kubrick-style templates (that use the “sidebar” and “content” divs). Or, you can change the code to fit your site…

    I highly recommend the book “jQuery in Action” if you really want to use jQuery on your WordPress site, or anywhere for that matter.

    Sorry, this is a bad idea.

    What will happen if a search engine follows a bad link? It will index the bad link and result message (possibly even if you insert a nofollow, noindex meta in the header). Search engines can’t understand the text they see on your page like most humans can. That’s why there are status codes – to represent that the page requested and the result received is not an official page, in the case of 404.

    Google actually appears to be testing this… their webmaster tools will complain if they detect a 404 page that is sending a 200 header.

    If you want to redirect, set up redirect rules and logic within the existing WordPress actions and filters, and avoid your 404 page. If you want to receive parameters, there are WordPress functions that you can use to set that up, such as add_rewrite_endpoint().

    But if you get to the 404 page template, a 404 header should logically be sent back.

    You’re most welcome.

    <?php $alt = ($alt) ? "" : "altclass"; ?>

    is the less verbose method. But sometimes brevity has pitfalls.

    @jburas – There’s an example right in the WordPress code… take a peek in wp-includes/widgets.php and you’ll see some heavily commented multi-widget code at the very end of the file.

    (WARNING: Use the “uncommented” code for the Text widget as your example; since it’s not commented out it should be well debugged. The commented out section of code may not be as up to date.)

Viewing 15 replies - 46 through 60 (of 309 total)