Previous Thread
Next Thread
Print Thread
Rate Thread
#253601 07/12/2003 11:17 PM
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
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).

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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.

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
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.

Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
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.


Nikos
Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
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

Sponsored Links
Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
This is a neat modification that can have many different applications. Kudos to all involved!

Joined: Sep 2003
Posts: 803
Coder
Coder
Offline
Joined: Sep 2003
Posts: 803
Ok, im bookmarking this thread. Im going to add this to the gaming site as soon as i get the upgrade. This script owns....

Joined: Sep 2003
Posts: 803
Coder
Coder
Offline
Joined: Sep 2003
Posts: 803
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

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
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.

Joined: Sep 2003
Posts: 803
Coder
Coder
Offline
Joined: Sep 2003
Posts: 803
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....

Sponsored Links
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Like who has on what site.

Joined: Sep 2003
Posts: 803
Coder
Coder
Offline
Joined: Sep 2003
Posts: 803
[]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.)

Last edited by DrChaos; 01/02/2004 8:13 AM.
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
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

Joined: Sep 2003
Posts: 803
Coder
Coder
Offline
Joined: Sep 2003
Posts: 803
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.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
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

Joined: Sep 2003
Posts: 803
Coder
Coder
Offline
Joined: Sep 2003
Posts: 803
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.

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
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.

Joined: Sep 2003
Posts: 803
Coder
Coder
Offline
Joined: Sep 2003
Posts: 803
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

Joined: Jan 2003
Posts: 125
Journeyman
Journeyman
Joined: Jan 2003
Posts: 125
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

Joined: Apr 2002
Posts: 474
Enthusiast
Enthusiast
Offline
Joined: Apr 2002
Posts: 474
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:

Joined: Apr 2002
Posts: 474
Enthusiast
Enthusiast
Offline
Joined: Apr 2002
Posts: 474
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 -----------

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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.

Joined: Apr 2002
Posts: 474
Enthusiast
Enthusiast
Offline
Joined: Apr 2002
Posts: 474
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

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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".

Joined: Apr 2002
Posts: 474
Enthusiast
Enthusiast
Offline
Joined: Apr 2002
Posts: 474
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.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
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!

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
[]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.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
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?

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
I'll give this graemlin to anyone *cough* PJ *cough* that would kindly show me where I went wrong.

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
Do you use the same form that you created to process the replies?

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
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.

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
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.

#253633 05/18/2004 11:26 PM
Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
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.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
[]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.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
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.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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?

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
Does to me

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
I finally got it working the way it should!

Here ya go Josh!

Joined: Sep 2002
Posts: 151
Member
Member
Offline
Joined: Sep 2002
Posts: 151
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?

Last edited by Gregori; 03/25/2005 10:04 AM.
Joined: Sep 2002
Posts: 151
Member
Member
Offline
Joined: Sep 2002
Posts: 151
Anyone?


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)