Include code in posts
She wants to include some banner ads from other companies, and getting these in the right format is turning into a real headache…..
they are published like this…
but the image plugin only allows .jpg .gif etc.
Could that be disabled only if the ADMIN was posting the entry?
There is a plugin to allow the img tag, but you’d need to edit it and add a statement in saying “if admin then allowed_tags = …, else allowed_tags = …”. I’m not sure how easy that would be – anyone else have any clues?
I’d suggest editing the template in bb-templates and adding it in manually, if you really, really want a banner ad.
If you can’t edit the template and have something against the excellent bb-Ads plugin: I can’t help you, because AFAIK there’s no straightforward API function to check what a non-current user can do.
Can be done let me think…………….
– You’ll have to enter some new tags in the plugin (allowed tags)
– Then in the template files containing post fields, you could add the tags and make them visible for the admin only with something like: if user can edit;
So some filter should be added in view.php? like euuhh…
If post is by admin, allow tags x,y,z else print as code...
Yeah, and that’s where it’s annoying because you can’t easily check if a given user has permissions. Might be worth a trac ticket request.
Possibly easiest would be to attach a filter for the post being submitted, because then you can use the
if (bb_current_user_can('administrate'))in his YouTube plugin. Couldn’t you mod the allow_images plugin to also allow
<script>tags, but only if the user is an administrator? That would still allow the scripts to do their thing, but only in posts authored by an administrator.
Unfortunately, if you’re looking for a way to place ads in posts by any ol’ user, there’s not a safe way to do that b/c they could put ANY script in and have it execute.
- You must be logged in to reply to this topic.