Sunday, January 17th, 2010 (updated 16 Oct ’14)

Nearby Entries v1.6.2 (Free)

 

Sometimes a site needs more access to next and previous entries than ExpressionEngine’s built-in next/previous tags provide.

With the Nearby Entries plugin, you can display not just one but any number of next and previous links. Order them not only chronologically by entry date but by any column in the exp_channel_titles table, such as edit date, expiration date, entry id or title. Filter them using standard channel:entries parameters such as status, category and author (search by custom fields coming soon). And display their custom fields.

For more information, see the docs.

Nearby Entries is now free and released under the GPL license.

ExpressionEngine Forums threads where Nearby Entries is mentioned as a solution:

How to construct a URL to the entry before most recent?

Documentation

Mon 18 Jan ’10
4:15pm

Adam Khan

Yes, there’s an author_id parameter, documenting it now.

Mon 18 Jan ’10
4:53pm

Adam Khan

Excellent, post here if any problems. Remember the debug=“y” parameter can be helpful if you’re not getting the results you expect.

Mon 18 Jan ’10
5:51pm

Adam Khan

My mistake, the reason the author_id parameter wasn’t documented is because it wasn’t there. Now added in v1.0.3.

Mon 18 Jan ’10
9:11pm

Terry Evans

This extension loolks really great.

Say I have a weblog and I want to show the next previous entries of only the currently viewed weblog entry’s author.  Is it possible to filter entries by author?

Mon 18 Jan ’10
9:39pm

Terry Evans

Awesome. This solves a major hurdle for me. Sending $$ to you today.

Thu 21 Jan ’10
2:53am

Steve Hurst

It figures, I just solved this issue with custom query tags… where were you a month ago? :)

Fri 29 Jan ’10
9:45am

shine

Hi Adam,

Using the above example returns:

Notice: Undefined variable: output in /home/club/public_html/admin/plugins/pi.nearby_entries.php on line 364

Notice: Undefined variable: output in /home/club/public_html/admin/plugins/pi.nearby_entries.php on line 364

I have enabled php for the template. I am basically trying to use the plugin to mimic something textpattern or wordpress does out of the box whereby you can link to next and previous entries in the same weblog.

e.g. http://www.opensourcecms.com/demo/1/85/Textpattern demo showing linking to next and previous at the bottom.

Any help would be great. Cheers!

Shine

Fri 29 Jan ’10
3:01pm

Adam Khan

Shine,

I’ve updated to v1.0.4 so that there won’t be a PHP notice from if the $output variable never gets defined.

A couple of things: are you sure you even need this plugin? If you just need a simple single next and previous from the same weblog, EE’s own built-in next and previous tags should be fine.

If you’re not getting any output at all, try the debug=“yes” parameter and see what it tells you.

Fri 29 Jan ’10
3:40pm

shine

Adam thanks for you quick response and fix.

I have looked at the built-in ee next and previous tags over at http://expressionengine.com/docs/modules/weblog/entry_linking.html

I was unaware I could do what I wanted with the built-in tags because I was not getting any output.

For example I have a weblog called spring collection. I then have for example 10 entries called tops, jeans, shoes etc etc.

I simply want the user to land on the page and view the latest entry and then have a button to have a link to the next and previous entries within the same weblog.

I assumed that your plugin was necessary to get this working.

Just will have to play about with both options to see if I can execute what I want.

Thanks once again.

Shine

Tue 23 Feb ’10
8:01pm

Tyler

I have just set the this_weblog (text) and this_urltitle (segment var) but still get no output. I have set debug to “yes” and I get this

Method: prev

This entry ID:

Prelim query:

Raw results: Array

Fields SQL:

Nearby Entries errors:

If there’s no entry_id there must be both a url_title and a weblog_name.

It looks like its not pulling the url_title / weblog to determine which entry it should be. Please help. Thanks!

Tue 23 Feb ’10
11:33pm

Adam Khan

Tyler, you’re right, it’s a bug introduced with v1.1, making the plugin compatible with both EE v1 and v2. Try the new version, v1.1.1, that should address the problem. (Good to see the debug option in use!)

Tue 23 Feb ’10
11:43pm

Tyler

Now were talking! Does exactly what I want. Brilliant plug-in!

Tue 23 Feb ’10
11:50pm

Adam Khan

Thanks, Tyler, pleased to hear it.

Tue 23 Feb ’10
11:58pm

Tyler

Using it with Low Seg2Cat to completely free up the URL structure in EE.

Wed 24 Feb ’10
9:37am

Adam Khan

> Using it with Low Seg2Cat to completely free up the URL structure in EE.

Crazy sh*t. Would be interesting to see an article on this.

Sun 28 Feb ’10
11:55pm

trif3cta

Fantastic plugin idea, although I’m having the same issue that Tyler was. I’m using 1.1.1.

I’m providing this_urltitle=’{segment_x}’ and this_weblog=‘channel_name’ in debug mode and getting back:

If there’s no entry_id there must be both a url_title and a weblog_name.

Thanks for the help.

@Tyler - pls do share, that sounds wicked.

Mon 1 Mar ’10
9:22am

Adam Khan

trif3cta, are you using Multiple Site Manager?

Mon 1 Mar ’10
3:16pm

trif3cta

Nope. My setup is like so:

/staff/profile/name

Name (segment 3) is what I want to key off, and I have a channel called staff.  So this_urltitle=”{segment_3}” this_weblog=“staff” gives me the error.

The entry ID method returns the right data, however it’s not what I need in this particular case.

Thanks so much for the help.

Mon 1 Mar ’10
5:59pm

Adam Khan

trif3cta, it wasn’t working in EEv2. Try downloading v1.1.2.

Mon 1 Mar ’10
7:59pm

trif3cta

Thanks Adam, that seemed to fix it. 

For some reason I can’t run both functions in the same template, whichever one listed first outputs the results of the query and the other one is blank (or in debug mode, it gives the (If there’s no entry….).

Forgive me if I’m being dense.

Mon 1 Mar ’10
8:58pm

Adam Khan

trif3cta, the density is all mine. Fixed in v1.1.3…

Tue 2 Mar ’10
2:42am

trif3cta

Works like a charm. Gracias.

Thu 1 Apr ’10
6:03am

vinay

I am not able to sort the entries in

{exp:nearby_entries:next this_urltitle=”{segment_3}” this_weblog=“photos” debug=“n” limit=“5” orderby=“entry_id” sort=“desc”}

The output entries always gets sorted in “ASC” rather than what i specified. Anyway to solve this?

Thu 1 Apr ’10
6:06am

vinay

Actually when i use sort=“asc” in next loop, i get very weird results… very random entries…

Thu 1 Apr ’10
10:23am

Adam Khan

Thanks for trying the plugin, vinay. I’m taking a look now at the problem…

Thu 1 Apr ’10
11:09am

Adam Khan

Vinay, I’m seeing that when using orderby=“entry_id” and sort=“asc” for the next function, it ends up producing the same thing as the previous function. Working on it.

Thu 1 Apr ’10
4:39pm

Adam Khan

Vinya, there was a step missing in the logic, which I’m trying to fix, but the plugin won’t take two instances of a weblog (well, it does, but the second one ignores important parameters).

I’ve got to give up on this today—I’ll resume working on the fix tomorrow or Sunday.

Mon 5 Apr ’10
5:20am

vinay

Hi Adam,

Thanks for the info. Let me know if you fix this.

Mon 5 Apr ’10
11:41am

Adam Khan

Vinay, you can now download v1.2.3, and the problem should be fixed.

Because the fix required another level of complexity, the plugin now also has another level of control. See the this_orderby and this_sort parameters.

Tue 6 Apr ’10
1:49am

vikhel

Hi Adam, I am trying to download v1.2.3, but there is an error that says

“Oops, there is no file at this URL. Hopefully you can find what you’re looking for in the adjacent lists.”

Tue 6 Apr ’10
2:12am

Adam Khan

Vikhel, thanks for the heads-up. Try now.

Tue 6 Apr ’10
2:41am

vikhel

Hi Adam,

Getting this error when there are no prev entries

Notice: Trying to get property of non-object in /data/home/app/www/system/plugins/pi.nearby_entries.php on line 100

Warning: Invalid argument supplied for foreach() in /data/home/app/www/system/plugins/pi.nearby_entries.php on line 108

Tue 6 Apr ’10
2:46am

Adam Khan

Will fix that tomorrow (late here, need to be fully awake…).

Tue 6 Apr ’10
9:42am

Adam Khan

Vikhel, I can’t replicate this problem. Can you switch the debug paramter to “yes” and either post the results here or email me them?

Meanwhile I’ve updated the plugin to v1.2.4.

Wed 7 Apr ’10
2:43am

vikhel

Hi Adam,

I am using next loop inside weblog:entries

{exp:weblog:entries weblog=“contest_photos” limit=“1” disable=“trackbacks|comments” status=“Open|Featured”}
              {exp:nearby_entries:next this_entryid=”{entry_id}” debug=“n” limit=“5”}
                {embed=“seaawards/photocarousel” curEntryID=”{nearby:entry_id}”}
              {/exp:nearby_entries:next}
              {/exp:weblog:entries}

The error appears only when you are viewing the latest entry. As there is no next entries, it displays the error. When i set debug=“y”, i get

Notice: Undefined variable: fields_sql in /data/home/app/www/system/plugins/pi.nearby_entries.php on line 642

Notice: Undefined variable: final_sql in /data/home/app/www/system/plugins/pi.nearby_entries.php on line 643

Wed 7 Apr ’10
6:33pm

Adam Khan

Vikhel, those are errors generated by EE. The plugin itself should generate some info instead of the actual output when its debug paramter is set to “y”.

I tried on the latest entry myself and didn’t get those errors, that’s why I’m thinking maybe there’s a clue in the plugin’s own debug notes in your scenario.

Sat 10 Apr ’10
10:21pm

mgr88

Hi Adam,

I’m just trying it out and using the code snippet for year/month/date links, with appropriate changes for EE2. It all works well except that the php code doesn’t parse when it is inside the nearby tags.

I’ve got php enabled for the template and when I put the equivalent php date code outside the tags it gives the date with correct formatting. But when the code is inside the tags the output is a literal repeat of the code.

Michael

p.s. thanks for the great “How I Built Subtraction” article.

Sun 11 Apr ’10
9:49am

Adam Khan

Michael,

Thanks for trying the plugin. Did you try the parse=“inward” parameter?

Sun 11 Apr ’10
10:53am

mgr88

Hi Adam, I just added the parse=“inward’ parameter. It hasn’t made a difference. I’m using EE 2.0.1 on MAMP 1.8.4 and MasOSX 10.6.3.
This segment of input with the same 2 calls, one inside and one outside:
                          {exp:nearby_entries:next ......
                                            ....
                <?php echo date(“Y/m/d”, “{entry_date}”); ?>
                {/exp:nearby_entries:next}
                          <?php echo date(“Y/m/d”, “{entry_date}”); ?>
Gives this output
                    <?php echo date(“Y/m/d”, “1213886097”); ?>
                    2008/06/19

Michael

Sun 11 Apr ’10
5:40pm

Adam Khan

Michael, one other thing—is PHP set to the output rather than input stage in template settings? It won’t work with PHP set as input—no plugin will I don’t think, due to EE’s template parsing order.

Sun 11 Apr ’10
7:30pm

mgr88

Hi Adam, yes, PHP is set to output.
As a check to see if it was a general issue with plugins, I put the same php code inside twitter timeline tags on the same page. That rendered the dates correctly.

I also checked the logs inside MAMP and couldn’t find any error messages.
Michael

Mon 12 Apr ’10
7:39am

Adam Khan

Michael, the problem was due to introducing EE’s xss_cleaning functionality in v1.3.

I’ve added a parameter to v1.3.1 of the plugin, allow_php, which if set to “yes”, makes the plugin not use xss_cleaning, thereby allowing PHP within the plugin.

Thanks for the heads up, I’ll add this parameter to other plugins.

Mon 12 Apr ’10
10:33am

mgr88

That fixed it. Thanks so much for your prompt help.

Michael

Mon 26 Apr ’10
5:13pm

mgr88

Hi Adam, sorry to bother you again. I just upgraded EE to version 2.0.2 and something seems to have changed. The plugin now gives the following error.
Cheers,
Michael

A PHP Error was encountered
Severity: Notice
Message: Undefined property: Channel::$query
Filename: nearby_entries/pi.nearby_entries.php
Line Number: 586

Wed 28 Apr ’10
2:28pm

Adam Khan

Sorry about the delay Michael, I’ve been travelling this last day. Will get to the fix as soon as I can.

Wed 5 May ’10
7:11am

Adam Khan

Michael, I had to take an unscheduled trip and am now back and catching up. My apologies again for letting this problem sit so long. I’ll be addressing it today, Wednesday.

Fri 7 May ’10
6:30am

Adam Khan

Michael, change made to adapt to changes in EEv2.0.2. Should work now.

Tue 11 May ’10
9:05am

mgr88

Hi Adam,

thanks again for this.

Fri 21 May ’10
4:37pm

Kyle Batson

Hi Adam,
The plugin is working properly except for getting to an entry that has no previous entry. When that happens it outputs the following error:

Notice: Trying to get property of non-object in /plugins/pi.nearby_entries.php on line 103

Warning: Invalid argument supplied for foreach() in /plugins/pi.nearby_entries.php on line 111

This is my code:
{exp:weblog:entries weblog=“comics” limit=“1”}
{comic_image}
{exp:nearby_entries:prev this_entryid=”{entry_id}” this_weblog=“comics” author_id=”{author_id}” limit=“1”}{nearby:entry_id}{/exp:nearby_entries:prev}
{/exp:weblog:entries}

Fri 21 May ’10
5:43pm

Adam Khan

Kyle, I’m not able to replicate that problem. Can you plugin in the debug=“y” parameter and report the results here? You’re on EE v1.x, right?

Fri 21 May ’10
8:08pm

Kyle Batson

Turning on debug added the following errors:
Notice: Undefined variable: fields_sql in /plugins/pi.nearby_entries.php on line 650

Notice: Undefined variable: final_sql in /plugins/pi.nearby_entries.php on line 651

Parse error: syntax error, unexpected T_LNUMBER in /core/core.functions.php(653) : eval()‘d code on line 5

Method: prev

This entry ID: 2

Prelim SQL: SELECT entry_id FROM exp_weblog_titles WHERE weblog_id = ‘1’ ORDER BY entry_date desc

Raw results: 1

Limited results:

Fields SQL:

Final SQL:

Fri 21 May ’10
8:09pm

Kyle Batson

And yes. EE 1.6.9, latest build.

Tue 8 Jun ’10
8:06pm

Kyle Batson

Any thoughts Adam? Thanks.

Thu 10 Jun ’10
6:43am

Adam Khan

Sorry Kyle, I forgot all about this one. Will get on it this afternoon (UK time) and try again to discover the problem.

Thu 10 Jun ’10
8:08pm

Kyle Batson

No worries.
Let me know if there’s anything I can do to help.

Fri 11 Jun ’10
8:07am

Adam Khan

Kyle, how many entries do you have in the Comics weblog?

Fri 11 Jun ’10
9:17pm

Adam Khan

Thanks for staying on this, Kyle. Problem now fixed in v1.4.2.

Mon 2 Aug ’10
7:16pm

Jonathan Longnecker

Hello! It doesn’t seem that the custom fields work with a file field type (native EE2). Is that correct? If so, any plans to support it in the future?

Tue 3 Aug ’10
3:54pm

Adam Khan

Jonathan, you’re right, I’ll add this limitation to the plugin’s docs. Instead of the file path, what gets outputted is {filedir_1}, so I’ll have to figure out what’s happening there. Meanwhile I’ll add supporting this to the plugin’s roadmap.

Tue 3 Aug ’10
5:09pm

Adam Khan

Jonathan, v1.4.3 of the plugin now has support for EE2’s field type.

Tue 3 Aug ’10
7:40pm

Jonathan Longnecker

Hahaha wow man. Talk about fast turnaround! Completely awesome. I’ve already got it working, thanks so much!

Tue 3 Aug ’10
7:47pm

Adam Khan

Pleasure is mine, Mr Longnecker. Can I quote some of that comment on the slidey bits below?

Tue 3 Aug ’10
8:59pm

Jonathan Longnecker

Sure thing, go for it. One more question: Is there a way to do an {if_no_results} type statement to put some content in when you’re at the first/last entry? I’ve been trying to do it with count and total_results without any luck.

thanks,

Jonathan

Tue 3 Aug ’10
9:17pm

Adam Khan

Should work with nearby:count and nearby:total_results:

{if “{nearby:count}” == “1”}first{/if} and {if “{nearby:count}” == “{nearby:total_results}”}last{/if}

Is that not working?

Tue 3 Aug ’10
9:55pm

Jonathan Longnecker

Hmm for some reason I can’t get it to work. This is what I’m using right now:

{exp:nearby_entries:prev this_urltitle=”{segment_3}” this_channel=“blog” debug=“n” limit=“1”}
  {if “{nearby:count}” == “1”}
      <li><h3>You’re at the first entry!!!</h3></li>
  {if:else}
      {embed=“blog/nextprev” title=”{nearby:title}” url=”{nearby:url_title}” img=”{nearby:body_image}”}
  {/if}
{/exp:nearby_entries:prev}

This does the opposite of what I need…the first entry is blank and all the other entries that should have a previous one say “You’re at the first entry.” I assumed if I switched the logic it would work, but while it does show the correct previous entry on entries that have them, the first entry is still blank. I can’t seem to find the value in the count that will trigger the empty version.

Further adding to my confusion, the next and previous tags seemed to be switched. It might be my embed setup, but I’m so turned around from testing I’m not sure :)

Haven’t gotten to the last entry, either but I don’t see it being a big a deal as the first.

Also (man I’m turning into a pain, I’m sorry) whenever I try to view a category page I’m getting this error:

A PHP Error was encountered
Severity: Notice

Message: Undefined offset: 1

Filename: nearby_entries/pi.nearby_entries.php

Line Number: 419

Error

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 5


  SELECT f.field_id, f.field_name
  FROM exp_channel_fields AS f, exp_channels AS c, exp_channel_titles AS e
  WHERE f.group_id = c.field_group
  AND c.channel_id = e.channel_id
  AND e.entry_id =
  ;

which doesn’t make any sense because the category page is a listing page, not a single entry. Both are in the same template, but being checked by {if segment} statements.

I’m sorry for all the questions; I’m just sooo close to having it all working :)

Tue 3 Aug ’10
10:03pm

Adam Khan

It’s late here UK time, I’m better off looking at this fresh in the morning.

Tue 3 Aug ’10
10:08pm

Jonathan Longnecker

Haha no worries man. That’s a lot to process. I’m out for the day here as well. Thanks again for your help.

Mon 9 Aug ’10
2:13pm

Jonathan Longnecker

Hey Adam,

So apparently EE2 handles if/segments differently than EE1 and I’ve had to separate my templates so the whole category error issue is gone for me. And the reversal isn’t that big a deal either; just trying to figure out how to add something to that newest entry to let people know they’re at the first one.  I’m going to try something with channels; let me know if you come up with anything on your end.

thanks,

Jonathan

Mon 9 Aug ’10
4:09pm

Adam Khan

Jonathan, my apologies, I completely forgot about this thread. Will take a look at how conditionals are working.

Mon 9 Aug ’10
6:53pm

Adam Khan

Jonathan, I’m using Nearby Entries v1.4.3 I tried:

{if “{nearby:count}” == “1”}Something{/if}

and

{if “{nearby:count}” == “{nearby:total_results}”}Something Else{/if}

in EE2.1.0 build 20100805 and it worked fine, and no PHP errors. Maybe try with two conditionals instead of {if:else}?

Mon 9 Aug ’10
9:19pm

Jonathan Longnecker

Hey Adam,

I’m sorry I must be missing something simple. I haven’t had a chance to upgrade to the EE build that just came out, but this is the code I’m using:

{exp:nearby_entries:next this_urltitle=”{segment_3}” this_channel=“blog” debug=“n” limit=“1”}
       
          {if “{nearby:count}” == “{nearby:total_results}”}
              <li>
              <div class=“noentry”></div>
              <h3>You’re at the first entry</h3>
              </li>
          {/if}
         
          {if “{nearby:count}” == “1”}
          {embed=“blog/nextprev” title=”{nearby:title}” url=”{nearby:url_title}” img=”{nearby:body_image}”}
          {/if}
         
        {/exp:nearby_entries:next}

I’ve also tried switching these so that the count == 1 is around the related embed and the total results is around the First Entry text. I think I’m not using the tags correctly?

Thanks for your patience,

Jonathan

Mon 9 Aug ’10
9:34pm

Adam Khan

Jonathan, a first question: if you’ve got the limit set to 1, why do need to do this anyway, since there’ll only be one result? Also, comparing nearby:count to nearby:total_results will give you the last entry, not the first.

I just tried to embed a template within a conditional within the tag and it works for me.

Is the tag doing what you’d expect without the conditionals and embeds? If so, I’m not sure what else to do except try to fix directly on your template. Want to email me permissions?

Mon 9 Aug ’10
9:39pm

Jonathan Longnecker

Haha well that’s what I was wondering. Let me shoot you an email with some more info.

Fri 22 Oct ’10
6:09pm

George

I am trying to limit the results to a single category, but pass this as a variable. One way that I can see this working is by using the Session Variables plugin and setting the category parameter as:

category = {exp:session_variables:get name=‘category’}

This, however, doesn’t seem to work. Does your plugin allow other plugins to set parameters? Or is this an issue with the other plugin?

Sun 24 Oct ’10
9:52pm

george

Okay, scratch my last comment, but I do have a legitimate issue here. I am finding that when assigning a category to the parameters, The last entry in the group throws an error “The query you submitted is not valid.” This only happens when the category is set. Is this a known issue and is there a work-around?

I would really love to get this plug in to work for me and will be more than happy to pay the fee upon that happening, but right now, it’s giving me fits. Thanks!

Mon 25 Oct ’10
5:20pm

Adam Khan

George, are you on EE1 or 2?

Mon 25 Oct ’10
5:32pm

George

I’m on 2.

Mon 25 Oct ’10
6:17pm

Adam Khan

George, in EE1 the category parameter is taken care of by invoking the EE object weblog. The plugin does the same thing for EE2, invoking the channel object, but EE2 won’t accept it. I won’t have an immediate fix for this—sorry!

I’ve added to the docs that this parameter works in EE1 only.

Mon 25 Oct ’10
6:20pm

George

Ah, okay. Well thanks for looking into it and letting me know. I will explore alternative solutions.

Mon 25 Oct ’10
10:57pm

Bryan

Hi Adam,
I’m thinking of purchasing your plugin, but I have the same issue as George, I need to be able to view the next/previous entries within a category. When do you expect Nearby Entries to support the Category param in EE2?

Tue 26 Oct ’10
9:48am

fxfortress

Hello Adam,

I’m also looking at purchasing your plugin to be able to view the next/previous entries within a category for EE2. Please do let me know when it can do this, as $15 saves me a lot of time and effort.

Tue 26 Oct ’10
10:03am

Adam Khan

I’ve added the fix to the top of the roadmap and marked it urgent.

Tue 26 Oct ’10
10:05am

fxfortress

Thanks Adam ... looking forward to the next update.

Tue 26 Oct ’10
5:05pm

Bryan

Thank you, keep us posted. Cheers.

Fri 29 Oct ’10
11:33am

Arif

Hi, I am getting a serious error with EE 2 : invalid query on line 101..and then the page stops parsing.

Some entries are working fine, but I found the reason: it only happens with entries that have a NEWER entry after it with STATUS CLOSED.

Please let me know how to fix it!

Fri 29 Oct ’10
3:44pm

Adam Khan

Arif, I’ll take a look as soon as I can. Swamped with client deadlines at the moment.

Thu 11 Nov ’10
12:04am

george

Hi Adam, Sorry to pester you, but any rough idea on the release of the update?

Tue 23 Nov ’10
6:09am

Bryan

Hi Adam, Just wanted to check on the status of the categories update. Cheers.

Mon 13 Dec ’10
3:31pm

Kyle Batson

I don’t know if this has recently shown up, because it was working earlier…
When I click the link the most recent item (the one that does not have a next entry), I get the following error:

Error

The query you submitted is not valid.

Filename: third_party/nearby_entries/pi.nearby_entries.php

Line Number: 101

Tue 14 Dec ’10
9:32pm

Adam Khan

George, Bryan, my apologies for taking so long to respond to your questions re when we’ll get categories back for the EE2 version. I’ve had lots of things going on on personal front, but still, that’s no excuse. I’m afraid I can’t give you a date, but I can say it’s the first thing I’ll do when I get back to work.

Kyle, I don’t quite get it—when does that happen?

Tue 14 Dec ’10
10:18pm

Kyle Batson

http://www.premiersportsonline.com/news
It only happens when you click on the most recent entry.

Tue 14 Dec ’10
11:02pm

Adam Khan

Kyle, was it working with an earlier version of the plugin, or working at one point with the current v1.4.4?

Wed 15 Dec ’10
4:35am

Kyle Batson

I think it might have been working before. I’m sure I would have noticed if it wasn’t, but I can’t be sure. I don’t know if upgrading to 2.1.1 made the change or what. I just recently upgraded to 1.4.4 to see if that would fix it, but it didn’t.

Wed 15 Dec ’10
7:00pm

Kyle Batson

To clarify, I had some bugs in other places recently and upgraded a lot of components. This is a part of the site that had been working fine so I didn’t check it as regularly as I should have. Fortunately, I do have an old version of the site that was working. It has EE 2.1.0 and Nearby Entries version 1.4.3.

Wed 15 Dec ’10
7:19pm

Adam Khan

Kyle, one last thing: if you replace v1.4.4 now with v1.4.3, does the problem go away? If so, that should make narrowing down the problem pretty easy as due to something introduced in the new version.

Wed 15 Dec ’10
7:37pm

Kyle Batson

Nope, no luck.

Wed 15 Dec ’10
7:45pm

Adam Khan

Kyle, it might be difficult to replicate your situation—can you email me at .(JavaScript must be enabled to view this email address) edit access to the template in question and ftp access to edit the plugin at the same time?

Sat 5 Feb ’11
3:28am

Bryan

Hey Adam,

Any word on categories functionality update?

Thanks,
Bryan

Thu 10 Mar ’11
4:05am

ron cooper

Hi Adam,

I downloaded plugin to try first since I am running into problems with the next/prev tags in EE…

I just ran a test with the example provided, enabled php in template, I added the path to template and weblog. nothing shows up except the arrows, which is better than the next/prev tags in EE which do not seem to work for me at all. I must be missing something…

Thanks
Ron

Thu 10 Mar ’11
4:28am

Adam Khan

Ron, tough to tell without seeing your precise template (and possibly channel fields). Can you paste your template here?

Thu 10 Mar ’11
5:16am

Ron Cooper

I actually want/have the next/prev code in the “includes/titles”...
I did not bother yet to change any of the example html…

{embed=“includes/head” title=”{exp:weblog:entries weblog=“art” limit=“1” status=“top”}{title}{/exp:weblog:entries}”}
{exp:weblog:entries weblog=“art”  status=“top” limit=“1” }
<body>
{embed=“includes/header”}

<div id= “prev” class=“prefix_13” >
<div class=“nextprev nextprev-single”>
  <div class=“nav-previous”>
      <span class=“nextprev-arrow”>‹</span>
      {exp:nearby_entries:prev this_urltitle=”{segment_2}” this_weblog=“art” debug=“n” limit=“1”}
     
        Previous Post
        <span class=“nextprev-single-link-title”>{nearby:title}</span>
     

      {/exp:nearby_entries:prev}
  </div><!—/.nav-previous—>
  <div class=“nav-next”>
      {exp:nearby_entries:next this_urltitle=”{segment_2}” this_weblog=“art” debug=“n” limit=“1”}
     
        <span class=“nextprev-post”>Next Post</span>
        <span class=“nextprev-single-link-title”>{nearby:title}</span>
     

      {/exp:nearby_entries:next}
      <span class=“nextprev-arrow”>›</span>
  </div><!—/.nav-next—>
</div><!—/.nextprev—> 
</div>


<div id=“sub-header” class=“container_16” ><div id=“sub-head”><div id =“titlebar”><div id =“title” class=“title” >{title}</div>{embed=“includes/titles”}</div></div></div>
<div id=“content”>
<div id=“artwrap”>
<div id=“art_images” >
{article_excerpt}{/exp:weblog:entries}</div>
</div>
</div>
</body>

Thu 10 Mar ’11
8:42pm

Launch Something

Hello Adam,

I hope you can help me get this working.  I keep getting the following errors:

A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_DB_mysql_result::$result
Filename: nearby_entries/pi.nearby_entries.php
Line Number: 360

A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: nearby_entries/pi.nearby_entries.php
Line Number: 360

When I turn on debugging it keeps saying:

Nearby Entries errors: Multiple Site Manager is installed but the site has not been specified.

This is strange because I do have the site defined:

{exp:nearby_entries:next site=“site_name” this_urltitle=”{segment_3}” this_channel=“channel_name” limit=“1” debug=“y”}

Funny thing is, if I change line 202 from      

$site_id = “”;  to $site_id = “1”;

the plugin works but still kicks out the PHP errors at the beginning of this post.  I am on ExpressionEngine: Version 2.1.3 Build 20101220

Thanks,

Steve

Sun 13 Mar ’11
1:11pm

Adam Khan

Steve, there was a bug. Try downloading the new v1.4.5.

Wed 6 Apr ’11
8:33pm

Andrew

Hello,

just bought this and it works great.. except it doesnt seem to work with img sizr. Is this true?

Thu 7 Apr ’11
5:28am

Adam Khan

Andrew, I’m not sure. Did you use the parse=“inward” parameter?

Sun 22 May ’11
9:51pm

8020design

I’ve been trying to get the nearby-entries to work with the Taggable add-on, but not having much luck. I’m not sure if it’s because of how Taggable stores it’s data.

What I’m trying to solve for is when a user clicks a Taggable tag, such as Non-Profit. It returns a list of project entries that were tagged with “Non-Profit.” Then if the user clicks on a specific project entry, I want the user to be able to go previous and next through only “Non-Profit” projects. However, it’s returning entries without those tags.

The URL flow looks something like this:
1. http://www.somedomain.com/work/groupsitesby/Non-Profit
2.  http://www.somedomain.com/work/groupsitesby/Non-Profit/project-X
(The second URL above is generated from the previous page with dynamic=“no” so that I can show the tag name in the URL. I’m not sure if that’s causing part of the problem)

This is my code that isn’t returning the correct entries:
    {exp:nearby_entries:prev this_urltitle=”{segment_4}” this_channel=“projects” debug=“n” limit=“1”}
        ‹ Previous: {nearby:title} |
    {/exp:nearby_entries:next}

    {exp:nearby_entries:next this_urltitle=”{segment_4}” this_channel=“projects” debug=“n” limit=“1”}
        Next: {nearby:title}
    {/exp:nearby_entries:next}

Am I missing something? Any help I can get would be great. Thanks in advance.

Wed 13 Jul ’11
9:23am

learn 2 speak Spanish

You may use any processor if you want to.  But Nearby Entries has been used to make our data’s more accessible and organize in a way that we can check it anytime. There are a lot of things these days that made everything very easy.

Sat 16 Jul ’11
7:24pm

intech

exp:nearby_entries:next breaks if next entry is dated in the future, but if “show_future_entries=“yes” is added as a parameter to exp:nearby_entries:next it seems to do ok (even when this parameter is not give for the enclosed channel:entries tag.)

Fri 22 Jul ’11
7:54pm

Kyle Batson

Hi Adam, it’s me again. I reworked the code again, and again it’s nearly working. Unfortunately, when it gets to a page with the oldest entry, it starts gathering entries from another channel. Here’s the problem URL http://www.premiersportsonline.com/news/2010/01/27/three-returning-award-winners-and-three-new-honorees-selected-as-2009-recip
That previous link to ‘Lowe’s Ticket Management System’ should not be appearing.

Sat 23 Jul ’11
4:13pm

Trench

Looks like this is working well for our site.  I don’t see a looping function, but was hoping we could jump into the entry “array” at a single point and then just push users forward through a loop of entries instead of offering them a previous link.  Hopefully that makes sense.  Thoughts on how to accomplish that?

Sat 23 Jul ’11
10:34pm

Trench

Also having no luck getting the search parameter working.  I don’t that parameter picked up in the code, but I could be missing it.

Sun 7 Aug ’11
1:08am

Jim

Getting a PHP error on EE2 - Severity: Notice

Message: Undefined variable: this_weblog_id

Filename: nearby_entries/pi.nearby_entries.php

Line Number: 317

Would like to know how to fix this.

Wed 2 Nov ’11
4:10pm

Travis Fleck

I believe my question may be the same as Jonathan’s but is there a way to display some text when there isn’t a next or prev entry (based on the current entry page)?

Here is the scenario.  I’d like to have a ‘Next’ text link when there is a next entry but just ‘Next’ text (w/out) link when there is no next entry. 

Thanks!

Wed 22 Feb ’12
9:25pm

luke holder

I am also getting this error on version 1.4.5

The query you submitted is not valid.

Filename: third_party/nearby_entries/pi.nearby_entries.php

Line Number: 101

i am using this tag:

{exp:nearby_entries:next this_urltitle=”{segment_4}” this_channel=“blog” limit=“1”}
         
        {/exp:nearby_entries:next}

The error only shows up on the most recent entry and the other ones work fine. This is not in a category or anything.

Sat 19 May ’12
8:34pm

Adam Khan

Oh dear, it looks like it’s been a solid year since I’ve responded here. What can I say fellows except to offer my apologies. Version 1.5.6 should fix the syntax error issues.

Fri 19 Oct ’12
3:40pm

tobaco

The search:-parameter seems to have no effect ans i also could not find it in the plugin-source. Did you removed this one?
Without this one, the plugin is quite useless for me by now.

Thanks!

Sun 21 Oct ’12
12:02pm

Adam Khan

Tobaco, you’re right, the parameter is in fact not supported in the plugin. I’ll remove it from the docs and add it to the roadmap. My apologies. Let me know by email if you need a refund.

Post a comment

Name:

Email:

Location:

URL:

Your comment:

Please answer the following question to assure your intentions are honorable: What is the capital of France? (5 characters required)

Remember my personal information
Notify me of follow-up comments?