Skip to content
This repository was archived by the owner on Mar 2, 2024. It is now read-only.

Commit a57ee76

Browse files
author
William Entriken
committed
Fixes for bootstrap prettiness
1 parent 2050666 commit a57ee76

File tree

2 files changed

+52
-77
lines changed

2 files changed

+52
-77
lines changed

modules/theme/bootstrap/stats.inc

Lines changed: 51 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,71 @@
11
<?php
22
/**
33
* Displays popular photos and albums,and fun facts such as the amount of time a site has been online
4-
*@author Will Entriken <cameralife@phor.net>
5-
*@copyright Copyright (c) 2001-2009 Will Entriken
6-
*@access public
4+
* @author Will Entriken <cameralife@phor.net>
5+
* @copyright Copyright (c) 2001-2009 Will Entriken
6+
* @access public
77
*/
88

9-
# $cameralife and $album are set by ShowPage()
10-
$cameralife->GetFeature('photostore');
9+
# $cameralife and $album are set by ShowPage()
10+
$cameralife->GetFeature('photostore');
1111

12-
$stats = new Stats;
13-
$counts = $stats->GetCounts();
14-
$popular_photos = $stats->GetPopularPhotos();
15-
$popular_albums = $stats->GetPopularAlbums();
16-
$funfacts = $stats->GetFunFacts();
12+
$stats = new Stats;
13+
$counts = $stats->GetCounts();
14+
$popular_photos = $stats->GetPopularPhotos();
15+
$popular_albums = $stats->GetPopularAlbums();
16+
$funfacts = $stats->GetFunFacts();
1717

18-
$cameralife->Theme->Header($cameralife->GetPref('sitename').' - Stats', 'stats');
18+
$cameralife->Theme->Header($cameralife->GetPref('sitename').' - Stats');
1919
?>
20-
21-
<h1>Uploading Photos</h1>
22-
<ul>
23-
<li>You can upload a photo in JPEG format or a ZIP of JPEG photos
24-
<li>The maximum file size is 20MB.
20+
<h1>Site stats</h1>
21+
<ul class="thumbnails">
22+
<li class="span4">
23+
<div class="thumbnail">
24+
<h2>Most popular photos</h2>
25+
<table class="table table-condensed">
2526
<?php
26-
if ($cameralife->Security->Authorize('admin_file') && !isset($_REQUEST['path']))
27-
echo ' <li>To upload somewhere else, go to that folder and click "upload here"';
27+
foreach ($popular_photos as $photo) {
28+
$percent = $photo->Get('hits') * 100 / $popular_photos[0]->Get('hits');
29+
echo "<tr><td>";
30+
echo "<div style=\"width:50px; clear:left\" class=\"progress progress-info\"><div class=\"bar\" style=\"width: $percent%\"></div></div>";
31+
echo "<td>".number_format($photo->Get('hits'));
32+
echo "<td><a href=\"photo.php&#63;id=".$photo->Get('id').'">'.$photo->Get('description')."</a>\n";
33+
}
2834
?>
29-
</ul>
30-
31-
<div class="row">
32-
<div class="span4">
33-
<h1>Most popular nnphotos</h1>
35+
</table>
36+
</div>
37+
</li>
38+
<li class="span4">
39+
<div class="thumbnail">
40+
<h2>Most popular albums</h2>
41+
<table class="table table-condensed">
3442
<?php
35-
foreach ($popular_photos as $result)
36-
{
37-
if ($i++==3) break;
38-
$icon = $result->GetIcon();
39-
echo '<div class="item"><a href="'.$icon['href'].'"><img src="'.$icon['image'].'" alt="'.$icon['name'].'" /></a>';
40-
echo '<a style="clear: left" href="'.$icon['href'].'">'.$result->Get('hits').' hits</a><span class="description">'.$icon['name'].'</span></div>';
41-
}
43+
foreach ($popular_albums as $photo) {
44+
$percent = $photo->Get('hits') * 100 / $popular_photos[0]->Get('hits');
45+
echo "<tr><td>";
46+
echo "<div style=\"width:50px; clear:left\" class=\"progress progress-success\"><div class=\"bar\" style=\"width: $percent%\"></div></div>";
47+
echo "<td>".number_format($photo->Get('hits'));
48+
echo "<td><a href=\"album.php&#63;id=".$photo->Get('id').'">'.$photo->Get('name')."</a>\n";
49+
}
4250
?>
43-
</div>
44-
</div>
45-
46-
<?php exit(0); ?>
47-
48-
<div id="text">
49-
50-
<h1>Most popular photos</h1>
51-
<ol>
52-
<?php
53-
foreach ($popular_photos as $photo)
54-
{
55-
$percent = $photo->Get('hits') * 100 / $popular_photos[0]->Get('hits');
56-
echo "<li><div class='bar' style='width: ${percent}px; margin-right:".(20+100-$percent)."px'></div>";
57-
echo "<a href=\"photo.php&#63;id=".$photo->Get('id').'">&quot;'.$photo->Get('description')."&quot;</a>\n";
58-
echo "<font size=\"-2\">(".$photo->Get('hits').")</font>\n";
59-
}
60-
?>
61-
</ol>
62-
<ul>
63-
<li>There are <?= number_format($counts['photos']) ?> photos with <?= number_format($counts['photohits']) ?> hits
64-
<li>They contain <?= number_format($counts['pixels']) ?> total pixels
65-
</ul>
66-
67-
<h1>Most popular albums</h1>
68-
<ol>
69-
<?php
70-
foreach ($popular_albums as $album)
71-
{
72-
$percent = $album->Get('hits') * 100 / $popular_albums[0]->Get('hits');
73-
echo "<li><div class='bar' style='width: ${percent}px; margin-right:".(20+100-$percent)."px'></div>";
74-
echo "<a href=\"album.php&#63;id=".$album->Get('id').'">&quot;'.$album->Get('name')."&quot;</a>\n";
75-
echo "<font size=\"-2\">(".$album->Get('hits').")</font>\n";
76-
}
77-
?>
78-
</ol>
79-
<ul>
80-
<li>There are <?= number_format($counts['albums']) ?> albums with <?= number_format($counts['albumhits']) ?> hits
81-
<li>They are in <?= $counts['topics'] ?> topics
82-
</ul>
83-
84-
<h1>Fun facts</h1>
85-
<ul>
86-
<li><?= $cameralife->GetPref('sitename') ?> has been online since <?= $cameralife->GetPref('sitedate') ?> (<b><?= $counts['daysonline'] ?> days</b>).
51+
</table>
52+
</div>
53+
</li>
54+
<li class="span4">
55+
<div class="thumbnail">
56+
<h2>Fun facts</h2>
57+
<ul>
58+
<li><?= $cameralife->GetPref('sitename') ?> has been online since <?= $cameralife->GetPref('sitedate') ?> (<b><?= $counts['daysonline'] ?> days</b>).
8759
<?php
8860
shuffle($funfacts);
8961
for ($i = 0; $i < 3; $i++)
9062
echo '<li>'.$funfacts[$i]."</li>\n";
9163
?>
92-
<li><a href="&#63;">Click here to reload more random facts.</a></li>
93-
</ul>
64+
<li><a href="&#63;">Click here to reload more random facts.</a></li>
65+
</ul>
66+
</div>
67+
</li>
68+
</ul>
9469

9570
<?php
9671
$cameralife->Theme->Footer();

modules/theme/bootstrap/upload.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ else
2121
$folder = new Folder($path);
2222
$icon = $folder->GetIcon();
2323

24-
$cameralife->Theme->Header('Upload photos','photo');
24+
$cameralife->Theme->Header('Upload photos');
2525
?>
2626
<BGSOUND src="<?= $cameralife->base_url ?>/filedone.wav">
2727
<h1>Uploading Photos</h1>

0 commit comments

Comments
 (0)