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?
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: ";
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'
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.
@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.
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?
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.
In that case you wouldn't need this plugin. Just put <?php echo $h->post->origUrl; ?> in the bookmarking templates.
There are four bookmarking templates: _list _no_posts _post _sort_filter Should I put this code in every one of them?
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.
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?
I submit my blog (http://Tamil-computer.blogspot.in) article in hotaru. hotaru show my blog like this (blogspot.in) Thank you.
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
shibuya246 updated Domain Results with a new update entry: Version 0.2 Read the rest of this update entry...