Welcome to Geeklog, Anonymous Monday, October 03 2022 @ 01:12 pm EDT

Geeklog Forums

What's Related block weirdness


oddly

Anonymous
I posted an article on a geeklog site and for some reason, almost the entire article appears as part of the "What's Related" block, so basically you see the real article in the middle and most of the article again in the what's related block. Any ideas on how to fix this behavior so it only shows the story's links?

The site affected

the article posted (first 2 paragraphs in intro, the rest in the body)

 Quote

oddly

Anonymous
Also, that site is running geeklog 1.3.9
 Quote

Status: offline

Turias

Forum User
Full Member
Registered: 10/20/03
Posts: 807
Hmm, maybe it's a bug with 'a name'. Could you try removing that and seeing if it fixes it?
 Quote

Status: offline

asmaloney

Forum User
Full Member
Registered: 02/08/04
Posts: 214
Quote by oddly:Any ideas on how to fix this behavior so it only shows the story's links?


In lib-common.php in the function COM_extractLinks, try changing this:
Text Formatted Code
preg_match_all( "/(<a.*?href="(.*?)".*?>)(.*?)(</a>)/i", $fulltext, $matches );

 


to this:
Text Formatted Code
preg_match_all( "/(<a +?href="(.*?)".*?>)(.*?)(</a>)/i", $fulltext, $matches );

 


This will restrict it to matching only spaces between the 'a' and the 'href' which seems to be the problem.
 Quote

oddly

Anonymous
Quote by Turias: Hmm, maybe it's a bug with 'a name'. Could you try removing that and seeing if it fixes it?


Yup. Removing the "a name" html tags fixed it immediately.
 Quote

Status: offline

Turias

Forum User
Full Member
Registered: 10/20/03
Posts: 807
Yeah, asmaloney's hack will work, but it won't pick up links with attributes between the 'a' and the 'href' (like 'title', 'style', or 'class').

Looks like a bug with 'a' tags that don't hold a 'href' attribute. Wanna file a bug report? Mr. Green
 Quote

oddly

Anonymous
Thanks for the patch!! It fixed the problem completely.
 Quote

oddly

Anonymous
http://project.geeklog.net/ responds with "The Geeklog Project Site Could Not Connect to Database:" when I try to go there to report this bug. Frown
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by oddly: http://project.geeklog.net/ responds with "The Geeklog Project Site Could Not Connect to Database:" when I try to go there to report this bug. Frown

Keep trying ... The project site is a bit unstable these days. That should be resolved soon, hopefully, when we finally move it to the new server.

bye, Dirk
 Quote

All times are EDT. The time is now 01:12 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content