Part of the EllisLab Network
pMachine Pro has been replaced by ExpressionEngine, our full featured web publishing solution. Please consider upgrading.
You can download pMachine Pro here: Download pMachine Pro  |  Download Language Packs
   
 
Related Entries Minor Error
Posted: 08 April 2005 07:33 PM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  33
Joined  2002-07-31

Just found a minor bug that’s, well, bugging me.

The related entries tag in pMachine isn’t working - if you go to http://www.thegate.ca/news/more.php?id=831_0_1_0_M and look below the article there are links there, but they aren’t the most recent music entries. It seems like it doesn’t see any entires that were created since I upgraded pMachine to 2.3/2.4.

Any ideas how I can fix this? No rush…

Cheers!
Andrew

Profile
 
 
Posted: 24 April 2005 11:39 AM   [ Ignore ]   [ # 1 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  2002-08-05

I cannot see anything obviously wrong with the code and I do not remember changing it during the development of 2.4 except change how the time is gotten.  It works by looking up the category of the displayed entry and finding any other entries that have the same category.  If there is no category it will look for entries with no category as well.  Does this entry have a category?

 Signature 
Profile
 
 
Posted: 25 April 2005 04:22 PM   [ Ignore ]   [ # 2 ]  
Grad Student
Avatar
Rank
Total Posts:  33
Joined  2002-07-31

Yeah, all of my stories are put in categories.

As an example… Here’s one from my Game category:
http://www.thegate.ca/news/more.php?id=839_0_1_0_M

It lists these as the most recent stories:
‘Jak II’ Hits The PS2; ‘Ratchet & Clank’ Sequel Coming This Fall; ‘True Fantasy Live Online’ Coming to Xbox; BloodRayne To Appear In… Playboy?; Danny Elfman Joins ‘Fable’ Soundtrack

But if you go to the game sections…
http://www.thegate.ca/news/index.php?id=C0_31_1
It’s all just Gam3Bytes for the last four stories.

Profile
 
 
Posted: 25 April 2005 04:32 PM   [ Ignore ]   [ # 3 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  2002-08-05

Ah, I suspect it is because it orders the result by title and not date.  This is the way that tag has always behaved, I believe, so I am hesitant to change it now.  I can tell you where to modify the code though.

 Signature 
Profile
 
 
Posted: 25 April 2005 05:20 PM   [ Ignore ]   [ # 4 ]  
Grad Student
Avatar
Rank
Total Posts:  33
Joined  2002-07-31

Sure, fire away - perhaps I edited it previously and just lost those changes when I updated. I totally forgot about that actually!

Profile
 
 
Posted: 25 April 2005 05:22 PM   [ Ignore ]   [ # 5 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  2002-08-05

Ok, in the /pm/lib/stats.fns.php file there is a related_entries() function around line 92 you’ll see this:

order by title

Change it to this:

order by t_stamp

 Signature 
Profile
 
 
Posted: 25 April 2005 05:46 PM   [ Ignore ]   [ # 6 ]  
Grad Student
Avatar
Rank
Total Posts:  33
Joined  2002-07-31

Thanks, but just one issue now - it’s backwards. 

Profile
 
 
Posted: 25 April 2005 05:49 PM   [ Ignore ]   [ # 7 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  2002-08-05

OK, now which is which?  Try either

order by t_stamp dec

or

order by t_stamp asc

I think it is the latter, but I am not positive.

 Signature 
Profile
 
 
Posted: 25 April 2005 06:02 PM   [ Ignore ]   [ # 8 ]  
Grad Student
Avatar
Rank
Total Posts:  33
Joined  2002-07-31

Got it - it was descending, but it was desc. Thanks for all your help! Really, really appreciate it. I’d send you some beer if I could. LOL

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 233, on December 18, 2007 12:04 AM
Total Registered Members: 60714 Total Logged-in Users: 0
Total Topics: 73170 Total Anonymous Users: 0
Total Replies: 394632 Total Guests: 52
Total Posts: 467802    
Members ( View Memberlist )
Active Members: