Notifications
Clear all

[Sticky] Images in Skins

1 Posts
1 Users
0 Reactions
3,994 Views
(@tammy)
Posts: 2577
Member Moderator
Topic starter
 

When you add images to your skins use the {skindir} variable to point to the correct location. You cannot use a relative path to the image because not all the pages are in the same directory (such as a number of the challenges pages, poll and shoutbox archives, etc)


<img src="'skins/MYSKIN/images/Banner.jpg'>"

Wrong!  This will break on some of your pages.


<img src="'{skindir}/images/Banner.jpg'>"

Right!  The script will automatically fill in the correct relative path to the skin directory.


<img src="' http://www.yoursite.com/skins/images/Banner.jpg '>"

Also right.  You can also use the complete URL to the image like this.

When you want to customize the stars, like/dislike, featured/retired, etc. graphics using the variables.php you should use the php variable $skindir in the same way.


$star = "<img src="'skins/MYSKIN/images/star.gif'" alt='"._STAR."'>";

Wrong!  This will break in places. 


$star = "<img src="'".$skindir."/images/star.gif'" alt='"._STAR."'>";

Right!  This will automatically supply the correct relative path.


 
Posted : 29/12/2006 8:04 pm
Share: