diff --git a/load-program-old.php b/load-program-old.php
deleted file mode 100644
index 8f14f63..0000000
--- a/load-program-old.php
+++ /dev/null
@@ -1,146 +0,0 @@
-
';
-
-$prg = pg_query("select
- h.name as hallname,
- to_char(starts_at, 'DD FMMonth - FMDay') as dt,
- to_char(s.starts_at,'HH24:MI') as start, to_char(s.ends_at,'HH24:MI') as end,
- e.title, e.language,
- e.abstract,
- t.name as tname, t.color as tcolor,
- sp.first_name || ' ' || sp.last_name as spname
- from
- slots s join halls h on h.id=s.hall_id
- join events e on s.event_id = e.id
- join tracks t on t.id=e.track_id
- join users u on u.id=e.user_id
- join speaker_profiles sp on sp.user_id=u.id
- where
- not s.event_id is null
- order by date(s.starts_at),s.hall_id, s.starts_at
-");
-
- $bgpost = array();
- $enpost = array();
-
- $bgpost['ID'] = $sched_bg;
- $enpost['ID'] = $sched_en;
-
- $bgpost['post_title'] = "Програма";
- $enpost['post_title'] = "Schedule";
-
- $bgpost['post_name'] = "schedule";
- $enpost['post_name'] = "schedule";
-
- $cdate='';
- $chall='';
-
- while ($row = pg_fetch_object($prg)) {
-
- if ($chall!=$row->hallname && strlen($chall)>1) {
- $bg.= "\n";
- $en.= "\n";
- }
-
- if ($cdate!=$row->dt) {
- $cdate = $row->dt;
- $bg.= "
$cdate
\n";
- $en.= "
$cdate
\n";
- }
-
- if ($chall!=$row->hallname) {
- $chall = $row->hallname;
- echo pll_translate_string($chall, 'en_US')."\n";
- $en.= "
".pll_translate_string($chall, 'en')." Hall";
- $bg.= "\n";
- $en.= "
\n";
-
-
- $bgpost['post_content'] = $bg;
- $enpost['post_content'] = $en;
-
- $bgpost['post_content_filtered'] = $bg;
- $enpost['post_content_filtered'] = $en;
-
- $bgpost['post_status'] = 'publish';
- $enpost['post_status'] = 'publish';
-
- $bgpost['post_type'] = 'page';
- $enpost['post_type'] = 'page';
-
- $bgpost['filter'] = true;
- $enpost['filter'] = true;
-
- kses_remove_filters();
-
- wp_insert_post($bgpost);
- wp_insert_post($enpost);
-
- /*
- $newpost = array();
- $newpost['post_type'] = 'speakers';
- $newpost['post_status'] = 'publish';
- $newpost['post_title'] = $row->first_name." ".$row->last_name;
- $newpost['post_content'] = $row->biography;
- $newpost['post_excerpt'] = $row->biography;
-
- $postid=wp_insert_post($newpost);
- $url = 'https://cfp.openfest.org/uploads/speaker_profile/picture/'.$row->id.'/schedule_'.$row->picture;
- echo $url."\n";
- $att = media_sideload_image($url, $postid, "photo_spk_".$row->user_id);
- preg_match("%src='(http://[^']*)'%", $att, $matches);
- var_dump($matches);
- $wpurl = $matches[1];
- $attid = pn_get_attachment_id_from_url($wpurl);
- add_post_meta($postid, '_thumbnail_id', $attid);
- pll_set_post_language($postid, 'bg');
- }*/
-
diff --git a/load-program.php b/load-program.php
deleted file mode 100644
index 430b5b0..0000000
--- a/load-program.php
+++ /dev/null
@@ -1,195 +0,0 @@
- | Зала София | Зала Варна | Зала G1 |
';
- $en = ' | Sofia Hall | Varna Hall | Hall G1 |
';
-
- $tracks=array(8 => 'open-biz', 9 => 'open-art', 2 => 'technical', 6 => 'civic', 5 => 'social', 3 => 'advanced-technical');
-
- $prg = pg_query("select
- h.name as hallname,h.id as hallid,
- to_char(starts_at, 'DD FMMonth - FMDay') as dt,
- to_char(s.starts_at,'HH24:MI')|| ' - ' || to_char(s.ends_at,'HH24:MI') as slot,
- e.title, e.subtitle, e.language, e.id as eventid,
- e.abstract, e.description,
- t.name as tname,t.id as trackid,
- array_agg(sp.first_name || ' ' || sp.last_name)::text as spname
- from
- slots s join halls h on h.id=s.hall_id
- join events e on s.event_id = e.id
- join tracks t on t.id=e.track_id
- left join events_speaker_profiles esp on esp.event_id=e.id
- left join speaker_profiles sp on esp.speaker_profile_id=sp.id
- where
- not s.event_id is null and h.id in (1,2,3)
- group by h.name, h.id, starts_at, ends_at, t.id, e.title, e.subtitle, e.language, e.id, s.hall_id
- order by date(s.starts_at),s.starts_at, s.hall_id;
- ");
-
-
- $dtrans = array('01 November - Saturday' => '01 ноември - събота', '02 November - Sunday' => '02 ноември - неделя');
-
-$p = array();
-while ($row = pg_fetch_object($prg)) {
- $p[$row->dt][$row->slot][$row->hallname]=$row;
-}
-
-
- $bgpost = array();
- $enpost = array();
-
- $bgpost['ID'] = $sched_bg;
- $enpost['ID'] = $sched_en;
-
- $bgpost['post_title'] = "Програма";
- $enpost['post_title'] = "Schedule";
-
- $bgpost['post_name'] = "programa";
- $enpost['post_name'] = "schedule";
-
- $bgpost['post_author'] = 2;
- $enpost['post_author'] = 2;
-
- $bgpost['post_date'] = "2014-10-13 00:01:02";
- $enpost['post_date'] = "2014-10-13 00:01:02";
-
- $cdate='';
- $chall='';
-
-
- $clearsmb=array('{', '}', '"');
-
- $events = array();
-
- foreach ($p as $day => $dayv) {
- $bg .=''.$dtrans[$day].' | |
'."\n";
- $en .=''.$day.' | |
'."\n";
- foreach ($dayv as $slot => $slotv) {
- $bg .= ''.$slot.' | '."\n";
- $en .= '
'.$slot.' | '."\n";
- $h=0;
- foreach ($slotv as $hall => $event){
- $h++;
- while ($h < $event->hallid) {
- $h++;
- $bg .= " | \n";
- $en .= " | \n";
- }
-
- $spkarr = explode(',', str_replace($clearsmb, '' ,$event->spname));
- $spkbgarr = array();
- $spkenarr = array();
- foreach ($spkarr as $val){
- if ($val == "NULL") continue;
- $spkbgarr[] = ''.htmlentities($val).'';
- $spkenarr[] = ''.htmlentities($val).'';
- }
- $spkbg = implode(", ", $spkbgarr);
- $spken = implode(", ", $spkenarr);
-
- if (count($spkbgarr)>0) {
- $event->spken = '('.$spken.')';
- $event->spkbg = '('.$spkbg.')';
- } else {
- $event->spken = '';
- $event->spkbg = '';
- }
-
- $events[] = $event;
-
- $bg .= ''.htmlentities($event->title).'';
- $bg .=' '.$spkbg.' | '."\n";
-
- $en .= ''.htmlentities($event->title).'';
- $en .=' '.$spken.' | '."\n";
-
- #var_dump($event);
-
- }
- while ($h < 3) {
- $h++;
- $bg .= " | \n";
- $en .= " | \n";
- }
- $bg .= '
'."\n";
- $en .= ''."\n";
- }
- }
-
- $bg .= '
';
- $en .= '
';
- $legend = '
-
- Technical |
- Advanced technical |
- Social |
- Open art |
- Open biz |
- Civic hacking |
- Misc |
- English |
- Български |
-
';
- $bg .= $legend;
- $en .= $legend;
-
-
- $bg .= '';
- $en .= '';
-
-
-
- foreach ($events as $k => $event) {
- if ($event->spkbg=='') continue;
- $bg .= '';
- $bg .= ' '.$event->title.' '.$event->spkbg.'
';
- if (strlen($event->subtitle)>2) $bg .= '
'.htmlentities($event->subtitle).'
';
- $bg .= ''.htmlentities($event->abstract).'
';
-# $bg .= ''.htmlentities($event->description).'
';
- $bg .= "";
-
- $bg .= '';
-
- $en .= '';
- $en .= ' '.$event->title.' '.$event->spken.'
';
- if (strlen($event->subtitle)>2) $en .= '
'.htmlentities($event->subtitle).'
';
- $en .= ''.htmlentities($event->abstract).'
';
-# $en .= ''.htmlentities($event->description).'
';
- $en .= "";
-
- $en .= '';
-
- };
- $bg .= '';
- $en .= '';
-
-
- $bgpost['post_content'] = $bg;
- $enpost['post_content'] = $en;
-
- $bgpost['post_content_filtered'] = $bg;
- $enpost['post_content_filtered'] = $en;
-
- $bgpost['post_status'] = 'publish';
- $enpost['post_status'] = 'publish';
-
- $bgpost['post_type'] = 'page';
- $enpost['post_type'] = 'page';
-
- $bgpost['filter'] = true;
- $enpost['filter'] = true;
-
- kses_remove_filters();
-
- wp_insert_post($bgpost);
- wp_insert_post($enpost);
-
-
diff --git a/load-speakers.php b/load-speakers.php
deleted file mode 100644
index 51ca2c1..0000000
--- a/load-speakers.php
+++ /dev/null
@@ -1,74 +0,0 @@
- 'speakers','lang' => $lang, 'nopaging' => 'true');
- $speakers = new WP_Query( $speakers_args );
-
- $result = $speakers->get_posts();
- # var_dump($result);
-
- foreach ($result as $k=>$v) {
- $args = array(
- 'post_parent' => $v->id,
- 'post_type' => 'attachment',
- 'posts_per_page' => -1,
- 'post_status' => 'any' );
-
- $chld = get_children($args);
- foreach ($chld as $k => $att) {
- if (preg_match('/^photo_spk/', $att->post_name))
- wp_delete_post($att->ID, true);
- }
- wp_delete_post($v->ID, true);
- }
- }
-
- $spk = pg_query("select
- distinct sp.user_id, sp.id, sp.first_name, sp.last_name, e.language, picture, biography, github, twitter, public_email
- from
- speaker_profiles sp join events_speaker_profiles esp on sp.id=esp.speaker_profile_id
- join events e on esp.event_id=e.id
- where e.state=1
- order by sp.first_name, sp.last_name;
-");
-
- while ($row = pg_fetch_object($spk)) {
- $newpost = array();
- $newpost['post_type'] = 'speakers';
- $newpost['post_status'] = 'publish';
- $newpost['post_title'] = $row->first_name." ".$row->last_name;
- $newpost['post_content'] = $row->biography;
- $newpost['post_excerpt'] = $row->biography;
-
- $postid=wp_insert_post($newpost);
- $url = 'https://cfp.openfest.org/uploads/speaker_profile/picture/'.$row->id.'/schedule_'.$row->picture;
- echo $url."\n";
- $att = media_sideload_image($url, $postid, "photo_spk_bg_".$row->user_id);
- preg_match("%src='(http://[^']*)'%", $att, $matches);
- $wpurl = $matches[1];
- $attid = pn_get_attachment_id_from_url($wpurl);
- add_post_meta($postid, '_thumbnail_id', $attid);
- pll_set_post_language($postid, 'bg');
-
- $postid_en=wp_insert_post($newpost);
- $url = 'https://cfp.openfest.org/uploads/speaker_profile/picture/'.$row->id.'/schedule_'.$row->picture;
- echo $url."\n";
- $att = media_sideload_image($url, $postid_en, "photo_spk_en_".$row->user_id);
- preg_match("%src='(http://[^']*)'%", $att, $matches);
- $wpurl = $matches[1];
- $attid = pn_get_attachment_id_from_url($wpurl);
- add_post_meta($postid_en, '_thumbnail_id', $attid);
- pll_set_post_language($postid_en, 'en');
-
- foreach (array($postid, $postid_en) as $v) {
- if (strlen($row->github)>1) add_post_meta ($v, 'github', $row->github);
- if (strlen($row->twitter)>1) add_post_meta ($v, 'twitter', $row->twitter);
- if (strlen($row->public_email)>1) add_post_meta ($v, 'public_email', $row->public_email);
- }
-
- pll_save_post_translations(array($postid => 'bg', $postid_en => '$en'));
-
- }
-
diff --git a/load-workshops.php b/load-workshops.php
deleted file mode 100644
index d251906..0000000
--- a/load-workshops.php
+++ /dev/null
@@ -1,195 +0,0 @@
- | Зала Пловдив | Зала Бургас |
';
- $en = ' | Plovdiv Hall | Burgas Hall |
';
-
- $tracks=array(8 => 'open-biz', 9 => 'open-art', 2 => 'technical', 6 => 'civic', 5 => 'social', 3 => 'advanced-technical');
-
- $prg = pg_query("select
- h.name as hallname,h.id as hallid,
- to_char(starts_at, 'DD FMMonth - FMDay') as dt,
- to_char(s.starts_at,'HH24:MI')|| ' - ' || to_char(s.ends_at,'HH24:MI') as slot,
- e.title, e.subtitle, e.language, e.id as eventid,
- e.abstract, e.description,
- t.name as tname,t.id as trackid,
- array_agg(sp.first_name || ' ' || sp.last_name)::text as spname
- from
- slots s join halls h on h.id=s.hall_id
- join events e on s.event_id = e.id
- join tracks t on t.id=e.track_id
- left join events_speaker_profiles esp on esp.event_id=e.id
- left join speaker_profiles sp on esp.speaker_profile_id=sp.id
- where
- not s.event_id is null and h.id in (4,5)
- group by h.name, h.id, starts_at, ends_at, t.id, e.title, e.subtitle, e.language, e.id, s.hall_id
- order by date(s.starts_at),s.starts_at, s.hall_id;
- ");
-
-
- $dtrans = array('01 November - Saturday' => '01 ноември - събота', '02 November - Sunday' => '02 ноември - неделя');
-
-$p = array();
-while ($row = pg_fetch_object($prg)) {
- $p[$row->dt][$row->slot][$row->hallname]=$row;
-}
-
-
- $bgpost = array();
- $enpost = array();
-
- $bgpost['ID'] = $sched_bg;
- $enpost['ID'] = $sched_en;
-
- $bgpost['post_title'] = "Workshop-и";
- $enpost['post_title'] = "Workshops";
-
- $bgpost['post_name'] = "workshopsbg";
- $enpost['post_name'] = "workshops";
-
- $bgpost['post_author'] = 2;
- $enpost['post_author'] = 2;
-
- $bgpost['post_date'] = "2014-10-13 00:01:02";
- $enpost['post_date'] = "2014-10-13 00:01:02";
-
- $cdate='';
- $chall='';
-
-
- $clearsmb=array('{', '}', '"');
-
- $events = array();
-
- foreach ($p as $day => $dayv) {
- $bg .=''.$dtrans[$day].' | |
'."\n";
- $en .=''.$day.' | |
'."\n";
- foreach ($dayv as $slot => $slotv) {
- $bg .= ''.$slot.' | '."\n";
- $en .= '
'.$slot.' | '."\n";
- $h=0;
- foreach ($slotv as $hall => $event){
- $h++;
- while ($h+3 < $event->hallid) {
- $h++;
- $bg .= " | \n";
- $en .= " | \n";
- }
-
- $spkarr = explode(',', str_replace($clearsmb, '' ,$event->spname));
- $spkbgarr = array();
- $spkenarr = array();
- foreach ($spkarr as $val){
- if ($val == 'NULL') continue;
- $spkbgarr[] = ''.htmlentities($val).'';
- $spkenarr[] = ''.htmlentities($val).'';
- }
- $spkbg = implode(", ", $spkbgarr);
- $spken = implode(", ", $spkenarr);
-
- if (count($spkbgarr)>0) {
- $event->spken = '('.$spken.')';
- $event->spkbg = '('.$spkbg.')';
- } else {
- $event->spken = '';
- $event->spkbg = '';
- }
-
- $events[] = $event;
-
- $bg .= ''.htmlentities($event->title).'';
- $bg .=' '.$spkbg.' | '."\n";
-
- $en .= ''.htmlentities($event->title).'';
- $en .=' '.$spken.' | '."\n";
-
- #var_dump($event);
-
- }
- while ($h < 2) {
- $h++;
- $bg .= " | \n";
- $en .= " | \n";
- }
- $bg .= '
'."\n";
- $en .= ''."\n";
- }
- }
-
- $bg .= '
';
- $en .= '
';
- $legend = '
-
- Technical |
- Advanced technical |
- Social |
- Open art |
- Open biz |
- Civic hacking |
- Misc |
- English |
- Български |
-
';
- $bg .= $legend;
- $en .= $legend;
-
-
- $bg .= '';
- $en .= '';
-
-
-
- foreach ($events as $k => $event) {
- if ($event->spkbg=='') continue;
- $bg .= '';
- $bg .= ' '.$event->title.' '.$event->spkbg.'
';
- if (strlen($event->subtitle)>2) $bg .= '
'.htmlentities($event->subtitle).'
';
- $bg .= ''.htmlentities($event->abstract).'
';
-# $bg .= ''.htmlentities($event->description).'
';
- $bg .= "";
-
- $bg .= '';
-
- $en .= '';
- $en .= ' '.$event->title.' '.$event->spken.'
';
- if (strlen($event->subtitle)>2) $en .= '
'.htmlentities($event->subtitle).'
';
- $en .= ''.htmlentities($event->abstract).'
';
-# $en .= ''.htmlentities($event->description).'
';
- $en .= "";
-
- $en .= '';
-
- };
- $bg .= '';
- $en .= '';
-
-
- $bgpost['post_content'] = $bg;
- $enpost['post_content'] = $en;
-
- $bgpost['post_content_filtered'] = $bg;
- $enpost['post_content_filtered'] = $en;
-
- $bgpost['post_status'] = 'publish';
- $enpost['post_status'] = 'publish';
-
- $bgpost['post_type'] = 'page';
- $enpost['post_type'] = 'page';
-
- $bgpost['filter'] = true;
- $enpost['filter'] = true;
-
- kses_remove_filters();
-
- wp_insert_post($bgpost);
- wp_insert_post($enpost);
-
-
diff --git a/schedule-config.php b/schedule-config.php
deleted file mode 100644
index af37ac5..0000000
--- a/schedule-config.php
+++ /dev/null
@@ -1,59 +0,0 @@
- array('lectures' => array(1, 2, 3), 'workshops' => array(4, 5), 'all' => array(1, 2, 3, 4, 5) ),
- '2015' => array('lectures' => array(6, 7, 8), 'workshops' => array(9), 'all' => array(6, 7, 8, 9) ),
- '2016' => array('lectures' => array(10, 11, 12), 'workshops' => array(12, 13, 14), 'all' => array(10, 11, 12, 13, 14) )
-);
-
-/* clarion conference ids */
-$confids = array('2014' => 1, '2015' => 2, '2016' => 3);
-
-
-/* get stuff from WP and parse */
-$siteurl = get_option('siteurl');
-$year = preg_replace('%.*/([0-9]*)$%', '\1', $siteurl);
-
-$CF['confid'] = $confids[$year];
-
-/* TODO make this read the ids from the proper place, as this breaks other years*/
-if ( preg_match('/^workshop/', $pagename) ) {
- $CF['allowedhallids'] = $hall_defs[$year]['workshops'];
-} else if (preg_match('/^(speakers|lektori)/', $pagename) ) {
- $CF['allowedhallids'] = $hall_defs[$year]['all'];
-} else {
- $CF['allowedhallids'] = $hall_defs[$year]['lectures'];
-}
-
-/*
- * There is no better way to get where the speakers are
- */
-
-if ('en' === $CF['lang']) {
- $CF['s_slug'] = 'speakers';
-} else {
- $CF['s_slug'] = 'lektori';
-}
-
-$args = array(
- 'name' => $CF['s_slug'],
- 'post_type' => 'page',
- 'numberposts' => 1
-);
-
-$speakers_url = '';
-
-$my_posts = get_posts($args);
-if( $my_posts ) {
- $CF['speakers_url'] = get_permalink( $my_posts[0]->ID );
-}
-
-
-?>