[TH] Custom Fields [Deleted]

You've set up the the custom field. You just need to make a quick template edit (or create an add-on and make a template modification).

In the template thread_list_item replace:
HTML:
                   <a href="{xen:link "threads{xen:if '{$thread.isNew} AND {$thread.haveReadData}', '/unread'}", $thread}"
                    title="{xen:if '{$thread.isNew} AND {$thread.haveReadData}', {xen:phrase go_to_first_unread_message}}"
                    class="{xen:if $thread.hasPreview, PreviewTooltip}"
                    data-previewUrl="{xen:if $thread.hasPreview, {xen:link threads/preview, $thread}}">
with:
Rich (BB code):
            <xen:if is="{$thread.customFields.FIELD_ID}">
                <a href="{$thread.customFields.FIELD_ID}">
            <xen:else />
                <a href="{xen:link "threads{xen:if '{$thread.isNew} AND {$thread.haveReadData}', '/unread'}", $thread}"
                    title="{xen:if '{$thread.isNew} AND {$thread.haveReadData}', {xen:phrase go_to_first_unread_message}}"
                    class="{xen:if $thread.hasPreview, PreviewTooltip}"
                    data-previewUrl="{xen:if $thread.hasPreview, {xen:link threads/preview, $thread}}">
                </xen:if>


I haven't actually tested this, but it should work.

Thanks a lot dude! Awesome feature :)

I fixed up your code above as you missed a } on the second line :)
 
Last edited:
Is there any way to make an input required... I'm sure i saw it before, however cant find it for the life of me (i.e. not allowing a user to leave a field blank)
Many thanks :)
 
Hello,

I searched lot but I didn't find the answer to my question ,

Would you please tell me if it is possible to create UNIQUE USER CUSTOM FIELD which user should fill in registration form using this plugin ?

like username and email which should be unique per user ...

Thank you
 
Hello,

I searched lot but I didn't find the answer to my question ,

Would you please tell me if it is possible to create UNIQUE USER CUSTOM FIELD which user should fill in registration form using this plugin ?

like username and email which should be unique per user ...

Thank you
This isn't possible but is a really great idea and I could add it as a feature of this add-on relatively easily. Drop me a PM if this is a feature that you would be interesting in contributing towards.
 
Am running the latest version of this add on and I am trying to edit a regular custom user profile field which is generating an error:-
Server Error Log
Error Info
ErrorException: Fatal Error: Call to undefined method Waindigo_CustomFields_Extend_XenForo_Model_UserField::getObjectFieldTypeMap() - library/Waindigo/CustomFields/Extend/XenForo/DataWriter/UserField.php:169
Generated By: Rob, Today at 09:18
Stack Trace
#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}
Request State
array(3) {
["url"] => string(64) "http://www.mydomain.com/admin.php?user-fields/country/save"
["_GET"] => array(1) {
["user-fields/country/save"] => string(0) ""
}
["_POST"] => array(22) {
["title"] => string(7) "Country"
["description"] => string(19) "Choose your country"
["display_group"] => string(8) "personal"
["display_order"] => string(1) "2"
["match_type"] => string(4) "none"
["field_type"] => string(6) "select"
["choice_type"] => string(6) "custom"
["field_choice"] => array(10) {
[0] => string(14) "united_kingdom"
[1] => string(7) "ireland"
[2] => string(14) "rest_of_europe"
[3] => string(3) "usa"
[4] => string(6) "canada"
[5] => string(11) "new_zealand"
[6] => string(9) "australia"
[7] => string(15) "middle_east_amp"
[8] => string(5) "other"
[9] => string(0) ""
}
["field_choice_text"] => array(10) {
[0] => string(14) "United Kingdom"
[1] => string(7) "Ireland"
[2] => string(14) "Rest of Europe"
[3] => string(3) "USA"
[4] => string(6) "Canada"
[5] => string(11) "New Zealand"
[6] => string(9) "Australia"
[7] => string(24) "Middle East &amp; Africa"
[8] => string(5) "Other"
[9] => string(0) ""
}
["required"] => string(1) "1"
["show_registration"] => string(1) "1"
["user_editable_base"] => string(1) "1"
["viewable_profile"] => string(1) "1"
["value_display"] => string(4) "html"
["display_template"] => string(0) ""
["export_callback_class"] => string(0) ""
["export_callback_method"] => string(0) ""
["addon_id"] => string(0) ""
["_xfToken"] => string(8) "********"
["_xfRequestUri"] => string(35) "/admin.php?user-fields/country/edit"
["_xfNoRedirect"] => string(1) "1"
["_xfResponseType"] => string(4) "json"
}
}
 
The latest version of this addon is throwing an error with latest versions of XenForo and the Resource Manager when I try to edit an existing RM category

Code:
Server Error

Undefined index: required_fields

    XenForo_Application::handlePhpError() in C:\wamp\www\xf13\library\Waindigo\CustomFields\Extend\XenResource\ControllerAdmin\Category.php at line 31
    Waindigo_CustomFields_Extend_XenResource_ControllerAdmin_Category_Base->_getCategoryAddEditResponse() in C:\wamp\www\xf13\library\Waindigo\CustomFields\Extend\XenResource\ControllerAdmin\Category.php at line 133
    Waindigo_CustomFields_Extend_XenResource_ControllerAdmin_Category->_getCategoryAddEditResponse() in C:\wamp\www\xf13\library\XenResource\ControllerAdmin\Category.php at line 116
    XenResource_ControllerAdmin_Category->actionEdit() in C:\wamp\www\xf13\library\XenForo\FrontController.php at line 347
    XenForo_FrontController->dispatch() in C:\wamp\www\xf13\library\XenForo\FrontController.php at line 134
    XenForo_FrontController->run() in C:\wamp\www\xf13\admin.php at line 13


When trying to add a new category, I get the following error

Code:
Mysqli prepare error: Unknown column 'category_resource_fields' in 'field list'

    Zend_Db_Statement_Mysqli->_prepare() in C:\wamp\www\xf13\library\Zend\Db\Statement.php at line 115
    Zend_Db_Statement->__construct() in C:\wamp\www\xf13\library\Zend\Db\Adapter\Mysqli.php at line 381
    Zend_Db_Adapter_Mysqli->prepare() in C:\wamp\www\xf13\library\Zend\Db\Adapter\Abstract.php at line 478
    Zend_Db_Adapter_Abstract->query() in C:\wamp\www\xf13\library\Zend\Db\Adapter\Abstract.php at line 574
    Zend_Db_Adapter_Abstract->insert() in C:\wamp\www\xf13\library\XenForo\DataWriter.php at line 1624
    XenForo_DataWriter->_insert() in C:\wamp\www\xf13\library\XenForo\DataWriter.php at line 1613
    XenForo_DataWriter->_save() in C:\wamp\www\xf13\library\XenForo\DataWriter.php at line 1405
    XenForo_DataWriter->save() in C:\wamp\www\xf13\library\XenResource\ControllerAdmin\Category.php at line 158
    XenResource_ControllerAdmin_Category->actionSave() in C:\wamp\www\xf13\library\Waindigo\CustomFields\Extend\XenResource\ControllerAdmin\Category.php at line 86
    Waindigo_CustomFields_Extend_XenResource_ControllerAdmin_Category_Base->actionSave() in C:\wamp\www\xf13\library\XenForo\FrontController.php at line 347
    XenForo_FrontController->dispatch() in C:\wamp\www\xf13\library\XenForo\FrontController.php at line 134
    XenForo_FrontController->run() in C:\wamp\www\xf13\admin.php at line 13

The XF RM addon was added after installing this addon.
 
Ok, I have a question since I can't get to display a selection's field value.

So basically I have a drop down selection and when I choose to display it with {$customFields.fieldid} it displays the value of the field not the text value.

So if I have pc as the value and personal computer as the text, it shows pc all the time. I also modified the customfield by adding the {$value} as its html output, no changes.
 
Waindigo updated Custom Fields by Waindigo with a new update entry:

Version 2.0.2 released

New features:
  • Added ability to select custom fields to appear in the forum quick search menu. If a user enters a value for any field in the quick search, the Threads and Post search is used, rather than the Everything search.
  • Added ability to select which custom fields appear in the advanced searches for Threads and Posts, Users and Resources.
  • Added option to only show custom fields in search if usable by a user (excluding Custom User Fields).
Bug fixes:...

Read the rest of this update entry...
 
Ok, I have a question since I can't get to display a selection's field value.

So basically I have a drop down selection and when I choose to display it with {$customFields.fieldid} it displays the value of the field not the text value.

So if I have pc as the value and personal computer as the text, it shows pc all the time. I also modified the customfield by adding the {$value} as its html output, no changes.
This is as designed. If you are using the templates, you have to write your own display code. For example:
HTML:
<xen:if is="{$customFields.fieldid} = 'option1'">
Option 1 Value
<xen:elseif is="{$customFields.fieldid} = 'option2'" />
Option 2 Value
<xen:else />
Some Other Option Value
</xen:if>
 
@Waindigo thanks for the update
i wana ask u about placing the fields ?! is there a free choice for placing them ?

like i just take the field id and put it on some places of the threads ?!

so i can play with them easily
 
@Waindigo with the search functionality and the join of thread and search table, do you think it'll be okay for a busy board and will it be usable with Enhanced Search.
 
Last edited:
@Waindigo with the search functionality and the join of thread and search table, do you think it'll be okay for a busy board and will it be usable with Enhanced Search.
The search already joins the thread table if you select to order by reply count. Actually, what we are joining is the thread fields table, so this would probably be less of an impact. It also only joins if someone searches on a field, so normal searches are unaffected. So it should work fine on a busy board and should be usable with Enhanced Search.
 
@Waindigo It's awesome that you added this to quick search but I really need to be able to search ONLY for that field. Right now it's making me put in something in the main search or a member name. Is it possible for you to do that? Thanks. Great work by the way. It's so close to what I need.
 
@Waindigo I'm running into a couple problems. First I have the custom field set to show up in the thread list but it's not there. The star rating is there but the custom field isn't and also, it's awesome that you added this to quick search but I really need to be able to search ONLY for that field.
Can you give me more information about the custom field that isn't there? Are you sure you have set it up correctly. Does it have a value? If your star rating field is showing correctly, it sounds like it probably isn't a bug with the add-on.

Right now it's making me put in something in the main search or a member name. Is it possible for you to do that? Thanks. Great work by the way. It's so close to what I need.
We have a really old add-on called Search by Waindigo which allows for searching without entering any keywords. You can find it here:
http://xenforo.com/community/resources/search-by-waindigo.1173/
 
Can you give me more information about the custom field that isn't there? Are you sure you have set it up correctly. Does it have a value? If your star rating field is showing correctly, it sounds like it probably isn't a bug with the add-on.


We have a really old add-on called Search by Waindigo which allows for searching without entering any keywords. You can find it here:
http://xenforo.com/community/resources/search-by-waindigo.1173/

Oops... sorry I didnt see your response before I posted the last thing. Oh thats right I forgot about that addon. I'll give it a shot. I tried to edit out the thing about the field not showing up in thread list because I realized that it was because the font color was set to white lol. So thats fixed.
 
Top Bottom