Changeset 8

Show
Ignore:
Timestamp:
10/03/07 17:00:17 (1 year ago)
Author:
francois
Message:

better moderation, fixed typo in forum title

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/apps/frontend/config/app.yml

    r7 r8  
    11all: 
    22  sfSimpleForumPlugin: 
    3     forum_name:             Motile forums 
     3    forum_name:             Motyle forums 
    44    display_categories:     true 
    55    use_feeds:              true  # requires sfFeed2Plugin 
  • trunk/apps/frontend/modules/sfSimpleForum/actions/actions.class.php

    r7 r8  
    1111    $this->forward404Unless($topic); 
    1212     
     13    // Spam all topic's posts 
     14    $posts = $topic->getPosts(); 
     15    foreach ($posts as $post) 
     16    { 
     17      $post->setModerationStatus(sfPropelModerationBehavior::TAGGED_UNSAFE); 
     18      $post->save(); 
     19    } 
     20    // Spam topic 
    1321    $topic->setModerationStatus(sfPropelModerationBehavior::TAGGED_UNSAFE); 
    1422    $topic->save(); 
     
    2836     
    2937    $post->setModerationStatus(sfPropelModerationBehavior::TAGGED_UNSAFE); 
    30     $post->save(); 
     38    $post->save(null, true); 
    3139     
    3240    $topic = $post->getsfSimpleForumTopic(); 
    33      
    34     $this->redirect('sfSimpleForum/topic?id='.$topic->getId().'&page='.$page); 
     41    if($topic->getNbPosts() == 0) 
     42    { 
     43      // Last post of the topic was moderated 
     44      // Spam topic too (to avoid errors on counts) 
     45      $topic->setModerationStatus(sfPropelModerationBehavior::TAGGED_UNSAFE); 
     46      $topic->save();       
     47      // redirect to the forum 
     48      $this->redirect('sfSimpleForum/forum?forum_name='.$topic->getsfSimpleForumForum()->getStrippedName()); 
     49    } 
     50    else 
     51    { 
     52      // redirecto to the topic 
     53      $this->redirect('sfSimpleForum/topic?id='.$topic->getId().'&page='.$page); 
     54    } 
    3555  } 
    3656 
  • trunk/apps/frontend/modules/sfSimpleForum/templates/_topic_moderator_actions.php

    r7 r8  
    11<?php echo use_helper('I18N') ?> 
     2<?php if ($user_is_moderator): ?> 
    23<ul class="post_actions"> 
    34  <li><?php echo link_to(__('Moderate'), 'sfSimpleForum/spamTopic?id='.$topic->getId()) ?></li> 
    45  <li><?php echo link_to(__('Delete'), 'sfSimpleForum/deleteTopic?id='.$topic->getId(), array('confirm' =>__('Are you sure you want to delete this topic?'))) ?></li> 
    56</ul> 
     7<?php endif; ?> 
  • trunk/apps/frontend/modules/sfSimpleForum/templates/forumListSuccess.php

    r6 r8  
    11<?php use_helper('I18N', 'sfSimpleForum') ?> 
    22 
    3 <?php $sf_context->getResponse()->setTitle('Motile forums') ?> 
     3<?php $sf_context->getResponse()->setTitle('Motyle forums') ?> 
    44 
    55<div class="sfSimpleForum"> 
  • trunk/apps/frontend/templates/layout.php

    r6 r8  
    2525  </ul> 
    2626  <div id="main_title"> 
    27     <?php echo link_to(image_tag('motile.gif', 'align=absbottom') . ' Motile', 'sfSimpleForum/forumList') ?> 
     27    <?php echo link_to(image_tag('motile.gif', 'align=absbottom') . ' Motyle', 'sfSimpleForum/forumList') ?> 
    2828  </div> 
    2929</div> 
     
    3838   
    3939  <div id="footer"> 
    40     <?php echo __('Powered by %sfSimpleForum%', array('%sfSimpleForum%' => link_to('Motile', 'http://trac.symfony-project.com/wiki/sfSimpleForumPlugin'))) ?> 
     40    <?php echo __('Powered by %sfSimpleForum%', array('%sfSimpleForum%' => link_to('Motyle', 'http://trac.symfony-project.com/wiki/sfSimpleForumPlugin'))) ?> 
    4141  </div> 
    4242   
  • trunk/data/sql

    • Property svn:ignore set to
      *
  • trunk/lib/model

    • Property svn:ignore set to
      om
      map