-
Notifications
You must be signed in to change notification settings - Fork 1
/
single-rsch.php
162 lines (155 loc) · 5.46 KB
/
single-rsch.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?php
if ( isset($_GET['rsch_id']) ) :
global $sexes;
$rid = $_GET['rsch_id']; // researcher id
$r = get_rsch_byID($rid);
$topics = get_topic_byrsch($rid);
if ( empty($r) ) :
echo '<h2>你所要找的研究者不存在!</h2>';
require_once('404.php');
else :
if ( empty($r->img_path) )
$r->img_path = '/images/default-thumb.png';
echo ' <div id="researcher-avatar">
<img src="'.get_bloginfo('template_directory').$r->img_path.'">
<p style="margin-top:15px;">'.$r->name.'</p>
<p style="font-weight:normal;font-size:14px;color:#b9b9b9;">'.$r->alias.'</p>
</div>';
if ( $r->region == '7' ) : // for 智库
$year = substr($r->birth, 0, 4);
if ( $year == '0000' ) {
$birth = "未知";
}
else {
$birth = $year." 年";
}
echo ' <div id="column1" class="grid_6">
<div class="researcher-intro">
<p><span style="font-weight:bolder;color:#000;">成立时间:</span>'.$birth.'</p>
<p><span style="font-weight:bolder;color:#000;line-height:50px;">智库简介</b></p>
<p>'.$r->intro.'</p>
<ul><span style="font-weight:bolder;color:#000;line-height:50px;">代表作品</span>';
$delimiters = array( ';' , '、', ';');
$reps = multiple_explode($delimiters,$r->rep);
//$reps = explode(",", $r->rep); //var_dump($rep);
foreach ( $reps as $rep ) {
echo '<li><span>'.$rep.'</span></li>';
}
echo ' </ul>
</div>
</div><!-- End column1 -->';
else :
if ( $r->sex==NULL )
$r->sex = 0;
$gender = $sexes;
$year = substr($r->birth, 0, 4);
if ( $year == '0000' ) {
$birth = "未知";
}
else {
$age = date('Y') - $year;
$birth = $year." 年($age 岁)";
}
echo '
<div id="column1" class="grid_6">
<div class="researcher-intro">
<p><span style="font-weight:bolder;color:#000;">性别:</span>'.$gender[$r->sex].'</p>
<p><span style="font-weight:bolder;color:#000;">出生:</span>'.$birth.'</p>
<p><span style="font-weight:bolder;color:#000;">现职:</span>'.$r->title.'</p>
<p><span style="font-weight:bolder;color:#000;line-height:50px;">相关经历</b></p>';
$exps = explode(";", $r->experience);
if ( empty($exps) )
echo ' <p></p>';
else {
foreach ( $exps as $exp ) {
echo ' <p>'.$exp.'</p>';
}
}
echo ' <p><span style="font-weight:bolder;color:#000;line-height:50px;">个人简介</b></p>
<p>'.$r->intro.'</p>
<ul><span style="font-weight:bolder;color:#000;line-height:50px;">代表作品</span>';
$delimiters = array( ',' , ',' , ';' , '、', ';');
$reps = multiple_explode($delimiters,$r->rep);
//$reps = explode(",", $r->rep); //var_dump($rep);
foreach ( $reps as $rep ) {
echo '<li><span>'.$rep.'</span></li>';
}
echo ' </ul>
</div>
</div><!-- End column1 -->';
endif;
echo ' <div id="column2" class="prefix_7 grid_4.1">
<div class="researcher-topic">
<p>
<span style="color:#000;font-weight:bolder;line-height:50px;">研究主题</span>
</p>
<ul>';
if ( !empty($topics) ) {
$count = 0;
foreach ( $topics as $t ) {
//echo '<li style="margin-top:20px;">'.$topic.'</li>';
echo '<li><a href="'.get_bloginfo('url')."/topic/?topic_id=".$t->id.'">'.$t->subject.'</a></li>';
$count = $count + 1;
//if ( $count == 4 ) break;
}
}
echo '
</ul>
</div>
</div><!-- End column2 -->
<div class="clear"></div>';
?>
<div id="display_bar">
<img src="<?php bloginfo('template_directory'); ?>/images/shadow_middle.png">
</div>
<div id="column1" class="grid_7">
<div><a href="#" style="font-size:13px;color:#b9b9b9;font-weight:300;">全部政见 / </a>
<span style="font-size:15px;color:#000;font-weight:bold;"><?php echo $r->name;?></span>
</div>
<?php
// get post id via rsch_id
$pid_array = get_postid_byrschid($rid);
$pid_array = check_postinfo_bypostids($pid_array);
global $issue_array;
global $authorid_array;
global $quarter_array;
//$issue_array = array("次贷危机" , "中东局势", "亚洲策略");
$issue_array = get_issues_bypostids($pid_array);
$authorid_array = get_authorids_bypostids($pid_array);
$quarter_array = get_quarters_bypostids($pid_array);
$pid_array = pid_filter($pid_array, $issue, $authorid, $quarter);
if ( !empty($pid_array) ) {
// The Loop
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array('paged' => $paged, 'post__in' => $pid_array );
query_posts($args);
/* the loop */
if (have_posts()) :
// put the theme options here
global $cnpolitics_theme_dir;
require_once( $cnpolitics_dir.'/inc/article_inc.php' );
else:
// No posts found
endif;
}
?>
<div class="pagination"><?php wp_pagenavi(); ?></div>
<div class="post-end-button back-to-top">
<p style="padding-top:20px;">回到开头</p>
</div>
<div id="display_bar">
<img width="556px;" src="<?php bloginfo('template_directory'); ?>/images/shadow-post-end.png">
</div>
<div><p style="text-align:center; color:#b9b9b9;">1</p></div>
</div> <!-- End column1 -->
<div id="column2" class="prefix_1 grid_4">
<div style="margin-bottom:40px;">
<a href="<?php echo $cnpolitics_url.'/researcher/?rsch_id='.$r->id;?>" style="float:right;position:relative;color:#b9b9b9;font-size:13px;">« 全部关于<?php echo $r->name;?></a>
</div>
<?php get_sidebar('filter'); ?>
</div><!--column2-->
<?php
endif;
endif;
?>
<script type="text/javascript" src="<?php bloginfo('template_directory');?>/js/abstract.js"></script>