Welcome to Geeklog, Anonymous Tuesday, March 19 2024 @ 05:57 am EDT

Geeklog Forums

Need to hack articke url not to show up in article.php as hyperlink


Status: offline

orfilms

Forum User
Regular Poster
Registered: 08/02/05
Posts: 70
Google news says they can't crawl my site because our headline is linked on the article page...

"In order for Google News to include articles, each article must hyperlink to a page dedicated solely to that article, as your site does. However, when the headline on this page is an active link, we often have difficulty displaying it correctly. For example, the headline "HEADLINE" is an active hyperlink on this page: ARTICLE URL. Making these headlines regular text, not links, will increase the likelihood that our crawler will extract the correct headlines."

The tag I use im my template is:
Text Formatted Code
<a href="{article_url}">{story_title}</a>
 


I need some kind of hack so that if the article is called from the article.php that hyperlink will be gone and it will just appear as: {story_title}

I don't know PHP well at all! Please, anyone, someone, help me!
 Quote

Status: offline

eyecravedvd

Forum User
Full Member
Registered: 06/09/03
Posts: 152
Funny Google crawls my site all the time. I have a tonne of stories listed usually in the first 3 pages of Google.

Although what you say makes sense. I'm not sure how you'd pull it off though, because I'm not sure how to code it either. I'm trying to figure out another issue with article.php myself.
Shane | www.EyeCraveDVD.com
 Quote

Status: offline

orfilms

Forum User
Regular Poster
Registered: 08/02/05
Posts: 70
This is for the Google news search I'm talking about, not google search.

Andy (god bless the guy) e-mailed me with the hack, and it works:

------

1) remove th link from the storytext.thtml template
2) in system/lib-story.php, change line 207 from this:

$article->set_var( 'story_title', stripslashes( $A['title'] ));

to this:

$article->set_var( 'story_title', ' '" class="non-ul">' . stripslashes( $A['title'] ) . '' );
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 09/29/02
Posts: 820
I am trying to use the code you posted for the lib-story.php, but it seems to be corrupted. Could you please post it again using the code frame?

And I wonder what this addition does. Why isn't just removing the link tag from the temple enough?

Thanks!
 Quote

Status: offline

orfilms

Forum User
Regular Poster
Registered: 08/02/05
Posts: 70
Removing the link in the template will also remove the link on the index page. Sure you'll have the Read more link if there is more to the story, but what about the stories that don't need a read more link? This all came about while I was trying to get indexed by google news. They need a link for each story to the story, but can't have a link to the story on the story page... if that makes sense. Here's the code from andy:

Text Formatted Code
1) remove th link from the storytext.thtml template
2) in system/lib-story.php, change line 207 from this:

       $article->set_var( 'story_title', stripslashes( $A['title'] ));

to this:

       $article->set_var( 'story_title', ' <a href="' . $articleUrl .
'" class="non-ul">' . stripslashes( $A['title'] ) . '</a>' );

 
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 09/29/02
Posts: 820
Now I see what part of the code was missing. That's really neat. Thanks!


Dirk, should this be standard for Geeklog in next release?

Sam
 Quote

Status: offline

eyecravedvd

Forum User
Full Member
Registered: 06/09/03
Posts: 152
Very handy. I've just implemented it and added a few things so that when you mouse over the title of the url will popup making it a little more search engine friendly.

Just replace line 207 in your lib-story.php with this

Text Formatted Code
        $article->set_var( 'story_title', '<a href="' . $articleUrl . '" title="' . stripslashes( $A['title'] ) . '">' . stripslashes( $A['title'] ) . '</a>' );
 

Shane | www.EyeCraveDVD.com
 Quote

All times are EDT. The time is now 05:57 am.

  • 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