TorrentFlux.com Hey, OppTupacShakur, you have 11 messages, 0 are new.
05-07-2007, 12:39:58
Home Help Search Profile Logout donate chat
News:


+  TorrentFlux Forums
|-+  Code Hacks and Tools
| |-+  TorrentFlux 2.1 Hacks
| | |-+  Advanced Start Dialog Icon
« previous next »
Pages: [1] Go Down Reply Notify of replies Send this topic Print
Author Topic: Advanced Start Dialog Icon  (Read 935 times)
sparks
Newbie
*
Offline Offline

Posts: 4



View Profile Personal Message (Offline)
« on: 04-28-2006, 00:34:32 » Reply with quote

Hi,

I occasionally want a torrent to start with settings other than the defaults, but dont want the Advanced start dialog to pop up for every torrent.

Has anyone made an addon that adds an option to start the torrent with advanced start?

Hope people can understand what I mean .

Sparks
Report to moderator   Logged
b4rt
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 542



View Profile WWW Email Personal Message (Offline)
« Reply #1 on: 04-28-2006, 00:40:53 » Reply with quote


functionality you seek might be in here :
http://www.torrentflux.com/forum/index.php/topic,1265.0.html

b4rt
Report to moderator   Logged

torrentflux-b4rt svn-trunk
Linux 2.4.34.1, Apache 2.0.59, PHP 4.4.5, Perl 5.8.8, Python 2.5, MySQL 4.1.22
Paczesiowa
Full Member
***
Offline Offline

TF Base: Linux 2.x
Posts: 177



View Profile Email Personal Message (Offline)
« Reply #2 on: 06-09-2006, 09:42:07 » Reply with quote

if there is anyone who likes to pick hacks and not to install them all using b4rt's mod
try this:

1. in functions.php find:
Code
if (!is_file($cfg["torrent_file_path"].$alias.".pid"))
                       {
                           // Allow Avanced start popup?
                           if ($cfg["advanced_start"])
                           {
                               if($show_run)
                               {
                                   $output .= "<a href=\"#\" onclick=\"StartTorrent('startpop.php?torrent=".urlencode($entry)."')\"><img src=\"images/run_on.gif\" width=16 height=16 title=\""._RUNTORRENT."\" border=0></a>";
                               }
                               else
                               {
                                   $output .= "<a href=\"#\" onclick=\"StartTorrent('startpop.php?torrent=".urlencode($entry)."')\"><img src=\"images/seed_on.gif\" width=16 height=16 title=\""._SEEDTORRENT."\" border=0></a>";
                               }
                           }
                           else
                           {
                               // Quick Start
                               if($show_run)
                               {
                                   $output .= "<a href=\"".$_SERVER['PHP_SELF']."?torrent=".urlencode($entry)."\"><img src=\"images/run_on.gif\" width=16 height=16 title=\""._RUNTORRENT."\" border=0></a>";
                               }
                               else
                               {
                                   $output .= "<a href=\"".$_SERVER['PHP_SELF']."?torrent=".urlencode($entry)."\"><img src=\"images/seed_on.gif\" width=16 height=16 title=\""._SEEDTORRENT."\" border=0></a>";
                               }
                           }
                       }

and change it to:

Code
if (!is_file($cfg["torrent_file_path"].$alias.".pid"))
                       {
                           // Allow Avanced start popup?
                           // Quick Start
                           if($show_run)
                           {
                               $output .= "<a href=\"".$_SERVER['PHP_SELF']."?torrent=".urlencode($entry)."\"><img src=\"images/thunder.gif\" width=16 height=16 title=\""._RUNTORRENT."\" border=0></a>";
                           }
                           else
                           {
                               $output .= "<a href=\"".$_SERVER['PHP_SELF']."?torrent=".urlencode($entry)."\"><img src=\"images/thunder.gif\" width=16 height=16 title=\""._SEEDTORRENT."\" border=0></a>";
                           }
   if ($cfg["advanced_start"])
                           {
                               if($show_run)
                               {
                                   $output .= "<a href=\"#\" onclick=\"StartTorrent('startpop.php?torrent=".urlencode($entry)."')\"><img src=\"images/run_on.gif\" width=16 height=16 title=\""._RUNTORRENT."\" border=0></a>";
                               }
                               else
                               {
                                   $output .= "<a href=\"#\" onclick=\"StartTorrent('startpop.php?torrent=".urlencode($entry)."')\"><img src=\"images/seed_on.gif\" width=16 height=16 title=\""._SEEDTORRENT."\" border=0></a>";
                               }
                           }
                           else
                           {
                               // Quick Start
                               if($show_run)
                               {
                                   $output .= "<a href=\"".$_SERVER['PHP_SELF']."?torrent=".urlencode($entry)."\"><img src=\"images/run_on.gif\" width=16 height=16 title=\""._RUNTORRENT."\" border=0></a>";
                               }
                               else
                               {
                                   $output .= "<a href=\"".$_SERVER['PHP_SELF']."?torrent=".urlencode($entry)."\"><img src=\"images/seed_on.gif\" width=16 height=16 title=\""._SEEDTORRENT."\" border=0></a>";
                               }
                           }
                       }

2. find in functions.php this:
Code
if($kill_id != "" && $af->percent_done >= 0 && $af->running == 1)
           {
               $output .= "<a href=\"index.php?alias_file=".$alias."&kill=".$kill_id."&kill_torrent=".urlencode($entry)."\"><img src=\"images/kill.gif\" width=16 height=16 title=\""._STOPDOWNLOAD."\" border=0></a>";
               $output .= "<img src=\"images/delete_off.gif\" width=16 height=16 border=0>";
           }

and replace it with:
Code
if($kill_id != "" && $af->percent_done >= 0 && $af->running == 1)
           {
               $output .= "&nbsp&nbsp";
               $output .= "<a href=\"index.php?alias_file=".$alias."&kill=".$kill_id."&kill_torrent=".urlencode($entry)."\"><img src=\"images/kill.gif\" width=16 height=16 title=\""._STOPDOWNLOAD."\" border=0></a>";
               $output .= "&nbsp&nbsp";
               $output .= "<img src=\"images/delete_off.gif\" width=16 height=16 border=0>";
$output .= "<input type=\"checkbox\" disabled=\"disabled\">";
           }


3. put thunder.gif in images directory (google ur own and resize it with paint or use mine.)

4.change TF settings to use advanced start dialog = true


the end

screen (checkboxes are from mass delete hack)



ow, if u want to say that I'm so elite php coder and my graphic skills are amazing remember that I dont know php and ms paint is the only graphic edit I have ever used:]


* thunder.gif (0.89 KB, 16x16 - viewed 118 times.)
« Last Edit: 06-09-2006, 09:47:10 by Paczesiowa » Report to moderator   Logged

wallace
Newbie
*
Offline Offline

Posts: 1



View Profile Personal Message (Offline)
« Reply #3 on: 03-23-2007, 11:26:10 » Reply with quote

Well, I know it's an old thread but there are some annoying bugs in the code you gave. I fixed them:

In Functions.php:

Replace
Code:
if (!is_file($cfg["torrent_file_path"].$alias.".pid"))
{
// Allow Avanced start popup?
if ($cfg["advanced_start"])
{
if($show_run)
{
$output .= "<a href=\"#\" onclick=\"StartTorrent('startpop.php?torrent=".urlencode($entry)."')\"><img src=\"images/run_on.gif\" width=16 height=16 title=\""._RUNTORRENT."\" border=0></a>";
}
else
{
$output .= "<a href=\"#\" onclick=\"StartTorrent('startpop.php?torrent=".urlencode($entry)."')\"><img src=\"images/seed_on.gif\" width=16 height=16 title=\""._SEEDTORRENT."\" border=0></a>";
}
}
else
{
// Quick Start
if($show_run)
{
$output .= "<a href=\"".$_SERVER['PHP_SELF']."?torrent=".urlencode($entry)."\"><img src=\"images/run_on.gif\" width=16 height=16 title=\""._RUNTORRENT."\" border=0></a>";
}
else
{
$output .= "<a href=\"".$_SERVER['PHP_SELF']."?torrent=".urlencode($entry)."\"><img src=\"images/seed_on.gif\" width=16 height=16 title=\""._SEEDTORRENT."\" border=0></a>";
}
}

With
Code:
if (!is_file($cfg["torrent_file_path"].$alias.".pid"))
{
// Allow Avanced start popup?
if ($cfg["advanced_start"])
{
if($show_run)
{
$output .= "<a href=\"".$_SERVER['PHP_SELF']."?torrent=".urlencode($entry)."\"><img src=\"images/run_on.gif\" width=16 height=16 title=\""._RUNTORRENT."\" border=0></a>";
$output .= "<a href=\"#\" onclick=\"StartTorrent('startpop.php?torrent=".urlencode($entry)."')\"><img src=\"images/thunder.gif\" width=16 height=16 title=\""._RUNTORRENT."\" border=0></a>";
}
else
{
$output .= "<a href=\"".$_SERVER['PHP_SELF']."?torrent=".urlencode($entry)."\"><img src=\"images/seed_on.gif\" width=16 height=16 title=\""._SEEDTORRENT."\" border=0></a>";
$output .= "<a href=\"#\" onclick=\"StartTorrent('startpop.php?torrent=".urlencode($entry)."')\"><img src=\"images/thunder.gif\" width=16 height=16 title=\""._SEEDTORRENT."\" border=0></a>";

}
}
else
{
// Quick Start
if($show_run)
{
$output .= "<a href=\"".$_SERVER['PHP_SELF']."?torrent=".urlencode($entry)."\"><img src=\"images/run_on.gif\" width=16 height=16 title=\""._RUNTORRENT."\" border=0></a>";
}
else
{
$output .= "<a href=\"".$_SERVER['PHP_SELF']."?torrent=".urlencode($entry)."\"><img src=\"images/seed_on.gif\" width=16 height=16 title=\""._SEEDTORRENT."\" border=0></a>";
}
}

That's pretty much everything ^_^
Report to moderator   Logged
Pages: [1] Go Up Reply Notify of replies Send this topic Print 
« previous next »
Jump to:  


Powered by MySQL Powered by SMF 1.1.1 | SMF © 2006, Simple Machines LLC Powered by PHP