Module: HTML in Messages
Posted by Maurice Makaay
Re: Module: HTML in Messages October 23, 2009 11:49AM |
Registered: 14 years ago Posts: 10 |
I got some similar requirements like Rob Granger and did a small hack being new to php... I want only one user to post html so.... modified the default html plugin of phorum as below...
It seems to work
Language: PHPforeach($data as $message_id => $message) { -->>> if ($message["user_id"]==2) <<<-- { if(isset($message["body"])) { $body = $message["body"];
It seems to work
Re: Module: HTML in Messages November 12, 2009 11:23AM |
Registered: 14 years ago Posts: 41 |
Re: Module: HTML in Messages November 12, 2009 11:37AM |
Moderator Registered: 17 years ago Posts: 1,301 |
Try adding this javascript (adapted from my Post Previews module) to the end of your read.tpl template file:
Basically, every url which does not link to your site will get the _blank target added via javascript.
Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Language: Javascript<script type="text/javascript"> function assign_foreign_url_targets() { anchors = document.getElementsByTagName("a"); for (i in anchors) { if (anchors[i].href) { ahref = anchors[i].href; if (!ahref.match("http://ukshopping.hopto.org")) { anchors[i].target = "_blank"; } } } } assign_foreign_url_targets(); </script>
Basically, every url which does not link to your site will get the _blank target added via javascript.
Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: HTML in Messages November 12, 2009 12:16PM |
Registered: 14 years ago Posts: 41 |
Re: Module: HTML in Messages November 24, 2009 07:46AM |
Registered: 14 years ago Posts: 41 |
Hi
Is there a way to add an extra domain to this code?
I just noticed that my top links are all opening new windows as they are pointing to a different domain when reading the post.
Regards
Bluesplayer
Is there a way to add an extra domain to this code?
Language: PHP<script type="text/javascript"> function assign_foreign_url_targets() { anchors = document.getElementsByTagName("a"); for (i in anchors) { if (anchors[i].href) { ahref = anchors[i].href; if (!ahref.match("http://ukshopping.hopto.org")) { anchors[i].target = "_blank"; } } } } assign_foreign_url_targets(); </script>
I just noticed that my top links are all opening new windows as they are pointing to a different domain when reading the post.
Regards
Bluesplayer
Re: Module: HTML in Messages November 24, 2009 08:05AM |
Moderator Registered: 17 years ago Posts: 1,301 |
To skip multiple domains, try:
Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
if (!ahref.match("http://ukshopping.hopto.org") && !ahref.match("http://myothersite.com") ) {You can add as many
&& !ahref.match("http://myothersite.com")as you need.
Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: HTML in Messages November 24, 2009 08:22AM |
Registered: 14 years ago Posts: 41 |
Re: Module: HTML in Messages November 24, 2009 09:16AM |
Registered: 14 years ago Posts: 41 |
Re: Module: HTML in Messages November 24, 2009 09:27AM |
Moderator Registered: 17 years ago Posts: 1,301 |
A couple of questions:
First, this if clause is designed to ignore to the listed sites, thus the "and" is necessary (ignore site 1 links and site 2 links and . . .) so can I assume that by "working" for the second site you mean that the links to that site are being ignored by this code and by "ignoring the first site" you mean that links to the first site are actually not being ignored and thus opening in a new window?
Second, I noticed that in other posts you have changed your sites domain from the ukshopping site to bluesplayer-shops. Did you change this bit of code to reflect the new domain?
Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
First, this if clause is designed to ignore to the listed sites, thus the "and" is necessary (ignore site 1 links and site 2 links and . . .) so can I assume that by "working" for the second site you mean that the links to that site are being ignored by this code and by "ignoring the first site" you mean that links to the first site are actually not being ignored and thus opening in a new window?
Second, I noticed that in other posts you have changed your sites domain from the ukshopping site to bluesplayer-shops. Did you change this bit of code to reflect the new domain?
Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: HTML in Messages November 24, 2009 09:32AM |
Registered: 14 years ago Posts: 41 |
1st Question: Yes the first site is opening new windows - 2nd site is ok.
2nd Question: Yes I altered the domain name as the UK Shopping was to be a separate site initially but on reflection I decided to use the same look as my main site and incorporate the shopping into it. The new name has bluesplayer in it so it doesn't look so out of place. The UK Shopping domain still works though.
UPDATE: Apparently the UK Shopping domain doesn't work! I will sort that out now.
Working now. The domains are free ones off no-ip and I hadn't ticked the box on the software I have on my computer to update the ipaddress of the domain.
Another UPDATE!
Sorry! I can see now why you referred to UK Shopping as it was the domain on the first part of the code and not my new domain. Now I have altered the domain setting the code works! Doh! Cheers.
Edited 3 time(s). Last edit at 11/24/2009 09:46AM by Bluesplayer.
2nd Question: Yes I altered the domain name as the UK Shopping was to be a separate site initially but on reflection I decided to use the same look as my main site and incorporate the shopping into it. The new name has bluesplayer in it so it doesn't look so out of place. The UK Shopping domain still works though.
UPDATE: Apparently the UK Shopping domain doesn't work! I will sort that out now.
Working now. The domains are free ones off no-ip and I hadn't ticked the box on the software I have on my computer to update the ipaddress of the domain.
Another UPDATE!
Sorry! I can see now why you referred to UK Shopping as it was the domain on the first part of the code and not my new domain. Now I have altered the domain setting the code works! Doh! Cheers.
Edited 3 time(s). Last edit at 11/24/2009 09:46AM by Bluesplayer.
Sorry, only registered users may post in this forum.