Changeset 1506 in ExiteCMS


Ignore:
Timestamp:
07/02/08 17:27:46 (4 years ago)
Author:
hverton
Message:

bugfixes, added a missing download title field

Location:
modules/common/download_statistics/php-files/modules/download_statistics
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • modules/common/download_statistics/php-files/modules/download_statistics/admin.php

    r1481 r1506  
    137137                } 
    138138            } 
     139            $title = stripinput($_POST['dlstats_title']); 
    139140            $remote = IsNum($_POST['dlstats_remote']) ? $_POST['dlstats_remote'] : 0; 
    140141            $google_key = stripinput($_POST['dlstats_google_api_key']); 
     
    147148                $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$remote."' WHERE cfg_name = 'dlstats_remote'"); 
    148149                $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$google_key."' WHERE cfg_name = 'dlstats_google_api_key'"); 
     150                $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$title."' WHERE cfg_name = 'dlstats_title'"); 
    149151                redirect(FUSION_SELF.$aidlink."&status=cs"); 
    150152                exit; 
     
    161163            $settings2['dlstats_remote'] = $remote; 
    162164            $settings2['dlstats_google_api_key'] = $google_key; 
     165            $settings2['dlstats_title'] = $title; 
    163166        } 
    164167        // reset the action switch to return to the default action 
  • modules/common/download_statistics/php-files/modules/download_statistics/download_statistics.side_panel.php

    r1464 r1506  
    3030    // check if we need to get a local download counter 
    3131    if ($data['dlsc_download_id']) { 
    32         $result2 = dbquery("SELECT * FROM ".$db_prefix."downloads WHERE download_id = '".$data['dlsc_download_id']."'"); 
     32        $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']."'"); 
    3333        if ($data2 = dbarray($result2)) { 
    34             // get the counter and the download category (needed to create a link) 
    35             $data['download_cat'] = $data2['download_cat']; 
    36             $data['count'] = $data2['download_count']; 
     34            // check if the user has access to it 
     35            if (checkgroup($data2['download_cat_access'])) { 
     36                // get the counter and the download category (needed to create a link) 
     37                $data['download_cat'] = $data2['download_cat']; 
     38                $data['count'] = $data2['download_count']; 
     39            } 
    3740        } 
    3841    } 
  • modules/common/download_statistics/php-files/modules/download_statistics/module_installer.php

    r1499 r1506  
    1717$mod_title = "Download Statistics"; 
    1818$mod_description = "Gather and display download statistics from download mirror logs. includes a Google Map with downloaders per country"; 
    19 $mod_version = "1.0.8"; 
     19$mod_version = "1.1.1"; 
    2020$mod_developer = "WanWizard"; 
    2121$mod_email = "wanwizard@gmail.com"; 
     
    9494$localestrings['en']['dls511'] = "Google Maps API key:"; 
    9595$localestrings['en']['dls512'] = "Click <a href='http://code.google.com/apis/maps/signup.html' target='_blank'>here</a> to sign up for a key."; 
     96$localestrings['en']['dls513'] = "Download Statistics Panel Title"; 
     97$localestrings['en']['dls514'] = "Used as title of the statistics panel. You can use %s as a placeholder for the total download count"; 
    9698// Statistics counter panel 
    9799$localestrings['en']['dls600'] = "Download Statistics Panel"; 
     
    163165$mod_install_cmds[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##configuration (cfg_name, cfg_value) VALUES ('dlstats_remote', '0')"); 
    164166$mod_install_cmds[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##configuration (cfg_name, cfg_value) VALUES ('dlstats_google_api_key', '')"); 
     167$mod_install_cmds[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##configuration (cfg_name, cfg_value) VALUES ('dlstats_title', '')"); 
    165168 
    166169// Geomap information table 
     
    229232$mod_uninstall_cmds[] = array('type' => 'db', 'value' => "DELETE FROM ##PREFIX##configuration WHERE cfg_name = 'dlstats_remote'"); 
    230233$mod_uninstall_cmds[] = array('type' => 'db', 'value' => "DELETE FROM ##PREFIX##configuration WHERE cfg_name = 'dlstats_google_api_key'"); 
     234$mod_uninstall_cmds[] = array('type' => 'db', 'value' => "DELETE FROM ##PREFIX##configuration WHERE cfg_name = 'dlstats_title'"); 
    231235 
    232236// delete the tables 
     
    262266             
    263267        switch ($current_version) { 
    264             case "1.0.0":           // current release version 
     268            case "1.1.0": 
     269                $result = dbquery("INSERT INTO ".$db_prefix."configuration (cfg_name, cfg_value) VALUES ('dlstats_title', '')"); 
     270 
     271            case "1.1.1":           // current release version 
     272 
    265273        } 
    266274    } 
  • modules/common/download_statistics/php-files/modules/download_statistics/templates/modules.download_statistics.admin.tpl

    r1481 r1506  
    141141            </tr> 
    142142            <tr> 
     143                <td class='tbl' valign='top'> 
     144                    {$locale.dls513} 
     145                </td> 
     146                <td class='tbl'> 
     147                    <input type='text' name='dlstats_title' value='{$settings2.dlstats_title}' maxlength='50' class='textbox' style='width:300px;' /> 
     148                    <br /> 
     149                    <span class='small2'>{$locale.dls514}</span> 
     150                </td> 
     151            </tr> 
     152            <tr> 
    143153                <td class='tbl' style='vertical-align:top;width:250px;'> 
    144154                    {$locale.dls508} 
  • modules/common/download_statistics/php-files/modules/download_statistics/templates/modules.download_statistics.side_panel.tpl

    r1464 r1506  
    1818{section name=bar loop=$counters} 
    1919{if $smarty.section.bar.first} 
    20 {include file="_openside_x.tpl" name=$_name title=$_title|cat:" ("|cat:$total|cat:")" state=$_state style=$_style} 
     20{include file="_openside_x.tpl" name=$_name title=$_title state=$_state style=$_style} 
    2121<table cellpadding='0' cellspacing='0'> 
    2222{/if} 
     
    3636    </tr> 
    3737{if $smarty.section.bar.last} 
     38    {if $settings.dlstats_title != "" || true} 
     39        <td colspan='2' align='center'> 
     40            {ssprintf format=$settings.dlstats_title|replace:"|":"<br />" var1=$total} 
     41        </td> 
     42    {/if} 
    3843</table> 
    3944{include file="_closeside_x.tpl"} 
Note: See TracChangeset for help on using the changeset viewer.