This may take a bit of time to explain, but if anyone can help I'd REALLY appreciate it. I've spent a couple days searching the forums and and hacking away at the scripts and finally have to admit that I don't know what I'm doing.
I am trying to allow viewers (with view access only) to click on a link (Review it!) at the bottom of a record that takes them to a page in which there is a form that gets emailed to the webmaster. I want a field in this form to contain some information from the db record (ie. title or organization name - which is $rec{'Organization'}). I was able to build the new page by adding a new subroutine to both the db.cgi page and by adding one to the html.pl page. The problem I'm having is that the record field information ($rec{'Organization'}) is not making it onto to the new page.
The code I've added has been largely taken from the preview mod. I'm incorporated the short/long mod, and various others over the past 9 months that I've working with dbman.
Here's my code:
To db.cgi I added this elseif to all the elsif statements :
elsif ($in{'review_record'}) { if ($per_view) { &html_review; } else { &html_unauth; } }
and this to the db.cgi:
sub review_record {
if ($status eq "ok") {
&html_review(@hits);
}
else {
&html_view_failure($status);
}
}
Then I added this form (which calls up an external form-to-email script into &html_review:
sub html_review {
# --------------------------------------------------------
$page_title= "Reader Review";
&html_page_top;
$submit_button = "View Records";
$reset_button = "Reset Form";
&html_record(%in);
# < -- Start page text -- >
print qq|
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table>
<TR><TD COLSPAN="2" ALIGN="left" VALIGN="TOP"><$font_color><b>What do you think? Give us a Review of $rec{'Organization'}"</b></FONT></TD>
<TR><TD>$nbsp</td><TD><$font><form METHOD="POST" ACTION="http://www.pathtoformmail/">
<input type=hidden name="recipient" value="$admin_email">
<input type=hidden name="subject" value="Review of $rec{'Organization'}">
<table width="680" bgcolor="#FFFFFF" align="center">
<tr>
<td align="Right" valign="TOP" width="150" height="29"><p>Your name</p></td>
<td valign="TOP" width="475" height="29"> <input type="text" name="name" maxlength="25"></td>
</tr>
<tr>
<td align="Right" valign="TOP" width="150"><p>Your email</p></td>
<td valign="TOP" width="475"><input type="text" name="email" maxlength="25"><i><font color="#FF0000">optional! </font></i></p></td>
</tr>
<tr>
<td align="Right" valign="top" width="150" height="235"><p>Comments</p></td>
<td valign="TOP" width="475" height="235"> <textarea name="comments" cols=60 rows=15 ></textarea></td>
</tr>
<tr>
<td align="Right" valign="middle" width="150" height="57"><p>
<input type=hidden name="redirect" value="http://www.gokid.org/html/thankyou_main.shtml"></p></td>
<td valign="TOP" width="475" height="57"> <input type="submit" name="Submit" value="submit"></td>
</tr>
<p> </p>
</table></form>
</Font></TD></TR> </table>
and finally this is the link at the bottom of the html_record_long subroutine for displaying:
print qq||;
if ($rec{'Organization'}) {
print qq|
<TR><TD ALIGN="left" VALIGN="TOP" colspan="2"><$font><b>
Post Your Own Review </b></font></TD></tr>
<tr><TD ALIGN="left" VALIGN="TOP" colspan="2"><$font>Join the conversation and tell us what you think of $rec{'Organization'}.
<a href="$db_script_url?&db=$db_setup&review_record=1&uid=default">Review it!</a></font></td></tr>
<TD> </td></tr></table>
</body>
</html>
|;
}
Help! I don't know if i should modify the sub record_review, the sub html_review, or the link that calls up the form in order to get $rec{'Organization'} to show up on the form.
Thank you so much.
I am trying to allow viewers (with view access only) to click on a link (Review it!) at the bottom of a record that takes them to a page in which there is a form that gets emailed to the webmaster. I want a field in this form to contain some information from the db record (ie. title or organization name - which is $rec{'Organization'}). I was able to build the new page by adding a new subroutine to both the db.cgi page and by adding one to the html.pl page. The problem I'm having is that the record field information ($rec{'Organization'}) is not making it onto to the new page.
The code I've added has been largely taken from the preview mod. I'm incorporated the short/long mod, and various others over the past 9 months that I've working with dbman.
Here's my code:
To db.cgi I added this elseif to all the elsif statements :
elsif ($in{'review_record'}) { if ($per_view) { &html_review; } else { &html_unauth; } }
and this to the db.cgi:
sub review_record {
if ($status eq "ok") {
&html_review(@hits);
}
else {
&html_view_failure($status);
}
}
Then I added this form (which calls up an external form-to-email script into &html_review:
sub html_review {
# --------------------------------------------------------
$page_title= "Reader Review";
&html_page_top;
$submit_button = "View Records";
$reset_button = "Reset Form";
&html_record(%in);
# < -- Start page text -- >
print qq|
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table>
<TR><TD COLSPAN="2" ALIGN="left" VALIGN="TOP"><$font_color><b>What do you think? Give us a Review of $rec{'Organization'}"</b></FONT></TD>
<TR><TD>$nbsp</td><TD><$font><form METHOD="POST" ACTION="http://www.pathtoformmail/">
<input type=hidden name="recipient" value="$admin_email">
<input type=hidden name="subject" value="Review of $rec{'Organization'}">
<table width="680" bgcolor="#FFFFFF" align="center">
<tr>
<td align="Right" valign="TOP" width="150" height="29"><p>Your name</p></td>
<td valign="TOP" width="475" height="29"> <input type="text" name="name" maxlength="25"></td>
</tr>
<tr>
<td align="Right" valign="TOP" width="150"><p>Your email</p></td>
<td valign="TOP" width="475"><input type="text" name="email" maxlength="25"><i><font color="#FF0000">optional! </font></i></p></td>
</tr>
<tr>
<td align="Right" valign="top" width="150" height="235"><p>Comments</p></td>
<td valign="TOP" width="475" height="235"> <textarea name="comments" cols=60 rows=15 ></textarea></td>
</tr>
<tr>
<td align="Right" valign="middle" width="150" height="57"><p>
<input type=hidden name="redirect" value="http://www.gokid.org/html/thankyou_main.shtml"></p></td>
<td valign="TOP" width="475" height="57"> <input type="submit" name="Submit" value="submit"></td>
</tr>
<p> </p>
</table></form>
</Font></TD></TR> </table>
and finally this is the link at the bottom of the html_record_long subroutine for displaying:
print qq||;
if ($rec{'Organization'}) {
print qq|
<TR><TD ALIGN="left" VALIGN="TOP" colspan="2"><$font><b>
Post Your Own Review </b></font></TD></tr>
<tr><TD ALIGN="left" VALIGN="TOP" colspan="2"><$font>Join the conversation and tell us what you think of $rec{'Organization'}.
<a href="$db_script_url?&db=$db_setup&review_record=1&uid=default">Review it!</a></font></td></tr>
<TD> </td></tr></table>
</body>
</html>
|;
}
Help! I don't know if i should modify the sub record_review, the sub html_review, or the link that calls up the form in order to get $rec{'Organization'} to show up on the form.
Thank you so much.