Gossamer Forum
Home : Products : Links 2.0 : Customization :

Show 3-Level Graphic on Rated Page, How?

Quote Reply
Show 3-Level Graphic on Rated Page, How?
Is it possible to show the graphic ($new_img) from the 3-Level "New" Graphic Mod,
and the Ratings graphic ($rate_img) from the Review.cgi,
on the Top Rated Page ?

Any help is appreciated at advance.

Quote Reply
Re: Show 3-Level Graphic on Rated Page, How? In reply to
It is possible...with a little bit of testing code hacks.

You will need to edit the sub build_rate_page in the nph-build.cgi file.

You will need to do the following:

1) Copy the new and ratings codes that you are using in the sub site_html_link routine in the site_html_templates.pl file, and put them after the following codes:

Code:

$top_rated = ''; $top_votes = '';


2) Then you will have to put the rating and new variables ($new_image and $rate_img) between the $top_votes .= and ~; AND $top_rated .= and ~; codes.

Good luck!

Regards,

Eliot Lee
Quote Reply
Re: Show 3-Level Graphic on Rated Page, How? In reply to
Thanks for your help but I cannot work it out this time,
my code is listed as follow, please give more coaching:

$top_rated = ''; $top_votes = '';
# ******* Insert the New and Rating codes from sub site_html_link in site_html_template.pl ********************
$new_7 = qq|<img src="http://www.webassic.com/images/new_7.gif" border="0" width=53 height=18 alt="Born" align="absmiddle">|;
$new_14 = qq|<img src="http://www.webassic.com/images/new_14.gif" border="0" width=59 height=18 alt="Young" align="absmiddle">|;
my %rec = @_;
my $days_old = &days_old($rec{'Date'});
my $new_img = "";

# Set new and pop to either 1 or 0 for templates.
if ($days_old <= 7) { $new_img = $new_7; }
elsif ($days_old <= 14) { $new_img = $new_14; }
else { (delete $rec{'isNew'}); }
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});
($rec{'isSold'} eq 'Yes') ? ($rec{'isSold'} = 1) : (delete $rec{'isSold'});
($rec{'isBest'} eq 'Yes') ? ($rec{'isBest'} = 1) : (delete $rec{'isBest'});
# ******* Insert the New and Rating codes from sub site_html_link in site_html_template.pl - end **************
................

if ($link{'isNew'}) { $top_rated .= qq~ $new_img~; }
[ To avoid long post, i just cut-out this one for ref. ]
[ As the problem of $new_img is still not solved, I've not started the $rate_img yet (ref.)]

Thank You.

-- Adam Hui

Quote Reply
Re: Show 3-Level Graphic on Rated Page, How? In reply to
Delete the following codes:

Code:

if ($link{'isNew'}) { $top_rated .= qq~ $new_img~; }


And simply use $new_img in the $top_votes and $top_rated statements.

Regards,

Eliot Lee
Quote Reply
Re: Show 3-Level Graphic on Rated Page, How? In reply to
Eliot, thank you for your support,
but I tried the following two arrangment, not work,
Do I misunderstand your meaning? I think so .............

For ref, I tried:
$top_rated = ''; $top_votes = '';
# ***************************
$new_7 = <img src="http://www.webassic.com/images/new_7.gif" border="0" width=53 height=18 align="absmiddle">;
$new_14 = <img src="http://www.webassic.com/images/new_14.gif" border="0" width=59 height=18 align="absmiddle">;
my %rec = @_;
my $days_old = &days_old($rec{'Date'});
my $new_img = "";
if ($days_old <= 7) { $new_img = $new_7; }
elsif ($days_old <= 14) { $new_img = $new_14; }
else { (delete $rec{'isNew'}); }
# ***********************************

$top_rated .= qq~ $new_img ~;


AND


$top_rated = ''; $top_votes = '';
# ***************************
$new_7 = qq~ <img src="http://www.webassic.com/images/new_7.gif" border="0" width=53 height=18 align="absmiddle"> ~;
$new_14 = qq~ <img src="http://www.webassic.com/images/new_14.gif" border="0" width=59 height=18 align="absmiddle"> ~;
my %rec = @_;
my $days_old = &days_old($rec{'Date'});
my $new_img = "";
if ($days_old <= 7) { $new_img = $new_7; }
elsif ($days_old <= 14) { $new_img = $new_14; }
else { (delete $rec{'isNew'}); }
# ***********************************

$top_rated .= $new_img;


help ...... Crazy
-- Adam

Quote Reply
Re: Show 3-Level Graphic on Rated Page, How? In reply to
Ugh...

No...you put the $new_img variable in the line where $link{'Title'} appear! Not in a separate line.

Do you understand now???

Regards,

Eliot Lee