[interchange-cvs] interchange - heins modified 4 files
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Sat Jun 4 01:49:40 EDT 2005
User: heins
Date: 2005-06-04 05:49:40 GMT
Modified: dist/standard/include/forum submit_form
Modified: dist/standard/pages flypage.html
Modified: dist/standard/pages/forum display.html submit.html
Log:
* Make products forums work again -- why did they stop working? And when?
I don't know, but looking back at 5.0 I don't think they have worked for
quite a while.
Revision Changes Path
1.3 +5 -1 interchange/dist/standard/include/forum/submit_form
rev 1.3, prev_rev 1.2
Index: submit_form
===================================================================
RCS file: /var/cvs/interchange/dist/standard/include/forum/submit_form,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- submit_form 26 Jan 2005 17:51:13 -0000 1.2
+++ submit_form 4 Jun 2005 05:49:40 -0000 1.3
@@ -8,6 +8,7 @@
<form ACTION="[area @@MV_PAGE@@]" METHOD="GET">
<input TYPE="HIDDEN" NAME="artid" VALUE="[loop-data forum artid]">
<input TYPE="HIDDEN" NAME="parent" VALUE="[loop-code]">
+<input TYPE="HIDDEN" NAME="product" VALUE="[cgi product]">
<input TYPE="HIDDEN" NAME="mv_arg" VALUE="[loop-code]">
<table BORDER="0" CELLSPACING="0" CELLPADDING="4">
<!--
@@ -18,7 +19,10 @@
<tr><td ALIGN="RIGHT"><br>[L]Subject[/L]: </td>
<td><br><input TYPE="text" NAME="subject" VALUE="[loop-calc]
my $subj = $CGI->{subject} || q{[loop-data forum subject]};
- $subj = "Re: $subj" unless $subj =~ /^\s*re:/i;
+
+ unless($subj =~ /^\s*re:/i or $CGI->{product}) {
+ $subj = "Re: $subj";
+ }
return $Tag->filter('restrict_html', $subj);
[/loop-calc]" SIZE=50 MAXLENGTH=50></td>
</tr>
1.4 +1 -1 interchange/dist/standard/pages/flypage.html
rev 1.4, prev_rev 1.3
Index: flypage.html
===================================================================
RCS file: /var/cvs/interchange/dist/standard/pages/flypage.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- flypage.html 23 Apr 2005 18:10:10 -0000 1.3
+++ flypage.html 4 Jun 2005 05:49:40 -0000 1.4
@@ -189,7 +189,7 @@
[if variable FORUM_PRODUCTS]
<tr>
<td>
- [forum top="[item-code]" display_page="forum/display/"]
+ [forum top="[item-code]" display_page="forum/display" /]
<p>
[page href="forum/submit"
form="
1.2 +3 -1 interchange/dist/standard/pages/forum/display.html
rev 1.2, prev_rev 1.1
Index: display.html
===================================================================
RCS file: /var/cvs/interchange/dist/standard/pages/forum/display.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- display.html 25 Apr 2004 17:07:52 -0000 1.1
+++ display.html 4 Jun 2005 05:49:40 -0000 1.2
@@ -73,7 +73,9 @@
<A HREF="{DISPLAY_URL}">One message below your threshold</a>
[/tmp]
-
+[if type=data term="products::sku::[data session arg]"]
+ [bounce page="[data session arg]"]
+[/if]
[forum
top="[data session arg]"
show-score=2
1.3 +43 -9 interchange/dist/standard/pages/forum/submit.html
rev 1.3, prev_rev 1.2
Index: submit.html
===================================================================
RCS file: /var/cvs/interchange/dist/standard/pages/forum/submit.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- submit.html 26 Jan 2005 17:27:01 -0000 1.2
+++ submit.html 4 Jun 2005 05:49:40 -0000 1.3
@@ -28,6 +28,15 @@
@_LEFTONLY_TOP_@
+[if cgi product]
+[perl tables=products]
+ ## Set the subject if coming from product page
+ my $desc = tag_data('products', $Config->{DescriptionField}, $Session->{arg});
+ $CGI->{subject} = $desc;
+ return;
+[/perl]
+[/if]
+
[perl tables="forum"]
#code parent artid mod_time created username host score lastscore reason anon extended subject comment
sub scrub {
@@ -54,6 +63,10 @@
unless $noscrub;
return $value;
}
+ if($CGI->{product}) {
+ $Session->{forum_start} ||= {};
+ $Session->{forum_start}{$CGI->{product}} = 1;
+ }
return;
[/perl]
@@ -102,7 +115,7 @@
my $db = $Db{forum}
or return "Database error.";
$v{host} = $Session->{host};
- $v{score} = 0;
+ $v{score} = 1;
my $noscrub;
if(! $CGI->{commtype}) {
# do nothing
@@ -123,11 +136,29 @@
$v{mod_time} =
$v{created} = $Tag->time( { body => "%Y-%m-%d %H:%M:%S" });
$v{subject} = $Tag->filter('encode_entities', $CGI->{subject}, 'subject');
- $v{artid} = '0';
- $v{parent} = '0';
- $Scratch->{tmp_code} = $db->set_slice(undef, [ keys %v ], [values %v])
+ $v{artid} = $CGI->{artid} || 0;
+
+ my $code;
+
+ if($CGI->{parent}) {
+ my $existing = $db->query("select * from forum where parent = '$CGI->{parent}'");
+ if($existing and ! @$existing) {
+ $v{artid} = $CGI->{parent};
+ $code = $CGI->{parent};
+ $v{parent} = 0;
+ }
+ else {
+ $v{parent} = $CGI->{parent};
+ }
+ }
+ $Scratch->{tmp_code} = $db->set_slice($code, \%v)
or return "Error submitting reply!";
$Scratch->{tmp_code} =~ s/'//g;
+
+ unless ($code) {
+ $Scratch->{tmp_code} = $v{parent};
+ }
+
## This is special processing only if there is a submission email address
## is found
if($Variable->{FORUM_SUBMIT_EMAIL}) {
@@ -174,11 +205,14 @@
return;
[/perl]
- [if scratch tmp_code]
- Your story has been submitted. You will receive a response when it
- is handled. For questions, contact <A HREF="mailto:webmaster at perusion.com">webmaster at perusion.com</A>
- <P>
- [page index]Return to the Intranet home</A>
+ [if cgi parent]
+ Your comment has been submitted.
+ [if type=data term="products::sku::[cgi parent]"]
+ [page href="[cgi parent]"]Return to product</a>.
+ [else]
+ [page href="forum/display" arg="[cgi parent]"]See in context.
+ [/else]
+ [/if]
[/if]
[else]
[include include/forum/submit_form]
More information about the interchange-cvs
mailing list