rejetto forum
May 24, 2012, 01:51:15 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Top Download tag  (Read 3221 times)
0 Members and 1 Guest are viewing this topic.
Giant Eagle
Insane poster
*****
Offline Offline

Netherlands Netherlands

Posts: 533


>=3 RAWR!

no.body056@gmail.com
View Profile WWW
« on: December 30, 2006, 03:51:17 PM »

First of all, i want to say hi, cause im new to this forum  Wink
so here goes:

Hi everyone  Cheesy


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:
<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:
[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.. Smiley

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

Rest in peace 500mhz server, you served me well...
New 1500mhz server DOA'ed on me >_>
New 2400mhz server up and running again Grin

rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11829


View Profile
« Reply #1 on: December 31, 2006, 06:13:12 AM »

very nice Smiley
Logged
maverick
Insane poster
*****
Offline Offline

Posts: 1056


Computer Solutions


View Profile
« Reply #2 on: December 31, 2006, 06:40:06 AM »


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.
Logged

maverick
Giant Eagle
Insane poster
*****
Offline Offline

Netherlands Netherlands

Posts: 533


>=3 RAWR!

no.body056@gmail.com
View Profile WWW
« Reply #3 on: December 31, 2006, 07:27:09 AM »

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  Wink

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:
<script language="javascript">var top='%item-dl-count%'; if (top > 25) { document.write ("<span class=flag>&nbsp;TOP DOWNLOAD&nbsp;</span>") }</script>

Logged

Rest in peace 500mhz server, you served me well...
New 1500mhz server DOA'ed on me >_>
New 2400mhz server up and running again Grin

Twolivejew
Occasional poster
*
Offline Offline

Posts: 2


View Profile
« Reply #4 on: January 06, 2007, 09:07:07 AM »

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
Logged
TSG
Operator
Insane poster
*****
Offline Offline

Australia Australia

Posts: 1919



View Profile WWW
« Reply #5 on: January 06, 2007, 10:17:58 AM »

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!

Grin hope this helps.
« Last Edit: January 06, 2007, 10:20:02 AM by That_Stevens_Guy » Logged

rejetto forum
« Reply #5 on: January 06, 2007, 10:17:58 AM »

Do you like this software? Consider even $2
 Logged
traxxus
Guest


Email
« Reply #6 on: January 23, 2007, 03:44:48 AM »

Plz can tell me anyone how i must include the code into the template "HFS Terayon v1.1" ?
I cant do it...  Huh?  Embarrassed

Thank you  Smiley
Logged
Giant Eagle
Insane poster
*****
Offline Offline

Netherlands Netherlands

Posts: 533


>=3 RAWR!

no.body056@gmail.com
View Profile WWW
« Reply #7 on: January 23, 2007, 08:11:38 AM »

It's already included! Cheesy

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

Rest in peace 500mhz server, you served me well...
New 1500mhz server DOA'ed on me >_>
New 2400mhz server up and running again Grin

traxxus
Guest


Email
« Reply #8 on: January 23, 2007, 09:44:36 AM »

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


Email
« Reply #9 on: January 23, 2007, 10:45:39 AM »

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



[attachment deleted by admin]
Logged
Twolivejew
Occasional poster
*
Offline Offline

Posts: 2


View Profile
« Reply #10 on: February 02, 2007, 08:19:41 AM »

Thanks that worked well, Grin
Logged
Giant Eagle
Insane poster
*****
Offline Offline

Netherlands Netherlands

Posts: 533


>=3 RAWR!

no.body056@gmail.com
View Profile WWW
« Reply #11 on: February 02, 2007, 09:35:36 AM »

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
Logged

Rest in peace 500mhz server, you served me well...
New 1500mhz server DOA'ed on me >_>
New 2400mhz server up and running again Grin

TSG
Operator
Insane poster
*****
Offline Offline

Australia Australia

Posts: 1919



View Profile WWW
« Reply #12 on: February 02, 2007, 10:45:08 PM »

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  Cheesy

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:
[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 02, 2007, 10:56:00 PM by That_Stevens_Guy » Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page May 16, 2012, 02:25:20 AM
anything