Put the directory list in a scrollable window

Frequently asked questions with answers

Put the directory list in a scrollable window

Postby Chaos » Sun Oct 09, 2005 6:02 pm

Is there any way to make the directory listing that appares on the right of the screen go into a scrollable window? because i think it would look cleaner if u could just scroll through the directories without scrolling down the whole page.
Chaos
 
Posts: 1
Joined: Sun Oct 09, 2005 5:53 pm

Re: Put the directory list in a scrollable window

Postby aba » Sun Oct 09, 2005 6:20 pm

Chaos wrote:Is there any way to make the directory listing that appares on the right of the screen go into a scrollable window? because i think it would look cleaner if u could just scroll through the directories without scrolling down the whole page.


Well, you could by using a iframe/frame. I am currently moving all HTML related code into a suited place to support themes and such. If you know a bit HTML, you will easily be able to customize your kP to suit this scrolling idea you have (in the next build.)

Åge
aba
Site Admin
 
Posts: 2325
Joined: Wed May 08, 2002 9:19 am

Css

Postby Blackax » Mon Oct 24, 2005 11:08 pm

You can also do it with css. this is what i do
Code: Select all
 HTML Code
<div id="container">Code you want to scroll</div>
Css code
#container
{
overflow: auto;
}
You could also do this in Tables but div's are better for more complex css
Blackax
 
Posts: 27
Joined: Tue Apr 19, 2005 7:49 am

Postby theillien » Wed Oct 26, 2005 11:46 pm

I too, wish to allow for a scrollable window. And though I'm learning a HTML all the time as well as a bit of PHP, I'm clueless as to which section of code to place between the <div> tags. Any further help would be appreciated.

Thanks
theillien
 
Posts: 11
Joined: Sun Oct 16, 2005 10:29 pm
Location: Alexandria, VA

Postby Antics » Sat Nov 26, 2005 4:45 pm

theillien wrote:I too, wish to allow for a scrollable window. And though I'm learning a HTML all the time as well as a bit of PHP, I'm clueless as to which section of code to place between the <div> tags. Any further help would be appreciated.

Thanks

Look for the function listroot, in there, look for
Code: Select all
if ($cfg['sortroot']) array_multisort($sortlist, $drivelist, $nrlist, SORT_STRING);

above that line, insert
Code: Select all
echo '<div id="dir">';


At the ending of the function, change it so it closes the div.
Code: Select all
         $fcnt++;
         print_file($row[0],0,1);
      }
   }
   echo '</div><br>';   
}


Now, to get rid of the table layout, look for the function called print_dir.

In here, change two lines.
First, the beginning $out variable is to be changes to null.
Code: Select all
   if (!empty($pdir)) $pdir_64 = base64_encode($pdir); else $pdir_64='';
   $out = '';
   if ($showalbum)
   {

As the function ends, it prints a second end to the string, such as to close the table.
Code: Select all
   $out .= '<br>';
   return $out;
}

This will make each album appear on a new line.

Finally, you have to setup kplaylist for an external style sheet.
Once you have downloaded the style sheet, open it, and add this on the bottom of the file:
Code: Select all
#dir
{
scrollbar-face-color: #0000CC;
scrollbar-highlight-color: #0066CC;
scrollbar-3dlight-color: #0099FF;
scrollbar-shadow-color: #333333;
scrollbar-darkshadow-color: #000000;
scrollbar-arrow-color: #9933FF;
scrollbar-track-color: #660099;
width: 200px;
height: 550px;
overflow: auto;
padding: 50px;
}

This is the style for how it will show the scrollbars.

Its a long and somewhat complicated walkthrough, but I don't have the time to do screenshots, sorry. ^_^;
You can see what my page looks like by clicking here.

I hope this helps. :)
Antics
 
Posts: 12
Joined: Sat Nov 26, 2005 4:32 pm
Location: Washington, USA


Return to FAQ



cron