Keyword

Forbid links in commens?

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 4 months ago #144105 by Krikor Boghossian
Replied by Krikor Boghossian on topic Forbid links in commens?
Replace isset($this->item->extraFields->AAA->value) with
isset($this->item->extraFields->AAA->value) && $this->item->extraFields->AAA->value != ''

This will also check if the value is indeed set but it is empty.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #144111 by Joe Campbell
Replied by Joe Campbell on topic Forbid links in commens?
1) You did not include "BBB", should it be placed here... && $this->item->extraFields->BBB->value

2) I received a code error when I tried adding the following to my item template override (of course I replaced AAA & BBB with real alias values)

<?php
Replace isset($this->item->extraFields->AAA->value) with
isset($this->item->extraFields->AAA->value) && $this->item->extraFields->BBB->value != ''
?>

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 4 months ago #144132 by Krikor Boghossian
Replied by Krikor Boghossian on topic Forbid links in commens?
I think you where a bit too literal on this Joe :)
I meant replace as replace in your code, not as in a php function.

This extra check -> && $this->item->extraFields->ALIAS->value != '' checks if the field is set but it has no value.

I think the best option is the shorthand if/ else.
Cleaner and easier to maintain. Trust me on this one, give it a 15 min read and you will understand it better. In 2 - 3 months from now you probably won't be able to remember/ read that single line code.

I know that you are not a developer but since you can understand code I think you should look for the optimal solution.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #144137 by Joe Campbell
Replied by Joe Campbell on topic Forbid links in commens?
Thank you for the advice @Krikor :)

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 4 months ago #144152 by Krikor Boghossian
Replied by Krikor Boghossian on topic Forbid links in commens?
Always happy to help Joe :)

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum