Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
Susann
Moderator


Joined: Dec 19, 2004
Posts: 3191
Location: Germany:Moderator German NukeSentinel Support

PostPosted: Fri Jul 06, 2007 10:35 am Reply with quote

I would like to hide 2 buttons in my forum like Post reply and New topic.
The buttons should only not be visible for searchengines but visible for all other quests.
I´m using theme fisubice.
Any ideas how to hide this ?
 
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Fri Jul 06, 2007 12:06 pm Reply with quote

That would be kind of difficult I think. I think you would have to check the user agent string and then somehow decide if the user is a bot crawling your site or a real person. That could be error prone also, as some bots probably don't behave and use user agent string values that make them look like normal users.

_________________
Only registered users can see links on this board! Get registered or login! - An Event Calendar for PHP-Nuke
Only registered users can see links on this board! Get registered or login! - A Google Maps Nuke Module 
View user's profile Send private message
Susann
PostPosted: Fri Jul 06, 2007 1:36 pm Reply with quote

Its possible I think by using Java SCR. because bots don´t follow usally such links.
 
Gremmie
PostPosted: Fri Jul 06, 2007 2:38 pm Reply with quote

What is Java SCR?
 
Susann
PostPosted: Fri Jul 06, 2007 3:47 pm Reply with quote

With Javascrip-t
 
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9453
Location: Arizona

PostPosted: Fri Jul 06, 2007 5:55 pm Reply with quote

Actually, check out kguske's code in the nuke_WYSIWYG function within mainfile.php. I think he checks to see that cookies are enabled?

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
Gremmie
PostPosted: Fri Jul 06, 2007 10:28 pm Reply with quote

But do guests have cookies?
 
montego
PostPosted: Sat Jul 07, 2007 7:22 am Reply with quote

Well, this works. Try enabling Submit News module to All Visitors and then make sure you are not logged in. When you go to Submit News as anonymous (and the advanced editor is turned on), you still see the editor right?
 
Gremmie
PostPosted: Sat Jul 07, 2007 10:30 am Reply with quote

Yes I see and I agree that is a cool trick Smile Exclamation, but she wants no links for search engine bots but links for human non-member guests. That's why the user agent string came to my mind, but I don't think that is very reliable. Maybe there is a robots.txt setting that nice bots will behave? Probably not reliable either...

I'm not familiar with this javascript link idea you mentioned Susann. Do you have a link to an article describing this technique or more explanation?
 
mars
Worker
Worker


Joined: Jul 08, 2006
Posts: 123
Location: Bloomsburg,Pennsylvania

PostPosted: Sat Jul 07, 2007 11:59 am Reply with quote

A quick fix for that would be to add the rel="nofollow" to the link on the buttons in viewtopic_body.tpl

Code:


<a href="{U_POST_NEW_TOPIC}" rel="nofollow"><img src="{POST_IMG}" alt="{L_POST_NEW_TOPIC}" title="{L_POST_NEW_TOPIC}" /></a><a href="{U_POST_REPLY_TOPIC}" rel="nofollow"><img src="{REPLY_IMG}" alt="{L_POST_REPLY_TOPIC}" hspace="8" title="{L_POST_REPLY_TOPIC}" /></a>


This tells googlebot and most of the major search engine bots to not follow that link.

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
montego
PostPosted: Sat Jul 07, 2007 1:10 pm Reply with quote

mars, that is an excellent suggestion! Thanks.

Gremmie, regarding this:

Quote:

but she wants no links for search engine bots but links for human non-member guests


Unless I am missing something, that is exactly the same use model that kguske employed within the nukeW functions referenced. Susann basically just wants to make sure that search engines (only) cannot crawl those links. It is actually an age-old SEO problem with forum type tools. There are way too many ways to reference the exact same page.

However, to be honest, that is less of an issue these days at least with the more commonly used forum tools. I have read that Google's algorithms are now smart enough to recognize these few very popular tools and does not penalize the web site.

However, I still see why Susann wants to not show the other buttons. They are completely unnecessary and also why make these links "findable" within the SE's so that automated attacks can be taken up... Wink
 
mars
PostPosted: Sat Jul 07, 2007 1:52 pm Reply with quote

Thanks!
Also for the robots.txt idea, you can use wildcards to stop bots from accessing pages and directories for example if you put the following at the bottom of robots.txt in your root folder

Disallow: /admin
Disallow: *memberlist*
Disallow: *Private_Messages*
Disallow: *profile*

It will block COMPLIANT bots like Google,MSN and Yahoo from accessing the admin folder, the memberlist module, private messages and profiles.
 
Gremmie
PostPosted: Sat Jul 07, 2007 3:07 pm Reply with quote

montego, sorry to beat a dead horse, but the wysiwyg editor checks for a cookie and either displays the new editor or the old textarea.

But neither bots nor non-member guests have cookies, so they would not see any links. But she said she still wanted guests to see the links. Without a cookie you only have a few things left to tell if they are human: IP address, user agent string, and....? And none of those are really very good indicators.

I like the rel="nofollow" idea, but I see it isn't standard. Still if google obeys it that should be a big plus.
 
Susann
PostPosted: Sat Jul 07, 2007 3:54 pm Reply with quote

Gremmie, I know how tho hide those buttons for all but Montego hit the nail on the head. He gave me an idea. I also know that Java Script doesn´t work always and therefore that wouldn´t be an optimal solution.
Mars can you confirm that rel=nofollow works did you checked your logs for a certain time ? I think that doesn´t work. But who knows
 
mars
PostPosted: Sat Jul 07, 2007 4:54 pm Reply with quote

It is a standard that google has adopted for just this purpose, and you can use the robots.txt file for all other things as well.
Only registered users can see links on this board! Get registered or login!
 
Susann
PostPosted: Sat Jul 07, 2007 5:31 pm Reply with quote

Maybe it works for those button maybe not.
I should try it out but I know form different guys that this didn´t worked like it should.

Only registered users can see links on this board! Get registered or login!
 
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6793
Location: Ha Noi, Viet Nam

PostPosted: Sun Jul 08, 2007 6:50 am Reply with quote

Surely you could use the standard nuke is_user function?
Thanks for bring this up again Susann, it is also something I have been meaning to look at for some time.
As all my forums are set so that only registered users can post, relpay and quote I do not want those links picking up my search engines anyway.
 
View user's profile Send private message Send e-mail
mars
PostPosted: Sun Jul 08, 2007 8:50 am Reply with quote

You can wrap the buttons in the phpbb is user functions, you need to make sure that the BEGIN and END lines are on seperate lines in the code.
The code below is the top set of buttons in viewtopic_body.tpl

Code:


<!-- BEGIN switch_user_logged_in -->
<a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" alt="{L_POST_NEW_TOPIC}" title="{L_POST_NEW_TOPIC}" /></a><a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" alt="{L_POST_REPLY_TOPIC}" hspace="8" title="{L_POST_REPLY_TOPIC}" /></a>
<!-- END switch_user_logged_in -->


You would need to do this for the post and reply buttons, along with any quote buttons as well.
 
Guardian2003
PostPosted: Sun Jul 08, 2007 10:29 am Reply with quote

Thats a great idea.
Susann - I'm working on this now and should have the files for you very soon.
 
Susann
PostPosted: Sun Jul 08, 2007 10:45 am Reply with quote

Cool Guardian !
User-friendly would be to show this button "post reply" and "new topic" because it can confuse site visitors and the result is that you loose potential new members. Ever thought about this ?
However, the most of my forums links are not visible for all but I lost 40.000 indexed pages a year ago and they never came back therefore I´m very careful with optimation within in the forum.


Last edited by Susann on Sun Jul 08, 2007 10:55 am; edited 1 time in total 
Guardian2003
PostPosted: Sun Jul 08, 2007 10:52 am Reply with quote

The two files in the download link below will hide the buttons and links for;
New Post
Reply Post
Quote
from all anonymous users Only registered users can see links on this board! Get registered or login!

These files are modified from the RN 2.10 fisubice theme.
If you are using a different theme you can use them as a guide. If you are using a theme that does not have forum files, use these as a guide for modifying the forum subSilver template files.
 
Guardian2003
PostPosted: Sun Jul 08, 2007 10:59 am Reply with quote

Actually, they will also hide the PM and Profile buttons too Smile
 
montego
PostPosted: Mon Jul 09, 2007 5:56 am Reply with quote

I am confused. Susann, I thought that you ONLY want to exclude search engines from seeing these buttons? The is_user function checks to see that you have a registered
 
montego
PostPosted: Mon Jul 09, 2007 5:58 am Reply with quote

Gremmie

I hear what you are saying, but try it in practice. It works! All I can say is that when I come to my site as an anonymous user (after clearing ALL cookies even), and then go to Submit News, the editor shows. This means that this check in mainfile is also checking to see that cookies are enable or not. That was the whole point of kguske putting that in there so that the editor would not be "crawled" and therefore bandwidth possibly wasted for no good reason.

That is the behavior that I thought Susann was after.
 
Gremmie
PostPosted: Mon Jul 09, 2007 7:17 am Reply with quote

montego, ah cool, I will try it. I'm curious now how this is working. Thanks.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©