View Full Version : Whats up with my HTML posting hack?
Alrighty then...so it works nicely for the person who posted it and people who are in the 'allowed' groups, but it needs to be edited in order for the html content of the post to be seen by the other groups.
Could this be due to some.. caching thing? Is it that the editing of the post forces something to happen that does not in the posting of a reply? Or the other way around?
Link to the thread in question is in my sig. :)
Andreas
10-06-2005, 08:51 AM
if ($permissions['allowhtmlpermissions'] & $vbulletin->bf_ugp_allowhtmlpermissions['canposthtml'])
This checks the Permissions of the viewing User, not the permission of the author of the post ...
if ($permissions['allowhtmlpermissions'] & $vbulletin->bf_ugp_allowhtmlpermissions['canposthtml'])
This checks the Permissions of the viewing User, not the permission of the author of the post ...
But then why does it work for edited posts? ie: I post a reply with <b> tags. It shows as bold to me, but not to un-allowed users.
If I edit that, it does show as bold to all users.
Marco van Herwaarden
10-06-2005, 09:02 AM
Because the WYSIWYG editor will convert the HTML to bb-codes on edit.
Try some other html like creating a table and see the difference.
(PS Just guessing here)
Because the WYSIWYG editor will convert the HTML to bb-codes on edit.
Try some other html like creating a table and see the difference.
(PS Just guessing here)
Even on a quick-edit, the resultant post comes out nice. I have to change the post, just add a . or something.. but whatever happens then makes it viewable.
As it turns out, New Threads, Replies and Edits come out nice.
Quick Replies (and anything that is 'automated' like the RSS feeds :( ) do not.
Andreas
10-06-2005, 09:17 AM
Postcache.
If you edit the Post, if must be parsed again afterwards.
And as you are the first to see it, it will take your permissions for parsing - and store the correctly parsed HTML.
OK.. so if I was to somehow force it to not be cached if it's posted by someone with this permission.. would that be the way to approach the problem?
Or, how do I go about forcing all posts made by someone with this permission to be stored with the parsed html?
If I have this right, posting New Threads and Quoting posts goes through ...something that Quick Replys (probably due to AJAX) do not?
Andreas
10-06-2005, 09:23 AM
Best way: Fix your permission check :)
Best way: Fix your permission check :)
*sighs*
It's too late at night.
What should I be using there? I know the difference between $bbuserinfo[userid] and $post[userid], but this stuff I am only just learning...with a whole lot of help from you actually. :)
Andreas
10-06-2005, 09:35 AM
bbcode_parse_start
global $post;
// Was this post made by an allowed Usergroup member?
if ($post['permissions']['allowhtmlpermissions'] & $this->registry->bf_ugp_allowhtmlpermissions['canposthtml'])
{
// This is an allowed post so parse HTML.
$dohtml = '1';
}
Nope, still doesn't work with a quickreply. :(
Andreas
10-06-2005, 10:14 AM
Slightly modified
global $post;
$perms =& $post['permissions'];
if (!$perms)
{
$perms = fetch_permissions(0, $post['userid'], $post);
}
// Was this post made by an allowed Usergroup member?
if ($perms['allowhtmlpermissions'] & $this->registry->bf_ugp_allowhtmlpermissions['canposthtml'])
{
// This is an allowed post so parse HTML.
$dohtml = '1';
}
Should be optimized though.
Ooooh! That looks like its working!
I think I was under the impression that the plugin was only called on Creation of a post, not viewing. Pretty stupid really, given that that other one you helped me with (nofollow) works on viewing. :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.