UBB.Dev
Posted By: ericgtr Form for specific forum - 07/13/2003 6:17 AM
This is probably asking a lot but I figure it's worth a shot. I noticed that you have a form under the Modifacations forum, that would be really handy for a specific forum I have and I figure I could tweak it to what I need. Any chance of sharing that with us? (that is unless I missed it on here already).
Posted By: JoshPet Re: Form for specific forum - 07/13/2003 6:53 AM
It's nothing that I ever really "wrote up" as it's so customized it'd be tough to post it as a mod.... and it was nothing that I really wanted to "support". However, it is easy to do.

Basically in the newpost.php & newreply.php script where it calls the .tmpl file - you add a clause so that if ($Board == "modifications") {
Then it calls a different template as well.
Like this:
Code
<br />		if ($Board == "modifications") {<br />		   	include("$thispath/templates/$tempstyle/newpostmod.tmpl");<br />		} else {<br />	   	include("$thispath/templates/$tempstyle/newpost.tmpl");<br />		}<br />


Then in addpost.php - I had to add some code near the top. Since our modification posting page basically builds a formatted subject and body - you need to use some code to build the subject & body however you want.

This is what I have near the top of the addpost.php file:
Code
<br />// ----- JoshPet's Mod Template START ---------<br />	$modname = get_input("modname","post");<br />	$moddesc = get_input("moddesc","post");<br />	$v60 = get_input("60","post");<br />	$v61 = get_input("61","post");<br />	$v62 = get_input("62","post");<br />	$v63 = get_input("63","post");<br />	$prerequisites = get_input("prerequisites","post");<br />	$author = get_input("author","post");<br />	$date = get_input("date","post");<br />	$credits = get_input("credits","post");<br />	$filesaltered = get_input("filesaltered","post");<br />	$databasealter = get_input("databasealter","post");<br />	$instructions = get_input("instructions","post");<br />	$status = get_input("status","post");<br />	$newfiles = get_input("newfiles","post");<br />	$modsubmit = get_input("modsubmit","post");<br /><br />if (($Board == "modifications") && ($modsubmit == "yes")) {<br /><br />  // --- Let's display the checked version numbers right --<br />  	if (($v60) && (($v61) || ($v62) || ($v63))) {<br />  		$version = $v60."-";<br />  	}	<br /><br />  	if (($v61) && (($v62) || ($v63))) {<br />  		$version .= $v61."-";<br />  	} else {<br />  		$version .= $v61;<br />  	}	<br /><br />  	if (($v62) && ($v63)) {<br />  		$version .= $v62."-";<br />  	} else {<br />  		$version .= $v62;<br />  	}<br />  	<br />  	if ($v63) {<br />  		$version .= $v63;<br />  	}<br />  	<br />  	if (!$version) {<br />  		$version = "$v60$v61$v62$v63";<br />  	}			<br />  <br /><br />  // --- Build Subject & Body ---------<br />	$Subject = "$status-[$version] $modname";<br />	$Body = "Mod Name / Version: $modname \n\n";<br />	$Body .= "Description: $moddesc \n\n";<br />	$Body .= "Working Under: UBB.Threads $version \n\n";<br />	$Body .= "Mod Status: $status \n\n";<br />	$Body .= "Any pre-requisites: $prerequisites \n\n";<br />	$Body .= "Author(s): $author \n\n";<br />	$Body .= "Date: $date \n\n";<br />	$Body .= "Credits: $credits \n\n";<br />	$Body .= "Files Altered: $filesaltered \n\n";<br />	$Body .= "New Files: $newfiles \n\n";<br />	$Body .= "Database Altered: $databasealter \n\n";<br />	$Body .= "Info/Instructions: $instructions \n\n";<br />	$Body .= "Disclaimer: Please backup every file that you intend to modify. \n";<br />	$Body .= "If the modification modifies the database, it's a good idea to backup your database before doing so. \n\n";<br />	$Body .= "Note: If you modify your UBB.Threads code, you may be giving up your right for \"official\" support from Infopop.";<br />	$Body .= "If you need official support, you'll need to restore unmodified files.  \n\n";<br />}<br />// ----- JoshPet's Mod Template END -----------<br />


That's not real specific - as it's tough to explain this like a generic mod - but hopefully it's enough to get you goin in the right direction.
Posted By: ericgtr Re: Form for specific forum - 07/13/2003 7:19 AM
Thanks Josh, that should be enough for me to get something going. I also understand not wanting to support it as it has to be specific to your needs, if it gives me too much of a problem I will scratch it. I just think it's a neat idea.
Posted By: dimopoulos Re: Form for specific forum - 07/14/2003 1:31 AM
If you really want to beef this modification up you can add one field in the w3t_Boards table U_Specific TINYINT(1) DEFAULT '0'

What this would do is have all the boards to 0. Then you can edir the scripts that create and edit boards to populate this field. I believe the names are editboard.php, doeditboard.php, createboard.php and something else... but you will be able to find them easily. Changing the screen of the edit/create boards in the admin area you can have a combo box which will set the value for this field. Hence you can have:

0 - Default
1 - Modifications 6.3
2 - Modifications 6.2

etc.

Then you change Josh's instructions and you check for the U_Specific field's values instead of the board keyword. This makes the script a lot more flexible and less prone to typing errors. Mapping every choice to a template gives you what is needed.
Posted By: Zackary Re: Form for specific forum - 07/19/2003 9:00 AM
Well, after seeing this thread, I decided to follow up on my dream of creating a unique form within a forum on my board.

With the information posted here by both Josh and dimopoulos, I've managed to succeed in my dream!

Thanks to ericgtr for bringing this topic up, and to Josh and dimopoulos for showing me how it could be done!

My board is small, and designed for members of my gaming guild and other guilds/friends who might be interested, but the form I created will help streamline the application process to our guild on our EverQuest chapter.

If this works out for our EQ chapter, I will be creating the same thing for our chapters on other games. Would be really easy, now that I have a template to work from.

If folks were interested, I MIGHT be able to post what I did and how I did it. But keep in mind that I've also integrated a guild roster into my forum as well, so part of my form utilizes that.

If you want to take a look, pop by my site at http://forum.sofguild.com, login as test/test, then go to the EQ Membership Applications forum and click post. You'll be able to see the form.

Unfortunately, I can't let you see the results, except in a screen shot, as the forum that the application is posted to, is a hidden forum for guild officers only.

Sorry to get so long winded. I'm pretty proud of myself over this and just wanted to share. LOL

So anyways, here's the results of a submitted application via the form.

New Application in hidden Forum

Viewing the new application

Again, big props to you guys for the help.

I'll answer any questions folks have as best I can, just let me know!

Zack
Posted By: AKD96 Re: Form for specific forum - 07/19/2003 9:52 AM
This is a neat modification that can have many different applications. Kudos to all involved!
Posted By: DrChaos Re: Form for specific forum - 09/16/2003 1:55 AM
Ok, im bookmarking this thread. Im going to add this to the gaming site as soon as i get the upgrade. This script owns....
Posted By: DrChaos Re: Form for specific forum - 12/31/2003 4:29 AM
Sorry to dig up an old thread but I was wondering if this mod was ever put up for download. This would be great for my board.... and I think Im ready to work on it
Posted By: omegatron Re: Form for specific forum - 12/31/2003 5:33 AM
Well this was never wrote up as a mod as it would have to be tailored to each exact site so there would be no way to make it a mod as Josh stated. However he stated above how to do it There is enough information posted above to get you going.
Posted By: DrChaos Re: Form for specific forum - 01/02/2004 2:26 AM
Ill try it out. I would like to get it working like he has it on his site. That is really a nice hack. Takes alot of work out of the entire process....
Posted By: omegatron Re: Form for specific forum - 01/02/2004 2:44 AM
Like who has on what site.
Posted By: DrChaos Re: Form for specific forum - 01/02/2004 3:11 PM
[]If folks were interested, I MIGHT be able to post what I did and how I did it. But keep in mind that I've also integrated a guild roster into my forum as well, so part of my form utilizes that.

If you want to take a look, pop by my site at http://forum.sofguild.com, login as test/test, then go to the EQ Membership Applications forum and click post. You'll be able to see the form.

Unfortunately, I can't let you see the results, except in a screen shot, as the forum that the application is posted to, is a hidden forum for guild officers only.

Sorry to get so long winded. I'm pretty proud of myself over this and just wanted to share. LOL
[/]

Zacary: about 7 posts up.

(the quote mod that dispplays the name when quoting seems to not be working.)
Posted By: omegatron Re: Form for specific forum - 01/02/2004 5:11 PM
Okay well for what he did which was only add a few fields to the newpost form you do not need Josh's modification. That is overkill.

Have you filled out the extra fields? You can use them in the new post screen etc. Might as well do minor coding instead of major coding
Posted By: DrChaos Re: Form for specific forum - 01/02/2004 10:46 PM
I like the way its layed out. You can log in and see the active mambers, then click on their name to see their rank and some info, then you can click on the name there and get their entire stats. I dont know how he pulls the stats to keep it updated but it is a sweet layout.

What I am tring to get done is use the layout he has but have different info. I want to be able to host tournament (like a 10 man 1v1 double elimination) I have the brackets but they are in html. Im still working on getting them to work inside josh's generic page mod. When the tourney is over I can go in and enter the information and you could use this layout to see the results for each person, download a re-play of the game, read the commentary, see various info. there are endless possibilities. I was just seeing if he ever wrote it out and add it to the mods.
You can see that after a few tourneys you will be able to see the stats for any one person, for all the tourneys they played in and tell if they are good or not. they have something like this as a mod for phpnuke but I am having a heck of a time getting it transferred and to work. Since it was coded to work with phpnuke, some things certainly will not work.

If I ever get it the way I want it to Ill be sure to add it to the mod section.
Posted By: omegatron Re: Form for specific forum - 01/02/2004 10:50 PM
Well what I was getting at is using the extra fields built into Threads you can save alot of coding. You can use those to add the fields you want and they can be included on the registration signup and the when viewing profiles. You have 4 extra fields
Posted By: DrChaos Re: Form for specific forum - 01/02/2004 11:39 PM
ya, in the pofile. there is more slots for info.

But the way it is set up there is controlled by the admin or mods (assuming) If I just open the slots and put the question as, "tournaments won by member" they could just put 4, 10, 15 or whatever and even change it every day.

Question: (probably asked by me before)
If I take the generic page mod and simply paste the full html code between the tags where it says, the links should stay as they are and link to the pages that I set, correct.
Posted By: Zackary Re: Form for specific forum - 01/03/2004 2:21 AM
Omegatron is right. I have my guild members roster integrated into my threads so I have extra fields there.

Most of what is shown on the form though is directly from Threads, i.e. the link to the "sponsor's" profile.

I'd go into detail as to why I haven't done a write up yet, or why the other mods I've done haven't been updated (let alone my upgrade to 6.4 ) but, ya'll think I was lying to ya.

Let's just say, I'm living in a soap opera it seems...

Complete with cheating husbands (not me), abusive fiancee's (also not me), and a pregnant wife (yes mine ).

ANYWAY, drop me a PM DrChaos and let me know what you need help with regarding setting up this type of form or whatever, I'll give help where I can. As has been stated, a generic write up for this type of thing wouldn't be easy as everyone's forms are basically customized.

But I check here a couple times a day still and can chat with ya to assist where I am able.

PS. Sorry for the long winded blah blah folks. I'll go be quiet now.
Posted By: DrChaos Re: Form for specific forum - 01/03/2004 3:23 AM
Congrats on the baby (lol, sorry for the rest)
IM tring out a couple of things. Ill keep you posted in some pm's. easier for you to get them quicker
Posted By: chillin Re: Form for specific forum - 01/04/2004 7:05 PM
Josh, the corresponding Modindex page... do you actually take certain bits of each form and dump to a seperate table? I'm trying to figure out how you accomplished this page, and that was my first guess.

tia
chillin
Posted By: oceanwest Re: Form for specific forum - 02/08/2004 10:41 PM
Ok i added this for all new posts but for some reason when I hit submit it puts the code in twice w/out any data...


Body text

Platform: xxx / Version: yyy
FileMaker Version: zzz

Platform: / Version:
FileMaker Version:
Posted By: oceanwest Re: Form for specific forum - 02/08/2004 10:42 PM
This is all I added to addpost.php


// ----- JoshPet's Mod Template START ---------
$platform = get_input("platform","post");
$version = get_input("version","post");
$fmp = get_input("fmp","post");

// --- Build Subject & Body ---------

$Body .= "\n\nPlatform: $platform / Version: $version \nFileMaker Version: $fmp\n\n";




// ----- JoshPet's Mod Template END -----------
Posted By: JoshPet Re: Form for specific forum - 02/09/2004 9:29 AM
Didn't see this before. Sorry.

No - given that we update here quite frequently, we didn't want a specific table. All the info is stored in the body of the post. The input form just helps it get displayed nicely.
Posted By: oceanwest Re: Form for specific forum - 02/15/2004 8:12 PM
What is the difference between $Body .= and $Body = with out the "." When I tried to set this up
I got it sort of working but it would post stuff twice... I am not sure how to have a few extra fields end up either at the top of the body or the bottom of the body.

Thanks. SD
Posted By: JoshPet Re: Form for specific forum - 02/15/2004 10:25 PM
The .= adds to it.

So if you have:

$Body = "blah blah";

Then body is equal to "blah blah"

Then below that if I say:

$Body .= "this that";

The .= adds to it, so now body is equal to:

"blah blah this that".
Posted By: oceanwest Re: Form for specific forum - 02/17/2004 4:47 AM
I am still baffled. I added the code to the php and added the form to the template. but
when the user posts i get it posted twice. the first time with the data the second time blank.

I had to disable as it was adding extra lines to every post.

any suggestions.
Posted By: AKD96 Re: Form for specific forum - 05/13/2004 3:57 AM
I've used this for a forum here: http://www.drumlines.org/threads/postlist.php/Board/season

I use it so people can submit a Fantasy Corps while keeping all of their picks in a neat format. As you can see if you visit it, I've used extensive HTML to format the post. This still works even though I have HTML off, since the HTML is not typed in by the user, but rather passed by the script. If anyone needs help with implementing this "mod" on their site, add me to the list of people that can help!

Thanks for sharing this with us PetJosh!
Posted By: AKD96 Re: Form for specific forum - 05/13/2004 4:00 AM
[]oceanwest said:
I am still baffled. I added the code to the php and added the form to the template. but
when the user posts i get it posted twice. the first time with the data the second time blank.

I had to disable as it was adding extra lines to every post.

any suggestions. [/]

I got this same problem. This happens when you have the "preview" box ticked. I removed the preview code from the tmpl file to fix this so users cannot use the feature.
Posted By: AKD96 Re: Form for specific forum - 05/13/2004 4:40 AM
Although, I am having problems with replies. They all try to include the original layout using HTML. I only want the first post in a thread to use the layout. Am I missing something?
Posted By: AKD96 Re: Form for specific forum - 05/18/2004 10:31 PM
I'll give this graemlin to anyone *cough* PJ *cough* that would kindly show me where I went wrong.
Posted By: Zackary Re: Form for specific forum - 05/19/2004 2:05 AM
Do you use the same form that you created to process the replies?
Posted By: AKD96 Re: Form for specific forum - 05/19/2004 4:19 AM
I use the default reply form for all replies. I only use the unique form for new posts. I have implemented a temporary fix by creating seperate newpost, etc. files for the forums, but I would like to have things laid out more efficiently.
Posted By: Zackary Re: Form for specific forum - 05/19/2004 5:05 AM
If you are using the standard reply form, I don't know why it would try to use the HTML from the original post unless you are quoting the original message?

I might misunderstand what's happening though.
Posted By: AKD96 Re: Form for specific forum - 05/19/2004 6:26 AM
It looked like it was still pulling the $body from the formatted part that is called when $board= matches up with the current board. I want to know how to use the formatted "if $board=" part only on new posts and not for subsequent replies.
Posted By: JoshPet Re: Form for specific forum - 05/19/2004 9:50 AM
[]DLWebmaestro said:
I'll give this graemlin to anyone *cough* PJ *cough* that would kindly show me where I went wrong. [/]

This is tough for me to follow - but if you PM me FTP info and a login at your board (maybe I have one) I'll take a glance.
Posted By: AKD96 Re: Form for specific forum - 05/19/2004 10:28 AM
Actually, I think the problem lies here:

Code
 <br />if ($Board == "season"){ <br /> <br />$Subject = "$corps"; <br />$Body = "<ol><li>$corps</li>"; <br />$Body .= "<li>$name</li>"; <br />$Body .= "<li>$postername</a></li>"; <br />$Body .= "<li>$email</li>"; <br />$Body .= "<li>$location</li></ol>"; <br />} <br />else { <br />	$Body = get_input("Body","post"); <br />


I've truncated all of the $Body lines for ease of reading. I noticed you have this:
Code
 <br />&& ($modsubmit == "yes") <br />

as part of your "if" statement. I've tried tying it to the submit button's name in newpost to no avail. Is this what is supposed to be done? I figure there has to be a purpose for this check, but I don't know what you've assigned to $modsubmit and I get the same problem with it in there.
Posted By: JoshPet Re: Form for specific forum - 05/19/2004 11:09 AM
Ah - this is so that it only "builds" the post once, otherwise, every time you preview, it gets duplicated.

Inside your Special newpost "form", add this BETWEEN the form tags:

<input type="hidden" name="modsubmit" value="1" />

Then at the top of addpost.php, be sure you have a get_input line for the variable "modsubmit".

Then your "if" should look like this:


if (($Board == "season") && ($modsubmit)){


Now this way - it only does the "building" of the detailed post text, if it's coming from your special form. If it comes from anywhere else (like the privew etc...) $modsubmit will not have a value, and it'll skip over (as your special forwarding is already in place at that point.

Make sense?
Posted By: scroungr Re: Form for specific forum - 05/19/2004 1:35 PM
Does to me
Posted By: AKD96 Re: Form for specific forum - 05/19/2004 11:09 PM
I finally got it working the way it should!

Here ya go Josh!
Posted By: Gregori Re: Form for specific forum - 03/25/2005 4:50 PM
This is a great modification!

I only have two questions.

Is it possible to make some specified, or all, of these new fields mandatory?

How does the navigation links at modindex.php work?
Posted By: Gregori Re: Form for specific forum - 04/14/2005 9:24 PM
Anyone?
© UBB.Developers