vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - CES Parser Permissions (https://vborg.vbsupport.ru/showthread.php?t=138476)

thincom2000 02-20-2008 06:59 PM

Quote:

Originally Posted by cheesegrits (Post 1447492)
The cleaning process is pretty intense, lots of memory and CPU, and on larger sites I'm not sure it would be workable for common things like forum posts ... but for stuff like profiles, I think it's a winner.

I thought this might be the case, so I was thinking of only running it when the post / profile is saved, and not on each post on showthread during run time.

thincom2000 02-20-2008 08:04 PM

Apparently there is some conflict with one of the modules available for vBadvanced. I'm not a vBa user, and since I don't have the time to go through all the addons for it, could someone experiencing the white page bug PM me login details for a test board with this issue? It has been reported by multiple users, so I would like to post a fix. Thanks.

cheesegrits 02-20-2008 08:57 PM

Do you have any idea which module? I'm a CMPS user, be happy to debug it for you.

-- hugh

cheesegrits 02-20-2008 10:25 PM

Quote:

Originally Posted by thincom2000 (Post 1447040)
I haven't tested this, but just thought of it while I was out.

In includes/ces_permissions.php, find:
PHP Code:

global $vbulletin$post$userinfo$nuwiki

Replace with:
PHP Code:

global $vbulletin$post


Just to confirm this does fix the issue with posting visitor messages to the wrong userid.

-- hugh

thincom2000 02-21-2008 01:56 AM

That's good to know. Thanks for confirming. Hard to believe that such a crazy bug could be caused by that. I'm still trying to figure out why IMG tags are completely stripped from Profile Fields.

nerofix 02-21-2008 08:52 AM

Yes I can also confirm this. Thanks for this fix!

Another question, what about custom BB-Code? When trying to post a visitor message with custom bb-code it always says:



The following errors occurred when this message was submitted

1. BB code yt is not allowed.




Is there a way to allow it? Its also ignored in "about me".

thincom2000 02-21-2008 01:29 PM

Yeah the reason for this was the way Visitor Messages were hardcoded. I suspect that the developers thought we wouldn't want users embedding videos and images and such on people's profiles. Of course it's always possible to block individual codes and not kill the whole list.

I have implemented a workaround for this in my dev version, so that IMG and custom BB-Codes are working. I just have to figure out why HTML and IMG aren't parsed immediately following the AJAX edit pencils (until page refresh).

cheesegrits 02-21-2008 03:27 PM

Quote:

Originally Posted by thincom2000 (Post 1448117)
I just have to figure out why HTML and IMG aren't parsed immediately following the AJAX edit pencils (until page refresh).

That's because of this code in ces_permissions_customfields():

PHP Code:

    if (FILE_VERSION >= '3.7.0')
    {
        global 
$blockobj;

        
$userinfo =& $blockobj->profile->userinfo;
    } 

Sllight variation of the same bug I mentioned in a previous post. When coming in through AJAX, a lot of the data structures that exist on a normal page load aren't there ... including $blockobj; I changed the above to just use $vbulletin->userinfo instead, and it works.

But I do need to test and make sure this doesn't screw up display perms when not using AJAX ...

EDIT - yup, it does need another change to work right in both cases:

PHP Code:

    if (FILE_VERSION >= '3.7.0')
    {
        if (
$_REQUEST['ajax'] == 1)
        {
            
$userinfo =& $vbulletin->userinfo;            
        }
        else
        {
            global 
$blockobj;
            
$userinfo =& $blockobj->profile->userinfo;
        }
    } 

This seems to work. The assumption being if it's AJAX, we know we are editing the profile for the logged on user, so we can use $vbulletin->userinfo. If not AJAX, we can use the $blockobj->profile->userinfo, which will be whoever the profile belongs to.

-- hugh

thincom2000 02-21-2008 05:48 PM

Quote:

Originally Posted by cheesegrits (Post 1448163)
The assumption being if it's AJAX, we know we are editing the profile for the logged on user, so we can use $vbulletin->userinfo. If not AJAX, we can use the $blockobj->profile->userinfo, which will be whoever the profile belongs to.

Right. Using $vbulletin->userinfo is still a problem, however. The function you have modified is also called in the postbits. Say an admin Quick Edits a post by someone with different profile field permissions. Using $vbulletin->userinfo when only checking that this is an AJAX request would result in the very minor bug that upon saving the edit, the admin would see the profile fields for that post parsed with the admin's permissions until he/she refreshed the page. Therefore, the fix I have implemented is similar, but slightly more specific in the criteria for setting $userinfo to $vbulletin->userinfo.

Thanks for your fix, though. It saved me some time looking this afternoon.

cheesegrits 02-21-2008 07:41 PM

Yeah, I figured there'd be some other gotchas.

I'd like to get my hands on your latest fixes ASAP. I have a different issue - profile fields will display correctly after an AJAX edit, but not on a regular profile page load. I'm working on a semi-related hack, which replaces the regular About Me tab (but shows the same About Me profile field info by default unless you crate an HTML profile). And I'm not sure if it's a bug in my code, or some weird interaction between mine and yours, but the default field display isn't parsed. Except when loaded via AJAX ... *sigh* ...

-- hugh


All times are GMT. The time now is 02:27 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01355 seconds
  • Memory Usage 1,755KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete