Resource icon

Profile Posts with BB Codes 2.0

No permission to download
@AlexT Please add full editor (WYSIWYG - Redactor) in new update. Your addon very useful. Perhaps it should be integrated into the core.
 
No problem. When I update this mod for xF 1.2, those template edits will happen automatically during install.
 
An updated version is about to be released soon. WYSIWYG support will be included and can be enabled/disabled as an option.

It will take full advantage of xF's 1.2 template modification system and listener hinting. Currently I am still debating with myself whether I should write the info to keep 1.1.x compatibility...
 
  • Like
Reactions: Cao
@AlexT You should stop follow support 1.1, it had enought to using.
Now, go next and make perfect with 1.2. Xenforo had release 1.2 RC1 :)
 
Has anyone had problems with profiles loading slowly after installing this? I have some performance issues I need to sort out on my server so it might just be me but it can take up to a minute to load a profile now.

Great addon btw, not sure why this isn't core.
 
Thanks TeflonDon. I don't see why there should be any performance issues that would be related to using this addon. It doesn't add any additional database queries, and it uses xF built-in routines to parse the profile posts / bb codes. Well, bb codes aren't cached as it is now supported by the latest xF 1.2 release, but the effect of this should be negligible.
 
@AlexT
This addon conflicts with Widget Framework
http://xenforo.com/community/resources/bd-widget-framework.297/


Please fix it
.



@xfrocks
@AlexT: The problem is with the check before calling parent::renderHtml.

If your class is in the middle of the class hierarchy:

SomeAddOn_Class extends XFCP_SomeAddOn_Class...
Your_Class extends XFCP_Your_Class...
Target_Class extends XenForo_ViewPublic_Base

And you get the parent class by calling get_parent_class, it will return "XFCP_SomeAddOn_Class".
Performing the check using method_exists($parent, 'renderHtml) will return true because Your_Class does implement that method.
When you call parent::renderHtml, it will fail. The check will work if your class is the last one in the chain though. I propose this fix:

PHP:
protected function _parentHasMethod($method)
{
$us ='XFCP_' . __CLASS__;
$usFound = false;

foreach (class_parents($this) as $parent)
{
if ($parent === $us)
{
$usFound = true;
continue;
}
if (!$usFound)
{
continue;
}

// Do not perform method check until we found ourself in the class hierarchy.
// That needs to be done to safely trigger parent::$method.
// Performing method_exists(get_parent_class($this), $method) is not enough
// if our class is in the middle of the hierarchy:
//
// SomeAddOn_Class extends XFCP_SomeAddOn_Class...
// Our_Class extends XFCP_Our_Class...
// Target_Class
//
// pretty confusing...
if (method_exists($parent, $method))
{
return true;
}
}

return false;
}
 
Possible but imagine if two of your addons need to do that...

Well, yes, I could mention it in the readme to look at the execution order if one requires to. Thing is, theoretically, anyone extending (view) classes would have to include extra code checking for possible parent methods, and that would lead to an awful lot of repeated code that doesn't even contribute to the core functionality. It would be nice if xF added helper functions for this purpose.
 
Well, yes, I could mention it in the readme to look at the execution order if one requires to. Thing is, theoretically, anyone extending (view) classes would have to include extra code checking for possible parent methods, and that would lead to an awful lot of repeated code that doesn't even contribute to the core functionality. It would be nice if xF added helper functions for this purpose.

Not always as most of the case the view exists already and it's safe to call the parent class.

But yeah, best if we have a helper method to use.
 
Top Bottom