Custom Form Mod

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

Previous topic - Next topic

Garou

#660
willerby, its kind of hard to give you a step by step with out knowing what tools your server has for you to use. Many servers have phpMyAdmin to do this sort of thing. If you have access to that then you would use the export function and just choose those two tables to back up, you would use the drop function to delete them, then after you have reinstalled the mod you would use the import function to add your backup back in. Additional info on how to use it can be found at http://docs.simplemachines.org/index.php?board=83.0 or at http://www.phpmyadmin.net

nathan42100, that is a very good suggestion somewhat similar to one I made a while back http://www.simplemachines.org/community/index.php?topic=248871.msg2047400#msg2047400 I just didn't think of using the other mod. I plan on providing a choice of where to redirect your users sometime in the, hopefully, not so far off future. :)

willerby

#661
Thanks Garou. I think that's all I needed - just not familiar with phrases like 'drop'. I'll give it a shot with PHPMyAdmin

Edit: All fixed. Great mod...still.

W
What type of washing machine is September?

An autumnatic. :)

nathan42100

Quote from: Garou on July 25, 2009, 11:55:17 PM
willerby, its kind of hard to give you a step by step with out knowing what tools your server has for you to use. Many servers have phpMyAdmin to do this sort of thing. If you have access to that then you would use the export function and just choose those two tables to back up, you would use the drop function to delete them, then after you have reinstalled the mod you would use the import function to add your backup back in. Additional info on how to use it can be found at http://docs.simplemachines.org/index.php?board=83.0 or at http://www.phpmyadmin.net

nathan42100, that is a very good suggestion somewhat similar to one I made a while back http://www.simplemachines.org/community/index.php?topic=248871.msg2047400#msg2047400 I just didn't think of using the other mod. I plan on providing a choice of where to redirect your users sometime in the, hopefully, not so far off future. :)
Turns out redirectexit works with full urls also

Garou

willerby, glad you are all fixed up. :)

nathan42100, you are quite correct.  :)

GhostRider2110

Base system:
SMF 1.1.9
TP 1.0 B4

I have something I want to do with my SMF/TP forums.  I just installed the following mod:
Custom Form Mod      1.4  And I like what it does.  One of the things I am trying to offer is to allow the Contest Directors around the country an easy way to post the info about the contest and have it added to the calendar.

Maybe this mod have that ability already and I just have not found the right way to apply it, but I would like for me to be able to build a form, where the specific info is asked for, then processed as a forum post and the event linked to the calendar.

How hard would this be to accomplish?

Thanks love the mod!!!

--Mitch

Mitchell Baker
--------------------
CoffeeCup Software Ambassador
Get 20% Off CoffeeCup Web Design Software
Use this code when you checkout: 226STS
--------------------
www.getcoffeecup.com

Garou

While I wont say its impossible, it doesn't really fit the function of the existing mod. To be honest I like the idea but I think it would be better off as a separate calendar mod. None the less Ill add it to the list of things to check out but no promises.

Garou

Mod Updated to Version 1.5

Replaced Board Id entries with a select box containing the actual boards on your forum. This should make it easier for Admins to find the board that they want the form to post to.

Added New Field Type Info Box. This allows you to display text throughout the form without requiring any user input.

Added New Field Type Radio Box. Thanks to mang for supplying the code to make this possible. Like a Selection Box it will allow the user to chose from various items. Enter the list of items you want separated by commas in the Extra Type Parameters field. None of the items will be preselected. Note that this field type can not be required.

Priorities for the next version(s) will be...
thread icons that the Admin can select for a form.
the ability to choose where to redirect your users after they submit a form.
the ability to rearrange the form list.
the ability for users to add attachments through a form.

Of course there are no promises on what will actually be in the next version or when it will be released, this is just what I am trying to focus on. :)

willerby

Good work garou. Will upgarde and let you know how it goes...
What type of washing machine is September?

An autumnatic. :)

FragaCampos

Well done, Garou. Thanks a lot for your effort!
I'll give you feedback as soon as possible.

Rafferty

I have to add this manually but doesnt work with smf parser?
Don't Follow me I got No Idea what I'm Doing

Garou

Sure it does

2.0 RC1.2
http://custom.simplemachines.org/mods/index.php?action=parse;mod=1279;attach=109551;smf_version=2.0_RC1.2

1.1.10
http://custom.simplemachines.org/mods/index.php?action=parse;mod=1279;attach=109550;smf_version=1.1.10

If your using an older version of SMF you really should upgrade, due to security risks, but the code should work on earlier versions. In fact I wrote it on RC 1.1 and 1.1.9 then tested it on the latest versions to make sure it would work.

Rafferty

thank you, dunno what happened then when i clicked the link, it said it wasnt compatable or something.



ps: probably because I'm dumb, I had selected version for smf 2 and parse for 1.1.10 duh
Don't Follow me I got No Idea what I'm Doing

Garou

Thanks for the complements guys  :)

Rafferty, don't feel too bad Ive made that mistake a few times myself. :)

willerby

Hi Garou,

Can you help me with the hard code change required to redirect different forms to different pages?  I haven't upgraded yet to the latest version (does that do this?) as have an number of edits on the older one. What I need is an if statement on the redirect after creating the post - something like:
      
IF formID=1 THEN redirectexit(this_page) ELSE redirect exit(that_page)

Sorry I can't quite get the syntax and code right despite a few attempts...

Thanks

W
What type of washing machine is September?

An autumnatic. :)

Garou

Try...

// redirect from form 1
if ($form_id = '1')
redirectexit();

else

// Redirect this user to the board.
redirectexit('board='.$board.'.0');


I havent tested but it might also be...
if (ID_FORM = '1')

But it should be something along those lines.

willerby

Sorry Garou, tried both (latter gives a parse error) and former not changing redirect at all even after emptying file cache??? Have also tried without apostrophes... I don't know which variable and syntax I should be picking up in the code

Any other suggestions (sorry)

W
What type of washing machine is September?

An autumnatic. :)

willerby

Found an alternative. The redirects I wanted were to pages created with CustomPages mod...

By numbering the pages in line with the form id I could call the respective ones as follows:

redirectexit('action=page;sa=PageName' . $form_id);

For Custom Form id=1 it redirects to /.../PageName1
For Custom Form id=2 it redirects to /.../PageName2

Thanks for trying to help with the IF/ELSE. Not sure why it didn't work as it seems to be correct. Anyway, solved.

W
What type of washing machine is September?

An autumnatic. :)

Garou

Well that's what I get for trying to pull it off the top of my head. At least you got it working the way you want. I hope to get the selectable redirect feature in the next version.

C4G-TK

#678
Running SMF 2.0 RC1.2 on default


I uninstalled the 1.4 version of the mod and tried the 1.5 version.  First thing that I came across was it saying my database was not running current to RC1.2, but still at RC1-1, so I updated that over the weekend.  completed

Next thing, when installing the mod, I got an error stating that the table for cf_forms didn't exist, so I checked my database and it was there since I had the older version already installed.  I went ahead and deleted the two tables cf_forms and cf_fields from the older mod since I only had two forms created and didn't mind doing them over again.  I went ahead and installed and it completed the install.  completed

Now, I did have two failed tests in the install.  Sources/Admin.php (2nd edit) which failed because I had Simple Portal installed in the same area.  This is the way that I manually edited that part.

// Load the language and templates....
loadLanguage('Admin');
loadLanguage('SPortalAdmin', sp_languageSelect('SPortalAdmin'));
loadLanguage('Ads');
loadTemplate('Admin', 'admin');
loadLanguage('Modifications');


The other failed test was in Sources/ManageSettings.php (1st edit), but for the life of me I can not find the correct area to do this edit.  I'm assuming another mod has altered the code that I am to find.  I'm going through the 2K+ lines of code line by line in order to complete the manual edit needed.

Nevermind I GOT IT!!!!!!!!!!!!!!  WOOHOO!!
:-*



-img removed-

C4G-TK

Ok, I have one problem afterall... I'm showing "TITLE" twice in the mod.  Where do I go to correct this?

-img removed-

Advertisement: