The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Need help tweaking a plugin's php code
Hi all,
PHP newbie here. I hope a member of the community can help lend a hand and possibly find a solution to this. I'm currently using Kall's rel="nofollow" attribute in parsed URLs hack and it is fantastic. Definite candidate for plugin of the century in my opinion. However, I'm currently trying to tweak the plugin's php code so that the 'rel="external nofollow" tag applies to everyone's links except the primary Super Administrator with the userid of 1. At the moment, the code looks like: Code:
$this->tag_list['no_option']['url']['callback'] = 'handle_external'; $this->tag_list['no_option']['url']['external_callback'] = 'handle_bbcode_url_relnofollow'; $this->tag_list['option']['url']['callback'] = 'handle_external'; $this->tag_list['option']['url']['external_callback'] = 'handle_bbcode_url_relnofollow'; if (!function_exists('handle_bbcode_url_relnofollow')) { function handle_bbcode_url_relnofollow(&$parser, $text, $link) { global $post; // Excempt Admins with more than 395 posts $parsedurl = $parser->handle_bbcode_url($text, $link); if (is_member_of($post, 6) AND $post['posts'] > 395) { return $parsedurl; } else { return str_replace('href="', 'rel="external nofollow" href="', $parsedurl); } } } Would anyone be so kind as to post what might area might need to be altered in order to accomplish this? I also wouldn't mind if the minimum post count limit was removed from there too. I unfortunately can't seem to do this without causing an error! Heh. I would be eternally grateful and be forever in love with you; Wish I could offer more but that's all I've got! Thank you very much for reading. |
#2
|
||||
|
||||
replace this
if (is_member_of($post, 6) AND $post['posts'] > 395) with this if ($vbulletin->userinfo['userid'] == 1) |
#3
|
||||
|
||||
Awesome! Thank you very much.
Just one last quick question: If I wanted to add additional userids to the equation - would this work? Code:
if ($vbulletin->userinfo['userid'] == 1,2,666) |
#4
|
|||
|
|||
PHP Code:
|
#5
|
||||
|
||||
Hi,
I just realised after testing both that neither work. Even links contained within my own posts have an rel="external follow" tagged on. Is there anything else that might work? |
#6
|
||||
|
||||
Replace:
PHP Code:
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|