News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Custom fields and filters of post

Started by davidhs, February 21, 2014, 01:53:17 PM

Previous topic - Next topic

davidhs

Quote from: Sakae on June 10, 2015, 10:33:45 AM
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.

Quote from: Sakae on June 10, 2015, 10:40:35 AM
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.

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.

davidhs

Quote from: davidhs on June 08, 2015, 12:42:24 PM
In next update I will review all Portuguese strings (utf8 and iso).
Fixed.

Quote from: Sakae on June 10, 2015, 10:40:35 AM
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.

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:
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:

// BEGIN MOD CustomFieldFilterPost
...
// END MOD CustomFieldFilterPost

Sakae

Quote from: davidhs on June 13, 2015, 08:54:29 AM
Quote from: davidhs on June 08, 2015, 12:42:24 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... :-\

Quote from: davidhs on June 13, 2015, 08:54:29 AM
Quote from: Sakae on June 10, 2015, 10:40:35 AM
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.

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

davidhs

Quote from: Sakae on June 15, 2015, 03:19:28 PM
Quote from: davidhs on June 13, 2015, 08:54:29 AM
Quote from: davidhs on June 08, 2015, 12:42:24 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".

davidhs

New version:
1.3.2   2015-06-19
------------------
! Errors in source code.

Mabba

Gruss
Mabba
SMF 2.0.9

davidhs

Quote from: Mabba on June 19, 2015, 03:30:30 PM
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.

Mabba

Here the files are in the appendix.
Thanks in advance.
Gruss
Mabba
SMF 2.0.9

davidhs

Quote from: Mabba on June 21, 2015, 01:42:40 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)

t.approved, m.body, m.smileys_enabled, m.subject, m.poster_time, m.id_topic, m.id_msg, t.id_prefix


Replace by

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)

$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

// 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)

echo '
', $post['body'];
if (array_key_exists('thank_list', $post)) {
echo template_saythanks_thanker_list($post, $post['thank_list']);
}
echo '

Replace by

// 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.

sangham.net

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.


davidhs

Quote from: sangham.net 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.
I reply in your topic "Vision of a SMF-DIC tionary mod" http://www.simplemachines.org/community/index.php?topic=537527.msg3820399#msg3820399

Americano

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 

davidhs

Quote from: Americano on July 06, 2015, 07:52:33 PM
Davidhs Hello, How are you?

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

Quote from: Americano on July 06, 2015, 07:52:33 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?

Quote from: Americano on July 06, 2015, 07:52:33 PM
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. :)

Americano

Quote from: davidhs on July 07, 2015, 07:10:42 AM

Quote from: Americano on July 06, 2015, 07:52:33 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

davidhs

Quote from: Americano on July 07, 2015, 03:43:35 PM
Quote from: davidhs on July 07, 2015, 07:10:42 AM

Quote from: Americano on July 06, 2015, 07:52:33 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 :)

Americano

Quote from: davidhs on July 08, 2015, 06:23:19 AM
Quote from: Americano on July 07, 2015, 03:43:35 PM
Quote from: davidhs on July 07, 2015, 07:10:42 AM

Quote from: Americano on July 06, 2015, 07:52:33 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

davidhs

Quote from: Americano on July 08, 2015, 02:20:27 PM
Quote from: davidhs on July 08, 2015, 06:23:19 AM
Quote from: Americano on July 07, 2015, 03:43:35 PM
Quote from: davidhs on July 07, 2015, 07:10:42 AM

Quote from: Americano on July 06, 2015, 07:52:33 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
Ok, now I understand. I expect! :)

I will see...

Americano

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  :)

davidhs

Quote from: Americano 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  :)
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!

Americano

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.

Advertisement: