Skip to content

Commit

Permalink
shortener fix
Browse files Browse the repository at this point in the history
  • Loading branch information
voitto committed Sep 7, 2009
1 parent 30df4e4 commit eb2d1dc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
19 changes: 19 additions & 0 deletions app/omb/controllers/blogs.php
Expand Up @@ -54,6 +54,25 @@ function put( &$vars ) {

function delete( &$vars ) {
extract( $vars );
$b = $collection->MoveFirst();
if (!empty($b->prefix)) {
$tabresult = $db->get_result("SHOW tables");
$tables = array();
for($i=0;$tables[$i]=mysql_fetch_assoc($tabresult);$i++) {
$key = $tables[$i]['Tables_in_'.$db->dbname];
if (substr($key,0,3) == $b->prefix.'_' && !in_array($key,array('categories_entries','aggregates_entries','twitter_users','db_sessions'))) {
$Shortener =& $db->model('Shortener');
$short = $Shortener->find_by('nickname',$b->nickname);
if ($short)
echo "DELETE shortener ".$b->nickname;
echo "DROP $key <BR>";
// $sql = "DROP TABLE ".$key;
// $result = $db->get_result( $sql );
} else {
}
}
}
exit;
$resource->delete_from_post( $request );
header_status( '200 OK' );
redirect_to( $request->resource );
Expand Down
3 changes: 2 additions & 1 deletion app/omb/views/blogs/_index.html
Expand Up @@ -22,7 +22,8 @@
</td>
<!--XXX subdomain upgrade-->
<td><b><a href="<?php echo blog_url($Member->nickname); ?>">
<?php echo blog_url($Member->nickname); ?></a></b></td>
<?php echo blog_url($Member->nickname); ?></a></b><a href="<?php url_for( array( 'resource'=>'blogs', 'id'=>$Member->id, 'action'=>'remove' )); ?>">
<img src='<?php blog_url(); ?>resource/cancel.png'></a></td>
</tr>

<?php endwhile; ?>
Expand Down

0 comments on commit eb2d1dc

Please sign in to comment.