|
1 <?php |
|
2 include_once($this->path . '/pages/default_settings.php'); |
|
3 |
|
4 |
|
5 global $wpdb; |
|
6 if($id) { |
|
7 global $wpdb; |
|
8 $timeline = $wpdb->get_results('SELECT * FROM ' . $wpdb->base_prefix . 'ctimelines WHERE id='.$id); |
|
9 $timeline = $timeline[0]; |
|
10 } |
|
11 $title = $timeline->name; |
|
12 $cats = "["; |
|
13 $catArray = array(); |
|
14 $ccNumbers = array(); |
|
15 $catNumber = 0; |
|
16 |
|
17 foreach(explode('||',$timeline->settings) as $val) { |
|
18 $expl = explode('::',$val); |
|
19 if(substr($expl[0], 0, 8) == 'cat-name') { |
|
20 if($cats != "[") $cats .= ","; |
|
21 $cc = get_cat_name(intval(substr($expl[0], 9))); |
|
22 $cats .= "'".$cc."'"; |
|
23 array_push ($catArray,$cc); |
|
24 array_push ($ccNumbers, 0); |
|
25 $catNumber++; |
|
26 } |
|
27 else { |
|
28 $settings[$expl[0]] = $expl[1]; |
|
29 } |
|
30 |
|
31 } |
|
32 $cats .= "]"; |
|
33 |
|
34 |
|
35 if($settings['read-more'] == 'whole-item') { |
|
36 $read_more = "'.item'"; |
|
37 $swipeOn = 'false'; |
|
38 } |
|
39 else if ($settings['read-more'] == 'button') { |
|
40 $read_more = "'.read_more'"; |
|
41 $swipeOn = 'true'; |
|
42 } |
|
43 else { |
|
44 $read_more = "'none'"; |
|
45 $swipeOn = 'true'; |
|
46 } |
|
47 |
|
48 if($settings['cat-type'] == 'categories') { |
|
49 $cats = ', |
|
50 categories : '.$cats . ', |
|
51 numberOfSegments : ['; |
|
52 $cats .= $settings['number-of-posts']; |
|
53 for ($i = 1; $i < $catNumber; $i++) { |
|
54 $cats .= ', '. $settings['number-of-posts']; |
|
55 } |
|
56 $cats .= ']'; |
|
57 } |
|
58 else { |
|
59 $cats = ''; |
|
60 } |
|
61 if ($timeline->items != '') { |
|
62 $explode = explode('||',$timeline->items); |
|
63 $open_content_height = intval($settings['item-height']) - intval($settings['item-open-image-height']) - 2*intval($settings['item-open-content-padding']) -intval($settings['item-open-image-border-width']) - 6; |
|
64 |
|
65 $itemsArray = array(); |
|
66 foreach ($explode as $it) { |
|
67 $ex2 = explode('::', $it); |
|
68 $key = substr($ex2[0],0,strpos($ex2[0],'-')); |
|
69 $subkey = substr($ex2[0],strpos($ex2[0],'-')+1); |
|
70 $itemsArray[$key][$subkey] = $ex2[1]; |
|
71 } |
|
72 } |
|
73 |
|
74 |
|
75 include_once($this->path . '/pages/front_html.php'); |
|
76 include_once($this->path . '/pages/front_script.php'); |
|
77 ?> |