Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Red 'New' Image not appearing

Quote Reply
Red 'New' Image not appearing
Searching through the forums I can find some threads relating to this image not appearing correctly but I can't find any mention of it being solved. My red image is not displayed, just the word 'new'. Where is the image stored or was this problem sorted out and I missed it... Thanks

Quote Reply
Re: Red 'New' Image not appearing In reply to
Reading between the lines, I don't think you're refering to an image. The words "new" are formatted HTML (the CSS element SUP.new).


Martin Webster
--
Cebidae's UK Internet Resource
http://www.cebidae.co.uk/
Quote Reply
Re: Red 'New' Image not appearing In reply to
ah gotcha... so if I'm not using css then it figures I don't see the 'image' or whatever. Drat.. I didn't know that would happen.
Thanks

Quote Reply
Re: Red 'New' Image not appearing In reply to
You can edit site_html.pl or site_html_templates.pl and hard code the changes (sub site_html_link). Look for <sup class="new">.

But, CSS is better! Wink

Martin Webster
--
Cebidae's UK Internet Resource
http://www.cebidae.co.uk/
Quote Reply
Re: Red 'New' Image not appearing In reply to
Sorry to appear a bit thick (maybe it's too late for that!) but could you please tell me exactly what code to insert / change and where in order to get the 'images' working again when not using css. I don't want to play around with perl files that I'm not familiar with.
Thanks in advance :-)

Quote Reply
Re: Red 'New' Image not appearing In reply to
If you don't like playing around with Perl, it's best not to delve into the scripts. You'd be best off sticking with the style sheet: insert <LINK rel="stylesheet" href="/url/to/links.css" type="text/css"> in every page.

If you want to hard code the HTML, you will have to replicate this:

sup.new {
font-size: x-small;
color: #FFFFFF; (white)
background: #FF3300; (red)
font-weight: bold;
font-family: "verdana", "arial", "geneva", sans-serif;
}


using depreciated HTML tags (replacing instances of <sup class="new">. I don't know what these are without looking them up because I don't like using them.

Martin Webster
--
Cebidae's UK Internet Resource
http://www.cebidae.co.uk/
Quote Reply
Re: Red 'New' Image not appearing In reply to
Hi... Are the 'Green New' and the 'Update' images appearing? My code at the top of site_html_templates, (globals), starts like this... $new_1 = qq|<img src="/images/new_1.gif" border="0" width=34 height=12
alt="New0-2" align="absmiddle">|;

$new_3 = qq|<img src="/images/new_3.gif" border="0" width=34 height=12
alt="New3-7" align="absmiddle">|;

$new_7 = qq|<img src="/images/new_7.gif" border="0" width=34 height=12
alt="New8-14" align="absmiddle">|;

$updated = qq|<img src="/images/updated.gif" width=34 height=12
border=0 alt="Updated" align="absmiddle">|;

If I'm on the right track its new_1.gif we are chasing so we can step through the process.

Regards

George E.D. Burville
Ed: www.appbe.com
Quote Reply
Re: Red 'New' Image not appearing In reply to
Thanks for you input. However, Pitman is not using the three new graphics MOD. The "graphic" he is concerned about is actually the white superscript text "NEW" displayed on a red background. Tongue

Martin Webster
--
Cebidae's UK Internet Resource
http://www.cebidae.co.uk/
Quote Reply
Re: Red 'New' Image not appearing In reply to
Sorry Martin.

George E.D. Burville
Ed: www.appbe.com
Quote Reply
Re: Red 'New' Image not appearing In reply to
Well unfortunately I never did get this working. Thanks for trying anyway, I guess I just have to do without a Red 'New':-(

Quote Reply
Re: Red 'New' Image not appearing In reply to
Don't give up. I'm new to this forum and from what I've read now it looks like Martin is the man to solve things for you.

George E.D. Burville
Ed: www.appbe.com
Quote Reply
Re: Red 'New' Image not appearing In reply to
Thanks for the complement, but I wouldn't go that far. Blush There are quite a few regulars on these forums who have far greater experience than me; I only started learning HTML this April and Perl programming about a month ago!

Pitman,

Let's look at the problem again. How far did you get?

Martin Webster
--
Cebidae's UK Internet Resource
http://www.cebidae.co.uk/
Quote Reply
Re: Red 'New' Image not appearing In reply to
Martin, thanks. I didn't get very far :-(
I'd really given up on this - I don't have a clue what 'depreciated html tags' are. Unless you have the time and the patience to explain it all to me in dummy-speak then I'm afraid I'm a lost cause!
The only way I'll solve this one is to be told exactly what to do and wher to do it. I've no experience with perl scripts at all and hopefully I'll never need to look at another one again :-)
Having said that.. the site is coming along quite nicely.. I have the Links database online now at www.soccerlinks.co.uk so I'm definately making progress here. It'd be nice to have the 'New' images (oops - they're not images apparently) working though... Cheers

Quote Reply
Re: Red 'New' Image not appearing In reply to
Alright...if I may interrupt again...

The problem is that since you are NOT using the CSS files, you need to delete ALL occurrences of the CSS codes in the sub site_html_print_cat routine in the site_html_templates.pl (IF you are using templates) or the site_html.pl file (IF you are not using templates).

Look for the following codes in the above mentioned subroutine:

Code:

<sup class="new">


REPLACE these codes with the following:

Code:

<font color="ff0000">


AND THEN REPLACE the following codes:

Code:

<div class="margin">
<td class="catlist" valign="top">
<a class="link" href="$url">
<small class="numlinks">


with the following codes:

Code:

<div align="center">
<td valign="top">
<a href="$url">
<small>


Regards,

Eliot Lee


Quote Reply
Re: Red 'New' Image not appearing In reply to
Thanks for clearing this up Eliot. Smile

Martin Webster
--
Cebidae's UK Internet Resource
http://www.cebidae.co.uk/
Quote Reply
Re: Red 'New' Image not appearing In reply to
The 'new' has now changed colour to red rather than to the white on red 'image' that there used to be.
This is the code I have now in sub site html_print_cat - have I made the changes correctly? Thanks

my (@subcat) = @_;
my ($url, $numlinks, $mod, $subcat, $category_name, $description, $output, $i);
my ($half) = int (($#subcat+2) / 2);

# Print Header.
$output = qq|<div align="center"><table width="80%" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top">\n|;

foreach $subcat (sort @subcat) {
($description) = @{$category{$subcat}}[2];

# First let's get the name, number of links, and last modified date...
$url = "$build_root_url/" . &urlencode($subcat) . "/";
if ($subcat =~ m,.*/([^/]+)$,) { $category_name = &build_clean($1); } else { $category_name = &build_clean($subcat); }
$numlinks = $stats{"$subcat"}[0];
$mod = $stats{"$subcat"}[1];

# We check to see if we are half way through, if so we stop this table cell
# and begin a new one (this lets us have category names in two columns).
if ($i == $half) {
$output .= qq|</td><td valign="top">\n|;
}
$i++;

# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<dl><dt><strong><a href="$url">$category_name</a></strong> <small>($numlinks)</small> |;
$output .= qq|<small><font color="ff0000">new</small>| if (&days_old($mod) < $db_new_cutoff);
$output .= qq|</dt>|;
$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
$output .= qq|</dl>|;
}

# Don't forget to end the unordered list..
$output .= "</td></tr></table></div>\n";
return $output;
}

1;

Quote Reply
Re: Red 'New' Image not appearing In reply to
Hi

Sorry for butting in,

Might it not be handier in the long run to use Bobsie's graphics for new, it seems to me that there are very few links sites not using this nowadays.

It can be found here

http://goodstuff.orphanage.com/new_updated_mod.html


Good Luck

DavyC

Quote Reply
Re: Red 'New' Image not appearing In reply to
I might try that if I'm feeling a bit braver. At the moment I'm still trying to get the basic script to work properly :-(

Quote Reply
Re: Red 'New' Image not appearing In reply to
Well, all you have to do is the following if you want the new image (GRAPHIC!) to appear...

1) Download the white on red new graphic image from the site where you saw it. This is the step you are missing. It is a graphic and you must download it and then upload the graphic to your web server! It is NOT dynamically created by Perl or Links. This lack of knowledge leads me to believe that you are not HTML competent, which will be a challenge for you to modify Links without understanding raw HTML and how web pages actually work. Tongue

2) Add the following variable in your links.cfg file:

Code:

$newimg = qq|img src="/path/to/new.gif" width="" height="" border="" alt="New"|;


Change /path/to to the relative path where your new.gif image is located. Add values to the image attributes (such as width and height).

3) Then you will need to replace the following codes in the sub site_html_print_cat routine in the site_html_templates.pl file:

Code:

<font color="ff0000">


to the following:

Code:

<$newimg>


I REALLY hope this helps and you get it this time!

Regards,

Eliot Lee

Quote Reply
Re: Red 'New' Image not appearing In reply to
I think I know roughly what I'm doing with HTML but I know nothing about PERL. That's why I ask questions, I thought that was the whole point of the forum. Sorry, I'll go read a book or something and come back when I know all the answers. Judging by the number of views to this thread there are plenty of other ppl with the same problem but maybe Im the only one who doesnt mind to look stupid by asking

Quote Reply
Re: Red 'New' Image not appearing In reply to
Well, it seems odd that if you were able to put the font codes in the correct spot, but you were unable to figure out how to put an img tag in the same spot. Wink

Regards,

Eliot Lee

Quote Reply
Re: Red 'New' Image not appearing In reply to
Pitman posted a question and not a single one of the 'Experts' have managed to help him. At best he has been persuaded to keep well away from asking questions in this forum. Well I don't care who you are, how good you are, how many people you have helped, or how you think you rate. I see this forum as something more than just an opportunity for those in the know to demonstrate their superiority over those who need answers to their questions.

Links 2.0 is a fantastic program but, despite all its flexibility, it can be a problem for perl newbies.

As I've said before, I'm new to this forum. I do have respect for those of you who have the expertise to help others but I do not understand negative or unfriendly response.

Perhaps in this thread we should start afresh and take on board the fact that if we can't solve the problem for Pitman then we don't really know how to solve the problem.

In other words, we don't have the expertise to solve the problem.

In conclusion... I don't know who is in control of the forum but I would be pleased to see them remove the tongue smiley.

George E.D. Burville
Ed: www.appbe.com
Quote Reply
Re: Red 'New' Image not appearing In reply to
Just for the record, I have offered to help Pitman resolve his problems "off-forum". Smile

Martin Webster
--
Cebidae's UK Internet Resource
http://www.cebidae.co.uk/
Quote Reply
Re: Red 'New' Image not appearing In reply to
Martin... Off forum would certainly be a quicker way of solving things.

George E.D. Burville
Ed: www.appbe.com