News:

Wondering if this will always be free?  See why free is better.

Main Menu

Custom Form Mod

Started by live627, July 09, 2008, 10:24:44 PM

Previous topic - Next topic

live627

Quote from: Grendor on May 15, 2024, 10:52:01 PMI need a form with fields that only certain member groups can add to the form and see the form.
Admin or assigned groups should be able to delete entries.

I need a form or mod for people to request items they need stocked in our games market.
you can restrict individual forms but  not fields. Any given field will have the same access as their associated form.

But this mod won't satisfy all your requrirements.

shawnb61

I suspect the challenge here is the template form needed.
A question worth asking is born in experience & driven by necessity. - Fripp

Grendor

Hey Guys,

Thanks for the help and info you supplied, I greatly appreciate it.

I guess I might have to request a custom mod to suit my needs.
I tried several mods and each had issues I could not work around.

Anyways thanks again for the help
Grendor

davo88


When the 'Submit Redirect' field for the form is set to 'thanks', the error below is generated. 
Doesn't happen when the 'Submit Redirect is set to 'forum'.
Any ideas for things to try?

PHP 8.2
SMF 2.1.4 - Default theme
TinyPortal 3.0
Custom Form Mod 4.06
Forum Width Setting
Board Sorting Method

Error Message
75d06f8fd0f4c4ef64e6454c30537cbe
 https://xx.xx.xxx.xxx/~douglasm/index.php?action=form;thankyou
 /home/douglasm/public_html/Sources/CustomForm/CustomForm.php (Line 155)  Backtrace information

Type of error: Undefined
Error messageSelect
2: Undefined array key "customform_tabheader"

Backtrace
Error
Type of error - Undefined_vars
Error message - 2: Undefined array key "customform_tabheader"
File - /home/douglasm/public_html/Sources/CustomForm/CustomForm.php
Line - 155
URL of page causing the error - https://XX.XX.XXX.XXX/~douglasm/index.php?action=form;thankyou

Backtrace information
#0: smf_error_handler()
Called from /home/douglasm/public_html/Sources/CustomForm/CustomForm.php on line 155

#1: ThankYou()
Called from unknown on line -1

#2: call_user_func()
Called from /home/douglasm/public_html/Sources/CustomForm/CustomForm.php on line

#3: __construct()
Called from /home/douglasm/public_html/Sources/CustomForm/CustomForm.php on line 52

#4: create()
Called from /home/douglasm/public_html/index.php on line 184

Thank you function in CustomForm.php
private function ThankYou(): void
 {
 global $context, $modSettings, $txt;

 $context['page_title'] = !empty($modSettings['customform_view_title'])
 ? $modSettings['customform_view_title']
 : $txt['customform_tabheader'];
 $context['linktree'][] = [
 'url' => $this->scripturl . '?action=form',
 'name' => $context['page_title'],
 ];
 $context['robot_no_index'] = true;
 $context['sub_template'] = 'ThankYou';
 loadTemplate('CustomForm');
 loadLanguage('CustomForm');
 }

duban1

I have edited the id in $topicOptions inside ForumPost.php and managed to post as a reply instead of creating a new topic.
I have already managed to embed the form but I would like the $topicOptions to recognize the topic number from the url : /index.php?topic=923 and post it there, so I could use the form in several topics and not just one.

<?php

namespace CustomForm\Output;

use 
CustomForm\OutputInterface;

class 
ForumPost implements OutputInterface
{
    public function 
send(string $subjectstring $output, array $form_data): void
    
{
        global 
$smcFunc$sourcedir$user_info;

        require_once 
$sourcedir '/Subs-Post.php';
        
$msgOptions = [
            
'id' => 0,
            
'subject' => $smcFunc['htmlspecialchars']($subject),
            
'icon' => $form_data['icon'],
            
'body' => $smcFunc['htmlspecialchars']($output),
            
'smileys_enabled' => true,
        ];
        
$topicOptions = [
            
'id' => 923//What should I change here so that it recognizes the topic number automatically?
            
'board' => $form_data['id_board'],
            
'mark_as_read' => true,
        ];
        
$posterOptions = [
            
'id' => $user_info['id'],
        ];

        
createPost($msgOptions$topicOptions$posterOptions);
    }
}

Any suggestions?

JRMBelgium

This update message is really confusing. Resulting me to install the mod a second time. Now it's listed twice in my installed packages.

Kindred

No, you have to uninstall mods in order to install the new version...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

JRMBelgium

I found an incompatibility problem:

When you install this mod:
https://custom.simplemachines.org/index.php?mod=3012

Users will get the following message when they submit a form:
The database value you're trying to insert does not exist: description

Info from the error log:

Error
Type of error
Critical
Error message
The database value you're trying to insert does not exist: description
Function: createPost
File
/home/allian11/public_html/forum/Sources/Subs-Post.php
Line
1940
URL of page causing the error
https://alliancemultigaming.com/forum/index.php?action=form
Backtrace information
#0: smf_db_error_backtrace()
Called from /home/allian11/public_html/forum/Sources/Subs-Db-mysql.php on line 201
#1: smf_db_replacement__callback()
Called from unknown on line -1
#2: preg_replace_callback()
Called from /home/allian11/public_html/forum/Sources/Subs-Db-mysql.php on line 346
#3: smf_db_quote()
Called from /home/allian11/public_html/forum/Sources/Subs-Db-mysql.php on line 783
#4: smf_db_insert()
Called from /home/allian11/public_html/forum/Sources/Subs-Post.php on line 1940
#5: createPost()
Called from /home/allian11/public_html/forum/Sources/CustomForm/Output/ForumPost.php on line 30
#6: send()
Called from /home/allian11/public_html/forum/Sources/CustomForm/CustomForm.php on line 317
#7: ViewForm()
Called from unknown on line -1
#8: call_user_func()
Called from /home/allian11/public_html/forum/Sources/CustomForm/CustomForm.php on line 44
#9: __construct()
Called from /home/allian11/public_html/forum/Sources/CustomForm/CustomForm.php on line 52
#10: create()
Called from /home/allian11/public_html/forum/index.php on line 184

I also reported this issue in the topic of the other mod.

JRMBelgium

Quote from: Kindred on September 18, 2024, 08:21:19 PMNo, you have to uninstall mods in order to install the new version...

To be clear, the mod is showing info about the latest version, even if you already have that installed. It would be more logical if that message was only visible if the installed version is outdated.

live627

That was the intention, but it's unfortunately bugged. Yep. Got a can of raid shadow legends?

live627

Custom Form Mod has just been updated to fix the incorrect upgrade notice that would always show even when running the latest. The new packages will still report 4.0.6 in the package manager, but its filename is correct custom-forms_4-0-7.tgz

Advertisement: