Merge lp:~quam-plures-core/quam-plures/dracones into lp:quam-plures

Proposed by Tilman Blumenbach
Status: Merged
Merged at revision: 7603
Proposed branch: lp:~quam-plures-core/quam-plures/dracones
Merge into: lp:quam-plures
Diff against target: 102 lines (+12/-24)
3 files modified
qp_templates/_contributors.php (+5/-1)
qp_templates/_credits.disp.php (+1/-19)
qp_templates/basic/_credits.disp.php (+6/-4)
To merge this branch: bzr merge lp:~quam-plures-core/quam-plures/dracones
Reviewer Review Type Date Requested Status
Yabs (community) Approve
EdB Approve
Review via email: mp+65511@code.launchpad.net

Description of the change

This branch mainly fixes an issue with the credits page that I've noticed. tilqi's last name is not displayed properly (wrong encoding). The solution is to convert it from UTF-8 (the contributor file's charset) to the internal QP charset. It will then automatically be converted to the right final encoding.

I also streamlined the way how we sort contributors alphabetically. Nothing mission critical, but less code is always good.

Finally, I noticed there's a separate credits disp handler for the basic template that slightly differs from the global credits disp -- it also missed some of the recent changes to the latter; I updated it.

Tested and seems to work. Installing the whole app also works for me.

To post a comment you must log in.
Revision history for this message
EdB (edb) wrote :

Nice! I kept thinking there must be a way to make Tilqi's name show up correctly :)

FYI, the basic template has it's own credits page due to it is the only one of the canned templates that either has or doesn't have the page title handled by the other files. There are some others that way in the template branch thing so I'll take a look at them and tidy them up according to what was done here.

Will merge this when I merge in the branch who's name I forget right now instead of merging it now because I'm pretty sure we should always give others a chance to review and comment. Even on an easy win like this one.

review: Approve
Revision history for this message
Yabs (yabs) wrote :

short review

¥

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qp_templates/_contributors.php'
2--- qp_templates/_contributors.php 2011-01-09 15:03:22 +0000
3+++ qp_templates/_contributors.php 2011-06-22 15:04:46 +0000
4@@ -18,6 +18,10 @@
5 * @package install
6 */
7 if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
8+
9+
10+global $evo_charset;
11+
12 // list of contributors for this version. Add new entries to the end of the array
13 // hic sunt dracones!
14 $_hic_sunt_dracones = array(
15@@ -58,7 +62,7 @@
16 'spiel' => 'Some German guy who coincidentally is Yet Another Dracone™ and mostly writes (in German and sometimes in English) about Linux and other technical stuff, on some rare occasions even about politics.'
17 ),
18 'tilqi' => array( // Changed to forum name
19- 'name' => 'Emin Özlem',
20+ 'name' => convert_charset( 'Emin Özlem', $evo_charset, 'UTF-8' ),
21 'homepage' => 'http://www.eodepo.com/',
22 'locale' => 'tr-TR',
23 'spiel' => 'the fixer.'
24
25=== modified file 'qp_templates/_credits.disp.php'
26--- qp_templates/_credits.disp.php 2011-03-18 16:07:26 +0000
27+++ qp_templates/_credits.disp.php 2011-06-22 15:04:46 +0000
28@@ -102,7 +102,7 @@
29 echo '<dt>'.T_('Core Contributors').':</dt>'."\n";
30 echo '<dd><dl>'."\n";
31
32- usort( $_hic_sunt_dracones, 'alpha_dracones' );
33+ uasort( $_hic_sunt_dracones, create_function( '$a, $b', 'return strnatcasecmp( $a[\'name\'], $b[\'name\'] );' ) );
34
35 foreach( $_hic_sunt_dracones as $dracone )
36 {
37@@ -132,21 +132,3 @@
38
39 </dl>
40 </div>
41-<?php
42-/**
43- * Callback function for sorting dracones into alphabetical order by "name"
44- * as opposed to forum names, which are the (unique) array keys we use
45- *
46- * @param string $drac_1 array entry
47- * @param string $drac_2 next array entry
48- * @return is $drac_1's name further down the alphabet than $drac_2's name
49- */
50-function alpha_dracones( $drac_1, $drac_2 )
51-{
52- $sorted = array( $drac_1['name'], $drac_2['name'] );
53- natcasesort( $sorted );
54- $sorted = array_values( $sorted );
55-
56- return ( $sorted[0] == $drac_2['name'] );
57-}
58-?>
59\ No newline at end of file
60
61=== modified file 'qp_templates/basic/_credits.disp.php'
62--- qp_templates/basic/_credits.disp.php 2011-03-18 16:07:26 +0000
63+++ qp_templates/basic/_credits.disp.php 2011-06-22 15:04:46 +0000
64@@ -40,11 +40,11 @@
65
66 foreach( $credits as $linkback )
67 {
68- echo '<dt>'.$linkback['pre'].'</dt>';
69+ echo '<dt>'.format_to_output( $linkback['pre'], 'htmlbody').'</dt>';
70 echo '<dd><a href="', $linkback['url'].'" title="';
71 echo format_to_output( $linkback['title'].'htmlattr' ).'">';
72 echo format_to_output( $linkback['text'], 'text' ).'</a></dd><dd>';
73- echo $linkback['post']."</dd>\n";
74+ echo format_to_output( $linkback['post'], 'htmlbody')."</dd>\n";
75 }
76
77 echo '</dl></dd>'."\n";
78@@ -108,13 +108,15 @@
79 echo '<dt>'.T_('Core Contributors').':</dt>'."\n";
80 echo '<dd><dl>'."\n";
81
82+ uasort( $_hic_sunt_dracones, create_function( '$a, $b', 'return strnatcasecmp( $a[\'name\'], $b[\'name\'] );' ) );
83+
84 foreach( $_hic_sunt_dracones as $dracone )
85 {
86 echo '<dt><a href="'.$dracone['homepage'].'" title="';
87 echo format_to_output( $dracone['homepage'], 'htmlattr' ).'">';
88 echo format_to_output( $dracone['name'], 'text' ).'</a></dt><dd>';
89 locale_flag( $dracone['locale'], 'h10px', 'leftmargin' );
90- echo $dracone['spiel']."</dd>\n";
91+ echo format_to_output( $dracone['spiel'], 'htmlbody')."</dd>\n";
92 }
93
94 echo '</dl></dd>'."\n";
95@@ -128,7 +130,7 @@
96 echo '<dt><a href="', $Template->poweredby_linkback['url'], '" title="';
97 echo format_to_output( $Template->poweredby_linkback['title'], 'htmlattr' ), '">';
98 echo format_to_output( $Template->poweredby_linkback['text'], 'text' ), '</a></dt><dd>';
99- echo $Template->poweredby_linkback['post'], "</dd>\n";
100+ echo format_to_output( $Template->poweredby_linkback['post'], 'htmlbody'), "</dd>\n";
101 echo '</dl></dd>', "\n";
102 }
103

Subscribers

People subscribed via source and target branches