TorrentFlux.com Welcome, Guest. Please login or register.
03-12-2010, 01:28:56
Home Help Search Login Register donate
TorrentFlux Home | TorrentFlux Hosting

+  TorrentFlux Forums
|-+  Code Hacks and Tools
| |-+  TorrentFlux 2.1 Hacks
| | |-+  TF index page on 1024x760 resolution
« previous next »
Pages: [1] Go Down Print
Author Topic: TF index page on 1024x760 resolution  (Read 2560 times)
agentsmith
Newbie
*
Offline Offline

Posts: 20




View Profile
« on: 04-12-2006, 07:02:51 »

Just edit index.php and in line 694 instead width="760" write width="990"

Replace
Code:
<table border="0" cellpadding="0" cellspacing="0" width="760">

with
Code:
<table border="0" cellpadding="0" cellspacing="0" width="990">
Also U can do it with any other page, but there is not need for that.
« Last Edit: 04-12-2006, 07:27:57 by agentsmith » Logged

Never send a human to do a machine job.!!!

SERVER: Ubuntu 5.10 | Intel 850MHz | 256MB Ram| Linux 2.6.12-9-386 | Apache/2.0.54 | PHP 4.4.0-3ubuntu2 | Python 2.4.2 | MySQL 4.0.24 |
D_V
Newbie
*
Offline Offline

Posts: 9



View Profile
« Reply #1 on: 04-13-2006, 09:01:00 »

And if you put:
Code:
<table border="0" cellpadding="0" cellspacing="0" width="100%">

Instead, it will automagically adjust to your screen, usefull when more users with different resolution.
Logged
Alfaspyke
Newbie
*
Offline Offline

Posts: 2



View Profile
« Reply #2 on: 04-18-2006, 11:05:01 »

Hi!
Great tip!
It really works wonders on my 1650x1050 resolution!

However where is the "magic" parameter to adjust the stringlength for the torrentfile on the index page?
Right now it seems to be restricted to 43'ish chararcters and the rest of the text is truncated with '...'

It would be really nice if the length of the string would be altered automatically to fit the coloumn!

Any tips or hints on this would be nice! Smiley

Cheers
Logged
D_V
Newbie
*
Offline Offline

Posts: 9



View Profile
« Reply #3 on: 04-18-2006, 15:55:56 »

However where is the "magic" parameter to adjust the stringlength for the torrentfile on the index page?
Right now it seems to be restricted to 43'ish chararcters and the rest of the text is truncated with '...'

It would be really nice if the length of the string would be altered automatically to fit the coloumn!

Any tips or hints on this would be nice! Smiley


Right here:
in functions.php, find:
Code:
$displayname = substr($entry, 0, 44);

You can just modify the number 44 to suit ur needs..

EDIT:
You might also change this:
Code:
if(strlen($entry) >= 47)
Change the 47 to whatever number of chars it should start truncating on.
« Last Edit: 04-18-2006, 16:10:37 by D_V » Logged
PiForever
Full Member
***
Offline Offline

TF Base: Linux 2.x
Posts: 144





View Profile
« Reply #4 on: 04-18-2006, 16:34:32 »

And if you put:
Code:
<table border="0" cellpadding="0" cellspacing="0" width="100%">

Instead, it will automagically adjust to your screen, usefull when more users with different resolution.


neat!!!...i wonder why this is not default  Huh? Huh?
Logged

Apache 2.0.54-MySQL 4.1.19-PHP 2.0.4-Perl 5.8.6-Fedora 4
TorrentFlux.2.1-b4rt
ryaner
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 919





View Profile
« Reply #5 on: 04-18-2006, 17:16:08 »

neat!!!...i wonder why this is not default  Huh? Huh?

Set it to 100%, then make your screen small and watch what happens Wink
Qrome has said that a proper template system is planned for sometime in the future so maybe it'll all be properly fixed then.
Logged

SERVER: Debian Sarge 2.6.16| AMD XP2000+ | 1.5GB Ram  | 1.6T - Raid 5 | TF 2.1 | Apache 2.0.54 | PHP 4.3.10 | MySQL 4.1.11 | Mod/Hacks: XFER Transfer Stats/Multi Torrent Delete/Seed Time Hack/Ajax Details/Torrent Details/RSS Hack
Alfaspyke
Newbie
*
Offline Offline

Posts: 2



View Profile
« Reply #6 on: 04-19-2006, 11:23:54 »

Right here:
in functions.php, find:
Code:
$displayname = substr($entry, 0, 44);

You can just modify the number 44 to suit ur needs..

EDIT:
You might also change this:
Code:
if(strlen($entry) >= 47)
Change the 47 to whatever number of chars it should start truncating on.

Ok Cool! Smiley

But that is still hardcoding the stringlength.
Is it any way to make the length dependent on the size of the coloumn?
Something like
Code:
if(strlen($entry) >= sizeof(coloumn[max]))

I do not know if that is possible with php and the way TF is coded, but that would be really neat!! Cool
Hardcoding the string will work for now Smiley

Thanks!!
Logged
D_V
Newbie
*
Offline Offline

Posts: 9



View Profile
« Reply #7 on: 04-19-2006, 12:13:23 »

It is not possible on PHP, but you could proberbly make it in javascript... which is out of my expertise..

he he...
Logged
Anaerin
Newbie
*
Offline Offline

TF Base: Linux 2.x
Posts: 2




View Profile
« Reply #8 on: 05-02-2006, 13:52:48 »

It is not possible on PHP, but you could proberbly make it in javascript... which is out of my expertise..

he he...

IIRC, you can use "Overflow: hidden" in the CSS for the cell to make it chop the end off. And in IE you can use "text-overflow: ellipsis;" to get a ... on the end, rather than a hard chop.
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  


Login with username, password and session length

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