Adult Script Pro Community Forums

Create, help and share your ideas with the community!

You are not logged in.

#1 2017-05-02 09:41:05

happylag
Member
Registered: 2016-04-05
Posts: 154

Put link in nofollow in main menu

Hello,

I added one external link in main menu. How to puts in in rel="nofollow"?

Thank you.

Offline

#2 2017-05-02 13:49:13

symtab
Administrator
Registered: 2010-08-23
Posts: 7,376
Website

Re: Put link in nofollow in main menu

Only if you modify the code in templates/defboot/extend/plugins/menu_main.plugin.php


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - PopAds

Offline

#3 2017-05-02 13:53:15

happylag
Member
Registered: 2016-04-05
Posts: 154

Re: Put link in nofollow in main menu

Would you know what code should i put to add rel="nofollow" to link id 64 ?

Thank you.

Offline

#4 2017-05-03 05:03:06

symtab
Administrator
Registered: 2010-08-23
Posts: 7,376
Website

Re: Put link in nofollow in main menu

Edit templates/defboot/extend/plugins/menu_main.plugin.php and after:

$target = ($link['target'] != 'none') ? ' target="_'.$link['target'].'"' : '';

add:

$target = ($link['link'] == 'the-url-here') ? $target.' rel="nofollow"' : $target;

If you want to use the link id instead of the-url-here, you can use:

$target = ($link['link_id'] == '64') ? $target.' rel="nofollow"' : $target;

but you also have to edit the mysql query from that file and change:

$db->query("SELECT l.name, l.title, l.link, l.type, l.target, l.lang, l.current

to:

$db->query("SELECT l.link_id, l.name, l.title, l.link, l.type, l.target, l.lang, l.current

Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - PopAds

Offline

Board footer

Powered by FluxBB