Skip to content

Commit

Permalink
* update wingCSS to 0.1.9
Browse files Browse the repository at this point in the history
 * shorter long title
 * remove unused code
  • Loading branch information
Kcchouette committed Oct 31, 2016
1 parent 3a4ce9a commit 6f6f448
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 24 deletions.
1 change: 0 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
- [ ] Cache can be refreshed (automatic check?)
- [ ] Download the XML file (from URL)? into cache (use the `lastupdate` tag; an epoch time)
- [ ] Possibility of reordering bots/bookmarks in the ADMIN page
- [ ] When adding bot, ask if Website/IRC are the same than the main in the ADMIN page

## For v0.4

Expand Down
2 changes: 1 addition & 1 deletion adding_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<title>' . $title . ' - ' . $lang[$language]["Admin_page"] . '</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/wingcss/0.1.7/wing.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/wingcss/0.1.9/wing.min.css">
<link href="css/main.css" rel="stylesheet">
<link href="css/admin.css" rel="stylesheet">
Expand Down
6 changes: 3 additions & 3 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<title>' . $title . ' - ' . $lang[$language]["Admin_page"] . '</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/wingcss/0.1.7/wing.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/wingcss/0.1.9/wing.min.css">
<link href="css/main.css" rel="stylesheet">
<link href="css/admin.css" rel="stylesheet">
Expand Down Expand Up @@ -52,7 +52,7 @@
echo '<table>';
foreach($bots as $b) {
echo '<tr class="text-center">
<td title="' . $b->getName() . '">' . substr($b->getName(), 0, 16) . '</td>
<td title="' . $b->getName() . '">' . shortText($b->getName(), 16, '...') . '</td>
<td>
<form method="post" action="adding_admin.php">
<fieldset>
Expand Down Expand Up @@ -117,7 +117,7 @@
echo '<table>';
foreach($bookmarks as $b) {
echo '<tr class="text-center">
<td title="' . $b->getName() . '">' . substr($b->getName(), 0, 16) . '</td>
<td title="' . $b->getName() . '">' . shortText($b->getName(), 16, '...') . '</td>
<td>
<form method="post" action="adding_admin.php">
<fieldset>
Expand Down
6 changes: 3 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<title><?php require_once 'config.php'; echo $title; ?></title>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/wingcss/0.1.7/wing.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/wingcss/0.1.9/wing.min.css">

<link href="css/main.css" rel="stylesheet">

Expand Down Expand Up @@ -88,7 +88,7 @@
$bots = getBotList();
echo '<ul>';
foreach($bots as &$bot) {
echo '<li><a class="chbot" href="?bot=' . $bot->getName() . '" title="' . $bot->getName() . '">' . substr($bot->getName(), 0, 22) . '</a></li>';
echo '<li><a class="chbot" href="?bot=' . $bot->getName() . '" title="' . $bot->getName() . '">' . shortText($bot->getName(), 24, '...') . '</a></li>';
}
echo '</ul>'
?>
Expand All @@ -100,7 +100,7 @@
$bookmarks = getBookmarkList();
echo '<ul>';
foreach($bookmarks as &$b) {
echo '<li><a class="chbot" href="?search=' . $b->getStringSearch() . '&amp;bot=' . $b->getBotSearch() . '" title="' . $b->getName() . '">' . substr($b->getName(), 0, 22) . '</a></li>';
echo '<li><a class="chbot" href="?search=' . $b->getStringSearch() . '&amp;bot=' . $b->getBotSearch() . '" title="' . $b->getName() . '">' . shortText($b->getName(), 18, '...') . '</a></li>';
}

echo '</ul>';
Expand Down
2 changes: 1 addition & 1 deletion login.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<title><?php require_once 'config.php'; echo $title . ' - ' . $lang[$language]["Login_page"]; ?></title>


<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/wingcss/0.1.7/wing.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/wingcss/0.1.9/wing.min.css">

<link href="css/main.css" rel="stylesheet">

Expand Down
24 changes: 9 additions & 15 deletions xdcc.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ function haveXMLfile($xmlFile) {
return false;
}

function shortText($string, $countChar, $addCharEnd = '') {
if (strlen($string) <= $countChar)
return $string;
else
return substr($string, 0, $countChar - strlen($addCharEnd)) . $addCharEnd;
}

// return bookmark or bot object
function returnObject($b, $n) {
Expand Down Expand Up @@ -136,28 +142,16 @@ function searchBotXMLFile($b, $n) {
}
}

function showBotList($xml, $bot) {
$dom = '';
foreach($xml->packlist->pack as $p) {
$dom .= '<tr class="mouse_pointer" title="' . $p->packname . '" onclick="javascript:paste(\'' . $bot . '\', ' . $p->packnr . ');">';
$dom .= '<td class="text-center">' . $p->packnr . '</td>';
$dom .= '<td class="text-center">' . $p->packsize . '</td>';
$dom .= '<td>' . $p->packname . '</td>';
$dom .= '</tr>';
}
return $dom;
}

function searchBotList($xml, $bot, $search = null, $onBot = true) {
$dom = '';
foreach($xml->packlist->pack as $p) {
if ($search === null || stripos($p->packname, $search) !== false) {
$dom .= '<tr class="mouse_pointer" title="' . $p->packname . '" onclick="javascript:paste(\'' . $bot . '\', ' . $p->packnr . ');">';
$dom .= '<tr class="mouse_pointer" title="' . $bot . ' &#x2014; ' . $p->packname . '" onclick="javascript:paste(\'' . $bot . '\', ' . $p->packnr . ');">';
if (!$onBot)
$dom .= '<td class="text-center">' . $bot . '</td>';
$dom .= '<td class="text-center">' . shortText($bot, 14, '...') . '</td>';
$dom .= '<td class="text-center">' . $p->packnr . '</td>';
$dom .= '<td class="text-center">' . $p->packsize . '</td>';
$dom .= '<td>' . $p->packname . '</td>';
$dom .= '<td>' . shortText($p->packname, 62, '...') . '</td>';
$dom .= '</tr>';
}
}
Expand Down

0 comments on commit 6f6f448

Please sign in to comment.