Changeset 1512 in ExiteCMS
- Timestamp:
- 07/02/08 18:58:52 (4 years ago)
- Location:
- themes/PLi-Fusion
- Files:
-
- 3 added
- 13 edited
-
PLiTheme/php-files/themes/PLiTheme/images/page_delete_grey.gif (added)
-
PLiTheme/php-files/themes/PLiTheme/images/top-right.png (modified) (previous)
-
PLiTheme/php-files/themes/PLiTheme/templates/templates/_header.tpl (modified) (3 diffs)
-
PLiTheme/php-files/themes/PLiTheme/templates/templates/_stylesheets.tpl (modified) (2 diffs)
-
PLiTheme/php-files/themes/PLiTheme/theme_functions.php (modified) (5 diffs)
-
PLiThemeCentered/php-files/themes/PLiThemeCentered/images/page_delete_grey.gif (added)
-
PLiThemeCentered/php-files/themes/PLiThemeCentered/images/top-right.png (modified) (previous)
-
PLiThemeCentered/php-files/themes/PLiThemeCentered/templates/templates/_header.tpl (modified) (3 diffs)
-
PLiThemeCentered/php-files/themes/PLiThemeCentered/templates/templates/_stylesheets.tpl (modified) (2 diffs)
-
PLiThemeCentered/php-files/themes/PLiThemeCentered/theme_functions.php (modified) (5 diffs)
-
PLiXmas/php-files/themes/PLiXmas/images/page_delete_grey.gif (added)
-
PLiXmas/php-files/themes/PLiXmas/images/top.gif (modified) (previous)
-
PLiXmas/php-files/themes/PLiXmas/templates/templates/_header.tpl (modified) (1 diff)
-
PLiXmas/php-files/themes/PLiXmas/templates/templates/_stylesheets.tpl (modified) (1 diff)
-
PLiXmas/php-files/themes/PLiXmas/theme.php (modified) (1 diff)
-
PLiXmas/php-files/themes/PLiXmas/theme_functions.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
themes/PLi-Fusion/PLiTheme/php-files/themes/PLiTheme/templates/templates/_header.tpl
r1411 r1512 205 205 </tr> 206 206 </table> 207 <div style='margin-left:auto;margin-right:auto;width:{$smarty.const.THEME_WIDTH}px;height:120px;margin-top:-12 1px;'>207 <div style='margin-left:auto;margin-right:auto;width:{$smarty.const.THEME_WIDTH}px;height:120px;margin-top:-122px;'> 208 208 <div id='bars' style='float:right;height:100px;'> 209 209 <table class='bargraph'> … … 213 213 {section name=index loop=$downloadbars} 214 214 <td width='40'> 215 < img src='/themes/PLiThemeCentered/images/bar-{$smarty.section.index.rownum}.gif' style='width:16px;height:{$downloadbars[index].value}px;' alt='{$downloadbars[index].download_count}' title='{$downloadbars[index].percentage}%: {$downloadbars[index].download_count} {$locale.087}'/>215 <a href='/downloads.php?cat_id={$downloadbars[index].download_cat}&download_id={$downloadbars[index].download_id}' title=''><img src='/themes/PLiTheme/images/bar-{$smarty.section.index.rownum}.gif' style='width:16px;height:{$downloadbars[index].value}px;' alt='{$downloadbars[index].download_count}' title='{$downloadbars[index].percentage}% = {$downloadbars[index].download_count} {$locale.087}'/></a> 216 216 </td> 217 217 {/section} … … 223 223 {section name=index loop=$downloadbars} 224 224 <th width='40'> 225 <a href='/downloads.php?cat_id={$downloadbars[index].download_cat}&download_id={$downloadbars[index].download_id}' title=''><img src='{$downloadbars[index].image_url}' height='{$downloadbars[index].image_height}' src='{$downloadbars[index].image_url}' width='{$downloadbars[index].image_width}' alt='' style='vertical-align:top;' /></a>225 <a href='/downloads.php?cat_id={$downloadbars[index].download_cat}&download_id={$downloadbars[index].download_id}' title=''><img src='{$downloadbars[index].image_url}' height='{$downloadbars[index].image_height}' src='{$downloadbars[index].image_url}' width='{$downloadbars[index].image_width}' title='{$downloadbars[index].download_description}' alt='' style='vertical-align:top;' /></a> 226 226 </th> 227 227 {/section} -
themes/PLi-Fusion/PLiTheme/php-files/themes/PLiTheme/templates/templates/_stylesheets.tpl
r1409 r1512 46 46 47 47 /* buttons */ 48 .button { font-size:90%; font-weight:normal; font-family:Verdana, Arial, Sans-Serif;width:1; overflow:visible; color:#606060; background-color:#e0e0e0; border-top:1px #ddd solid; border-left:1px #ddd solid; border-bottom:1px #666 solid; border-right:1px #666 solid; cursor:pointer; margin-top:2px; padding: 1px 2px; background:url(/themes/PLiTheme/images/buttonbg.jpg) repeat-x left top; }48 .button { font-size:90%; font-weight:normal; width:1; overflow:visible; color:#606060; background-color:#e0e0e0; border-top:1px #ddd solid; border-left:1px #ddd solid; border-bottom:1px #666 solid; border-right:1px #666 solid; cursor:pointer; margin-top:2px; padding: 1px 2px; background:url(/themes/PLiTheme/images/buttonbg.jpg) repeat-x left top; } 49 49 50 50 /* text entry fields */ 51 .textbox { font-size:95%; font-family:Verdana, Arial, Sans-Serif;color:#000; background-color:#eee; border:1px #666 solid; }51 .textbox { font-size:95%; color:#000; background-color:#eee; border:1px #666 solid; } 52 52 53 53 /* --- Website template ------------------------------------ */ 54 54 55 55 /* page body (normal mode & maintenance mode */ 56 body { font-size:1em; font-family:Verdana, Arial, Sans-Serif; }56 body { font-size:1em; font-family:Verdana, "Deja Vu Sans", Arial, Sans-Serif; } 57 57 .body { margin: 5px 5px 5px 5px; color:#000; background-color:#bbbbbc; } 58 58 .body-maint { margin: 5px 5px 5px 5px; color:#000; background-color:{/literal}{$settings.maintenance_color}{literal}; } … … 227 227 .bargraph td { padding:0; margin:-20px; vertical-align:bottom; text-align:center; } 228 228 .bargraph th { padding-top:5px; text-align:center; } 229 .bargraph td img { display:inline; margin-top:35px; border-right: 1px # 888 solid; border-top: 1px #fffsolid;}229 .bargraph td img { display:inline; margin-top:35px; border-right: 1px #ddd solid; border-top: 1px #ddd solid;} 230 230 231 231 /* --- Donations -------------------------------------------- */ -
themes/PLi-Fusion/PLiTheme/php-files/themes/PLiTheme/theme_functions.php
r1409 r1512 52 52 } 53 53 } 54 /* 55 [download_id] => 35 56 [download_title] => DM500 57 [download_description] => PLi® Iolite 2008 Edition - for the Dreambox DM500 58 [download_url] => http://downloads.pli-images.org/dm500/pli-Iolite-dm500-20071230-4014.zip 59 [download_cat] => 8 60 [download_license] => GPL 61 [download_os] => tuxbox - Enigma1 62 [download_version] => Iolite 2008 Edition 63 [download_filesize] => 5,878Mb 64 [download_bar] => 1 65 [download_datestamp] => 1199046320 66 [download_count] => 2138 67 [image_url] => /files/cache/pli-images.dev.vnvadvies.nl.PLiTheme.977ecf39a1186353f643b8b55ce34d5c.png 68 [image_height] => 10 69 [image_width] => 28 70 [percentage] => 5 71 [value] => 7 72 */ 54 73 55 74 /*------------------------------------------------------+ … … 58 77 function downloadbars() { 59 78 global $db_prefix, $settings; 60 79 61 80 // define the font2image array 62 81 $font2png = array(); … … 78 97 $font2png['return_link'] = true; 79 98 99 // define the download records we want a bar graph from 100 $downloads = array(); 101 102 $total = 0; 103 // get the defined download bars 104 $result = dbquery("SELECT * FROM ".$db_prefix."dlstats_counters ORDER BY dlsc_order"); 105 while ($data = dbarray($result)) { 106 // start with a count of zero 107 $download = array('download_count' => 0); 108 // check if we need to get a local download counter 109 if ($data['dlsc_download_id']) { 110 $result2 = dbquery("SELECT d.*, c.download_cat_access FROM ".$db_prefix."downloads d LEFT JOIN ".$db_prefix."download_cats c ON d.download_cat = c.download_cat_id WHERE d.download_id = '".$data['dlsc_download_id']."'"); 111 if ($data2 = dbarray($result2)) { 112 // check if this user has the right to download it 113 $access = true; 114 $cat_id = $data2['download_cat']; 115 while(true) { 116 // check if the user has access to this download item 117 $data3 = dbarray(dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id = '".$cat_id."'")); 118 if (!checkgroup($data3['download_cat_access'])) { 119 $access = false; 120 break; 121 } 122 // if this was a sub-category, check the parent as well 123 $cat_id = $data3['download_parent']; 124 // if no more parents are present, end the loop 125 if ($cat_id == 0) break; 126 } 127 // if the user has access, add the info from the download record 128 if ($access) { 129 $download = array_merge($download, $data2); 130 } 131 } 132 } 133 // check if we need to add file counters 134 $files = explode("\n", $data['dlsc_files']); 135 foreach($files as $file) { 136 $result2 = dbquery("SELECT * FROM ".$db_prefix."dlstats_files WHERE dlsf_file = '".trim($file)."'"); 137 if ($data2 = dbarray($result2)) { 138 // get the counter 139 $download['download_count'] += $data2['dlsf_counter']; 140 } 141 } 142 // and add some data from the counter definition 143 $download['download_title'] = $data['dlsc_name']; 144 $download['download_description'] = $data['dlsc_description']; 145 // make sure the title is properly formatted and fits 146 if (strlen($download['download_title']) > 6) $download['download_title'] = substr($download['download_title'],0,6); 147 $download['download_title'] = strtoupper(trim($download['download_title'])); 148 $font2png['font_text'] = $download['download_title']; 149 $download['image_url'] = font2image($font2png); 150 $size = getimagesize(PATH_ROOT.$download['image_url']); 151 $download['image_height'] =$size[1]; 152 $download['image_width'] = $size[0]; 153 $total += $download['download_count']; 154 $downloads[] = $download; 155 } 156 80 157 // define the max width of a bar in pixels 81 158 $barheight = 65; 82 83 // define the download records we want a bar graph from84 $download = array();85 86 // get the download statistics for the required download records87 $total = 0;88 $result = dbquery("SELECT * FROM ".$db_prefix."downloads WHERE download_bar > '0' ORDER BY download_bar ASC");89 while ($data = dbarray($result)) {90 $access = true;91 $cat_id = $data['download_cat'];92 while(true) {93 // check if the user has access to this download item94 $data2 = dbarray(dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id = '".$cat_id."'"));95 if (!checkgroup($data2['download_cat_access'])) {96 $access = false;97 break;98 }99 // if this was a sub-category, check the parent as well100 $cat_id = $data2['download_parent'];101 // if no more parents are present, end the loop102 if ($cat_id == 0) break;103 104 }105 // if the user has access, add this download to the bar panel106 if ($access) {107 if (strlen($data['download_title']) > 6) $data['download_title'] = substr($data['download_title'],0,6);108 $data['download_title'] = strtoupper(trim($data['download_title']));109 $font2png['font_text'] = $data['download_title'];110 $data['image_url'] = font2image($font2png);111 $size = getimagesize(PATH_ROOT.$data['image_url']);112 $data['image_height'] =$size[1];113 $data['image_width'] = $size[0];114 $download[] = $data;115 $total += $data['download_count'];116 }117 }118 159 119 160 // calculate the percentages of the grand total of all the entries listed (in $total) 120 161 $maxperc = 0; 121 foreach ($download as $key => $value) {162 foreach ($downloads as $key => $value) { 122 163 if ($total == 0) 123 $download [$key]['percentage'] = 0;164 $downloads[$key]['percentage'] = 0; 124 165 else 125 $download [$key]['percentage'] = floor($value['download_count'] / $total * 100);166 $downloads[$key]['percentage'] = floor($value['download_count'] / $total * 100); 126 167 // add 1 to make sure 'percentage' is never zero (to work around a Firefox DIV bug) 127 $download [$key]['percentage']++;128 $maxperc = max($maxperc, $download [$key]['percentage']);168 $downloads[$key]['percentage']++; 169 $maxperc = max($maxperc, $downloads[$key]['percentage']); 129 170 } 130 171 // calculate the percentage multiplier to fill out the bars nicely … … 133 174 // display the panel with the download statistics 134 175 $i=1; 135 foreach ($download as $key => $value) {136 $download [$key]['value'] = floor($value['percentage'] * $multiplier);176 foreach ($downloads as $key => $value) { 177 $downloads[$key]['value'] = floor($value['percentage'] * $multiplier); 137 178 $i++; 138 179 } 139 return $download; 180 181 return $downloads; 140 182 } 141 183 … … 152 194 } 153 195 154 $result = dbquery("SELECT download_cat_name FROM ".$db_prefix."download_cats WHERE download_cat_id = '0'"); 155 if ($data = dbarray($result)) { 156 if ($data['download_cat_name'] != "") { 157 $bar_title = trim($data['download_cat_name']). " : ".$total." | "; 158 } 159 } 196 $bar_title = sprintf(html_entity_decode($settings['dlstats_title']),$total); 197 160 198 if (!isset($bar_title)) $bar_title = "Current image downloads "; 161 199 -
themes/PLi-Fusion/PLiThemeCentered/php-files/themes/PLiThemeCentered/templates/templates/_header.tpl
r1411 r1512 205 205 </tr> 206 206 </table> 207 <div style='margin-left:auto;margin-right:auto;width:{$smarty.const.THEME_WIDTH}px;height:120px;margin-top:-12 0px;'>207 <div style='margin-left:auto;margin-right:auto;width:{$smarty.const.THEME_WIDTH}px;height:120px;margin-top:-121px;'> 208 208 <div id='bars' style='float:right;height:100px;'> 209 209 <table class='bargraph'> … … 213 213 {section name=index loop=$downloadbars} 214 214 <td width='40'> 215 < img src='/themes/PLiThemeCentered/images/bar-{$smarty.section.index.rownum}.gif' style='width:16px;height:{$downloadbars[index].value}px;' alt='{$downloadbars[index].download_count}' title='{$downloadbars[index].percentage}%: {$downloadbars[index].download_count} {$locale.087}'/>215 <a href='/downloads.php?cat_id={$downloadbars[index].download_cat}&download_id={$downloadbars[index].download_id}' title=''><img src='/themes/PLiThemeCentered/images/bar-{$smarty.section.index.rownum}.gif' style='width:16px;height:{$downloadbars[index].value}px;' alt='{$downloadbars[index].download_count}' title='{$downloadbars[index].percentage}%: {$downloadbars[index].download_count} {$locale.087}'/></a> 216 216 </td> 217 217 {/section} … … 223 223 {section name=index loop=$downloadbars} 224 224 <th width='40'> 225 <a href='/downloads.php?cat_id={$downloadbars[index].download_cat}&download_id={$downloadbars[index].download_id}' title=''><img src='{$downloadbars[index].image_url}' alt='' style='vertical-align:top;' /></a>225 <a href='/downloads.php?cat_id={$downloadbars[index].download_cat}&download_id={$downloadbars[index].download_id}' title=''><img src='{$downloadbars[index].image_url}' title='{$downloadbars[index].download_descriptions}' alt='' style='vertical-align:top;' /></a> 226 226 </th> 227 227 {/section} -
themes/PLi-Fusion/PLiThemeCentered/php-files/themes/PLiThemeCentered/templates/templates/_stylesheets.tpl
r1410 r1512 46 46 47 47 /* buttons */ 48 .button { font-size:90%; font-weight:normal; font-family:Verdana, Arial, Sans-Serif;width:1; overflow:visible; color:#606060; background-color:#e0e0e0; border-top:1px #ddd solid; border-left:1px #ddd solid; border-bottom:1px #666 solid; border-right:1px #666 solid; cursor:pointer; margin-top:2px; padding: 1px 2px; background:url(/themes/PLiThemeCentered/images/buttonbg.jpg) repeat-x left top; }48 .button { font-size:90%; font-weight:normal; width:1; overflow:visible; color:#606060; background-color:#e0e0e0; border-top:1px #ddd solid; border-left:1px #ddd solid; border-bottom:1px #666 solid; border-right:1px #666 solid; cursor:pointer; margin-top:2px; padding: 1px 2px; background:url(/themes/PLiThemeCentered/images/buttonbg.jpg) repeat-x left top; } 49 49 50 50 /* text entry fields */ 51 .textbox { font-size:95%; font-family:Verdana, Arial, Sans-Serif;color:#000; background-color:#eee; border:1px #666 solid; }51 .textbox { font-size:95%; color:#000; background-color:#eee; border:1px #666 solid; } 52 52 53 53 /* --- Website template ------------------------------------ */ 54 54 55 55 /* page body (normal mode & maintenance mode */ 56 body { font-size:1em; font-family:Verdana, Arial, Sans-Serif; }56 body { font-size:1em; font-family:Verdana, "Deja Vu Sans", Arial, Sans-Serif; } 57 57 .body { margin: 5px 5px 5px 5px; color:#000; background-color:#bbbbbc; } 58 58 .body-maint { margin: 5px 5px 5px 5px; color:#000; background-color:{/literal}{$settings.maintenance_color}{literal}; } … … 227 227 .bargraph td { padding:0; margin:-20px; vertical-align:bottom; text-align:center; } 228 228 .bargraph th { padding-top:5px; text-align:center; } 229 .bargraph td img { display:inline; margin-top:35px; border-right: 1px # 888 solid; border-top: 1px #fffsolid;}229 .bargraph td img { display:inline; margin-top:35px; border-right: 1px #ddd solid; border-top: 1px #ddd solid;} 230 230 231 231 /* --- Donations -------------------------------------------- */ -
themes/PLi-Fusion/PLiThemeCentered/php-files/themes/PLiThemeCentered/theme_functions.php
r1410 r1512 52 52 } 53 53 } 54 /* 55 [download_id] => 35 56 [download_title] => DM500 57 [download_description] => PLi® Iolite 2008 Edition - for the Dreambox DM500 58 [download_url] => http://downloads.pli-images.org/dm500/pli-Iolite-dm500-20071230-4014.zip 59 [download_cat] => 8 60 [download_license] => GPL 61 [download_os] => tuxbox - Enigma1 62 [download_version] => Iolite 2008 Edition 63 [download_filesize] => 5,878Mb 64 [download_bar] => 1 65 [download_datestamp] => 1199046320 66 [download_count] => 2138 67 [image_url] => /files/cache/pli-images.dev.vnvadvies.nl.PLiTheme.977ecf39a1186353f643b8b55ce34d5c.png 68 [image_height] => 10 69 [image_width] => 28 70 [percentage] => 5 71 [value] => 7 72 */ 54 73 55 74 /*------------------------------------------------------+ … … 58 77 function downloadbars() { 59 78 global $db_prefix, $settings; 60 79 61 80 // define the font2image array 62 81 $font2png = array(); … … 78 97 $font2png['return_link'] = true; 79 98 99 // define the download records we want a bar graph from 100 $downloads = array(); 101 102 $total = 0; 103 // get the defined download bars 104 $result = dbquery("SELECT * FROM ".$db_prefix."dlstats_counters ORDER BY dlsc_order"); 105 while ($data = dbarray($result)) { 106 // start with a count of zero 107 $download = array('download_count' => 0); 108 // check if we need to get a local download counter 109 if ($data['dlsc_download_id']) { 110 $result2 = dbquery("SELECT d.*, c.download_cat_access FROM ".$db_prefix."downloads d LEFT JOIN ".$db_prefix."download_cats c ON d.download_cat = c.download_cat_id WHERE d.download_id = '".$data['dlsc_download_id']."'"); 111 if ($data2 = dbarray($result2)) { 112 // check if this user has the right to download it 113 $access = true; 114 $cat_id = $data2['download_cat']; 115 while(true) { 116 // check if the user has access to this download item 117 $data3 = dbarray(dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id = '".$cat_id."'")); 118 if (!checkgroup($data3['download_cat_access'])) { 119 $access = false; 120 break; 121 } 122 // if this was a sub-category, check the parent as well 123 $cat_id = $data3['download_parent']; 124 // if no more parents are present, end the loop 125 if ($cat_id == 0) break; 126 } 127 // if the user has access, add the info from the download record 128 if ($access) { 129 $download = array_merge($download, $data2); 130 } 131 } 132 } 133 // check if we need to add file counters 134 $files = explode("\n", $data['dlsc_files']); 135 foreach($files as $file) { 136 $result2 = dbquery("SELECT * FROM ".$db_prefix."dlstats_files WHERE dlsf_file = '".trim($file)."'"); 137 if ($data2 = dbarray($result2)) { 138 // get the counter 139 $download['download_count'] += $data2['dlsf_counter']; 140 } 141 } 142 // and add some data from the counter definition 143 $download['download_title'] = $data['dlsc_name']; 144 $download['download_description'] = $data['dlsc_description']; 145 // make sure the title is properly formatted and fits 146 if (strlen($download['download_title']) > 6) $download['download_title'] = substr($download['download_title'],0,6); 147 $download['download_title'] = strtoupper(trim($download['download_title'])); 148 $font2png['font_text'] = $download['download_title']; 149 $download['image_url'] = font2image($font2png); 150 $size = getimagesize(PATH_ROOT.$download['image_url']); 151 $download['image_height'] =$size[1]; 152 $download['image_width'] = $size[0]; 153 $total += $download['download_count']; 154 $downloads[] = $download; 155 } 156 80 157 // define the max width of a bar in pixels 81 158 $barheight = 65; 82 83 // define the download records we want a bar graph from84 $download = array();85 86 // get the download statistics for the required download records87 $total = 0;88 $result = dbquery("SELECT * FROM ".$db_prefix."downloads WHERE download_bar > '0' ORDER BY download_bar ASC");89 while ($data = dbarray($result)) {90 $access = true;91 $cat_id = $data['download_cat'];92 while(true) {93 // check if the user has access to this download item94 $data2 = dbarray(dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id = '".$cat_id."'"));95 if (!checkgroup($data2['download_cat_access'])) {96 $access = false;97 break;98 }99 // if this was a sub-category, check the parent as well100 $cat_id = $data2['download_parent'];101 // if no more parents are present, end the loop102 if ($cat_id == 0) break;103 104 }105 // if the user has access, add this download to the bar panel106 if ($access) {107 if (strlen($data['download_title']) > 6) $data['download_title'] = substr($data['download_title'],0,6);108 $data['download_title'] = strtoupper(trim($data['download_title']));109 $font2png['font_text'] = $data['download_title'];110 $data['image_url'] = font2image($font2png);111 $download[] = $data;112 $total += $data['download_count'];113 }114 }115 159 116 160 // calculate the percentages of the grand total of all the entries listed (in $total) 117 161 $maxperc = 0; 118 foreach ($download as $key => $value) {162 foreach ($downloads as $key => $value) { 119 163 if ($total == 0) 120 $download [$key]['percentage'] = 0;164 $downloads[$key]['percentage'] = 0; 121 165 else 122 $download [$key]['percentage'] = floor($value['download_count'] / $total * 100);166 $downloads[$key]['percentage'] = floor($value['download_count'] / $total * 100); 123 167 // add 1 to make sure 'percentage' is never zero (to work around a Firefox DIV bug) 124 $download [$key]['percentage']++;125 $maxperc = max($maxperc, $download [$key]['percentage']);168 $downloads[$key]['percentage']++; 169 $maxperc = max($maxperc, $downloads[$key]['percentage']); 126 170 } 127 171 // calculate the percentage multiplier to fill out the bars nicely … … 130 174 // display the panel with the download statistics 131 175 $i=1; 132 foreach ($download as $key => $value) {133 $download [$key]['value'] = floor($value['percentage'] * $multiplier);176 foreach ($downloads as $key => $value) { 177 $downloads[$key]['value'] = floor($value['percentage'] * $multiplier); 134 178 $i++; 135 179 } 136 return $download; 180 181 return $downloads; 137 182 } 138 183 … … 149 194 } 150 195 151 $result = dbquery("SELECT download_cat_name FROM ".$db_prefix."download_cats WHERE download_cat_id = '0'"); 152 if ($data = dbarray($result)) { 153 if ($data['download_cat_name'] != "") { 154 $bar_title = trim($data['download_cat_name']). " : ".$total." | "; 155 } 156 } 196 $bar_title = sprintf(html_entity_decode($settings['dlstats_title']),$total); 197 157 198 if (!isset($bar_title)) $bar_title = "Current image downloads "; 158 199 -
themes/PLi-Fusion/PLiXmas/php-files/themes/PLiXmas/templates/templates/_header.tpl
r1190 r1512 161 161 </div> 162 162 <div class='sub-header' style='display:inline;float:right;margin-top:127px;height:5px;'> 163 {$bartitle} : {$bartotal} 163 {$bartitle} 164 164 </div> 165 165 <div id='countdown' style='white-space:no-wrap;text-align:center;float:right;font-weight:bold;width:380px;color:#CC0000;margin-top:148px;'></div> -
themes/PLi-Fusion/PLiXmas/php-files/themes/PLiXmas/templates/templates/_stylesheets.tpl
r1275 r1512 46 46 47 47 /* buttons */ 48 .button { font-size:90%; font-weight:normal; font-family:Verdana, Arial, Sans-Serif;width:1; overflow:visible; color:#fff; background-color:#CC0000; border-top:1px #ddd solid; border-left:1px #ddd solid; border-bottom:1px #666 solid; border-right:1px #666 solid; cursor:pointer; margin-top:2px; padding: 1px 2px;}48 .button { font-size:90%; font-weight:normal; width:1; overflow:visible; color:#fff; background-color:#CC0000; border-top:1px #ddd solid; border-left:1px #ddd solid; border-bottom:1px #666 solid; border-right:1px #666 solid; cursor:pointer; margin-top:2px; padding: 1px 2px;} 49 49 50 50 /* text entry fields */ 51 .textbox { font-size:95%; font-family:Verdana, Arial, Sans-Serif;color:#003300; background-color:#fff; border:1px #666 solid; }51 .textbox { font-size:95%; color:#003300; background-color:#fff; border:1px #666 solid; } 52 52 53 53 /* --- Website template ------------------------------------ */ 54 54 55 55 /* page body (normal mode & maintenance mode */ 56 body { font-size:1em; font-family:Verdana, Arial, Sans-Serif; }56 body { font-size:1em; font-family:Verdana, "Deja Vu Sans", Arial, Sans-Serif; } 57 57 .body { margin: 5px 5px 5px 5px; color:#fff; background-color:#58a7e3; } 58 58 .body-maint { margin: 5px 5px 5px 5px; color:#fff; background-color:{/literal}{$settings.maintenance_color}{literal}; } -
themes/PLi-Fusion/PLiXmas/php-files/themes/PLiXmas/theme.php
r1347 r1512 70 70 71 71 // bar counter title 72 $variables['bartitle'] = bartitle(); 73 74 // bar counter 75 $variables['bartotal'] = 0; 76 foreach($variables['downloadbars'] as $bar) { 77 $variables['bartotal'] += $bar['download_count']; 78 } 72 $variables['bartitle'] = bartitle($variables['downloadbars']); 79 73 80 74 // get the time left until new year -
themes/PLi-Fusion/PLiXmas/php-files/themes/PLiXmas/theme_functions.php
r1169 r1512 14 14 // include the menu functions to create the header menu bar 15 15 require_once PATH_INCLUDES."menu_include.php"; 16 17 // include the text image generation function 18 require_once PATH_INCLUDES."font2image.php"; 16 19 17 20 // generate the treelist for items in the header menu bar … … 54 57 +-------------------------------------------------------*/ 55 58 function downloadbars() { 56 global $db_prefix; 57 59 global $db_prefix, $settings; 60 61 // define the download records we want a bar graph from 62 $downloads = array(); 63 64 $total = 0; 65 // get the defined download bars 66 $result = dbquery("SELECT * FROM ".$db_prefix."dlstats_counters ORDER BY dlsc_order"); 67 while ($data = dbarray($result)) { 68 // start with a count of zero 69 $download = array('download_count' => 0); 70 // check if we need to get a local download counter 71 if ($data['dlsc_download_id']) { 72 $result2 = dbquery("SELECT d.*, c.download_cat_access FROM ".$db_prefix."downloads d LEFT JOIN ".$db_prefix."download_cats c ON d.download_cat = c.download_cat_id WHERE d.download_id = '".$data['dlsc_download_id']."'"); 73 if ($data2 = dbarray($result2)) { 74 // check if this user has the right to download it 75 $access = true; 76 $cat_id = $data2['download_cat']; 77 while(true) { 78 // check if the user has access to this download item 79 $data3 = dbarray(dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id = '".$cat_id."'")); 80 if (!checkgroup($data3['download_cat_access'])) { 81 $access = false; 82 break; 83 } 84 // if this was a sub-category, check the parent as well 85 $cat_id = $data3['download_parent']; 86 // if no more parents are present, end the loop 87 if ($cat_id == 0) break; 88 } 89 // if the user has access, add the info from the download record 90 if ($access) { 91 $download = array_merge($download, $data2); 92 } 93 } 94 } 95 // check if we need to add file counters 96 $files = explode("\n", $data['dlsc_files']); 97 foreach($files as $file) { 98 $result2 = dbquery("SELECT * FROM ".$db_prefix."dlstats_files WHERE dlsf_file = '".trim($file)."'"); 99 if ($data2 = dbarray($result2)) { 100 // get the counter 101 $download['download_count'] += $data2['dlsf_counter']; 102 } 103 } 104 // and add some data from the counter definition 105 $download['download_title'] = $data['dlsc_name']; 106 $download['download_description'] = $data['dlsc_description']; 107 // make sure the title is properly formatted and fits 108 if (strlen($download['download_title']) > 6) $download['download_title'] = substr($download['download_title'],0,6); 109 $download['download_title'] = strtoupper(trim($download['download_title'])); 110 $font2png['font_text'] = $download['download_title']; 111 $total += $download['download_count']; 112 $downloads[] = $download; 113 } 114 58 115 // define the max width of a bar in pixels 59 116 $barheight = 65; 60 61 // define the download records we want a bar graph from62 $download = array();63 64 // get the download statistics for the required download records65 $total = 0;66 $result = dbquery("SELECT * FROM ".$db_prefix."downloads WHERE download_bar > '0' ORDER BY download_bar DESC");67 while ($data = dbarray($result)) {68 $access = true;69 $cat_id = $data['download_cat'];70 while(true) {71 // check if the user has access to this download item72 $data2 = dbarray(dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id = '".$cat_id."'"));73 if (!checkgroup($data2['download_cat_access'])) {74 $access = false;75 break;76 }77 // if this was a sub-category, check the parent as well78 $cat_id = $data2['download_parent'];79 // if no more parents are present, end the loop80 if ($cat_id == 0) break;81 82 }83 // if the user has access, add this download to the bar panel84 if ($access) {85 if (strlen($data['download_title']) > 6) $data['download_title'] = substr($data['download_title'],0,6);86 $data['download_title'] = strtoupper(trim($data['download_title']));87 $download[] = $data;88 $total += $data['download_count'];89 }90 }91 117 92 118 // calculate the percentages of the grand total of all the entries listed (in $total) 93 119 $maxperc = 0; 94 foreach ($download as $key => $value) {120 foreach ($downloads as $key => $value) { 95 121 if ($total == 0) 96 $download [$key]['percentage'] = 0;122 $downloads[$key]['percentage'] = 0; 97 123 else 98 $download [$key]['percentage'] = floor($value['download_count'] / $total * 100);124 $downloads[$key]['percentage'] = floor($value['download_count'] / $total * 100); 99 125 // add 1 to make sure 'percentage' is never zero (to work around a Firefox DIV bug) 100 $download [$key]['percentage']++;101 $maxperc = max($maxperc, $download [$key]['percentage']);126 $downloads[$key]['percentage']++; 127 $maxperc = max($maxperc, $downloads[$key]['percentage']); 102 128 } 103 129 // calculate the percentage multiplier to fill out the bars nicely … … 106 132 // display the panel with the download statistics 107 133 $i=1; 108 foreach ($download as $key => $value) { 109 $download[$key]['value'] = floor($value['percentage'] * $multiplier); 110 $download[$key]['baseline'] = 65 - $download[$key]['value']; 134 foreach ($downloads as $key => $value) { 135 $downloads[$key]['value'] = floor($value['percentage'] * $multiplier); 111 136 $i++; 112 137 } 113 return $download; 138 139 return $downloads; 114 140 } 115 141 … … 117 143 | Generate the title for the download bar counter | 118 144 +-------------------------------------------------------*/ 119 function bartitle( ) {120 global $db_prefix ;145 function bartitle($downloads) { 146 global $db_prefix, $settings; 121 147 122 $result = dbquery("SELECT download_cat_name FROM ".$db_prefix."download_cats WHERE download_cat_id = '0'"); 123 if ($data = dbarray($result)) 124 if ($data['download_cat_name'] != "") $bar_title = trim($data['download_cat_name']); 125 if (!isset($bar_title)) $bar_title = "Current Release Downloads"; 148 // calculate the total downloads 149 $total = 0; 150 foreach ($downloads as $download) { 151 $total += $download['download_count']; 152 } 126 153 154 $bar_title = explode("|", $settings['dlstats_title']); 155 $bar_title = sprintf(html_entity_decode(trim($bar_title[0])),$total); 156 157 if (!isset($bar_title)) $bar_title = "Current image downloads "; 158 127 159 return $bar_title; 128 160 }
Note: See TracChangeset
for help on using the changeset viewer.
