News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Custom fields and filters of post

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

Previous topic - Next topic

thepitster

#220
right after I installed this mod
PHP Parse error:  syntax error, unexpected 'global' (T_GLOBAL) in /Themes/default/languages/Modifications.english.php on line 600
line 600 is global $forum_version;
now I dunno what is up

SMF 2.0.14

EDIT: I removed the entire bottom block in Modification.english.php, my Modifications.english-utf8.php had the exact same thing at the bottom and no errors, and Yes I am using UTF-8

davidhs

Quote from: thepitster on August 01, 2017, 11:57:16 PM
right after I installed this mod
PHP Parse error:  syntax error, unexpected 'global' (T_GLOBAL) in /Themes/default/languages/Modifications.english.php on line 600
line 600 is global $forum_version;
now I dunno what is up

SMF 2.0.14

EDIT: I removed the entire bottom block in Modification.english.php, my Modifications.english-utf8.php had the exact same thing at the bottom and no errors, and Yes I am using UTF-8
Perhaps is your PHP version... I do not know...

Works fine all now?

If no, you can to do this: At beginning of my block of strings, search
global $forum_version;
$smf_version_1 = 0 === strpos($forum_version, 'SMF 1');

and replace by
$smf_version_1 = false;

thepitster

after your suggestion:
PHP Parse error:  syntax error, unexpected '$smf_version_1' (T_VARIABLE) in /Themes/default/languages/Modifications.english.php on line 602

like I said if I remove ALL the code that was placed into Modifications.english.php, and leave the code that was placed into Modifications.english-utf8.php every thing appears to still work so.

thepitster

 I am so Sorry, this had NOTHING to do with your mod at all, instead I have to go find another mod author and give him a lesson in PHP like "DO NOT FORGET YOUR ;'s THEY ARE IMPORTANT!", the last mod I installed forgot a semicolon at the end and it was causing every mod to do this.

sorry again for troubles.

thepitster

oh yeah I did find one edit

Code (modification-2.0.2-2.0.99.xml Line 1540) Select
echo '
<!-- END MOD CustomFieldFilterPost -->

you forgot the ' at the end of line 1541 like this
echo '
<!-- END MOD CustomFieldFilterPost -->'

other wise it breaks anything to do with the Profile page.

other than that this mod IS FREAKING AWESOME!!!!!! since they are picky about certain mods here being developed, this and 2 or 3 other mods is helping us achieve this goal, YOU SIR ARE A GENIUS!!!

davidhs

Sorry, I forgot this: your forum is SMF 2.0.14 and my mod was tested up to 2.0.13.
SMF 2.0.14 need PHP 5.4 and my server has PHP 5.3.8. At this moment, I can not tested my mods in SMF 2.0.14, sorry. :(

Americano

Hello

Please, I wanted a modification.

I have a Custom field in my forum and have an evaluation on the form with "positive" "negative" and "neutral" options and I wanted when it was positive, it would have 1 point in the index of the topic and when it was negative it would lose 1 point.

If the topic custom form had 4 positive and 1 negative, the topic index would be +3.

It would be possible?

davidhs

Quote from: Americano on August 15, 2017, 05:38:40 PM
Hello

Please, I wanted a modification.

I have a Custom field in my forum and have an evaluation on the form with "positive" "negative" and "neutral" options and I wanted when it was positive, it would have 1 point in the index of the topic and when it was negative it would lose 1 point.

If the topic custom form had 4 positive and 1 negative, the topic index would be +3.

It would be possible?
I suppose
- your group is type "fields with several values per member",
- you have an only one field (type select box or radio buttons, with "positive", "negative" and "neutral" options)

Is better you create options with value and text:
Quote1 -- positive
-1 -- negative
0 -- neutral

You want show statistical data of this field, but now you can show only
- Average value
- Highest allowed value
- Lowest allowed value
- Highest used value
- Lowest used value
- Most frequent value
- Least frequent value
- Total (this is number of answers)

You need another data (sum) but this not exist. I will see if I can add in next upgrade. Now you can use average value: If the topic custom form had 4 positive and 1 negative, the average value is 0.60 ( (1+1+1+1-1) / 5; values between -1 and 1).

Also, you can define your options
Quote10 -- positive
0 -- negative
5 -- neutral
and the average value is 8.00 ( (10+10+10+10+0) / 5; values between 0 and 10).

thepitster

hey man from time to time this keeps popping up in my server error_log:
Code (error_log) Select
PHP Fatal error:  Call to undefined function template_cffp_show() in /Sources/Load.php(2291) : eval()'d code on line 507
and line 2291 of Load.php:
Code (Load.php:(2291)) Select
$file_found = file_exists($filename) && eval('?' . '>' . rtrim(file_get_contents($filename))) !== false;

now I am assuming it means line 507 in Profile.template.php:
Code (Profile.template.php:(507)) Select
template_cffp_show('display_readonly');

hopefully not a SMF 2.0.14 problem?

davidhs

The problem is my mod.

SMF 2.0.14 need PHP 5.4 and my server has PHP 5.3.8. At this moment, I can not tested my mods in SMF 2.0.14.

Arantor

You could always set up a local test server using something like XAMPP which comes with options for 5.6, 7.0 and 7.1.
Holder of controversial views, all of which my own.

thepitster

Quote from: davidhs on September 06, 2017, 07:47:50 AM
The problem is my mod.

SMF 2.0.14 need PHP 5.4 and my server has PHP 5.3.8. At this moment, I can not tested my mods in SMF 2.0.14.
that is what I meant your mod conflicting with SMF 2.0.14.

Arantor tells you the truth on that, I had XAMPP setup on one of my computers, before I formatted it and installed Linux, LAMP, LEMP, PHP7, etc. and it worked fine with what I needed. they got XAMPP for Windows with PHP 5.6.31, 7.0.22 & 7.1.8 to choose from, give it a try apachefriends.org/download.html

inkvfd

I must be getting old. I hope I am asking this the right way. We have tours out on our land and visitors can go to our SMF website to post what they have seen. I am using custom fields for them to add their info. It all works great except Guest post show before I can approve them. I need to approve them first before the world can see them. Can anyone help. 

davidhs

Quote from: inkvfd on October 22, 2017, 05:46:23 PM
I must be getting old. I hope I am asking this the right way. We have tours out on our land and visitors can go to our SMF website to post what they have seen. I am using custom fields for them to add their info. It all works great except Guest post show before I can approve them. I need to approve them first before the world can see them. Can anyone help. 

I am sorry, this mod does not consider this... :(

If you have a unapproved guest post with custom fields, are these fields show?

Kirolainen

Hello.
I installed this mod on my forum and it worked flawlessly with SMFs own original template. Now I installed new template from SMFtricks. The mod works fine BUT does not show the fields and their values in the post. Whenediting the post, it shows, when viewing the post, it does not. I think there is something I have to change in (template?) files, but what it is exactly?

Alpay

Hello,
    First of all thank you for mod.. I want to activate the glossary mod ( https://custom.simplemachines.org/mods/index.php?mod=1525 ) in the field. Can you help with this ?

davidhs

Quote from: Americano on August 15, 2017, 05:38:40 PM
Hello

Please, I wanted a modification.

I have a Custom field in my forum and have an evaluation on the form with "positive" "negative" and "neutral" options and I wanted when it was positive, it would have 1 point in the index of the topic and when it was negative it would lose 1 point.

If the topic custom form had 4 positive and 1 negative, the topic index would be +3.

It would be possible?
Now you can to do this! :) I added a new statistical data: Sum.




Quote from: Kirolainen on October 31, 2017, 04:45:04 AM
Hello.
I installed this mod on my forum and it worked flawlessly with SMFs own original template. Now I installed new template from SMFtricks. The mod works fine BUT does not show the fields and their values in the post. Whenediting the post, it shows, when viewing the post, it does not. I think there is something I have to change in (template?) files, but what it is exactly?
You must install first your themes and then mods (some mods, like this, need to do changes in themes).

You must to do:
1. uninstall new theme,
2. uninstall mods,
3. install new theme,
4. install mods.




Quote from: Alpay on November 05, 2017, 05:46:59 AM
I want to activate the glossary mod ( https://custom.simplemachines.org/mods/index.php?mod=1525 ) in the field. Can you help with this ?
I can not to do this. But you can create your own glossary with my mod:
- Create a group of fields type record, named "Word"
- Fields of this group can be "Name" (text), "Definition" (large text), "Category" (select or combo box with options), "Synonyms" (combo box), "Word is approved?" (checkbox).
- "Show definition in messages" can be a propiety of "Definition": Show on message index.
- Create a new board ("Glossary") and your users (all, moderators, or admins) can add words (topics with group "Word") to glossary.




New version:
1.5     2017-11-25
------------------
@ There may be conflict with SEF MODs, which create friendly URLs.
+ The number of each type of record created by the member is shown on the information about the member in personal messages.
+ Statistics in groups of type "fields with several values per member": Sum of numeric values.
+ Predefined filters: Types of record.
+ Field in administration panel to indicate if is allowed selecting the operator with which apply the predefined filter.
+ SMF compatibility: 2.0.12 to 2.0.15.
+ Languages: New language string in german, german-utf8, german_informal, german_informal-utf8, thanks to sangham.net.
! Languages: Some language string in english, english-utf8, english_british, english_british-utf8, thanks to sangham.net.

moyack

Hi Davidhs, you now that I'm in love of this mod and thanks to this I've made a really well customized site with an embedded resource section. But now, I have a question for you:

In the search mode in the fields of type "registry", there's an option for search by field that adds an option in the search button. But when I search, it shows a list with links with a generic text, just like that:



Is there a way to show a name in the links instead of the word "View"?

Another question is: in order to upgrade, should I uninstall and then reinstall the mod?

davidhs

Quote from: moyack on November 30, 2017, 10:42:50 PM
In the search mode in the fields of type "registry", there's an option for search by field that adds an option in the search button. But when I search, it shows a list with links with a generic text, just like that:

[...]

Is there a way to show a name in the links instead of the word "View"?
Your group record WC3 Models has permission Search with some users. With this you can see the search page of records WC3 Models with basic columns: icon of post with record, View (link to post), date posted and posted by. You see this now.

But you can add more columns :) (fields of this record).
1. Modify a field.
2. Go to Settings for type "Record".
3. You see settings fields:

Show on records lists: You can select one of these options:
- No: column is not added to search page.
- Yes, in a column with only this field: a column with name of this custom field is added to list, and can set the column width
- Yes, in a column together with other fields: a column with this and other fields is added to list. This is usefull when list has too many columns and you want reduce number of columns. You can add values of various custom fields in only one column. In this case you can set this column with a second setting field:

Column with multiple fields: You can add this custom field to another multi-field column created before, or create a new column (with name and width) with, at this moment, only this field.

4. Save.

5. Modify another custom field. You can create a new column or show in a multi-field column.

Quote from: moyack on November 30, 2017, 10:42:50 PM
Another question is: in order to upgrade, should I uninstall and then reinstall the mod?
Yes. You do not worry, your custom fields will be not delete.

moyack

Excellent!!! Now it looks very professional :D




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

HUGSS!!!!

Advertisement: