root/tagwire/tags/0.24/tagwire-pdcleaner.cgi

Revision 105, 0.9 kB (checked in by ogawa, 3 years ago)

Add MTTagDate for displaying the last date the tag added.
Add MTRelatedTags for listing tags related to the current tag.
Add MTXSearchTags for listing tags specified by MT-XSearch's argument.
Modify README.txt for these changes.
Add tagwire-pdcleaner.cgi which is a simple tool for cleaning PluginData? for tagwire.

  • Property svn:executable set to *
  • Property svn:keywords set to Id Author Date Rev
Line 
1#!/usr/bin/perl -w
2# Tagwire PluginData Cleaner
3#
4# $Id$
5#
6# This software is provided as-is. You may use it for commercial or
7# personal use. If you distribute it, please keep this notice intact.
8#
9# Copyright (c) 2005 Hirotaka Ogawa
10
11use strict;
12local $|=1;
13
14my($MT_DIR);
15BEGIN {
16    if ($0 =~ m!(.*[/\\])!) {
17        $MT_DIR = $1;
18    } else {
19        $MT_DIR = './';
20    }
21    unshift @INC, $MT_DIR . 'lib';
22    unshift @INC, $MT_DIR . 'extlib';
23}
24
25use MT;
26use MT::Blog;
27use MT::PluginData;
28
29print "Content-Type: text/html\n\n";
30print <<HTML;
31<html>
32<head><title>Tagwire PluginData Cleaner</title></head>
33<body>
34<h1>Tagwire PluginData Cleaner</h1>
35HTML
36
37my $mt = MT->new;
38my $iter = MT::Blog->load_iter();
39while (my $b = $iter->()) {
40    while (my $pd = MT::PluginData->load({ plugin => 'Tagwire Plugin',
41                                           key => $b->id })) {
42        $pd->remove;
43        print ".";
44    }
45}
46
47print <<HTML;
48<p><strong>PluginData successfully removed.</strong></p>
49</body>
50</html>
51HTML
Note: See TracBrowser for help on using the browser.