Print Page | Close Window

Mod Request : Message Icon radio button

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=19749
Printed Date: 29 March 2026 at 4:41am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Mod Request : Message Icon radio button
Posted By: chapman_bryn
Subject: Mod Request : Message Icon radio button
Date Posted: 07 May 2006 at 8:45am
Hi All
 
Would anyone know how to modify the Message Icon under "Edit Post" to be a radio button instead of a drop down box. I only want the user to be able to select the "thumbs up" or "thumbs down" image. The corresponding image should be displayed when you select the radio button. I have worked out how to change the drop down box to display only two options but I would like it to be chosen through this radio button.
 
Many thanks for all the help.



Replies:
Posted By: tw|kosh
Date Posted: 07 May 2006 at 11:00pm
Heyho :)
 
Do you mean something like this:
 
 
The only "problem" is, that on new posts the default is the first :)
 
If its that what you searched for write a message here and I'll post the code changes needed. If it's not describe it more and I'll try to do it...

Greets
Chris


Posted By: chapman_bryn
Date Posted: 08 May 2006 at 12:02am
Hi Chris
 
Many thanks for your prompt reply. Thats exactly what I want. Is it possible to not have a default? The user then has to select one of the two options otherwise the form results in an error similar to the error received if no subject is inserted.
 
Hope this is possible and not too difficult. Thanks once again for your help.
 
Regards,
Bryn


Posted By: JonnoB
Date Posted: 08 May 2006 at 5:07am
Just have a third blank image and set it to default.


Posted By: tw|kosh
Date Posted: 08 May 2006 at 10:35am
I've updated the files...
 
chapman_bryn:
Can you please test it yourself on my forum?
--> http://board.teraweb.ch - http://board.teraweb.ch
 
Just create a new account and create a topic - it should work now.
If you think it's ok write a msg here and I'll post change-instructions :)
 
Greets
Chris
 
-edit-
The board is partially translated to german - if you know the navigation from this forum it should not be a problem :)


Posted By: chapman_bryn
Date Posted: 08 May 2006 at 12:01pm
Hi Chris
 
Just tested it. It works perfectly. Many thanks for posting change instructions.
 
Bryn


Posted By: tw|kosh
Date Posted: 08 May 2006 at 4:00pm
Here we go...
 
Step 1: new_post.asp
 
Search for:

'********************************************
'***  Clean up and check in form details  ***
'********************************************
'If there is no subject or message then don't post the message as won't be able to link to it
If strSubject = "" AND (strMode = "new" OR strMode = "poll") Then strReturnCode = "noSubject"
 
below "if strSubject = "" ..." add the following line:

if strTopicIcon = "" AND (strMode = "new" OR strMode = "poll") then strReturnCode = "noTopicIcon" ' tw-MOD: Check if a topic icon is selected
 
Step 2: not_posted.asp
 
Search for:

'Write the error message
If strErrorCode = "posted" Then
 Response.Write(strTxtDoublePostingIsNotPermitted)
ElseIf strErrorCode = "noSubject" Then
 Response.Write(strTxtYourMessageNoValidSubjectHeading)
ElseIf strErrorCode = "maxS" OR strErrorCode = "maxM" Then   
 Response.Write(strTxtSpammingIsNotPermitted & "<br />" & strTxtYouHaveExceededNumOfPostAllowed)
ElseIf strErrorCode = "noPoll" Then
 Response.Write(strTxtYourNoValidPoll)
ElseIf strErrorCode = "FLocked" Then
 Response.Write(strTxtThisForumIsLocked)
ElseIf strErrorCode = "TClosed" Then
 Response.Write(strTxtThisTopicIsLocked)
 
below "Response.Write(strTxtThisTopicIsLocked)" add the following line:

ElseIf strErrorCode = "noTopicIcon" Then
 Response.Write(strTxtNoTopicIcon)
 ' tw-MOD: Send error Message to client if no topic icon is selected
 
Step 3: includes/message_form_inc.asp
 
Search for:

 'Display message icon drop down
 If blnTopicIcon AND NOT strMode = "PM" Then
  'Get the topic icon array
  %><!--#include file="topic_icon_inc.asp" -->
  <tr>
   <td align="right" width="30%"><% = strTxtMessageIcon %>:</td>
   <td align="left" width="70%">
    <select name="icon" id="icon" onChange="(T_icon.src = icon.options[icon.selectedIndex].value)" >
     <option value="<% = strImagePath %>topic_icon.gif"<% If strTopicIcon = "" Then Response.Write(" selected") %>><% = strTxtNoneSelected %></option><%
  'Loop through to display topic icons
  For intLoop = 1 TO Ubound(saryTopicIcon)
   Response.Write(vbCrLf & "     <option value=""" & saryTopicIcon(intLoop,2) & """")
   If strTopicIcon = saryTopicIcon(intLoop,2) Then Response.Write(" selected")
   Response.Write(">" & saryTopicIcon(intLoop,1) & "</option>")
  Next
  'If no topic Icon the get the default one
  If strTopicIcon = "" Then strTopicIcon = strImagePath & "topic_icon.gif"
%>
    </select>
    &nbsp;&nbsp;<img src="<% = strTopicIcon %>" border="0" align="middle" id="T_icon" alt"<% = strTxtMessageIcon %>" />
   </td>
  </tr><%
 End If
 
Replace (!) it with the following code:

 'Display message icon drop down
 If blnTopicIcon AND NOT strMode = "PM" Then
  'Get the topic icon array
  %><!--#include file="topic_icon_inc.asp" -->
  <tr>
   <td align="right" width="30%"><% = strTxtMessageIcon %>:</td>
   <td align="left" width="70%">
  <input name="icon" type="radio" id="icon" value="smileys/smiley20.gif" <% if strTopicIcon = "smileys/smiley20.gif" then %>checked="checked"<% end if %> /><img src="smileys/smiley20.gif" border="0" align="middle" id="T_icon" alt"Message Icon - Thumbs up" />
  <input name="icon" type="radio" id="icon2" value="smileys/smiley21.gif" <% if strTopicIcon = "smileys/smiley21.gif" then %>checked="checked"<% end if %>/><img src="smileys/smiley21.gif" border="0" align="middle" id="T_icon2" alt"Message Icon - Thumbs down" />
   </td>
  </tr><%
 End If
 
Step 4: language_files/language_file_inc.asp

Search for:

'not_posted.asp
'---------------------------------------------------------------------------------
Const strTxtMessageNotPosted = "Message Not Posted"
Const strTxtDoublePostingIsNotPermitted = "Double posting is not permitted; your message has been posted already."
Const strTxtSpammingIsNotPermitted = "Spamming is not permitted!"
Const strTxtYouHaveExceededNumOfPostAllowed = "You have exceeded the number of posts permitted in the time span.<br /><br />Please try again later."
Const strTxtYourMessageNoValidSubjectHeading = "Your message did not contain a valid subject heading and/or message body."
 
below "Const strTxtYourMessageNoValidSubjectHeading..." add the following line:

Const strTxtNoTopicIcon = "You have not selected a topic icon." ' tw-MOD: Text to display if no topic icon is selected
 
puh :)
I hope this is everything!
Just try & error - if it does not work drop a line here :)
 
Greets
Chris


Posted By: chapman_bryn
Date Posted: 09 May 2006 at 2:58am
Thanks Chris
 
That works perfectly so far. I will let you know if I see any bugs.
 
Thanks for the brilliant work.
 
Cheers,
Bryn
 
 


Posted By: chapman_bryn
Date Posted: 13 July 2006 at 6:42am
Hi Chris
 
I Hope you are still available on this website. Sorry to ask you for this but would it be possible to change the way the form handles the icon and if the member does not select the radio button then it will display a popup javabox with an error instead of showing an error.
 
The reason for this is that if the user submits all the other details but forgets the smiley selection then everything is reset when the user clickes the back button.
 
Many thanks for your help.
 
Bryn


Posted By: tw|kosh
Date Posted: 03 August 2006 at 10:10pm
Hi
 
Sorry, but is this still needed?
I was very busy the last weeks (new job, lot to do...) but maybe I can find the time to do it - but I don't change this if it's not needed anymore :)
 
Greets
Chris



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net