Page 1 of 1

A few little mods that you might not need, but would enjoy.

PostPosted: Tue Dec 13, 2005 7:19 am
by Antics
I'm going to put each of these little changes into a quote box for easy identification.

DNS Lookup a User's IP wrote:Do you have a user that you wish to look into a just a little?

If you wish to be able to view where your users are comming from, aswell as a few other little tidbits, do this little mod.

Look for under the show_users function:
Code: Select all
$out .= '"> '.$row['u_ip']. '</font></td>';

And change it to:
Code: Select all
$out .= '"><a href="http://www.dnsstuff.com/tools/whois.ch?ip='. $row['u_ip'] .'">'. $row['u_ip'] .'</a></font></td>';


This will change all the user IPs in the user list box into a link, which you can click, and it will show you little peices of information such as the IP's location, the ISP's phone number/contact information (in some cases) and a few other tidbits as it finds them.


Sign up Security wrote:A fancy name, for weak protection.
While I do critcize my own little doing, it worked for what I required.
If you have user signup enabled, and only want certain people to be able to register, do this little addon.

Look for the function KSignup.
Look for:
Code: Select all
if (isset($_POST['adduser']))
{

Add after that:
Code: Select all
if ($_POST['sp'] != "YOUR_PASSWORD_OF_CHOICE") {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Logon || Invalid Security Pass</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<link href="kplay.css" rel="stylesheet" type="text/css" />
Incorrect security password.<br>
Sign up access denied.</b>
<?php
die();
}

After that, go the function below it; nicely named signup_form.
Look for:
Code: Select all
   <tr>
      <td class="wtext"><?php echo get_lang(223); ?></td>
      <td><input type="text" name="email" class="fatbuttom" value="<?php echo fruser('email'); ?>"/></td>
   </tr>


And add after it:
Code: Select all
   <br>
   <tr>
      <td class="wtext">*Sign Up Access Password.<br></td>
      <td><input type="text" name="sp" class="fatbuttom" value=""/></td>
   </tr>


This will make it so only certain users (who you have given the password to) can sign up for your kplaylist.



Next up....One that I enjoyed doing even though it was simple--
Hide options for some users (Perhaps a guest account?) wrote:This is for those that know what they want to hide from certain users.
Personally, I used this little peice to hide the options panel from users using the guest account. (User ID: 6)

Around any peice of code that you want to hide from user(s), put this:
Code: Select all
if (db_guinfo('u_id') != USER_ACCOUNT_ID_HERE) {

Once you decide what you want to stop hiding, simply close the section of code with a bracket:
Code: Select all
}



Example of use would be:
Code: Select all
if (db_guinfo('u_id') != 6) {
$usermisc .= '<input type="button" name="editoptions" value="'.get_lang(92).'" class="fatbuttom" '. 'onclick="javascript: newwin(\'Options\', \''.$PHP_SELF.'?action=editoptions\',330,550);"/>&nbsp;';
            $usermisc .= '<input type="button" name="randomizer" value="'.get_lang(212).'" class="fatbuttom" '. 'onclick="javascript: newwin(\'Randomizer\', \''.$PHP_SELF.'?action=showrandomizer\',350,550);"/>&nbsp;';
}

This would make the options and randomizer buttons dissipear from the view of the guest account.
Note: As I stated, my guest account's id number is 6. This is from my script, so make sure you edit as needed.


A highly requested one...
Show the main directory in a scroll box. wrote:I'm just going to quote myself from a post I did at this topic

Antics wrote:
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. ^_^;

I hope this helps. :)



I have many more little mods if anyone would like me to post them.

Once again, for a final time; make sure you EDIT these modifications before to what YOU require.
I am here for help, but if you ask me why signup security mod doesnt work, and you show me that you still have
if ($_POST['sp'] != "YOUR_PASSWORD_OF_CHOICE") {
in your script, I will refuse to help you.

Re: A few little mods that you might not need, but would enj

PostPosted: Tue Dec 27, 2005 11:54 am
by budy
Antics wrote:I'm going to put each of these little changes into a quote box for easy identification.

DNS Lookup a User's IP wrote:Do you have a user that you wish to look into a just a little?

If you wish to be able to view where your users are comming from, aswell as a few other little tidbits, do this little mod.

Look for under the show_users function:
Code: Select all
$out .= '"> '.$row['u_ip']. '</font></td>';

And change it to:
Code: Select all
$out .= '"><a href="http://www.dnsstuff.com/tools/whois.ch?ip='. $row['u_ip'] .'">'. $row['u_ip'] .'</a></font></td>';


This will change all the user IPs in the user list box into a link, which you can click, and it will show you little peices of information such as the IP's location, the ISP's phone number/contact information (in some cases) and a few other tidbits as it finds them.



Try THis code it will open the info in a new window. That is in my opinion much better.

Code: Select all
$out .= '"><a href="http://www.dnsstuff.com/tools/whois.ch?ip='. $row['u_ip'] .'" target="blank">'. $row['u_ip'] .'</a></font></td>';

Re: A few little mods that you might not need, but would enj

PostPosted: Tue Dec 27, 2005 12:11 pm
by budy
I have many more little mods if anyone would like me to post them.


Yes let me show some more cool mods you have :D

PostPosted: Sat Jun 02, 2007 8:37 pm
by flashwebb
Hi
How have you make that so it will work???

i copy all your code and then change number 6 to 8..and my page is showing nothing instead...it's all white

if (db_guinfo ('u_id') != 8 ) {
$usermisc .= \'<input type="button" name="editoptions" value="\'.get_lang(92).\'" class="fatbuttom" \'. \'onclick="\'.jswin(\'Options\', \'?action=editoptions\',360,590).\'"/> \';
}

peter

Hiding the change password option

PostPosted: Thu Jan 31, 2008 10:03 pm
by jpeeler
Where does this code go?

if (db_guinfo('u_id') != 4) {
$usermisc .= '<input type="button" name="editoptions" value="'.get_lang(92).'" class="fatbuttom" '. 'onclick="javascript: newwin(\'Options\', \''.$PHP_SELF.'?action=editoptions\',330,550);"/>&nbsp;';
$usermisc .= '<input type="button" name="randomizer" value="'.get_lang(212).'" class="fatbuttom" '. 'onclick="javascript: newwin(\'Randomizer\', \''.$PHP_SELF.'?action=showrandomizer\',350,550);"/>&nbsp;';
}