Example #1
0
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
require_once 'geograph/global.inc.php';
require_once 'geograph/kmlfile.class.php';
require_once 'geograph/kmlfile2.class.php';
require_once 'geograph/gridimage.class.php';
require_once 'geograph/gridsquare.class.php';
require_once 'geograph/map.class.php';
if (!isLocalIPAddress()) {
    init_session();
    $USER->mustHavePerm("admin");
}
$db = NewADOConnection($GLOBALS['DSN']);
if (!$db) {
    die('Database connection failed');
}
require_once 'geograph/conversions.class.php';
$conv = new Conversions();
$gr = $_GET['gr'];
$square = new GridSquare();
$grid_ok = $square->setByFullGridRef($gr);
$html = '';
$kml = new kmlFile();
$kml->atom = true;
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
require_once 'geograph/global.inc.php';
require_once 'geograph/eventprocessor.class.php';
set_time_limit(5000);
//need perms if not requested locally
if (isLocalIPAddress()) {
    $smarty = null;
} else {
    init_session();
    $smarty = new GeographPage();
    $USER->mustHavePerm("admin");
}
$db = NewADOConnection($GLOBALS['DSN']);
if (!$db) {
    die('Database connection failed');
}
$wm = 1;
#minimum votes required to be listed (//todo if change need to add a having to clause below!)
$db->Execute("CREATE TEMPORARY TABLE vote_final AS SELECT MAX(vote_id) AS vote_id FROM vote_log GROUP BY type,id,user_id,ipaddr");
$db->Execute("UPDATE `vote_log` SET `final` = 0");
$db->Execute("UPDATE `vote_log`,vote_final SET vote_log.final = 1 WHERE `vote_log`.vote_id = vote_final.vote_id");