phpBBHacks.com - How to change the a:link behavior for generated links?
DeveloperCube, a community for webmasters and web developers
StatsForums Home   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in
FAQFAQ   SearchSearch   MemberlistMemberlist   TutorialsTutorials   ContactContact Us
Add Us:     MySpace     Facebook     StumbleUpon
Username:    Password:
Remember Me?    
How to change the a:link behavior for generated links?
BlinkList
del.icio.us
Furl
linkaGoGo
reddit
Simpy
Mister Wong
Yahoo! My Web

Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> phpBB 2 Template and Graphic Development
 See a User Guidelines violation? Please contact us.
Author Message

Saratoga Sam
Well Known User

Joined: 17 Feb 2004
Posts: 248
Location: Silicon Valley

PostPosted: June 23rd 2007, 2:34 pm    Post subject: How to change the a:link behavior for generated links? Reply with quote

Hi -

How do I change the a:link behavior for dynamically generated links in a template?

For example, on the viewforum page, links to moderators for the forum are dynamically generated and displayed above the forum.

The link is generated in the viewforum.tpl file with this code:

Code:
{L_MODERATOR}: {MODERATORS}


Which is translated into this html:

Code:
Moderators: <a href="profile.php?mode=viewprofile&amp;u=8">Joe Smith</a>


If I wrap the original code with a <span> statement, the new link definitions are ignored. In other words, my link shows up RED instead of GREEN.

Code:
<span class="gensmall">{L_MODERATOR}: {MODERATORS}</span>


My simple CSS file looks like this:
Code:

/* default link colors */
a:link {
   color:Red;
   text-decoration:underline;
}
a:visited {
   color:Red;
   text-decoration:underline;
}
a:hover {
   color:Red;
   text-decoration:none;
}


/* customized link colors */
.gensmall {
   font-family: Verdana, Arial;
   font-size: 12px;
   color: #666666;
}
a.gensmall:link {
   color:Green;
   text-decoration:underline;
}
a.gensmall:visited {
   color:Green;
   text-decoration:underline;
}
a.gensmall:hover {
   color:Green;
   text-decoration:none;
}

_________________
http://www.anncrafted.com | http://www.champaigncentennial1979.com |
http://abvprint.com
Back to top
View user's profile Send private message

~HG~
Dedicated User

Joined: 08 Nov 2003
Posts: 3232
Location: Australia

PostPosted: June 23rd 2007, 3:03 pm    Post subject: Reply with quote

Changing your css from

Code:
a:link {
   color:Red;
   text-decoration:underline;


to

Code:
a:link {
   color:Green;
   text-decoration:underline;


would resolve it but I am guessing you dont want to go that way with it?

Have you tried using font color= ?

Code:
Moderators: <a href="profile.php?mode=viewprofile&amp;u=8"><font color="green">Joe Smith</font></a>

_________________
~HG~

|| rodneyangell.com || My Hacks || Tutorial - Stopping Spam Bots
Back to top
View user's profile Send private message Send e-mail Visit poster's website

Saratoga Sam
Well Known User

Joined: 17 Feb 2004
Posts: 248
Location: Silicon Valley

PostPosted: June 23rd 2007, 5:49 pm    Post subject: Reply with quote

Changing the CSS definition of a:link to GREEN will not work because there are some a:links that need to be RED.

You cannot modify the <a href="profile.php?mode=viewprofile&amp;u=8>Joe Smith</font></a> statement in the tpl file because it is dynamically generated. I could modify this statement in the .php file but then it would affect all different templates on this phpBB.
_________________
http://www.anncrafted.com | http://www.champaigncentennial1979.com |
http://abvprint.com
Back to top
View user's profile Send private message

Thoul
VIP

Joined: 30 Jul 2002
Posts: 17676
Location: USA

PostPosted: June 24th 2007, 1:38 pm    Post subject: Reply with quote

Use .gensmall a:link in your CSS instead of using a.gensmall:link. The latter only applies to tags that have gensmall set on the link itself, like <a href="" class="gensmall">.
_________________
Phantasy Star: Fringes of Algo

70+ Listings @ phpBBHacks.com
Back to top
View user's profile Send private message Visit poster's website

Saratoga Sam
Well Known User

Joined: 17 Feb 2004
Posts: 248
Location: Silicon Valley

PostPosted: June 24th 2007, 2:54 pm    Post subject: Reply with quote

Thoul wrote:
Use .gensmall a:link in your CSS instead of using a.gensmall:link. The latter only applies to tags that have gensmall set on the link itself, like <a href="" class="gensmall">.


Brilliant. I just tested it and you're right.

Thanks again, Thoul!
_________________
http://www.anncrafted.com | http://www.champaigncentennial1979.com |
http://abvprint.com
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> phpBB 2 Template and Graphic Development All times are GMT - 6 Hours
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Links: Big Message Boards - Free JavaScript - phpBB2 - phpbb styles - Suporte phpBB - phpBB.it - phpBB Česky - phpBB Turkiye - phpBBArabia.com - phpBB-fr.com - Romanian phpBB online community - phpBB-TW.net - phpBBservice.nl - phpBB Brasil

Network: iFroggy Network Blog - iFroggy Hosting - SportsForums.net - KarateForums.com - YanksBlog.com - PhotoshopForums.com - DeveloperCube - Managing Online Forums - ManagingCommunities.com - CommunityAdmins.com - DrGregHouse.com - Bad Boy Blog - SodaRatings.com - Patrick O'Keefe

< Advertising - Contact Us - Staff - User Guidelines >

Copyright © 2001-2009. iFroggy Network, phpBBHacks.com. All Rights Reserved. Privacy Policy. We Support phpBBHacks.com (of course!).
Powered by phpBB © phpBB Group. phpBB SEO. Hosted by 100MegsWebHosting. We are in no way affiliated with the phpBB Group. phpBB is copyright to the phpBB Group.