rejetto forum

Top Download tag

0 Members and 1 Guest are viewing this topic.

Offline Giant Eagle

  • Tireless poster
  • ****
    • Posts: 535
  • >=3 RAWR!
    • View Profile
    • RAWR-Designs.com
First of all, i want to say hi, cause im new to this forum  ;)
so here goes:

Hi everyone  :D


The "Top Download Tag"

With a little java script, it's possible to create a TOP DOWNLOAD tag next to your files:

(i used a hit limit of 1 to test my script, but ofcourse this can be changed)

The code to achieve this:
Code: [Select]
<script language="javascript">
<!-- Top Download tag created by Giant Eagle
var top='%item-dl-count%';
if (top > 25)
{
document.write ("<span class=flag>&nbsp;TOP DOWNLOAD&nbsp;</span>")
}
</script>

If you'll use this code, the tag will show up after 25 people have downloaded the file.
So, if you want to change this, simply change 25 to whatever number you want.

If you use the default template, you can use this code to replace the [File] thing in your template:
Code: [Select]
[file]
<tr><td>%new%<script language="javascript">var top='%item-dl-count%'; if (top > 25) { document.write ("<span class=flag>&nbsp;TOP DOWNLOAD&nbsp;</span>") }</script><a href="%item-url%"><img src="/~img_file" /> %item-name%</a>%comment%<td align=right>%item-size%<td align=right>%item-modified%<td align=right>%item-dl-count%

That should do it.. :)

Anyway, sorry for my bad english, cause its not my first language


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile

Offline maverick

  • Tireless poster
  • ****
    • Posts: 1052
  • Computer Solutions
    • View Profile

Tested.  Works Good.  Thanks.

Just a note for those who have [file.mp3] [file.jpg] sections etc. and you want the top download tag included in those sections, you would also have to include the script in them.
maverick


Offline Giant Eagle

  • Tireless poster
  • ****
    • Posts: 535
  • >=3 RAWR!
    • View Profile
    • RAWR-Designs.com
Just a note for those who have [file.mp3] [file.jpg] sections etc. and you want the top download tag included in those sections, you would also have to include the script in them.

Sorry, i forgot to mention that  ;)

Those who also have [file.mp3], [file.jpg] or [file.anyextension] configured in their template, should copy and paste the following code right after the %new% tag in those sections.
Code: [Select]
<script language="javascript">var top='%item-dl-count%'; if (top > 25) { document.write ("<span class=flag>&nbsp;TOP DOWNLOAD&nbsp;</span>") }</script>


Offline Twolivejew

  • Occasional poster
  • *
    • Posts: 2
    • View Profile
I figured out the Top download tag and it works well. I am a newbie to HTML and was wondering how do I change the color and add the new tag


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
Um see the class=flag ? thats a css linking tag to the class .flag in the css, so go to the css (found in the [style] section) and change the hex codes found in those. These look like this.... color:#000000; . Also you can overide this linked css by adding a personal style to the object so sumfin like this.... <span class=flag style="color:#000000; border-color:#000000; background-color: #FFFFFF">&nbsp;TOP DOWNLOAD&nbsp;</span> but this is only needed sometimes, ur better off editing the main css if u wanna change the properties of the new tage aswell.

You can also shorten these hex codes when u become more experienced to save on code. so black which is normally represented with #000000 can be shown using simply #000, or #fff for white, if you like you can even use simple text like, white, or black, or green, or red, these will use the system default for the stated colours!

;D hope this helps.
« Last Edit: January 06, 2007, 04:20:02 PM by That_Stevens_Guy »


traxxus

  • Guest
Plz can tell me anyone how i must include the code into the template "HFS Terayon v1.1" ?
I cant do it...  ???  :-[

Thank you  :)


Offline Giant Eagle

  • Tireless poster
  • ****
    • Posts: 535
  • >=3 RAWR!
    • View Profile
    • RAWR-Designs.com
It's already included! :D

If a file is downloaded more than 25 times, a blue message will appear "This file has been downloaded more than 25 times now!!"


traxxus

  • Guest
Ok thx, but, the "new" flag dont work by me... not with the default template and not with the terayon template.


traxxus

  • Guest
Ok its done with the top downlaod flag ... but i wish anymore to integrate the "new" flag....



[attachment deleted by admin]


Offline Twolivejew

  • Occasional poster
  • *
    • Posts: 2
    • View Profile

Offline Giant Eagle

  • Tireless poster
  • ****
    • Posts: 535
  • >=3 RAWR!
    • View Profile
    • RAWR-Designs.com
im glad you like it ^^

Ok its done with the top downlaod flag ... but i wish anymore to integrate the "new" flag....



To do that, you have to go to "Menu" -> "Virtual File System" -> and select "Flag files added recently.."

You need to be in expert mode to do this tho


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
I have made a veerry slightly different version.
Because this has to go in all file sections and it will be repeated many times i thought it best to condense it as much as possible. I figured that since the variable is only used once... why not place it directly in the code  :D

I use a value of 1 to test aswell.

<script>if('%item-dl-count%'>1){document.write("<span class=flag>&nbsp;TOP DOWNLOAD&nbsp;</span>")}</script>

Example in some code:

Code: [Select]
[file]
<tr>
<td><a href="%item-url%">&nbsp;<img align=top src="/~img_file" alt=""> %item-name%</a>%new%<script>if('%item-dl-count%'>1){document.write("&nbsp;<span class=flag>&nbsp;TOP DOWNLOAD&nbsp;</span>")}</script>%comment%</td>
<td align=center>%item-size%</td>
<td align=center>%item-modified%</td>
<td align=center>%item-dl-count%</td>
</tr>
« Last Edit: February 03, 2007, 04:56:00 AM by That_Stevens_Guy »