Display the number of stories in the current topic in the Topic Editor (feature request #0000806) HEAD
authorDirk Haun <dirk@haun-online.de>
Sat Oct 03 20:40:08 2009 +0200 (5 months ago)
branchHEAD
changeset 7353566b2b4b5535
parent 73527db76f494446
child 735482e167a0e3a4
Display the number of stories in the current topic in the Topic Editor (feature request #0000806)
language/english.php
language/english_utf-8.php
public_html/admin/topic.php
public_html/docs/english/theme.html
public_html/docs/history
public_html/layout/professional/admin/topic/topiceditor.thtml
     1.1 --- a/language/english.php	Sat Oct 03 19:34:59 2009 +0200
     1.2 +++ b/language/english.php	Sat Oct 03 20:40:08 2009 +0200
     1.3 @@ -863,7 +863,8 @@
     1.4      26 => 'make this the default topic for archived stories. Only one topic allowed.',
     1.5      27 => 'Or Upload Topic Icon',
     1.6      28 => 'Maximum',
     1.7 -    29 => 'File Upload Errors'
     1.8 +    29 => 'File Upload Errors',
     1.9 +    30 => 'Stories in Topic'
    1.10  );
    1.11  
    1.12  ###############################################################################
     2.1 --- a/language/english_utf-8.php	Sat Oct 03 19:34:59 2009 +0200
     2.2 +++ b/language/english_utf-8.php	Sat Oct 03 20:40:08 2009 +0200
     2.3 @@ -863,7 +863,8 @@
     2.4      26 => 'make this the default topic for archived stories. Only one topic allowed.',
     2.5      27 => 'Or Upload Topic Icon',
     2.6      28 => 'Maximum',
     2.7 -    29 => 'File Upload Errors'
     2.8 +    29 => 'File Upload Errors',
     2.9 +    30 => 'Stories in Topic'
    2.10  );
    2.11  
    2.12  ###############################################################################
     3.1 --- a/public_html/admin/topic.php	Sat Oct 03 19:34:59 2009 +0200
     3.2 +++ b/public_html/admin/topic.php	Sat Oct 03 20:40:08 2009 +0200
     3.3 @@ -174,10 +174,20 @@
     3.4      $topic_templates->set_var('max_url_length', 255);
     3.5      $topic_templates->set_var('image_url', $A['imageurl']);
     3.6  
     3.7 -    $topic_templates->set_var('lang_metadescription', $LANG_ADMIN['meta_description']);
     3.8 -    $topic_templates->set_var('meta_description', stripslashes($A['meta_description']));
     3.9 -    $topic_templates->set_var('lang_metakeywords', $LANG_ADMIN['meta_keywords']);
    3.10 -    $topic_templates->set_var('meta_keywords', stripslashes($A['meta_keywords']));
    3.11 +    $topic_templates->set_var('lang_metadescription',
    3.12 +                              $LANG_ADMIN['meta_description']);
    3.13 +    $topic_templates->set_var('lang_metakeywords',
    3.14 +                              $LANG_ADMIN['meta_keywords']);
    3.15 +    $desc = '';
    3.16 +    if (! empty($A['meta_description'])) {
    3.17 +        $desc = $A['meta_description'];
    3.18 +    }
    3.19 +    $keywords = '';
    3.20 +    if (! empty($A['meta_keywords'])) {
    3.21 +        $keywords = $A['meta_keywords'];
    3.22 +    }
    3.23 +    $topic_templates->set_var('meta_description', $desc);
    3.24 +    $topic_templates->set_var('meta_keywords', $keywords);
    3.25  
    3.26      $topic_templates->set_var ('lang_defaulttopic', $LANG27[22]);
    3.27      $topic_templates->set_var ('lang_defaulttext', $LANG27[23]);
    3.28 @@ -199,6 +209,17 @@
    3.29              $topic_templates->set_var ('archive_disabled', 'disabled');
    3.30          }
    3.31      }
    3.32 +
    3.33 +    if (empty($tid)) {
    3.34 +        $num_stories = $LANG_ADMIN['na'];
    3.35 +    } else {
    3.36 +        $nresult = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['stories']} WHERE tid = '" . addslashes($tid) . "'" . COM_getPermSql('AND'));
    3.37 +        $N = DB_fetchArray( $nresult );
    3.38 +        $num_stories = $N['count'];
    3.39 +    }
    3.40 +
    3.41 +    $topic_templates->set_var('lang_num_stories', $LANG27[30]);
    3.42 +    $topic_templates->set_var('num_stories', $num_stories);
    3.43      $topic_templates->set_var('gltoken_name', CSRF_TOKEN);
    3.44      $topic_templates->set_var('gltoken', SEC_createToken());
    3.45      $topic_templates->parse('output', 'editor');
    3.46 @@ -259,9 +280,9 @@
    3.47          if ($imageurl == '/images/topics/') {
    3.48              $imageurl = '';
    3.49          }
    3.50 -        $topic = addslashes ($topic);
    3.51 -        $meta_description = addslashes ($meta_description);
    3.52 -        $meta_keywords = addslashes ($meta_keywords);
    3.53 +        $topic = addslashes($topic);
    3.54 +        $meta_description = addslashes(strip_tags($meta_description));
    3.55 +        $meta_keywords = addslashes(strip_tags($meta_keywords));
    3.56  
    3.57          if ($is_default == 'on') {
    3.58              $is_default = 1;
     4.1 --- a/public_html/docs/english/theme.html	Sat Oct 03 19:34:59 2009 +0200
     4.2 +++ b/public_html/docs/english/theme.html	Sat Oct 03 20:40:08 2009 +0200
     4.3 @@ -198,6 +198,9 @@
     4.4  <h2><a name="changes">Theme changes in Geeklog 1.6.1</a></h2>
     4.5  
     4.6  <ul>
     4.7 +<li>The Topic Editor now contains a line displaying the number of stories in
     4.8 +    the current topic. New variables in <tt>admin/topic/topiceditor.thtml</tt>:
     4.9 +    <code>{lang_num_stories}</code>, <code>{num_stories}</tt></li>
    4.10  <li>Cosmetics: Fixed the position of the story preview when using the
    4.11      advanced editor (was slightly shifted to the right, <a
    4.12      href="http://project.geeklog.net/tracking/view.php?id=963">bug #0000963</a>). Changes to the <code>&lt;div id="preview"&gt;</code> in
     5.1 --- a/public_html/docs/history	Sat Oct 03 19:34:59 2009 +0200
     5.2 +++ b/public_html/docs/history	Sat Oct 03 20:40:08 2009 +0200
     5.3 @@ -3,6 +3,8 @@
     5.4  Oct ??, 2009 (1.6.1)
     5.5  ------------
     5.6  
     5.7 +- Display the number of stories in the current topic in the Topic Editor
     5.8 +  (feature request #0000806) [Dirk]
     5.9  - Call CUSTOM_userCheck from admin/user.php (bug #0000925) [Dirk]
    5.10  - You can now have one featured story per topic (feature request #0000750,
    5.11    patch provided by Tom Homer)
     6.1 --- a/public_html/layout/professional/admin/topic/topiceditor.thtml	Sat Oct 03 19:34:59 2009 +0200
     6.2 +++ b/public_html/layout/professional/admin/topic/topiceditor.thtml	Sat Oct 03 20:40:08 2009 +0200
     6.3 @@ -41,6 +41,10 @@
     6.4                                          <td><input type="checkbox" name="is_archive" {archive_checked} {archive_disabled}{xhtml}> ({lang_archivetext})</td>
     6.5                                      </tr>
     6.6                                      <tr>
     6.7 +                                        <td class="alignright">{lang_num_stories}:</td>
     6.8 +                                        <td>{num_stories}</td>
     6.9 +                                    </tr>
    6.10 +                                    <tr>
    6.11                                          <td colspan="2"><hr{xhtml}></td>
    6.12                                      </tr>
    6.13                                      <tr>