Advertisement:

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

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,107
  • Gender: Male
Re: Custom fields and filters of post
« Reply #160 on: June 11, 2015, 04:55:21 PM »
Not neccessary ;)

Edit the correct language file ("portuguese_brazilian"). Have not reviewed Americano translation, so here it goes for portuguese_brazilian-utf8:

[...]
:o I'm sorry but ... I think you are confused.

I had this problem when I published one of my mods. Before I wrote characters always (in UTF-8 and ISO 8859-1) but SMF team said to me that in ISO 8859-1 languages must be with HTML entities.

Reason (in my words):
- UTF-8 is a multilanguage code, encode all simbols of "all" languages.
- ISO 8859-1 is a basic set of latin characters and no-English characters must be written as HTML entities.

Finally, an error, not sure if common, but happened to my smf.

I tested all my smf functions right after installed the mod, but it seems I can't delete any messages. All references I got for 'f.id_member' was on this mod edit of Sources/Removetopic.php, so I'm stuck now.

Code: [Select]
Erro na Base de Dados
Unknown column 'f.id_member' in 'where clause'
Arquivo: /xxx/Sources/RemoveTopic.php
Linha: 1020

Nota: Parece que a sua base de dados precisa de ser atualizada. Os arquivos do seu Fórum estão na versão SMF 2.0.10, enquanto que a sua base de dados está na versão SMF 2.0.9. Recomenda-se que seja executada a últiuma versão do arquivo de upgrade.php.

Something about upgrade my database to 2.0.10? Should I follow the message and see what happens?

Or perhaps should I run the db files of your mod again?
Your database is correct. It is a serious bug of my mod! I am sorry, I tested "all" cases but I did not saw this... :(

I will see now and fix this.

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,107
  • Gender: Male
Re: Custom fields and filters of post
« Reply #161 on: June 13, 2015, 08:54:29 AM »
In next update I will review all Portuguese strings (utf8 and iso).
Fixed.

Finally, an error, not sure if common, but happened to my smf.

I tested all my smf functions right after installed the mod, but it seems I can't delete any messages. All references I got for 'f.id_member' was on this mod edit of Sources/Removetopic.php, so I'm stuck now.

Code: [Select]
Erro na Base de Dados
Unknown column 'f.id_member' in 'where clause'
Arquivo: /xxx/Sources/RemoveTopic.php
Linha: 1020

Nota: Parece que a sua base de dados precisa de ser atualizada. Os arquivos do seu Fórum estão na versão SMF 2.0.10, enquanto que a sua base de dados está na versão SMF 2.0.9. Recomenda-se que seja executada a últiuma versão do arquivo de upgrade.php.
Fixed.



New version:
Code: [Select]
1.3.1   2015-06-13
------------------
! SMF 2.0.x: Error in SQL code.
! Use HTML entities in ISO-8859-1 languages.
! Since version 1.2 the help text is too long and generates an error on uninstallation. It is divided in two operations.



If your forum is in Spanish or Portuguese ISO-8859-1 (not UTF-8) and versions 1.2 or 1.3 of this mod are used, when you uninstall it to upgrade to the new version 1.3.1 can be eliminated all help in your language. This is due to the help of this mod is very large and occurs the error detected here http://www.simplemachines.org/community/index.php?topic=117506.0

I write steps for avoid this problem here http://www.simplemachines.org/community/index.php?topic=117506.msg3818378#msg3818378

In step 4, removes all the text between these texts, including these:
Code: [Select]
// BEGIN MOD CustomFieldFilterPost
...
// END MOD CustomFieldFilterPost

Offline Sakae

  • Full Member
  • ***
  • Posts: 498
  • Gender: Male
    • TigreLOG
Re: Custom fields and filters of post
« Reply #162 on: June 15, 2015, 03:19:28 PM »
In next update I will review all Portuguese strings (utf8 and iso).
Fixed.

Ok, I understand about ISO-8859-1. But I shall insist for the correct language files to be updated: portuguese_brazilian-utf8.php. There is no brazilian-utf8.php language files... :-\

Finally, an error, not sure if common, but happened to my smf.

I tested all my smf functions right after installed the mod, but it seems I can't delete any messages. All references I got for 'f.id_member' was on this mod edit of Sources/Removetopic.php, so I'm stuck now.

Code: [Select]
Erro na Base de Dados
Unknown column 'f.id_member' in 'where clause'
Arquivo: /xxx/Sources/RemoveTopic.php
Linha: 1020

Nota: Parece que a sua base de dados precisa de ser atualizada. Os arquivos do seu Fórum estão na versão SMF 2.0.10, enquanto que a sua base de dados está na versão SMF 2.0.9. Recomenda-se que seja executada a últiuma versão do arquivo de upgrade.php.
Fixed.

Working great now :D
http://www.tigrelog.com.br
l: simple p: machines

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,107
  • Gender: Male
Re: Custom fields and filters of post
« Reply #163 on: June 15, 2015, 04:00:42 PM »
In next update I will review all Portuguese strings (utf8 and iso).
Fixed.

Ok, I understand about ISO-8859-1. But I shall insist for the correct language files to be updated: portuguese_brazilian-utf8.php. There is no brazilian-utf8.php language files... :-\
Yes, it is true... in SMF 2.0.x does not exists "brazilian" language but in SMF 1.1.x yes (at least 1.1-1.1.5). Because of this I add "portuguese_brazilian" and "brazilian" (and "portuguese-pt", of course). Same case of "spanish", "spanish-es" and "spanish-latin".

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,107
  • Gender: Male
Re: Custom fields and filters of post
« Reply #164 on: June 19, 2015, 12:18:12 PM »
New version:
Code: [Select]
1.3.2   2015-06-19
------------------
! Errors in source code.

Offline Mabba

  • Jr. Member
  • **
  • Posts: 158
  • Gender: Female
  • SMF 2.0.9
    • Mabba2000 on Facebook
Re: Custom fields and filters of post
« Reply #165 on: June 19, 2015, 03:30:30 PM »
Errors
see attach.
Gruss
Mabba
SMF 2.0.9

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,107
  • Gender: Male
Re: Custom fields and filters of post
« Reply #166 on: June 20, 2015, 07:12:42 AM »
Errors
see attach.
You have installed another mod that changes the member's profile.

Attach your files

/Sources/Profile-View.php
/Themes/default/Profile.template.php

and I will tell that changes must do by hand.

Offline Mabba

  • Jr. Member
  • **
  • Posts: 158
  • Gender: Female
  • SMF 2.0.9
    • Mabba2000 on Facebook
Re: Custom fields and filters of post
« Reply #167 on: June 21, 2015, 01:42:40 AM »
Here the files are in the appendix.
Thanks in advance.
Gruss
Mabba
SMF 2.0.9

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,107
  • Gender: Male
Re: Custom fields and filters of post
« Reply #168 on: June 21, 2015, 07:40:38 AM »
Here the files are in the appendix.
Thanks in advance.
You have install a mod with topic prefix and this mod modify same source code of my mod.

If you want install my mod do these steps:
 
1. Install my mod with errors.

2. Open your /Sources/Profile-View.php and do modifications by hand:

2.1. Do modification #8
Search (line 413)
Code: [Select]
t.approved, m.body, m.smileys_enabled, m.subject, m.poster_time, m.id_topic, m.id_msg, t.id_prefix

Replace by
Code: [Select]
t.approved, m.body, m.smileys_enabled, m.subject, m.poster_time, m.id_topic, m.id_msg, t.id_prefix
' /* BEGIN MOD CustomFieldFilterPost */ . ', t.is_sticky, t.locked' . /* END MOD CustomFieldFilterPost */ '

2.2. Do modification #9
Search (line 434)
Code: [Select]
$request = $smcFunc['db_query']('', '
SELECT
b.id_board, b.name AS bname, c.id_cat, c.name AS cname, m.id_topic, m.id_msg,
t.id_member_started, t.id_first_msg, t.id_last_msg, m.body, m.smileys_enabled, t.id_prefix,
m.subject, m.poster_time, m.approved
FROM {db_prefix}messages AS m
INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)
WHERE m.id_member = {int:current_member}' . (!empty($board) ? '
AND b.id_board = {int:board}' : '') . (empty($range_limit) ? '' : '
AND ' . $range_limit) . '
AND {query_see_board}' . (!$modSettings['postmod_active'] || $context['user']['is_owner'] ? '' : '
AND t.approved = {int:is_approved} AND m.approved = {int:is_approved}') . '
ORDER BY m.id_msg ' . ($reverse ? 'ASC' : 'DESC') . '
LIMIT ' . $start . ', ' . $maxIndex,
array(
'current_member' => $memID,
'is_approved' => 1,
'board' => $board,
)
);
Replace by
Code: [Select]
// BEGIN MOD CustomFieldFilterPost
$request = $smcFunc['db_query']('', '
SELECT
DISTINCT
t.is_sticky, t.locked,
b.id_board, b.name AS bname, c.id_cat, c.name AS cname, m.id_topic, m.id_msg,
t.id_member_started, t.id_first_msg, t.id_last_msg, m.body, m.smileys_enabled, t.id_prefix,
m.subject, m.poster_time, m.approved
FROM {db_prefix}messages AS m
INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)' . ($context['is_cffp_record'] ? '
INNER JOIN {db_prefix}cffp_fields AS cffpf ON (cffpf.id_msg = m.id_msg)' : '') . '
LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)
WHERE m.id_member = {int:current_member}' . (!empty($board) ? '
AND b.id_board = {int:board}' : '') . (empty($range_limit) ? '' : '
AND ' . $range_limit) . ($context['is_cffp_record'] ? '
AND cffpf.id_group = {int:id_group}' : '') . '
AND {query_see_board}' . (!$modSettings['postmod_active'] || $context['user']['is_owner'] ? '' : '
AND t.approved = {int:is_approved} AND m.approved = {int:is_approved}') . '
ORDER BY m.id_msg ' . ($reverse ? 'ASC' : 'DESC') . '
LIMIT ' . $start . ', ' . $maxIndex,
array(
'current_member' => $memID,
'is_approved' => 1,
'board' => $board,
'id_group' => $context['is_cffp_record'],
)
);
// END MOD CustomFieldFilterPost

3. Open your /Themes/default/Profile.template.php and do modifications by hand:

3.1. Do modification #2
Search (line 392)
Code: [Select]
echo '
', $post['body'];
if (array_key_exists('thank_list', $post)) {
echo template_saythanks_thanker_list($post, $post['thank_list']);
}
echo '
Replace by
Code: [Select]
// BEGIN MOD CustomFieldFilterPost
// Show custom post fields.
$context['cffp']['display_readonly'] = $post['cffp']['display_readonly'];
template_cffp_show('display_readonly');

echo '
', $post['body'];

// Show custom post fields per member.
$context['cffp']['display_member_readonly'] = $post['cffp']['display_member_readonly'];
template_cffp_show('display_member_readonly');

if (array_key_exists('thank_list', $post)) {
echo template_saythanks_thanker_list($post, $post['thank_list']);
}
echo '
<!-- END MOD CustomFieldFilterPost -->

4. End. ;)

When you uninstall this mod, you must undo these modifications by hand.

Offline sangham.net

  • Full Member
  • ***
  • Posts: 497
  • Gender: Male
Re: Custom fields and filters of post
« Reply #169 on: June 22, 2015, 12:54:11 PM »
Valued Mr. Davidhs,

being directed here, generously by valued Mr. live627 from "Vision of a SMF-DIC tionary mod", my person likes to ask kindly if Mr. Davidhs thinks, that it is proper for this use and if he appreciates the use for it, since my person is not sure about it.

Thanks a lot, and sorry for using your time in advanced.


Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,107
  • Gender: Male
Re: Custom fields and filters of post
« Reply #170 on: June 23, 2015, 07:36:45 AM »
Valued Mr. Davidhs,

being directed here, generously by valued Mr. live627 from "Vision of a SMF-DIC tionary mod", my person likes to ask kindly if Mr. Davidhs thinks, that it is proper for this use and if he appreciates the use for it, since my person is not sure about it.

Thanks a lot, and sorry for using your time in advanced.
I reply in your topic "Vision of a SMF-DIC tionary mod" http://www.simplemachines.org/community/index.php?topic=537527.msg3820399#msg3820399

Offline Americano

  • Semi-Newbie
  • *
  • Posts: 89
Re: Custom fields and filters of post
« Reply #171 on: July 06, 2015, 07:52:33 PM »
Davidhs Hello, How are you?

I tested a Latest Version. Excellent.   :)

is it could have top?

You can make a top 10 rank of the custom fields:-X

---

I like of the Enhancements to recent posts  :D

I do the translation into Portuguese, if you want 

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,107
  • Gender: Male
Re: Custom fields and filters of post
« Reply #172 on: July 07, 2015, 07:10:42 AM »
Davidhs Hello, How are you?

I tested a Latest Version. Excellent.   :)
Thanks for all! I am pleased that you like.

is it could have top?

You can make a top 10 rank of the custom fields:-X
Sorry for my bad English. I do not understand this phrases. It is an enhancement?

I like of the Enhancements to recent posts  :D

I do the translation into Portuguese, if you want 
Yes, of course, you can translate this and others of my mods. :)

Offline Americano

  • Semi-Newbie
  • *
  • Posts: 89
Re: Custom fields and filters of post
« Reply #173 on: July 07, 2015, 03:43:35 PM »

is it could have top?

You can make a top 10 rank of the custom fields:-X
Sorry for my bad English. I do not understand this phrases. It is an enhancement?

Do you can to make top 10 users who posted more custom fields

Mod Top 10 custom fields

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,107
  • Gender: Male
Re: Custom fields and filters of post
« Reply #174 on: July 08, 2015, 06:23:19 AM »

is it could have top?

You can make a top 10 rank of the custom fields:-X
Sorry for my bad English. I do not understand this phrases. It is an enhancement?

Do you can to make top 10 users who posted more custom fields

Mod Top 10 custom fields
Ok, I understand.

In first post of this topic I wrote an example of use of this mod, but users can send to me their custom fields and I will publish as example.

This mod is complex and now I have only one example. The more the merrier. Examples with images of screen are welcome :)

Offline Americano

  • Semi-Newbie
  • *
  • Posts: 89
Re: Custom fields and filters of post
« Reply #175 on: July 08, 2015, 02:20:27 PM »

is it could have top?

You can make a top 10 rank of the custom fields:-X
Sorry for my bad English. I do not understand this phrases. It is an enhancement?

Do you can to make top 10 users who posted more custom fields

Mod Top 10 custom fields
Ok, I understand.

In first post of this topic I wrote an example of use of this mod, but users can send to me their custom fields and I will publish as example.

This mod is complex and now I have only one example. The more the merrier. Examples with images of screen are welcome :)

I don't understand...  :(

I want a top 10 custom field like the top 10 post.

check the example image

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,107
  • Gender: Male
Re: Custom fields and filters of post
« Reply #176 on: July 10, 2015, 08:57:03 AM »

is it could have top?

You can make a top 10 rank of the custom fields:-X
Sorry for my bad English. I do not understand this phrases. It is an enhancement?

Do you can to make top 10 users who posted more custom fields

Mod Top 10 custom fields
Ok, I understand.

In first post of this topic I wrote an example of use of this mod, but users can send to me their custom fields and I will publish as example.

This mod is complex and now I have only one example. The more the merrier. Examples with images of screen are welcome :)

I don't understand...  :(

I want a top 10 custom field like the top 10 post.

check the example image
Ok, now I understand. I expect! :)

I will see...

Offline Americano

  • Semi-Newbie
  • *
  • Posts: 89
Re: Custom fields and filters of post
« Reply #177 on: July 10, 2015, 08:42:33 PM »
For example:

In the forum has custom field that call reviews

In a user profile contains:

Posts 20
Reviews: 10 (it works perfectly  8))

The statistics will look like this:

Top 10 posts (already exists) and Top 10 review (new mod)

This mod would be an addition to the counter custom fields

I hope you understand  :)

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,107
  • Gender: Male
Re: Custom fields and filters of post
« Reply #178 on: July 12, 2015, 08:00:12 AM »
For example:

In the forum has custom field that call reviews

In a user profile contains:

Posts 20
Reviews: 10 (it works perfectly  8))

The statistics will look like this:

Top 10 posts (already exists) and Top 10 review (new mod)

This mod would be an addition to the counter custom fields

I hope you understand  :)
Yes, I saw Statistical section in my forum. I will add a "Top 10 user" for each group of type record. :)

Thanks for this request!

Offline Americano

  • Semi-Newbie
  • *
  • Posts: 89
Re: Custom fields and filters of post
« Reply #179 on: July 13, 2015, 11:33:03 PM »
hi

I'm doing a custom fields. However, all fields are in one column in filter and index.  This makes occupy a large space.  :'(

I can not get the search filter with the fields in the same line like the figure.

Note: The fields are in the same group

How do I get the fields on the same line like  figure of example.