Previous Thread
Next Thread
Print Thread
Rate Thread
#184281 04/22/2005 9:04 PM
Joined: Sep 2001
Posts: 672
Member
Member
Offline
Joined: Sep 2001
Posts: 672
This is adapted from LK's little mod found here
https://www.ubbdev.com/ubb/ultimatebb.php/topic/8/3801.html#000000

What Im trying to do is, if the user selects only two of these options, then it creates the thread title with the two chosen. However, the problem Im running into is, since I have 3 types, as seen below, if a user only selects two options, it still writes out the third.

For example it'll actually post this: [Roommate] blank1[Male]

So what I have is this for example: (public_new_topic_form.pl)

Code
if ($in{f} =~ m/^(7)$/) {
print qq~
<tr bgcolor="$vars_style{AltColumnColor1}">
<td nowrap="nowrap">
<font size="$vars_style{TextSize}" face="$vars_style{FontFace}"><b>
Message Type:
</b></font></td>
<td>
<input type="radio" name="type" value="" checked="checked" /> None
<input type="radio" name="type" value="[Roommate] " /> Roommate
<input type="radio" name="type" value="[Sublessor] " /> Sublessor
<input type="radio" name="type" value="[Apartment] " /> Apartment
<input type="radio" name="type" value="[House] " /> House

<input type="radio" name="type3" value="[Male] " /> Male
<input type="radio" name="type3" value="[Female] " /> Female

<select name="type2">
<option selected value="blank1">Please Choose</option>
<option value="['05] ">05</option>
<option value="[05-06] ">05-06</option>
<option value="['06] ">06</option>
<option value="[06-07] ">06-07</option>
</select>


</td>
</tr>
~;
}
and in ubb_new_topic.cgi:

Code
$in{topic_subject} = $in{type} . $in{type2} . $in{type3} . $in{topic_subject};

Sponsored Links
#184282 04/23/2005 9:20 AM
Joined: Sep 2001
Posts: 672
Member
Member
Offline
Joined: Sep 2001
Posts: 672
now its not even that so much Im having a problem with.

I want a : at the end of the thread title.

for example, Apartment 05/06 Male: (user inputs rest here)

However, I cant put :'s after each $in{type}, in ubb_new_topic cuz if a user selects all of those options, it will put 3 colons in.

I think I need some sort of if statment, err array?

#184283 04/24/2005 10:39 AM
Joined: Sep 2001
Posts: 672
Member
Member
Offline
Joined: Sep 2001
Posts: 672
n/m, figured it out by writing some if statements wink

Code
	if (($in{type}) && ($in{type2}) && ($in{type3})) {
$in{topic_subject} = $in{type} . " " . $in{type2} . " " . $in{type3}. ": " . $in{topic_subject};
}
elsif (($in{type}) && ($in{type2})) {
$in{topic_subject} = $in{type} . " " . $in{type2} . ": " . $in{topic_subject};
}
elsif (($in{type}) && ($in{type3})) {
$in{topic_subject} = $in{type} . " " . $in{type3} . ": " . $in{topic_subject};
}
elsif (($in{type2}) && ($in{type3})) {
$in{topic_subject} = $in{type2} . " " . $in{type3} . ": " . $in{topic_subject};
}

elsif ($in{type3}) {
$in{topic_subject} = $in{type3}. ": " . $in{topic_subject};
}
elsif ($in{type2}) {
$in{topic_subject} = $in{type2}. ": " . $in{topic_subject};
}
elsif ($in{type}) {
$in{topic_subject} = $in{type}. ": " . $in{topic_subject};
}


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:
• Shock Hosting
• Stable Host
• bluehost
• InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,583
Posts293,955
Members13,825
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 6968
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 7
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
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-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)