We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Add 'Member' tag automatically when IMG tags used
Topic Started: Jul 19 2010, 11:14 PM (601 Views)
NylonMoon
Member Avatar
Member
[ * ]
Board Address: http://s10.zetaboards.com/Free_To_Love
Board Software: Zetaboards
Description: Add [member] tags automatically / by default whenever [IMG] tags are used.


If relevant, our board is set for a maximum of 5 images per post. Perhaps (if possible) it could just add the [member] tags once - before the first and after the last [IMG] tag per post? :unsure:

Thanks in advance for anyone who may take this on. :)
Offline Profile Goto Top
 
Geoffrey
Member Avatar
bury hatchets, keep maps
[ *  *  *  *  * ]
What would the [Hidden Content: Login/Register to View]
Offline Profile Goto Top
 
NylonMoon
Member Avatar
Member
[ * ]
Hide image URLs from guests.
Offline Profile Goto Top
 
Geoffrey
Member Avatar
bury hatchets, keep maps
[ *  *  *  *  * ]
Admin CP > Board Customization > Preferences.

I'm sure there's a setting there that allows you to disallow guests from viewing posted images, but I can't seem to find it right now. I know I've seen it before.
Offline Profile Goto Top
 
NylonMoon
Member Avatar
Member
[ * ]
The option you refer to removes the image/s but leaves URLs which can still be followed, hence my previous post.
Offline Profile Goto Top
 
Roby-ZNR
Member Avatar
Efficacy
[ *  *  *  *  *  * ]
Just so you know, unless the member tags are added before posting, the urls could still technically be seen if the user disables Javascript.
Offline Profile Goto Top
 
NylonMoon
Member Avatar
Member
[ * ]
Yes, I'm aware of that. :yes: But without meaning to patronise our membership (and assorted lurkers), they're really not that 'hardcore'. ;) Does that mean you've got an idea for a code that would fit the bill then, Krupa? :unsure:
Offline Profile Goto Top
 
Roby-ZNR
Member Avatar
Efficacy
[ *  *  *  *  *  * ]
Below the Board or Above the Copyright
Code:
 
<script type='text/javascript'>
/* <![CDATA[ */
(function() {
var reg_tag = /\[img\](.+?)\[\/img\]/gi;
if (location.href.indexOf('topic/') !==-1) {
if ($('#top_info strong').text() === 'Guest') {
$('td.c_post img').each(function() { $(this).replaceWith('[Hidden Content: Login/Register to View] '); });
}
$('button[name=sd]').click(function() {
if ($('textarea[name=post]').val().match(reg_tag)) {
$('textarea[name=post]').val($('textarea[name=post]').val().replace(reg_tag, '[member][img]$1[/img][/member]'));
}
});
}
if (location.href.indexOf('post/') !==-1) {
$('button[name=post_submit]').click(function() {
if ($('#c_post-text').val().match(reg_tag)) {
$('#c_post-text').val($('#c_post-text').val().replace(reg_tag, '[member][img]$1[/img][/member]'));
}
});
}
})();
/* ]]> */
</script>

It will replace images with the member content message if you're a guest (there is no way of seeing the images if this was applied to members) and when posting, when you click the button to post, it will automatically wrap all img tags with member tags.
Edited by Roby-ZNR, Jul 28 2010, 12:21 AM.
Offline Profile Goto Top
 
Roby-ZNR
Member Avatar
Efficacy
[ *  *  *  *  *  * ]
Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic