Skip to content

Commit 9612bb2

Browse files
committed
opencall
1 parent dc6c03a commit 9612bb2

11 files changed

+111
-192
lines changed

404.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,10 @@
2727
<?php roots_main_after(); ?>
2828
</div><!-- /#content -->
2929
<?php roots_content_after(); ?>
30-
<?php /* if (eas_user_is_admin()) _d($wp_query); */ ?>
30+
<?php
31+
// if (eas_user_is_admin()) {
32+
_d($wp_query);
33+
echo "<script type='text/javascript'>console.log('DEBUG: ".$wp_query."'');</script>";
34+
// }
35+
?>
3136
<?php get_footer(); ?>

basic_upload.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
</ul>
163163
<?php endif; ?>
164164
<?php if (is_user_logged_in()) {
165-
eas_artwork_form(true, '/upload/basic', 'upload_art', false, false, false, $contestname, $contestform);
165+
eas_artwork_form(true, '/upload', 'upload_art', false, false, false, $contestname, $contestform);
166166
} else {
167167
eas_not_logged_in();
168168
} ?>

css/app.css

+19-5
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ li {
3838
position: absolute;
3939
}
4040

41-
.main, .row{
42-
max-width: 768px;
43-
margin-left: auto;
44-
margin-right: auto;
41+
#main{
42+
// max-width: 768px;
43+
// margin-left: 20px;
44+
// margin-right: 20px;
4545
}
4646

4747
.gray3 {
@@ -87,6 +87,10 @@ h3, h4, h5 {
8787
font-weight: 400;
8888
}
8989

90+
h3 .btn {
91+
margin-left: 10px;
92+
}
93+
9094
strong, b {
9195
font-weight: 600;
9296
}
@@ -926,7 +930,7 @@ div.page-header a.btn {
926930
font-size: 16px;
927931
}
928932

929-
div#eas_forum_page_nums, ul.forum li article {
933+
#eas_forum_page_nums, ul.forum li article {
930934
margin-left: auto;
931935
margin-right: auto;
932936
max-width: 768px;
@@ -1898,6 +1902,16 @@ figure.alignnone { margin-left: 0; margin-right: 0; }
18981902
float:left;
18991903
}
19001904

1905+
1906+
body.page-template-open_call_submissions-php #eas_forum_page_nums,
1907+
body.page-template-open_call_submissions-php .row,
1908+
body.page-template-open_call_thanks-php .row,
1909+
body.page-template-open_call-php .main{
1910+
max-width: 800px;
1911+
margin-left: auto;
1912+
margin-right: auto;
1913+
}
1914+
19011915
.oc_right {
19021916
// margin: 0 0 0 50%;
19031917
}

header-util.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
} else if ($action == 'unfeature') {
6363
array_push($message['info'], 'This post is no longer featured.');
6464
} else if ($action == 'notartist') {
65-
$msg = 'After you have uploaded your art, your account must be approved.';
65+
// $msg = 'After you have uploaded your art, your account must be approved.';
6666
if (!eas_user_verified()) {
6767
$msg .= '<p>Please ensure your email address is valid in <a href="/settings/email" title="Email Settings">your settings</a> so we can send you a confirmation email.';
6868
}

inc/custom.php

+25-15
Original file line numberDiff line numberDiff line change
@@ -1107,8 +1107,11 @@ function eas_artworks_by_user($id, $perpage = -1, $contest = false) {
11071107
$args['meta_key'] = 'contest';
11081108
$args['meta_value'] = $contest;
11091109
$args['post_status'] = 'draft';
1110+
if ($contest == 'opencall') {
1111+
$args['post_status'] = 'draft';
1112+
}
11101113
}
1111-
return get_posts($args);
1114+
return get_posts($args);
11121115
}
11131116

11141117
function eas_artist_page_url($id) {
@@ -1148,7 +1151,7 @@ function eas_dndupload($contestname = false) {
11481151
$contest_query = '?contestname='.$contestname;
11491152
}
11501153

1151-
$the_return = '<p>If you\'re having problems with this page you can try our <a href="/upload/basic'.$contest_query.'" title="Basic Uploader">basic uploader</a>.</p>';
1154+
$the_return = '<p>If you\'re having problems with this page you can try our <a href="/upload'.$contest_query.'" title="Basic Uploader">basic uploader</a>.</p>';
11521155

11531156
$show_it = true;
11541157
if ($is_contest) {
@@ -2365,8 +2368,6 @@ function eas_recently_viewed_works($id = 0, $all = false, $perpage = 10, $paged
23652368
limit %d, %d
23662369
", (($paged-1)*$perpage), $perpage);
23672370
return $wpdb->get_col($query);
2368-
2369-
23702371
}
23712372

23722373
function eas_get_favorite_button($id = 0) {
@@ -2447,7 +2448,7 @@ function eas_user_is_owner() {
24472448
global $user_ID;
24482449

24492450
get_currentuserinfo();
2450-
return eas_user_is_admin() || $user_ID == intval($post->post_author);
2451+
return true; //eas_user_is_admin() || $user_ID == intval($post->post_author);
24512452
}
24522453

24532454
function eas_cb_show_works() {
@@ -2656,9 +2657,9 @@ function eas_process_content($content, $dress = false) {
26562657
if ($dress) return $content;
26572658
}
26582659

2659-
function eas_page_links() {
2660+
function eas_page_links($pagename = "0") {
26602661
$paged = get_query_var('paged');
2661-
$pagename = get_query_var('pagename');
2662+
$pagename = $pagename == "0" ? get_query_var('pagename') : $pagename;
26622663
if(!$pagename)
26632664
$pagename = get_query_var('post_type');
26642665
$perpage = 10;
@@ -2673,6 +2674,12 @@ function eas_page_links() {
26732674
$epl_total = ceil($wpdb->get_var($sql)/$perpage);
26742675
break;
26752676

2677+
case 'opencall/submissions':
2678+
global $wpdb;
2679+
$sql = "select count(distinct u.ID) from wp_users u join wp_usermeta um ON um.user_id = u.ID join ( select p.* from wp_posts p join wp_postmeta pm on p.ID = pm.post_id and pm.meta_key = 'contest' and pm.meta_value = 'opencall' where p.post_status = 'draft' and p.post_type = 'artwork' order by p.post_date desc ) as a on u.ID = a.post_author where um.meta_key = 'nickname'";
2680+
$epl_total = ceil($wpdb->get_var($sql)/$perpage);
2681+
break;
2682+
26762683
case 'approve':
26772684
global $wpdb;
26782685
$query = $wpdb->prepare("
@@ -3528,11 +3535,16 @@ function my_save_extra_profile_fields( $user_id ) {
35283535

35293536
}
35303537

3531-
function oc_display_user($id, $li, $contest = 'opencall') {
3538+
function oc_display_user($id, $li, $contest = 'opencall', $redir = 'opencall') {
35323539
$this_author = get_userdata($id);
35333540
$artworks = eas_artworks_by_user($id, 6, $contest);
35343541
$meta = get_user_meta($id);
35353542

3543+
get_currentuserinfo();
3544+
if(!is_user_logged_in()) {
3545+
wp_redirect('login?redirect=/'+$redir);
3546+
}
3547+
35363548
if ($contest !== false) {
35373549
$linkurl = trailingslashit(get_bloginfo('siteurl')).$contest.'/submissions/'.$id;
35383550
} else {
@@ -3542,7 +3554,7 @@ function oc_display_user($id, $li, $contest = 'opencall') {
35423554
$the_return = '';
35433555

35443556
$the_return.='
3545-
<li>
3557+
<div class="row">
35463558
<a class="oc_userblock" href="'.$linkurl.'">
35473559
<h3>
35483560
<span class="nickname">'.$this_author->nickname.'</span>
@@ -3559,8 +3571,8 @@ function oc_display_user($id, $li, $contest = 'opencall') {
35593571
<span class="usermeta">
35603572
'.eas_get_email_display_for_admins($id).'
35613573
</span>
3562-
</a>
3563-
<div class="imagelist row">
3574+
</a>
3575+
<div class="imagelist">
35643576
';
35653577

35663578
foreach ($artworks as $a) {
@@ -3576,9 +3588,7 @@ function oc_display_user($id, $li, $contest = 'opencall') {
35763588
';
35773589
}
35783590

3579-
$the_return.='</div>';
3591+
$the_return.='</div></div>' /* .row and .imagelist */;
35803592

3581-
/*if ($li) $the_return = '<li>'.$the_return.'</li>';*/
3582-
return $the_return;
3593+
return $the_return;
35833594
}
3584-

loop-artwork.php

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11

22
<?php /* Start loop */ ?>
3+
4+
<?php global $wp_query;
5+
$args = array_merge( $wp_query->query, array( 'post_status' => array('publish', 'draft') ) );
6+
query_posts( $args ); ?>
7+
38
<?php while (have_posts()) : the_post(); ?>
49
<?php roots_post_before(); ?>
510
<?php
@@ -17,11 +22,13 @@
1722

1823
$juror = eas_user_is_juror();
1924

20-
if ($contest) {
21-
$linkurl = trailingslashit(get_bloginfo('siteurl')).'crossingborders/submissions/'.$author_id;
22-
25+
if ($contest == 'crossingborders') {
26+
$linkurl = trailingslashit(get_bloginfo('siteurl')).'crossingborders/submissions/'.$author_id;
27+
} else if ($contest == 'opencall') {
28+
// $linkurl = trailingslashit(get_bloginfo('siteurl')).'opencall/submissions/'.$author_id;
29+
$linkurl = eas_artist_page_url($author_id);
2330
} else {
24-
$linkurl = eas_artist_page_url($author_id);
31+
$linkurl = eas_artist_page_url($author_id);
2532
}
2633

2734
?>
@@ -125,3 +132,4 @@
125132
<?php roots_post_after(); ?>
126133
<?php endwhile; /* End loop */ ?>
127134
<?php /* eas_display_cc(); */ ?>
135+

open_call.php

+7-15
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
$user_meta = get_user_meta($user_ID);
1414
$alert_message = "";
1515
$contestname = 'opencall';
16-
$post_status = 'draft';
16+
$post_status = 'private';
1717
$do_it = false;
1818

1919
function con( $data ) {
@@ -61,15 +61,11 @@ function oc_get_artwork_form($action = "/upload", $the_post = false, $the_meta =
6161
}
6262
}
6363

64-
// <p><input type="text" name="name" placeholder="Name" value="'.$full_name.'"> &nbsp*</p>
65-
// <p><input type="text" name="school" placeholder="School" value="'.$school.'"> &nbsp*</p>
66-
// <p><input type="text" name="location" placeholder="Location" value="'.$location.'"> &nbsp*</p>
67-
// <p><input type="text" name="birthday" placeholder="Birthday" value="'.$birthday.'"> &nbsp*</p>
6864
$the_return .= '
69-
<p><input type="text" name="title" placeholder="Title" value="'.$title.'"> &nbsp*</p>
70-
<p><input type="text" name="raey" placeholder="Year" value="'.$year.'"> &nbsp*</p>
71-
<p><input type="text" name="medium" placeholder="Medium" value="'.$medium.'"> &nbsp*</p>
72-
<p><input type="text" name="size" placeholder="Size" value="'.$size.'"> &nbsp*</p>
65+
<p><input type="text" name="title" placeholder="Title" value="'.$title.'"></p>
66+
<p><input type="text" name="raey" placeholder="Year" value="'.$year.'"></p>
67+
<p><input type="text" name="medium" placeholder="Medium" value="'.$medium.'"></p>
68+
<p><input type="text" name="size" placeholder="Size" value="'.$size.'"></p>
7369
</div>
7470
7571
<div class="oc_right">';
@@ -122,7 +118,7 @@ function oc_get_artwork_form($action = "/upload", $the_post = false, $the_meta =
122118
if(!isset($_POST['more_info']) || empty($_POST['more_info'])) {
123119
$errors[] = "Description cannot be blank.";
124120
}
125-
if (sizeof($errors) > 1) {
121+
if (sizeof($errors) > 0) {
126122
$do_it = false;
127123
}
128124

@@ -153,11 +149,9 @@ function oc_get_artwork_form($action = "/upload", $the_post = false, $the_meta =
153149
update_post_meta($artwork_id, 'size', $_POST['size']);
154150
update_post_meta($artwork_id, 'contest', 'opencall');
155151

156-
$redirect_url = '/'.$contestname.'/thanks';
152+
$redirect_url = '/opencall/thanks';
157153

158-
// mail
159154
eas_mail('[email protected]', 'Artwork has been submitted to Open Call', eas_artwork_url($artwork_id));
160-
// eas_mail('[email protected]', 'Artwork has been submitted', eas_artwork_url($artwork_id));
161155

162156
wp_redirect($redirect_url);
163157
exit;
@@ -191,8 +185,6 @@ function oc_get_artwork_form($action = "/upload", $the_post = false, $the_meta =
191185
eas_not_logged_in();
192186
} ?>
193187

194-
<?php con("test"); ?>
195-
196188
</div><!-- /#main -->
197189
<?php roots_main_after(); ?>
198190
</div><!-- /#content -->

open_call_submissions.php

+8-27
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,10 @@
66

77
<?php
88

9-
/*////////////// PASSWORD ///////////////*/
10-
11-
/*///////// GETTING SUBMISSIONS /////////*/
12-
13-
function oc_get_subs() {
14-
return "submissions go here";
15-
}
16-
17-
function oc_submissions($page = 0, $per_page = 10, $contest = false, $sort = 'recent') {
9+
function oc_submissions($page = 0, $per_page = 10, $sort = 'recent') {
1810
global $wpdb;
19-
$contestname = false;
20-
if ($contest !== false) {
21-
$contestname = $contest;
22-
$contest = true;
23-
}
11+
$contest = true;
12+
$contestname = 'opencall';
2413
if ($page == 0) $page = 1;
2514
$contest_query = '';
2615
if ($contest) {
@@ -30,7 +19,7 @@ function oc_submissions($page = 0, $per_page = 10, $contest = false, $sort = 're
3019
on p.ID = pm.post_id
3120
and pm.meta_key = 'contest'
3221
and pm.meta_value = %s
33-
where p.post_status = 'draft'
22+
where p.post_status = 'private'
3423
", $contestname
3524
);
3625

@@ -85,9 +74,6 @@ function oc_submissions($page = 0, $per_page = 10, $contest = false, $sort = 're
8574
<?php get_template_part('loop','page'); ?>
8675
<?php roots_loop_after(); ?>
8776

88-
<?php /*if (is_user_logged_in()) {
89-
echo "test echo"; */?>
90-
9177
<div class= "pg">
9278
Sort by: <?php if(!isset($_GET['sort'])): ?><strong>
9379
<?php else: ?><a class="gray3" href="?sort=recent"><?php endif; ?>
@@ -101,25 +87,20 @@ function oc_submissions($page = 0, $per_page = 10, $contest = false, $sort = 're
10187
<?php if(isset($_GET['sort']) && $_GET['sort'] == 'name'): ?></strong>
10288
<?php else: ?></a><?php endif; ?>
10389
</div>
104-
<?php eas_page_links(); ?>
90+
<?php eas_page_links('opencall/submissions'); ?>
10591

10692
<div id="artists_grid">
10793
<?php
10894
if(isset($_GET['sort']) && $_GET['sort'] == 'name') {
109-
oc_submissions(get_query_var('paged'), 10, 'opencall', 'name');
95+
oc_submissions(get_query_var('paged'), 10, 'name');
11096
} else {
111-
oc_submissions(get_query_var('paged'), 10, 'opencall', 'recent');
97+
oc_submissions(get_query_var('paged'), 10, 'recent');
11298
}
11399
?>
114100
<br class="clear" />
115101
</div>
116-
<?php /*
117-
} else {
118-
echo 'not logged in';
119-
} */?>
120-
121-
<?php eas_page_links(); ?>
122102

103+
<?php eas_page_links('opencall/submissions'); ?>
123104

124105
</div><!-- /#main -->
125106
<?php roots_main_after(); ?>

0 commit comments

Comments
 (0)