This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Ktorrent 2.1.4 webinterface undefined constant torrent_name

Tags: None
(comma "," separated)
rapsys
Registered Member
Posts
71
Karma
0
I have a problem on webinterface :'(

It works now (was not in 2.1), but i have a bug, on webpage (after logged in), i get repeated infinitively that message :
Notice: Use of undefined constant torrent_name - assumed 'torrent_name' in /home/rapsys/- on line 247

Notice: Use of undefined constant total_bytes_to_download - assumed 'total_bytes_to_download' in /home/rapsys/- on line 249

Notice: Use of undefined constant bytes_left_to_download - assumed 'bytes_left_to_download' in /home/rapsys/- on line 250

Notice: Use of undefined constant total_bytes_to_download - assumed 'total_bytes_to_download' in /home/rapsys/- on line 250

I am using stock 2.1.4 version under mandriva 2007, builded tonight (cause of random crash bug in parseRcp as reported in other thread).

May you look at it ?

The coldmilk interface simply not work (not info or torrent said as running), the mobile and default one both show the previous error.
George
Moderator
Posts
5421
Karma
1

Thu Apr 26, 2007 5:20 pm
Strange, I will see if I can reproduce this.
George
Moderator
Posts
5421
Karma
1

Thu Apr 26, 2007 7:16 pm
Seems to be working fine, are you sure things are properly installed, maybe you are still using the old php scripts ?
rapsys
Registered Member
Posts
71
Karma
0

Thu Apr 26, 2007 7:47 pm
I just rebuilded ktorrent-2.1.4 from the tar.gz from website
(after a gzip -d and bzip2 on it)

Here are the md5 :
md5sum /usr/share/apps/ktorrent/www/default/*
d00d85c8fb3a11170c1280c454398d51 /usr/share/apps/ktorrent/www/coldmilk/favicon.ico
35a7077a66f75984e3a272bd3cbdbf1e /usr/share/apps/ktorrent/www/coldmilk/icon.png
md5sum: /usr/share/apps/ktorrent/www/coldmilk/icons: est un répertoire
335cf9310027e3a28e14d80f07b2ccbb /usr/share/apps/ktorrent/www/coldmilk/interface.js
7bd13c0ae3a2fe6d8e1690fc1552cd8a /usr/share/apps/ktorrent/www/coldmilk/interface.php
465b9cbaec59edde42933884d6a532cf /usr/share/apps/ktorrent/www/coldmilk/login.html
2170d90e4c002d34bfde35cd01cf07df /usr/share/apps/ktorrent/www/coldmilk/page_update.js
d8f54ec134656889b2f0397bd9f00918 /usr/share/apps/ktorrent/www/coldmilk/rest.php
205a018a826710dd91c4bb7d8fb43515 /usr/share/apps/ktorrent/www/coldmilk/shutdown.php
116a6627ea3fe6c3ae405f6805709a63 /usr/share/apps/ktorrent/www/coldmilk/style.css
d00d85c8fb3a11170c1280c454398d51 /usr/share/apps/ktorrent/www/default/favicon.ico
4c35024bea1b4a9d9ac00d2a6b135f22 /usr/share/apps/ktorrent/www/default/grad1.jpg
431c0c296bb771bda647df4325098d35 /usr/share/apps/ktorrent/www/default/grad2.jpg
6c2d2175a6f9e422fbe6059c9f714737 /usr/share/apps/ktorrent/www/default/header_tile.png
35a7077a66f75984e3a272bd3cbdbf1e /usr/share/apps/ktorrent/www/default/icon.png
abe671634fa541877b94762cf45eca1a /usr/share/apps/ktorrent/www/default/interface.php
3eb4a36a536fc68e220b56b2eac4710f /usr/share/apps/ktorrent/www/default/ktorrentwebinterfacelogo.png
f0647e7d169b5365b45fb53b346ea011 /usr/share/apps/ktorrent/www/default/login.html
5a504b9f7c3076731853aa0b1dc05691 /usr/share/apps/ktorrent/www/default/remove.png
7d9a20ae7d0929aa55a6a6ff1edc48af /usr/share/apps/ktorrent/www/default/shutdown.php
672030e96e7cf81388106c896ba01571 /usr/share/apps/ktorrent/www/default/start.png
69b3790121272917db711c25fa96855b /usr/share/apps/ktorrent/www/default/stop.png
db197322febf2692dfb7532a227157aa /usr/share/apps/ktorrent/www/default/style.css
4c3529063f7ad4f2491af8a2ac4e7a8f /usr/share/apps/ktorrent/www/default/stylen.css
4b5637538f398ca501422bf9799d2435 /usr/share/apps/ktorrent/www/default/wz_tooltip.js
d00d85c8fb3a11170c1280c454398d51 /usr/share/apps/ktorrent/www/mobile/favicon.ico
9ce058312bc27a6ea81ff88e66244b6e /usr/share/apps/ktorrent/www/mobile/interface.php
3eb4a36a536fc68e220b56b2eac4710f /usr/share/apps/ktorrent/www/mobile/ktorrentwebinterfacelogo.png
84074a6acb57f366a79451dd6d39feec /usr/share/apps/ktorrent/www/mobile/login.html
fa59214591a962cf68e430fa3ff3a1b0 /usr/share/apps/ktorrent/www/mobile/remove.png
4f56cab1f461947aa1539908aa21e38c /usr/share/apps/ktorrent/www/mobile/settings.php
00f5a9af665b0ee22b75e14c216353e4 /usr/share/apps/ktorrent/www/mobile/start.png
9e998d466edad4bde4a89b9a670e4a41 /usr/share/apps/ktorrent/www/mobile/stop.png
665c00578f12a1be3c53fd7442e5bfda /usr/share/apps/ktorrent/www/mobile/torrent.php

My phpinfo in cmdline :
phpinfo()
PHP Version => 5.1.6

System => Linux rapsys.eu 2.6.20-tmb-desktop-2mdv #1 Thu Feb 8 08:40:14 EST 2007 i686
Build Date => Feb 21 2007 18:27:10
Configure Command => This is irrelevant, look inside the /usr/share/doc/libphp5_common5-5.1.6/configure_command file. urpmi is your friend, use it to install extensions not shown below.
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php.ini
Scan this dir for additional .ini files => /etc/php.d
additional .ini files parsed => /etc/php.d/12_ctype.ini,
/etc/php.d/22_ftp.ini,
/etc/php.d/23_gd.ini,
/etc/php.d/24_gettext.ini,
/etc/php.d/26_iconv.ini,
/etc/php.d/29_mbstring.ini,
/etc/php.d/30_mcrypt.ini,
/etc/php.d/36_mysql.ini,
/etc/php.d/37_mysqli.ini,
/etc/php.d/41_pcre.ini,
/etc/php.d/43_posix.ini,
/etc/php.d/47_session.ini,
/etc/php.d/49_simplexml.ini,
/etc/php.d/54_hash.ini,
/etc/php.d/57_sysvsem.ini,
/etc/php.d/58_sysvshm.ini,
/etc/php.d/60_tokenizer.ini,
/etc/php.d/62_xml.ini,
/etc/php.d/62_xmlrpc.ini,
/etc/php.d/63_xmlreader.ini,
/etc/php.d/64_xmlwriter.ini

PHP API => 20041225
PHP Extension => 20050922
Zend Extension => 220051025
Debug Build => no
Thread Safety => disabled
Zend Memory Manager => enabled
IPv6 Support => enabled
Registered PHP Streams => php, file, http, ftp, compress.zlib, https, ftps
Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
Registered Stream Filters => string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, zlib.*, convert.iconv.*

Configuration

PHP Core

Directive => Local Value => Master Value
allow_call_time_pass_reference => Off => Off
allow_url_fopen => On => On
always_populate_raw_post_data => Off => Off
arg_separator.input => & => &
arg_separator.output => & => &
asp_tags => Off => Off
auto_append_file => no value => no value
auto_globals_jit => On => On
auto_prepend_file => no value => no value
browscap => no value => no value
default_charset => utf-8 => utf-8
default_mimetype => text/html => text/html
define_syslog_variables => Off => Off
disable_classes => no value => no value
disable_functions => no value => no value
display_errors => On => On
display_startup_errors => Off => Off
doc_root => no value => no value
docref_ext => no value => no value
docref_root => no value => no value
enable_dl => On => On
error_append_string => no value => no value
error_log => no value => no value
error_prepend_string => no value => no value
error_reporting => 4095 => 4095
expose_php => On => On
extension_dir => /usr/lib/php/extensions => /usr/lib/php/extensions
file_uploads => On => On
highlight.bg => #FFFFFF => #FFFFFF
highlight.comment => #FF8000 => #FF8000
highlight.default => #0000BB => #0000BB
highlight.html => #000000 => #000000
highlight.keyword => #007700 => #007700
highlight.string => #DD0000 => #DD0000
html_errors => Off => On
ignore_repeated_errors => Off => Off
ignore_repeated_source => Off => Off
ignore_user_abort => Off => Off
implicit_flush => On => Off
include_path => .:/usr/lib/php/:/usr/share/pear/ => .:/usr/lib/php/:/usr/share/pear/
log_errors => On => On
log_errors_max_len => 1024 => 1024
magic_quotes_gpc => Off => Off
magic_quotes_runtime => Off => Off
magic_quotes_sybase => Off => Off
mail.force_extra_parameters => no value => no value
max_execution_time => 0 => 30
max_input_time => -1 => 60
memory_limit => 32M => 32M
open_basedir => no value => no value
output_buffering => 0 => 4096
output_handler => no value => no value
post_max_size => 8M => 8M
precision => 14 => 14
realpath_cache_size => 16K => 16K
realpath_cache_ttl => 120 => 120
register_argc_argv => On => Off
register_globals => Off => Off
register_long_arrays => On => On
report_memleaks => On => On
report_zend_debug => Off => Off
safe_mode => Off => Off
safe_mode_exec_dir => no value => no value
safe_mode_gid => Off => Off
safe_mode_include_dir => no value => no value
sendmail_from => no value => no value
sendmail_path => /usr/sbin/sendmail -t -i => /usr/sbin/sendmail -t -i
serialize_precision => 100 => 100
short_open_tag => On => On
SMTP => localhost => localhost
smtp_port => 25 => 25
sql.safe_mode => Off => Off
track_errors => Off => Off
unserialize_callback_func => no value => no value
upload_max_filesize => 2M => 2M
upload_tmp_dir => no value => no value
user_dir => no value => no value
variables_order => EGPCS => EGPCS
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
y2k_compliance => On => On
zend.ze1_compatibility_mode => Off => Off

ctype

ctype functions => enabled

date

date/time support => enabled
Timezone Database Version => 2006.1
Timezone Database => internal

Default timezone => Europe/Berlin

Directive => Local Value => Master Value
date.default_latitude => 31.7667 => 31.7667
date.default_longitude => 35.2333 => 35.2333
date.sunrise_zenith => 90.583333 => 90.583333
date.sunset_zenith => 90.583333 => 90.583333
date.timezone => no value => no value

ftp

FTP support => enabled

gd

GD Support => enabled
GD Version => 2.0 or higher
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.2.1
GIF Read Support => enabled
GIF Create Support => enabled
JPG Support => enabled
PNG Support => enabled
WBMP Support => enabled

gettext

GetText Support => enabled

hash

hash support => enabled
Hashing Engines => md4 md5 sha1 sha256 sha384 sha512 ripemd128 ripemd160 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru gost adler32 crc32 crc32b haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5

iconv

iconv support => enabled
iconv implementation => glibc
iconv library version => 2.4

Directive => Local Value => Master Value
iconv.input_encoding => ISO-8859-1 => ISO-8859-1
iconv.internal_encoding => ISO-8859-1 => ISO-8859-1
iconv.output_encoding => ISO-8859-1 => ISO-8859-1

libxml

libXML support => active
libXML Version => 2.6.26
libXML streams => enabled

mbstring

Multibyte Support => enabled
Multibyte string engine => libmbfl
Multibyte (japanese) regex support => enabled
Multibyte regex (oniguruma) version => 3.7.1

mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.

Directive => Local Value => Master Value
mbstring.detect_order => no value => no value
mbstring.encoding_translation => Off => Off
mbstring.func_overload => 0 => 0
mbstring.http_input => pass => pass
mbstring.http_output => pass => pass
mbstring.internal_encoding => ISO-8859-1 => no value
mbstring.language => neutral => neutral
mbstring.strict_detection => Off => Off
mbstring.substitute_character => no value => no value

mcrypt

mcrypt support => enabled
Version => 2.5.7
Api No => 20021217
Supported ciphers => arcfour blowfish-compat blowfish cast-128 cast-256 des enigma gost loki97 rc2 rijndael-128 rijndael-192 rijndael-256 safer-sk128 safer-sk64 saferplus serpent threeway tripledes twofish wake xtea
Supported modes => cbc cfb ctr ecb ncfb nofb ofb stream

Directive => Local Value => Master Value
mcrypt.algorithms_dir => no value => no value
mcrypt.modes_dir => no value => no value

mysql

MySQL Support => enabled
Active Persistent Links => 0
Active Links => 0
Client API version => 5.0.24a
MYSQL_MODULE_TYPE =>
MYSQL_SOCKET => /var/lib/mysql/mysql.sock
MYSQL_INCLUDE =>
MYSQL_LIBS =>

Directive => Local Value => Master Value
mysql.allow_persistent => On => On
mysql.connect_timeout => 60 => 60
mysql.default_host => no value => no value
mysql.default_password => no value => no value
mysql.default_port => no value => no value
mysql.default_socket => no value => no value
mysql.default_user => no value => no value
mysql.max_links => Unlimited => Unlimited
mysql.max_persistent => Unlimited => Unlimited
mysql.trace_mode => Off => Off

mysqli

MysqlI Support => enabled
Client API library version => 5.0.24a
Client API header version => 5.0.24a
MYSQLI_SOCKET => /var/lib/mysql/mysql.sock

Directive => Local Value => Master Value
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => no value => no value
mysqli.default_user => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.reconnect => Off => Off

openssl

OpenSSL support => enabled
OpenSSL Version => OpenSSL 0.9.8b 04 May 2006

pcre

PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 6.7 04-Jul-2006

posix

Revision => $Revision: 1.70.2.3 $

Reflection

Reflection => enabled
Version => $Id: php_reflection.c,v 1.164.2.33 2006/03/29 14:28:42 tony2001 Exp $

session

Session Support => enabled
Registered save handlers => files user
Registered serializer handlers => php php_binary

Directive => Local Value => Master Value
session.auto_start => Off => Off
session.bug_compat_42 => On => On
session.bug_compat_warn => On => On
session.cache_expire => 180 => 180
session.cache_limiter => nocache => nocache
session.cookie_domain => no value => no value
session.cookie_lifetime => 0 => 0
session.cookie_path => / => /
session.cookie_secure => Off => Off
session.entropy_file => no value => no value
session.entropy_length => 0 => 0
session.gc_divisor => 100 => 100
session.gc_maxlifetime => 1440 => 1440
session.gc_probability => 0 => 0
session.hash_bits_per_character => 4 => 4
session.hash_function => 0 => 0
session.name => PHPSESSID => PHPSESSID
session.referer_check => no value => no value
session.save_handler => files => files
session.save_path => /var/lib/php => /var/lib/php
session.serialize_handler => php => php
session.use_cookies => On => On
session.use_only_cookies => Off => Off
session.use_trans_sid => 0 => 0

SimpleXML

Simplexml support => enabled
Revision => $Revision: 1.151.2.22 $
Schema support => enabled

SPL

SPL support => enabled
Interfaces => Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
Classes => AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, DirectoryIterator, DomainException, EmptyIterator, FilterIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RuntimeException, SplFileInfo, SplFileObject, SplObjectStorage, SplTempFileObject, UnderflowException, UnexpectedValueException

standard

Regex Library => Bundled library enabled
Dynamic Library Support => enabled
Path to sendmail => /usr/sbin/sendmail -t -i

Directive => Local Value => Master Value
assert.active => 1 => 1
assert.bail => 0 => 0
assert.callback => no value => no value
assert.quiet_eval => 0 => 0
assert.warning => 1 => 1
auto_detect_line_endings => 0 => 0
default_socket_timeout => 60 => 60
safe_mode_allowed_env_vars => PHP_ => PHP_
safe_mode_protected_env_vars => LD_LIBRARY_PATH => LD_LIBRARY_PATH
url_rewriter.tags => a=href,area=href,frame=src,input=src,form=,fieldset= => a=href,area=href,frame=src,input=src,form=,fieldset=
user_agent => no value => no value

tokenizer

Tokenizer Support => enabled

xml

XML Support => active
XML Namespace Support => active
EXPAT Version => expat_1.95.8

xmlreader

XMLReader => enabled

xmlrpc

core library version => xmlrpc-epi v. 0.51
php extension version => 0.51
author => Dan Libby
homepage => http://xmlrpc-epi.sourceforge.net
open sourced by => Epinions.com

xmlwriter

XMLWriter => enabled

zlib

ZLib Support => enabled
Stream Wrapper support => compress.zlib://
Stream Filter support => zlib.inflate, zlib.deflate
Compiled Version => 1.2.3
Linked Version => 1.2.3

Directive => Local Value => Master Value
zlib.output_compression => Off => Off
zlib.output_compression_level => -1 => -1
zlib.output_handler => no value => no value

Additional Modules

Module Name
sysvsem
sysvshm
dvj
Registered Member
Posts
19
Karma
0
rapsys wrote:I have a problem on webinterface :'(

It works now (was not in 2.1), but i have a bug, on webpage (after logged in), i get repeated infinitively that message :
Notice: Use of undefined constant torrent_name - assumed 'torrent_name' in /home/rapsys/- on line 247


This is likely because the default webinterface accesses variables in an array like this: globalinfo[download_speed] rather than globalinfo['download_speed'].

The best solution to this warning would be to access the variables like mentioned. A dirty workaround would be to add the following line at the top (after <?php)
error_reporting(0);


The coldmilk interface simply not work (not info or torrent said as running).


Just out of curiosity; what browser do you use? Do you have javascript enabled?
rapsys
Registered Member
Posts
71
Karma
0

Sat Apr 28, 2007 9:59 pm
I have konqueror 3.5.4 browser from mandriva 2007.0 with javascript activated.

I see where is the problem now, this php code is COMPLETELY INVALID **** !!!

When you want access a member you NEED use it (dot concatenation) :
<?php echo "<title>(D:".$globalinfo['download_speed'].") (U:".$globalinfo['upload_speed'].") KTorrent</title>"; ?>
Or (block delimiter for array variable) :
<?php echo "<title>(D:{$globalinfo['download_speed']}) (U:{$globalinfo['upload_speed']}) KTorrent</title>"; ?>

AND ALWAY quote the key or array accessed if it's not a number or a defined value (with : define('somename', 'somevalue');)

Plz rewrite the code in valid php, here is the patch :
Code: Select all
--- /usr/share/apps/ktorrent/www/default/interface.php~ 2007-04-22 13:25:45.000000000 +0200
+++ /usr/share/apps/ktorrent/www/default/interface.php  2007-04-28 23:53:14.354227806 +0200
@@ -17,8 +17,7 @@
     <meta http-equiv="Content-Type" content="text/html"/>
     <link rel="icon" href="favicon.ico" type="image/x-icon"/>
     <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
-    <?php echo "<title>(D:$globalinfo[download_speed]) (U:$globalinfo[upload_speed]) KTorrent</title>";
-    ?>
+    <title><?php echo '(D:'.$globalinfo['download_speed'].') (U:'.$globalinfo['upload_speed'].') KTorrent'; ?></title>
     <script language="JavaScript">

        function validate()
@@ -97,7 +96,7 @@
                              Upload speed
                           </td>
                           <td>
-                            <input type="text" name="maximum_upload_rate" value="<?php echo $globalinfo[max_upload_speed]; ?>" class="settingsInput" />
+                            <input type="text" name="maximum_upload_rate" value="<?php echo $globalinfo['max_upload_speed']; ?>" class="settingsInput" />
                           </td>
                         </tr>
                         <tr>
@@ -105,7 +104,7 @@
                              Download speed
                           </td>
                           <td>
-                            <input type="text" name="maximum_download_rate" value="<?php echo $globalinfo[max_download_speed]; ?>" class="settingsInput" />
+                            <input type="text" name="maximum_download_rate" value="<?php echo $globalinfo['max_download_speed']; ?>" class="settingsInput" />
                           </td>
                         </tr>
                         <tr>
@@ -113,7 +112,7 @@
                              Maximum downloads
                           </td>
                           <td>
-                            <input type="text" name="maximum_downloads" value="<?php echo $globalinfo[max_downloads]; ?>" class="settingsInput" />
+                            <input type="text" name="maximum_downloads" value="<?php echo $globalinfo['max_downloads']; ?>" class="settingsInput" />
                           </td>
                         </tr>
                         <tr>
@@ -121,7 +120,7 @@
                              MaximumSeeds
                           </td>
                           <td>
-                            <input type="text" name="maximum_seeds" value="<?php echo $globalinfo[max_seeds]; ?>" class="settingsInput" />
+                            <input type="text" name="maximum_seeds" value="<?php echo $globalinfo['max_seeds']; ?>" class="settingsInput" />
                           </td>
                         </tr>
                         <tr>
@@ -236,21 +235,21 @@
                                foreach ($stats as $torrent) {
                                        echo "<tr>";

-                                       $torrent_name = str_replace("'", "\'", $torrent[torrent_name]);
+                                       $torrent_name = str_replace("'", "\'", $torrent['torrent_name']);

-                                       if($torrent[total_bytes_to_download]!=0)
-                                               $perc = round(100.0 - ($torrent[bytes_left_to_download] / $torrent[total_bytes_to_download]) * 100.0, 2);
+                                       if($torrent['total_bytes_to_download']!=0)
+                                               $perc = round(100.0 - ($torrent['bytes_left_to_download'] / $torrent['total_bytes_to_download']) * 100.0, 2);
                                        else
                                                $perc = 0;
                                        echo "<td><a href=\"interface.php?stop=$a\" title=\"STOP\"><img src=\"/stop.png\" name=\"stop\" width=\"16\" height=\"16\" border=\"0\" style=\"padding:2px;\"></a>";
                                        echo "<a href=\"interface.php?start=$a\" title=\"START\"><img src=\"/start.png\" name=\"start\" width=\"16\" height=\"16\" border=\"0\" style=\"padding:2px;\"></a>";
                                        echo "<a href=\"interface.php?remove=$a\" title=\"REMOVE\" onClick=\"return validate()\"><img src=\"/remove.png\" name=\"remove\" width=\"16\" height=\"16\" border=\"0\" style=\"padding:2px;\"></a></td>";
-                                       echo "<td style=\"text-align:left;\" onmouseover=\"this.T_TITLE='$torrent_name';return escape('Download speed:<strong>$torrent[download_rate]</strong><br> Upload speed:<strong>$torrent[upload_rate]</strong></td>')\">";
-                                       if(strlen($torrent[torrent_name])>30)
-                                               echo substr($torrent[torrent_name], 0, 30) . " ...</td>";
+                                       echo "<td style=\"text-align:left;\" onmouseover=\"this.T_TITLE='$torrent_name';return escape('Download speed:<strong>{$torrent['download_rate']}</strong><br> Upload speed:<strong>{$torrent['upload_rate']}</strong></td>')\">";
+                                       if(strlen($torrent['torrent_name'])>30)
+                                               echo substr($torrent['torrent_name'], 0, 30) . " ...</td>";
                                        else
-                                               echo "$torrent[torrent_name]</td>";
-                                       switch ($torrent[status]) {
+                                               echo $torrent['torrent_name']."</td>";
+                                       switch ($torrent['status']) {
                                                case 0:
                                                        echo "<td>Not Started</td>";
                                                        break;
@@ -287,12 +286,12 @@
                                                default:
                                                        echo "<td>Not supported Status</td>";
                                        }
-                                       echo "<td style=\"text-align:right;\">$torrent[bytes_downloaded]</td>";
-                                       echo "<td style=\"text-align:right; padding-left:8px;\">$torrent[total_bytes]</td>";
-                                       echo "<td style=\"text-align:right; padding-left:8px;\">$torrent[bytes_uploaded]</td>";
-                                       echo "<td style=\"text-align:right;\">$torrent[download_rate]</td>";
-                                       echo "<td style=\"text-align:right;\">$torrent[upload_rate]</td>";
-                                       echo "<td>$torrent[num_peers]</td>";
+                                       echo "<td style=\"text-align:right;\">{$torrent['bytes_downloaded']}</td>";
+                                       echo "<td style=\"text-align:right; padding-left:8px;\">{$torrent['total_bytes']}</td>";
+                                       echo "<td style=\"text-align:right; padding-left:8px;\">{$torrent['bytes_uploaded']}</td>";
+                                       echo "<td style=\"text-align:right;\">{$torrent['download_rate']}</td>";
+                                       echo "<td style=\"text-align:right;\">{$torrent['upload_rate']}</td>";
+                                       echo "<td>{$torrent['num_peers']}</td>";
                                        echo "<td style=\"text-align:right;\">$perc %</td>";
                                        echo "</tr>";
                                $a++;
George
Moderator
Posts
5421
Karma
1

Mon Apr 30, 2007 5:41 pm
Could you send that in a file ? Copy pasting patches from the forum usually results in having to apply the patch manually.

Btw, concerning coldmilk, there were some bugs with parsing the cookies, I fixed this some days ago. This resulted in the torrents sometimes not showing.
rapsys
Registered Member
Posts
71
Karma
0

Mon Apr 30, 2007 8:16 pm
Patch is here :
http://rapsys.free.fr/ktorrent/2.1.4/kt ... -fix.patch

Notice i didn't looked for other .php file, maybe^Wcertainly other need a fix too.
George
Moderator
Posts
5421
Karma
1

Tue May 01, 2007 11:53 am
OK, patch applied, I also went over the mobile code, and fixed the same problems there.
Mailaender
Registered Member
Posts
20
Karma
0
OS

Mon May 21, 2007 6:35 pm
Thanks for the fixes. They seem to stop the frequent webinterface logouts, which were very annoying.

I used 2.1.4 from Ubuntu Feisty Repos before and now downloaded ktorrent_2.2~0dev~r666678 from 20-May-2007 for everyone who has similiar problems.

The Java-Script enhanced coldmilk skin is really nice. Good work!


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot]