1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Domain Results 0.2

Domain Results

  1. Nick

    Nick Well-Known Member

    Nick submitted a new resource:

    Domain Results - Domain Results

    Read more about this resource...
     
    Last edited by a moderator: Nov 30, 2014
    quimbox, Gunaxin, skorpyo and 4 others like this.
  2. nothingman

    nothingman Active Member

    Nick, the attachment is empty.
     
  3. Nick

    Nick Well-Known Member

    Sorry, try again now.
     
  4. nothingman

    nothingman Active Member

    Thanks Nick, this is just awesome. Not downplaying Jon's plugin, but this is giving the desired results. :)

    Also, is there a way I could add the text, 'Source' before the link?
     
  5. Nick

    Nick Well-Known Member

    Sure, you can edit the language file (and then clear the language cache).

    "Source" is not clickable in this example:
    PHP:
    $lang["domain_results_pre_domain"] = " |   Source: ";
    $lang["domain_results_domain"] = "";
    "Source" is clickable in this example:
    PHP:
    $lang["domain_results_pre_domain"] = " |  ";
    $lang["domain_results_domain"] = "Source: ";
     
    quimbox and nothingman like this.
  6. nothingman

    nothingman Active Member

    Thanks Nick.

    I did away with the 'Source' text and replaced it with a tool tip (when a user places the mouse on the URL, the user sees what it is does).

    For those interested in adding a tool tip just replace the following in domain_results.php (line 48).

    PHP:
    echo $h->lang["domain_results_pre_domain"] . "<a href='" $h->url(array('domain'=>$get_domain)) . "'>"$h->lang["domain_results_domain"] . $get_domain "</a>\n";
    WITH

    PHP:
    echo $h->lang["domain_results_pre_domain"] . "<a href='" $h->url(array('domain'=>$get_domain)) . "' title='ASDF'>"$h->lang["domain_results_domain"] . $get_domain "</a>\n";
    Replace 'ASDF' with 'whatever you want' :)
     
  7. Gunaxin

    Gunaxin Well-Known Member

    Nice work Nick! This plugin seems to find everything better. However it just gives me the Popular results. I can tell that's what you intended, and then if I click Upcoming or Latest I should get the results from that domain as well. However those buttons revert back to Upcoming and Latest for the entire site (without tagging the domain too). See an example here :

    http://links.gunaxin.com/domain/uproxx.com/

    I also noticed this method doesn't generate the RSS feed as the search did. That might be useful to have it possible.
     
    Last edited: Dec 9, 2010
  8. Nick

    Nick Well-Known Member

    @Gunaxin, you're right about there being no RSS feed. That would be a good addition in a future version.

    As for the filters, you're right about that too, but it's easily fixed:

    1. Open bookmarking.php in the Bookmarking plugin.
    2. Find the theme_index_pre_main function (possibly around line 500?)
    3. Scroll down to the very bottom of that function and add this plugin hook:

    PHP:
    $h->pluginHook('bookmarking_sort_filter'); // allow custom filters
    before:

    PHP:
    // display the sort links
    $h->displayTemplate('bookmarking_sort_filter');
    That hook will be in the next version of Bookmarking.
     
  9. Gunaxin

    Gunaxin Well-Known Member

    hmmmm. Tried it, and it didn't work. So either I didn't do it right, or it doesn't work. Can anyone else test and confirm?
     
  10. Kenet

    Kenet New Member

    I have question...
    Is the a way to modify this plugin to work as direct source link.
    I know that users can click the post title to visit source site (in Luciola Light) but I would like to give them visible original direct source link. Not to site but to actual url that user submitted in step 1 of post submission.
     
    Last edited: Jan 25, 2011
  11. Nick

    Nick Well-Known Member

    In that case you wouldn't need this plugin. Just put <?php echo $h->post->origUrl; ?> in the bookmarking templates.
     
  12. Kenet

    Kenet New Member

    There are four bookmarking templates:
    _list
    _no_posts
    _post
    _sort_filter

    Should I put this code in every one of them?
     
  13. Nick

    Nick Well-Known Member

    Well, you wouldn't put it in _no_posts, because that shows no posts, and you wouldn't put it in _sort_filter because that only shows the sort/filter. ;)
     
  14. quimbox

    quimbox New Member

    thank you very much for the tip, also you can add $ get_domain code to display the domain name.

    PHP:
    echo $h->lang["domain_results_pre_domain"] . "<a href='" $h->url(array('domain'=>$get_domain)) . "' title=".$get_domain.">"$h->lang["domain_results_domain"] . $get_domain "</a>\n";

    as I can do to when they click, the link opens the page in a new tab?
     
    Last edited: Apr 30, 2012
  15. robin007

    robin007 Well-Known Member

  16. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    Please go to the code for the domain results plugin in the file domain_results.php
    around line 55

    copy this in instead for the function getDomain

    Code:
    private function getDomain($url)
        {   
                    //http://news.mullerdigital.com/2013/10/30/how-to-get-the-domain-and-tld-from-a-url-using-php-and-regular-expression/
                    if (preg_match("/[a-z0-9\-]{1,63}\.[a-z\.]{2,6}$/", parse_url($url, PHP_URL_HOST), $_domain_tld))
                    { 
                        return $_domain_tld[0];
                    }
                   
                    //http://stackoverflow.com/questions/399250/going-where-php-parse-url-doesnt-parsing-only-the-domain
                    //$pieces = parse_url($url);
            //$domain = isset($pieces['host']) ? $pieces['host'] : '';
                   
    //        if (preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $regs))
    //        {
    //            return $regs['domain'];
    //        }
    
            return false;
        }
    
    I have commented out the current way and put in a new way of getting the domain

    Please try that and tell me if it works. If it does I will make a settings for this plugin to choose between the old way (showing just the top level domain) and the way you want (including the subdomain). The plugin is currently setup to show the top level domain only.

    Let me know so I can make changes if required
     
    valMETNG likes this.
  17. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    Also, the text on your site is so small I can barely read it. Should it be larger?
     
  18. valMETNG

    valMETNG Administrator Staff Member Admin

    This made me look at my (highly bastardized) code and see a bug. Thank you :)
     
    shibuya246 likes this.
  19. robin007

    robin007 Well-Known Member

    I tried many time but not work.
     
  20. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    robin007 and valMETNG like this.

Share This Page