Advertisement:

Author Topic: Custom fields and filters of post  (Read 83847 times)

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 936
  • Gender: Male
Re: Custom fields and filters of post
« Reply #240 on: December 01, 2017, 03:32:40 PM »
Let me give you a gift: In the upper part, where users can filter the topics, I added some CSS to make it looks more organized when there's a lot search parameters. Probably you can do it better than mine :D

Check the code in the attached file :)
If all your WC3 Maps are in only one board is better use filter (as you do). Search page is better when you have records in more than one boards (with search page you can find records in various boards in only one result list). I supose you saw this. ;)

I like your theme in filters :)

You did added CSS styles in template file (function template_cffp_show). You do not must modify CustomFieldFilterPost.template.php because your changes be lost in next uninstall/install new version. :'( Instead to do this, try add your own style in YOUR_FORUM/Themes/YOUR_THEME/css/index.css. 8)

If you open this file you see the CSS of my mod for default theme:
Code: [Select]
/* BEGIN MOD CustomFieldFilterPost */
/* You do not modify this CSS style. Add your style before line "BEGIN MOD CustomFieldFilterPost" */
div.cffp_post,
div.cffp_member,
div.cffp_search
{
padding: 0.5em;
overflow: hidden;
}
div.cffp_post div.cffp_data,
div.cffp_member div.cffp_data,
div.cffp_search div.cffp_data
{
}
div.cffp_post dl.cffp_data > dt,
div.cffp_member dl.cffp_data > dt,
div.cffp_search dl.cffp_data > dt
{
float: left;
padding: 0;
margin: .5em 0 0 0;
font-weight: bold;
clear: both;
}
div.cffp_post dl.cffp_data > dd,
div.cffp_member dl.cffp_data > dd,
div.cffp_search dl.cffp_data > dd
{
float: left;
padding: 0;
margin: .3em 0;
}
div.cffp_post dl.cffp_data > dt,
div.cffp_member dl.cffp_data > dt
{
width: 20%;
}
div.cffp_post dl.cffp_data > dd,
div.cffp_member dl.cffp_data > dd
{
width: 78%;
}
div.cffp_search dl.cffp_data > dt
{
width: 40%;
}
div.cffp_search dl.cffp_data > dd
{
width: 58%;
}
form#cffp_edit_group .roundframe,
form#cffp_search .roundframe
{
padding: 0 12%;
}
div.cffp_post .moderatorbar,
div.cffp_member .moderatorbar
{
margin: 0;
}
div.cffp_post ul.quickbuttons,
div.cffp_member ul.quickbuttons
{
}
div.cffp_member div.cffp_member_data_fields
{
background-color: #fff;
padding: 10px;
}
div.cffp_member div.cffp_member_data_fields div.cffp_member_data_fields
{
padding: 0;
}
div.cffp_member div.cffp_member_fields
{
}
div.cffp_member div.cffp_member_fields span.botslice
{
clear: both;
}
div.cffp_member div.cffp_member_new_title
{
margin: 10px 0px;
}
div.cffp_member > fieldset legend a,
div.cffp_member div.cffp_member_data > fieldset legend a,
div.cffp_member div.cffp_member_new_title a
{
color: #444;
text-decoration: none;
}
div.cffp_member div.cffp_member_data_fields,
div.cffp_member div.cffp_member_new_fields
{
}
form#cffp_search div.cffp_column
{
margin: 0;
padding: 0;
width: 50%;
}
form#cffp_search div.cffp_column div.cffp_search
{
padding: 0 12px;
}
form#cffp_search div.cffp_roundframe
{
padding: 0 24%;
}
div.cffp_message_index
{
}
div.cffp_message_index_member
{
border-top: 1px solid #c4c4c4;
}
div.cffp_message_index span.cffp_group_name,
div.cffp_message_index_member span.cffp_group_name
{
font-weight: bold;
margin-right: 1em;
}
div.cffp_message_index div.cffp_data,
div.cffp_message_index dl.cffp_data,
div.cffp_message_index dl.cffp_data > dt,
div.cffp_message_index_member div.cffp_data,
div.cffp_message_index_member dl.cffp_data,
div.cffp_message_index_member dl.cffp_data > dt
{
display: inline !important;
}
div.cffp_message_index dl.cffp_data > dt,
div.cffp_message_index_member dl.cffp_data > dt
{
float: none !important;
padding: 0 !important;
margin: 0 !important;
width: auto !important;
font-weight: normal !important;
clear: none !important;
}
div.cffp_message_index dl.cffp_data > dd,
div.cffp_message_index_member dl.cffp_data > dd
{
display: inline-block !important;
float: none !important;
padding: 0 !important;
margin: 0 1em 0 0 !important;
width: auto !important;
}
div.cffp_message_index_member .moderatorbar
{
margin: 0;
}
div.cffp_message_index_member div.cffp_member_fields
{
border-bottom: 1px solid #c4c4c4;
}
form#cffp_filters
{
margin-top: 1em;
}
form#cffp_filters div.cffp_filters span
{
font-weight: bold;
margin-right: 1em;
}
form#cffp_filters div.cffp_filters a
{
margin-right: 1em;
}
form#cffp_filters div.cffp_filters,
form#cffp_filters div.cffp_filters dl,
form#cffp_filters div.cffp_filters dt
{
display: inline;
}
form#cffp_filters div.cffp_filters dd,
form#cffp_filters div.cffp_filters_button
{
display: inline;
margin-left: 0;
margin-right: 1em;
}
ul.quickbuttons li.move_button
{
background: url(../images/icons/quick_move.gif) no-repeat 0 0;
}
div.cffp_member_stats
{
padding: 0 12%;
}
div.cffp_message_index_member_stats
{
padding: 5px 0;
}
div.cffp_stats
{
width: 100%;
}
div.cffp_stats > dl.stats > dt
{
text-align: left;
}
div.cffp_stats_average
{
max-width: 392px;
width: 100%;
padding: 0;
}
div.cffp_stats_average span
{
font-weight: bold;
}
div.cffp_stats_average_bar
{
padding: 0;
height: 16px;
}
div.cffp_stats_average_bar div
{
background: #6294CE url(../images/bar_stats.png) repeat-x -4px;
padding: 0;
height: 16px;
}
div.cffp_top_posters_left
{
float: left;
width: 49.5%;
}
div.cffp_top_posters_right
{
float: right;
width: 49.5%;
}
/* END MOD CustomFieldFilterPost */

You do not must modify this code because you will have errors in uninstall :o, but you can write here your own style:
Code: [Select]
/* Here you can add your style */
your style...

/* BEGIN MOD CustomFieldFilterPost */
/* You do not modify this CSS style. Add your style before line "BEGIN MOD CustomFieldFilterPost" */
original style...
/* END MOD CustomFieldFilterPost */

For example, in CustomFieldFilterPost.template.php, line 3560
Code: [Select]
echo '
<div class="cffp_filters">';


if ($group['show_group_name_filter'])
echo '

<span>', $group['name'], '</span>';
you replace by
Code: [Select]
echo '
<div class="cffp_filters" style="display: inline-flex; padding: 0">';

if ($group['show_group_name_filter'])
echo '
<span style="float: left; padding: 5px 10px 0 0">', $group['name'], '</span>';

You can add this to css file instead of modify template:
Code: [Select]
form#cffp_filters div.cffp_filters
{
display: inline-flex !important;
padding: 0 !important;
}
form#cffp_filters div.cffp_filters span
{
float: left !important;
padding: 5px 10px 0 0 !important;
}
Also you can try add style with
Code: [Select]
form#cffp_filters div.cffp_filters dl
form#cffp_filters div.cffp_filters dd
form#cffp_filters div.cffp_filters dt
instead of replace dl/dd/dt tags with div's ;)



In filter section also you can add a button "Sort" and order your board by "Minumum Players" or "Score".
Modify a field and check permissions Sort 8)

Offline thepitster

  • Semi-Newbie
  • *
  • Posts: 28
  • Gender: Male
    • ALLRiPPED
Re: Custom fields and filters of post
« Reply #241 on: December 07, 2017, 02:21:34 PM »
when I updated to the newer version this popped up in the error_log again:
Code: (error_log) [Select]
syntax error, unexpected 'thank_list' (T_STRING), expecting ',' or ';' in ./Themes/default/Profile.template.php on line 518forgot the
Code: [Select]
';on line 517 of Profile.template.php, like so:
Before:
Code: (Profile.template.php(517)) [Select]
<!-- END MOD CustomFieldFilterPost -->After:
Code: (Profile.template.php(517)) [Select]
<!-- END MOD CustomFieldFilterPost -->';that way we don't end up at a blank page trying to view any profile.

Using SMF 2.0.15

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 936
  • Gender: Male
Re: Custom fields and filters of post
« Reply #242 on: December 07, 2017, 03:00:07 PM »
when I updated to the newer version this popped up in the error_log again:
Code: (error_log) [Select]
syntax error, unexpected 'thank_list' (T_STRING), expecting ',' or ';' in ./Themes/default/Profile.template.php on line 518forgot the
Code: [Select]
';on line 517 of Profile.template.php, like so:
Before:
Code: (Profile.template.php(517)) [Select]
<!-- END MOD CustomFieldFilterPost -->After:
Code: (Profile.template.php(517)) [Select]
<!-- END MOD CustomFieldFilterPost -->';that way we don't end up at a blank page trying to view any profile.

Using SMF 2.0.15
Perhaps you have another mod and both mods modify same code...

I need see your code. Attach here your Profile.template.php.