Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Mod Request :  Message Icon radio button
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Mod Request : Message Icon radio button

 Post Reply Post Reply Page  12>
Author
chapman_bryn View Drop Down
Newbie
Newbie


Joined: 24 April 2006
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote chapman_bryn Quote  Post ReplyReply Direct Link To This Post Topic: Mod Request : Message Icon radio button
    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.
Back to Top
tw|kosh View Drop Down
Newbie
Newbie
Avatar

Joined: 02 May 2006
Location: Switzerland
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote tw|kosh Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
chapman_bryn View Drop Down
Newbie
Newbie


Joined: 24 April 2006
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote chapman_bryn Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
JonnoB View Drop Down
Newbie
Newbie
Avatar

Joined: 11 July 2005
Location: United States
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote JonnoB Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2006 at 5:07am
Just have a third blank image and set it to default.
Back to Top
tw|kosh View Drop Down
Newbie
Newbie
Avatar

Joined: 02 May 2006
Location: Switzerland
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote tw|kosh Quote  Post ReplyReply Direct Link To This Post 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
 
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 :)


Edited by tw|kosh - 08 May 2006 at 10:36am
Back to Top
chapman_bryn View Drop Down
Newbie
Newbie


Joined: 24 April 2006
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote chapman_bryn Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2006 at 12:01pm
Hi Chris
 
Just tested it. It works perfectly. Many thanks for posting change instructions.
 
Bryn
Back to Top
tw|kosh View Drop Down
Newbie
Newbie
Avatar

Joined: 02 May 2006
Location: Switzerland
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote tw|kosh Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
chapman_bryn View Drop Down
Newbie
Newbie


Joined: 24 April 2006
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote chapman_bryn Quote  Post ReplyReply Direct Link To This Post 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
 
 
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.