Changeset 3237
- Timestamp:
- 10/24/13 00:09:14 (10 years ago)
- Location:
- plugins/popularityContest
- Files:
-
- 3 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/popularityContest
- Property svn:externals deleted
-
plugins/popularityContest/_admin.php
r2295 r3237 29 29 preg_match('/plugin.php\?p=popularityContest(&.*)?$/',$_SERVER['REQUEST_URI']), 30 30 $core->auth->check('admin',$core->blog->id)); 31 32 require_once(dirname(__FILE__).'/inc/lib.popularityContest.php');33 34 # if the last report is "old"35 if (($_SERVER['REQUEST_TIME'] - $core->blog->settings->popularityContest_last_report) >36 $core->blog->settings->popularityContest_time_interval)37 {38 popularityContest::send();39 }40 41 ?> -
plugins/popularityContest/_define.php
r2401 r3237 29 29 /* Description */ "Dotclear Popularity Contest (http://popcon.gniark.net/)", 30 30 /* Author */ "Moe (http://gniark.net/)", 31 /* Version */ "1. 5",31 /* Version */ "1.6-dead", 32 32 /* Permissions */ null 33 33 ); 34 ?> -
plugins/popularityContest/index.php
r2401 r3237 27 27 l10n::set(dirname(__FILE__).'/locales/'.$_lang.'/admin'); 28 28 29 $settings =& $core->blog->settings;30 31 $msg = '';32 $tab = 'popularityContest';33 34 $time_interval_last_try =35 $_SERVER['REQUEST_TIME'] - $settings->popularityContest_last_try;36 $can_send_report = ($time_interval_last_try >= (30*60));37 38 $hidden_plugins = array();39 if (strlen($settings->popularityContest_hidden_plugins) > 0)40 {41 $hidden_plugins = unserialize(base64_decode($settings->popularityContest_hidden_plugins));42 }43 if (!is_array($hidden_plugins)) {$hidden_plugins = array();}44 45 require_once(dirname(__FILE__).'/php-xhtml-table/class.table.php');46 require_once(dirname(__FILE__).'/inc/lib.popularityContest.php');47 48 $popularityContest_time_interval =49 (is_int($settings->popularityContest_time_interval)) ?50 $settings->popularityContest_time_interval : (24*3600);51 $popularityContest_sent = false;52 53 # actions54 if (!empty($_POST['saveconfig']))55 {56 try57 {58 $settings->setNameSpace('popularitycontest');59 # Time interval in seconds between sends to Popularity Contest60 $popularityContest_time_interval =61 (empty($_POST['popularityContest_time_interval']))62 ? 604800:abs($_POST['popularityContest_time_interval']);63 $settings->put('popularityContest_time_interval',64 $popularityContest_time_interval,'integer',65 'Time interval in seconds between submissions to Popularity Contest',66 true,true);67 # Hide plugins68 $popularityContest_hidden_plugins =69 (!empty($_POST['hidden_plugins']))70 ? base64_encode(serialize($_POST['hidden_plugins']))71 : base64_encode(serialize(array('')));72 $settings->put('popularityContest_hidden_plugins',73 $popularityContest_hidden_plugins,'text','Hidden plugins',74 true,true);75 $hidden_plugins = $_POST['hidden_plugins'];76 77 http::redirect($p_url.'&saveconfig=1');78 }79 catch (Exception $e)80 {81 $core->error->add($e->getMessage());82 }83 }84 elseif (isset($_POST['send_report']))85 {86 if (!$can_send_report)87 {88 http::redirect($p_url.'&wait=1');89 }90 elseif (popularityContest::send() === true)91 {92 http::redirect($p_url.'&report_sent=1');93 }94 else95 {96 http::redirect($p_url.'&wait=1');97 }98 }99 100 if (isset($_GET['saveconfig']))101 {102 $msg = __('Configuration successfully updated.');103 $tab = 'settings';104 }105 elseif (isset($_GET['report_sent']))106 {107 $msg = __('Report successfully sent.');108 }109 elseif (isset($_GET['wait']))110 {111 $core->error->add(sprintf(112 __('please wait %s before sending a report'),113 popularityContest::getDiff((30*60)- $time_interval_last_try)));114 }115 29 ?> 116 30 <html> 117 31 <head> 118 32 <title><?php echo __('Popularity Contest'); ?></title> 119 <?php120 echo(dcPage::jsPageTabs($tab).121 dcPage::jsLoad('js/_posts_list.js').122 dcPage::jsLoad('js/filter-controls.js'));123 ?>124 <style type="text/css">125 /*tr:hover {background:#eee none;}*/126 .icon {text-align:center;}127 .default {background:transparent url(/images/template/default.png) repeat;}128 .popularityContest {background:transparent url(/images/template/popularityContest.png) repeat;}129 </style>130 33 </head> 131 34 <body> 132 35 133 <h2><?php echo __('Popularity Contest'); ?></h2> 134 135 <?php 136 if (!empty($msg)) {echo '<p class="message">'.$msg.'</p>';} 36 <h2><?php echo __('Popularity Contest'); ?></h2> 137 37 138 if (is_int($settings->popularityContest_last_report)) 139 { 140 printf('<h3>'.__('Last successful report: %s ago').'</h3>', 141 popularityContest::getDiff( 142 $_SERVER['REQUEST_TIME']-$settings->popularityContest_last_report)); 143 } 144 if (is_int($settings->popularityContest_last_try)) 145 { 146 printf('<h3>'.__('Last try: %s ago').'</h3>', 147 popularityContest::getDiff( 148 $_SERVER['REQUEST_TIME']-$settings->popularityContest_last_try)); 149 } 150 ?> 151 152 <div class="multi-part" id="popularityContest" 153 title="<?php echo __('Popularity Contest'); ?>"> 154 <p><?php echo(__('This plugin only send the following informations to Dotclear Popularity Contest:')); ?></p> 155 <ul> 156 <?php 157 $infos = array( 158 __('the names of installed and activated plugins'), 159 sprintf(__('a random key (%s) identify the Dotclear installation with an unique and anonym hash'), 160 '<strong>'.$settings->popularityContest_key.'</strong>'), 161 sprintf(__('the Dotclear version (%s)'), 162 '<strong>'.DC_VERSION.'</strong>') 163 ); 164 foreach ($infos as $k) 165 { 166 echo('<li>'.$k.'</li>'); 167 } 168 ?> 169 </ul> 170 171 <p><?php echo(__('In the settings, you can hide some plugins and they will be ignored by Dotclear Popularity Contest.')); ?></p> 172 <form method="post" action="<?php echo(http::getSelfURI()); ?>"> 173 <p><input type="submit" name="send_report"value="<?php echo 174 __('Send a report to Dotclear Popularity Contest'); ?>" /></p> 175 <p><?php echo $core->formNonce(); ?></p> 176 </form> 177 <h3><?php echo(__('Installed plugins:')); ?></h3> 178 <?php echo(popularityContest::getPluginsTable()); ?> 179 </div> 180 181 <div class="multi-part" id="settings" title="<?php echo __('settings'); ?>"> 182 <form method="post" action="<?php echo(http::getSelfURI()); ?>"> 183 <fieldset> 184 <legend><?php echo(__('Popularity Contest')); ?></legend> 185 <p> 186 <label for="popularityContest_time_interval"> 187 <?php echo(__('Send a report:')); ?> 188 <?php echo(form::combo('popularityContest_time_interval', 189 popularityContest::getComboOptions(), 190 $popularityContest_time_interval)); ?> 191 </label> 192 </p> 193 </fieldset> 194 195 <h2><?php echo(__('Hide plugins:')); ?></h2> 196 <?php echo(popularityContest::getPluginsTable(true)); ?> 197 <p class="col checkboxes-helpers"></p> 198 <p><?php echo $core->formNonce(); ?></p> 199 <p><input type="submit" name="saveconfig" value="<?php echo __('Save configuration'); ?>" /></p> 200 </form> 201 </div> 202 203 <div class="multi-part" id="results" title="<?php echo __('results'); ?>"> 204 <p><a href="http://popcon.gniark.net/"><?php echo(__('Click here to see results.')); ?></a></p> 205 <h3><?php echo(__('Plugins:')); ?></h3> 206 <?php echo(popularityContest::getResultsTable()); ?> 207 </div> 38 <p class="warning"><?php echo(__('The developement of this plugin is stopped.'). 39 ' '. 40 __('Please remove this plugin.')) ?></p> 208 41 209 42 </body> -
plugins/popularityContest/locales/fr/admin.po
r2401 r3237 11 11 "Content-Transfer-Encoding: 8bit\n" 12 12 13 msgid " weekly"14 msgstr " chaque semaine"13 msgid "The developement of this plugin is stopped." 14 msgstr "Le développement de cette extension est arrêté." 15 15 16 msgid "every 3 days" 17 msgstr "tous les 3 jours" 18 19 msgid "daily" 20 msgstr "quotidiennement" 21 22 msgid "Installed plugins:" 23 msgstr "Extensions installées :" 24 25 msgid "Hide" 26 msgstr "Cacher" 27 28 msgid "Icon" 29 msgstr "Icône" 30 31 msgid "Name" 32 msgstr "Nom" 33 34 msgid "Popularity" 35 msgstr "Popularité" 36 37 msgid "second" 38 msgstr "seconde" 39 40 msgid "year" 41 msgstr "année" 42 43 msgid "years" 44 msgstr "années" 45 46 msgid "month" 47 msgstr "mois" 48 49 msgid "months" 50 msgstr "mois" 51 52 msgid "day" 53 msgstr "jour" 54 55 msgid "days" 56 msgstr "jours" 57 58 msgid "hour" 59 msgstr "heure" 60 61 msgid "hours" 62 msgstr "heures" 63 64 msgid "minute" 65 msgstr "minute" 66 67 msgid "minutes" 68 msgstr "minutes" 69 70 msgid "seconds" 71 msgstr "secondes" 72 73 msgid "and" 74 msgstr "et" 75 76 msgid "Plugins:" 77 msgstr "Extensions :" 78 79 msgid "Installed" 80 msgstr "Installé" 81 82 msgid "Configuration successfully updated." 83 msgstr "Configuration mise à jour avec succès." 84 85 msgid "Report successfully sent." 86 msgstr "Rapport envoyé avec succès." 87 88 msgid "please wait %s before sending a report" 89 msgstr "veuillez patienter %s avant d'envoyer un rapport" 90 91 msgid "Last successful report: %s ago" 92 msgstr "Dernier rapport réussi : il y a %s" 93 94 msgid "Last try: %s ago" 95 msgstr "Dernier essai : il y a %s" 96 97 msgid "This plugin only send the following informations to Dotclear Popularity Contest:" 98 msgstr "Cette extension envoie seulement les informations suivantes à Dotclear Popularity Contest :" 99 100 msgid "the names of installed and activated plugins" 101 msgstr "les noms des extensions installées et activées" 102 103 msgid "a random key (%s) identify the Dotclear installation with an unique and anonym hash" 104 msgstr "une clé aléatoire (%s) identifie l'installation de Dotclear avec un hash unique et anonyme" 105 106 msgid "the Dotclear version (%s)" 107 msgstr "la version de Dotclear (%s)" 108 109 msgid "In the settings, you can hide some plugins and they will be ignored by Dotclear Popularity Contest." 110 msgstr "Dans les paramètres, vous pouvez cacher des extensions et elles seront ignorées par Dotclear Popularity Contest." 111 112 msgid "Send a report to Dotclear Popularity Contest" 113 msgstr "Envoyer un rapport à Dotclear Popularity Contest" 114 115 msgid "settings" 116 msgstr "paramètres" 117 118 msgid "Send a report:" 119 msgstr "Envoyer un rapport :" 120 121 msgid "Hide plugins:" 122 msgstr "Cacher les extensions :" 123 124 msgid "Save configuration" 125 msgstr "Enregistrer la configuration" 126 127 msgid "results" 128 msgstr "résultats" 129 130 msgid "Click here to see results." 131 msgstr "Cliquez ici pour voir les résultats." 132 16 msgid "Please remove this plugin." 17 msgstr "Veuillez désintaller cette extension."
Note: See TracChangeset
for help on using the changeset viewer.