Advertisement:

Author Topic: Custom Form Mod  (Read 558360 times)

Offline king kratos

  • Full Member
  • ***
  • Posts: 454
  • Gender: Male
  • SSDD
Re: Custom Form Mod
« Reply #1620 on: February 08, 2014, 02:37:51 PM »
I haven't created a new form in a long time and just tried to do so last night. However, the Body portion of the output is posting nothing, as in empty, to the database.

I went directly to the database table and entered the output format I wanted and it worked just fine, but if I click the save button on the form edit section, it will overwrite the database with nothing (ie remove everything I had put in the database table).

I cannot seem to find the file that is saving this to the database to see if the code got messed up somehow. Any ideas?

Kratos

Offline Raths Rants

  • Jr. Member
  • **
  • Posts: 101
  • Gender: Male
  • Just goofing off...
    • @Carrissis on Twitter
    • The Day Dreamers Consortium Network
Re: Custom Form Mod
« Reply #1621 on: February 08, 2014, 11:26:17 PM »
Am sure you tried this already. Have you tried to reinstall the mod ?
The DDC Network
a lot of hard work goes into easy

Offline bretttina

  • Jr. Member
  • **
  • Posts: 118
Re: Custom Form Mod
« Reply #1622 on: February 10, 2014, 12:05:27 PM »
Hi

OK I have installed the mod on a test forum and have set up the configuration settings as this :

settings i have set as follows :

permissions : set to regular and global

title and text : i have left these blank

Form is set up as follows :

title : description

board : general discussion

message icon : cheesy

function : left

permissions : regular/global

subject : about me

redirect : board

forum output is listed like this :

{name} :

{age} :

{where i am} :

{about me} :

Now when i go to the category i want ie general discussion and hit the "new topic" button nothing is shown in the type in box???

what have i done wrong please?

Thanks

Brett

Offline Raths Rants

  • Jr. Member
  • **
  • Posts: 101
  • Gender: Male
  • Just goofing off...
    • @Carrissis on Twitter
    • The Day Dreamers Consortium Network
Re: Custom Form Mod
« Reply #1623 on: February 10, 2014, 12:54:10 PM »
The forms area has two levels of permissions. The first menu under the admin window and the permission under the form itself.

Below is the example of my feedback form. Only Registered Members can see the form.

Code: [Select]
Feedback Type: {feedback_type}

Feedback Reason: {feedback_reason}

Message Body: {feedback_body}

Reply: {feedback_reply}

Feedback: {feedback_temp}

Also are you setting up your questions right ? This was one of the first things I goofed up on. I included a few screenshots. If it is a permission issue this should fix it.

Your can access the Forms Area using this link setup. All your forms will be listed there.
Code: [Select]
http://yoursite/forumdirectory/forum/index.php?action=form;
The DDC Network
a lot of hard work goes into easy

Offline bretttina

  • Jr. Member
  • **
  • Posts: 118
Re: Custom Form Mod
« Reply #1624 on: February 10, 2014, 02:36:32 PM »
Thanks Raths Rants,

I have done this (please see attachments)

Also when i type in http://yoursite.com/forumdirectory/forum/index.php?action=form; i get nothing?????

so where have i gone wrong?

Offline Raths Rants

  • Jr. Member
  • **
  • Posts: 101
  • Gender: Male
  • Just goofing off...
    • @Carrissis on Twitter
    • The Day Dreamers Consortium Network
Re: Custom Form Mod
« Reply #1625 on: February 10, 2014, 03:22:44 PM »
You have to type in your site address.

I am guessing it should be this:
Code: [Select]
http://j0intventure.com/index.php?action=form;
I do not see your questions below. I know that if no questions are associated it will not submit an output.
« Last Edit: February 10, 2014, 03:34:59 PM by Raths Rants »
The DDC Network
a lot of hard work goes into easy

Offline bretttina

  • Jr. Member
  • **
  • Posts: 118
Re: Custom Form Mod
« Reply #1626 on: February 10, 2014, 03:29:11 PM »
Yep did that but it's not on that forum it is on my test forum

is there anything wrong with what i have put in the screenshots?

Offline Raths Rants

  • Jr. Member
  • **
  • Posts: 101
  • Gender: Male
  • Just goofing off...
    • @Carrissis on Twitter
    • The Day Dreamers Consortium Network
Re: Custom Form Mod
« Reply #1627 on: February 10, 2014, 03:31:33 PM »
Sent you a PM.
The DDC Network
a lot of hard work goes into easy

Offline Raths Rants

  • Jr. Member
  • **
  • Posts: 101
  • Gender: Male
  • Just goofing off...
    • @Carrissis on Twitter
    • The Day Dreamers Consortium Network
Re: Custom Form Mod
« Reply #1628 on: February 10, 2014, 03:33:30 PM »
All looks good except for the missing questions to associate with the output.
The DDC Network
a lot of hard work goes into easy

Offline king kratos

  • Full Member
  • ***
  • Posts: 454
  • Gender: Male
  • SSDD
Re: Custom Form Mod
« Reply #1629 on: February 16, 2014, 08:52:50 PM »
Am sure you tried this already. Have you tried to reinstall the mod ?

I did reinstall the mod and it still isn't working correctly.

Kratos

Offline bretttina

  • Jr. Member
  • **
  • Posts: 118
Re: Custom Form Mod
« Reply #1630 on: February 17, 2014, 08:48:58 AM »
Hi all,

On the redirect board it states "View" as the option to click to take you to the form its self,

My question is : How do i change this to say "Post your advert" instead of "View"

Have a look at the screen shot

Thanks

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,498
  • Gender: Male
    • Kindred-999 on GitHub
Re: Custom Form Mod
« Reply #1631 on: February 17, 2014, 09:49:20 AM »
Well, for one, it would change every instance of the word... But I assume it would be in either the custom forms English file or the modifications.english.php file
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline s4ph1r3

  • Semi-Newbie
  • *
  • Posts: 30
Re: Custom Form Mod
« Reply #1632 on: February 19, 2014, 09:23:07 AM »
Hi, I tried to install this mod on SMF2.0.6 but I get this error:
3. Execute Modification    ./Sources/Admin.php    Test failed
   1.    Add After    ./Sources/Admin.php    Test failed
   2.    Add After    ./Sources/Admin.php    Test successful
If I click on 1. it shows this:
Code: (Find)
// Mod Authors for a "ADD AFTER" on this line. Ensure you end your change with a comma. For example:

Code: (Add After)
//   Place the Custom Form Mod Link.
'customform' => array($txt['CustomForm_tabheader']),

I searched through the Admin.php file but was not able to find the line "Mod Authors for a...". Should I add the line manually and then add the code after it?

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,498
  • Gender: Male
    • Kindred-999 on GitHub
Re: Custom Form Mod
« Reply #1633 on: February 19, 2014, 05:54:12 PM »
If you can not find that line, then you have some major issues -- because that comment line is in every distributed copy of Admin.php and nothing should ever remove it.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline s4ph1r3

  • Semi-Newbie
  • *
  • Posts: 30
Re: Custom Form Mod
« Reply #1634 on: February 20, 2014, 03:39:23 AM »
Ty for your reply Kindred, I searched through the entire Admin.php again and managed to find that line, it was behind a piece of code. I compared the file with mine (wich has only 4 or 5 mods installed) and moved the line directly below
'general' => array($txt['mods_cat_modifications_misc']),
in the 'modsettings' => array
The CustomForm mod installed without a problem so I hope that the line is in the right place now.

Offline hazy261

  • Newbie
  • *
  • Posts: 1
Re: Custom Form Mod
« Reply #1635 on: May 25, 2014, 07:41:39 AM »
hey

want to allow guests to submit a form, at the moment i have allowed them to view the forum but when i click the link to form page it just redirects me to the index page.
i have allowed guest access in the mod config page also

thanks in advance

hazy

Offline suresh1983

  • Semi-Newbie
  • *
  • Posts: 53
Re: Custom Form Mod
« Reply #1636 on: June 01, 2014, 02:05:32 AM »
Hi,

I have created a form using this mod, but the issue that I am facing is the topic is remaining blank.

I have created a form for self introduction with the below options

Name:
Organization:
Number of years of experience:
Description:

when the user posts details using the form, I want the topic in the forum (board) to show Name & Total years of experience.

Currently the topic after the form is posted is showing as blank.

Please suggest and help me on how to accomplish this.

Offline Grindabit

  • Semi-Newbie
  • *
  • Posts: 11
Re: Custom Form Mod - New Topic Button re-directing to form
« Reply #1637 on: July 29, 2014, 05:34:37 PM »
Hello everyone,

I searched everywhere for a post that explains how to make the 'New Topic' Button re-direct to the form you wish the user to use for posting in that forum. I found an old post here https://sites.google.com/a/balancegames.org/smf/mods/forms/new_topic [nofollow] that was originally written by  margarett in the Portuguese board over at SMF balance forums and translated to English by FragaCampos.

This solution did not work for me because I am using 2.0.6 version of SMF and that trick was for a different version. So, I modified the trick to work with my version and thought I would share how it is done and the code replacements for ver 2.0.6

Make sure to save a copy of your current messagesIndex.template.php file, so you can restore it if u mess up.

Go to the MessageIndex.template.php of your theme and find...
Code: [Select]
// Create the button set...
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);
           }

Replace with:
Code: [Select]
// Create the button set...
        if ($context['current_board'] != 58)
        {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);
         }
   else
   {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=4;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }

Next, you will need to specify which board you want the 'New Topic' Button to re-direct from to the new form. To do this, find the following in the new code you just replaced:
Code: [Select]
// Create the button set...
        if ($context['current_board'] != 58)
Replace the 58 with the board number you want to re-direct from.

Now we will need to tell it what form to re-direct to for creating a new post in that forum. Once again, in the newly pasted code, find the following:
Code: [Select]
action=form;n=4;submit;replace the 4 with the number of the form you wish to display.

Try it out! It should work, If it doesn't work, then you are using a different version than me.


See below how to modify any version.
(please excuse my lack of coding lingo, I am self taught and not very experienced yet)

All we are doing here is adding an if else statement and changing one action in the else section to call the action to the form instead of new topic.

In your  MessageIndex.template.php file under the theme you are using...
Find the function listed under the following heading:
Code: [Select]
//Create the button set...
Mine looked like this:
Code: [Select]
// Create the button set...
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);
           }

Now add this statement before the array:
Code: [Select]
if ($context['current_board'] != 58)Replacing the 58 with the board number you wish to re-direct from

It should look like this:
Code: [Select]
if ($context['current_board'] != 58)
        {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);

Next, add the following directly below what is in the code box above :
Code: [Select]
}
   else
   {

Now, copy and paste the original array again directly below the above pasted code:
to get  this:
Code: [Select]
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);
           }
}
   else
   {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);
Now find the 'New Topic' array in section below the 'else' statement:
Code: [Select]
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true), This is where we will change the action from, replace the action that looks like this
Code: [Select]
post;board=' . $context['current_board'] with this
Code: [Select]
form;n=4;submit;(replace the 4 with the form number u wish to re-direct to)

the finished product should look like this:
Code: [Select]
if ($context['current_board'] != 58)
        {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);
         }
   else
   {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=4;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }

I hope this helps! If it's not working for you, make sure to check for any missing } or ; , it's usually something that simple.

Also, If you want to use multiple forms for multiple boards, just copy and paste the entire script directly below the first one, then just change the board # and form #

*edited for correct spelling of margarett :D

« Last Edit: July 30, 2014, 02:12:16 AM by Grindabit »

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
Re: Custom Form Mod
« Reply #1638 on: July 29, 2014, 08:45:42 PM »
* margarett finds his username misspelled :P

The original post by FragaCampos can be found in this topic, some pages behind ;) But yes, it was in long gone times of 1.1.something :) Nice update, thanks ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline Grindabit

  • Semi-Newbie
  • *
  • Posts: 11
Re: Custom Form Mod
« Reply #1639 on: July 30, 2014, 10:20:06 PM »
SO i am trying to make forms for each board and was able to get two of them to work by just pasting the same code beneath the previous, but after the second one, things do not work. SO I tried this instead, But cannot make this work either. Can somone help point me in the right direction?

Code: [Select]
if ($context['current_board'] != 58)       
  {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=4;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }
elseif ($context['current_board'] !=56)
  {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=5;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }
elsif ($context['current_board'] !=25)
  {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=6;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }
else
{
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);
         }
« Last Edit: July 30, 2014, 10:50:46 PM by Grindabit »