Exemple #1
0
 public function fbogs($node, $data)
 {
     /* BENCHMARK */
     $this->benchmark->mark('func_fbogs_start');
     /*dev_dump($node);
       dev_dump($image_node);
       dev_dump($image);*/
     // human type for text
     $human_type = $this->node_model->get_human_type($node['type']);
     // get the image data for individual image stuff
     $individual_image = $this->individual_image($data);
     // either the node, or the individual image with the title of the node it belongs to
     if (isset($individual_image['node'])) {
         $fb = "<meta property='og:title' content='" . str_replace("'", '', $individual_image['image']['image_name']) . ", an image belonging to " . str_replace("'", '', $individual_image['node']['name']) . " @ " . $this->config->item('site_name') . "'/>";
     } else {
         $fb = "<meta property='og:title' content='" . str_replace("'", '', $node['name']) . " @ " . $this->config->item('site_name') . "'/>";
     }
     // some common tags
     $fb .= '<meta property="og:type" content="website"/>';
     $fb .= '<meta property="og:url" content="' . current_url() . '"/>';
     // the image to share with facebook, use the thumbnail
     if (isset($individual_image['image'])) {
         // show the thumbnail of the individual image
         $fb .= '<meta property="og:image" content="' . base_url() . thumbnail_url($individual_image['image'], 200) . '"/>';
     } else {
         // get the image based on node and show that
         $image = $this->image_model->get_images($node['id']);
         if (count($image) > 0) {
             $fb .= '<meta property="og:image" content="' . base_url() . thumbnail_url($image[0], 200) . '"/>';
         } else {
             $fb .= '<meta property="og:image" content="' . base_url() . $this->config->item('default_image') . '"/>';
         }
     }
     // finally close it up - set $node = $image_node so the short desc comes from the node to which the image belongs
     if (isset($individual_image['node'])) {
         $node = $individual_image['node'];
     }
     $fb .= '<meta property="og:site_name" content="' . $this->config->item('site_name') . '"/>';
     $fb .= '<meta property="og:description" content="' . $node['short_desc'] . '"/>';
     $fb .= '<meta property="fb:admins" content="' . $this->config->item('fbadmin') . '"/>';
     /* BENCHMARK */
     $this->benchmark->mark('func_fbogs_end');
     return $fb;
 }
Exemple #2
0
<a href="<?php 
echo str_replace('//', '/', '/' . $attachment);
?>
">
  <img src="<?php 
echo thumbnail_url($attachment);
?>
" alt="<?php 
echo $description;
?>
">
</a>
 public function save_images($post, $images, $node_id = null)
 {
     /* BENCHMARK */
     $this->benchmark->mark('func_save_images_start');
     // open message
     $message = "";
     // ready for a batch update
     $update_data = array();
     // count removes to adjust the scores
     $removes = array();
     // if there are actually some images
     if (count($images)) {
         foreach ($images as $img) {
             // name the names in the update array
             if (isset($post[$img["node_id"] . "name"])) {
                 if (image_name($img, 1000) != $post[$img["node_id"] . "name"]) {
                     $message .= image_name($img) . " has been renamed to '" . $post[$img["node_id"] . "name"] . "'<br/>";
                 }
                 $update_data[] = array('node_id' => $img["node_id"], 'image_name' => $post[$img["node_id"] . "name"]);
             }
             // and if we hit a main then catch that
             if (isset($post["main"]) && $post["main"] == $img["node_id"]) {
                 // set the main
                 if ($img['main'] != 1) {
                     // only message if main is actually changed
                     $message .= image_name($img) . ' is now the main image<br/>';
                 }
                 if (isset($post[$img["node_id"] . 'gallery'])) {
                     $update_data[] = array('node_id' => $img["node_id"], 'main' => 1, 'in_gallery' => 1);
                 } else {
                     $update_data[] = array('node_id' => $img["node_id"], 'main' => 1, 'in_gallery' => 0);
                 }
                 if (isset($node_id)) {
                     // update the node table with the new image id
                     $this->image_model->set_image_in_node($node_id, $img);
                     // update the action table to change images retrospectively
                     $this->stream_model->set_image_in_stream($node_id, $img);
                     // update the image in the message tables
                     $this->load->model('message_model');
                     $this->message_model->set_image_in_messages($node_id, $img);
                     // update the image in the comment tables
                     $this->load->model('comment_model');
                     $this->comment_model->set_image_in_comments($node_id, $img);
                 }
             } else {
                 if (isset($post[$img["node_id"] . 'gallery'])) {
                     if (null == $node_id) {
                         $update_data[] = array('node_id' => $img["node_id"], 'in_gallery' => 1);
                     } else {
                         $update_data[] = array('node_id' => $img["node_id"], 'main' => 0, 'in_gallery' => 1);
                     }
                 } else {
                     if (null == $node_id) {
                         $update_data[] = array('node_id' => $img["node_id"], 'in_gallery' => 0);
                     } else {
                         $update_data[] = array('node_id' => $img["node_id"], 'main' => 0, 'in_gallery' => 0);
                     }
                 }
             }
             // then removes
             if (isset($post[$img["node_id"] . "remove"])) {
                 $message .= image_name($img) . ' has been removed<br/>';
                 $this->load->model('node_admin_model');
                 $this->node_admin_model->delete_node('image', $img['node_id']);
                 $removes[] = thumbnail_url($img, '300');
             }
         }
         // batch processing much more efficient :-)
         $this->db->update_batch('image', $update_data, 'node_id');
         // close message
         $message .= "";
     } else {
         $message .= "<span class='fail message'>you must upload some images first before setting mains or deleting</span>";
     }
     // adjust the score and actions for the removal of images
     $remove_count = count($removes);
     if ($remove_count > 0) {
         $this->load->model('score_model');
         $this->load->model('stream_model');
         $node = $this->node_model->get_node($node_id);
         $score = $this->score_model->get_score('actor_score', 2, $node);
         $this->score_model->update_score($this->user, 0 - $score * $remove_count);
         foreach ($removes as $r) {
             $this->stream_model->undo_image_action($r, $node);
         }
     }
     return $message;
     /* BENCHMARK */
     $this->benchmark->mark('func_save_images_end');
 }
Exemple #4
0
<?php

echo $this->load->view("template/node/details_heading");
?>
<div id='images' class='node_panel images'>
	<?php 
if (count($images) > 0) {
    echo "<img class='main_image' src='" . thumbnail_url($images[0], 960, 'gal') . "' alt=''/>";
    foreach ($images as $i) {
        echo "<img class='thumb' src='" . thumbnail_url($i, 225, 'gal') . "' alt=''/>";
    }
}
?>
</div>
Exemple #5
0
 function set_image_in_messages($node_id, $img)
 {
     /* BENCHMARK */
     $this->benchmark->mark('func_set_image_in_messages_start');
     $image_path = thumbnail_url($img, '300');
     // actor first
     $update_data = array('user_image' => $image_path);
     $this->db->where('user_id', $node_id);
     $this->db->update('message', $update_data);
     /* BENCHMARK */
     $this->benchmark->mark('func_set_image_in_messages_end');
 }
Exemple #6
0
cockpit("cockpit")->assets(["js/jquery-2.1.1.js", "js/imagesloaded.pkgd.min.js", "js/packery.pkgd.min.js", "js/intense.min.js", "js/spin.min.js", "js/script.js", "css/reset.css", "css/style.css"], 'style');
?>
</head>
<body>
    <?php 
region('header');
?>

    <div class="content">
        <div class="content-wrapper grid">

            <?php 
foreach (gallery('home') as $image) {
    ?>
                <?php 
    $thumburl = thumbnail_url($image["path"], 1280, $options);
    ?>

                <div class="item">
                    <a data-image="<?php 
    echo $thumburl;
    ?>
" data-title="<?php 
    echo $image["data"]["title"];
    ?>
" data-caption="<?php 
    echo $image["data"]["caption"];
    ?>
" href="javascript:void(0);" >
                        <?php 
    thumbnail($image["path"], 250, $options);
function ws_get_article($keyword, $limit = 10)
{
    query_posts(array('s' => $keyword));
    $i = 0;
    $results = array();
    while (have_posts() && $i < 10) {
        the_post();
        $result['title'] = get_the_title();
        $result['content'] = mb_strimwidth(get_the_content(), 0, 200, '...', 'UTF-8');
        $result['url'] = get_site_url() . '/?p=' . get_the_id();
        $result['pic'] = thumbnail_url(get_the_post_thumbnail());
        if (!$result['pic']) {
            $result['pic'] = get_site_url() . DEFAULT_COVER;
        }
        $results[] = $result;
        $i++;
    }
    if (count($results) > 0) {
        return $results;
    } else {
        return false;
    }
}
Exemple #8
0
 public function set_image_in_node($node_id, $img)
 {
     /* BENCHMARK */
     $this->benchmark->mark('func_set_image_in_node_start');
     $this->load->model('node_admin_model');
     // the image update data
     $node_update_data = array('image' => thumbnail_url($img, '300'));
     // update
     $this->node_admin_model->node_update($node_id, $node_update_data);
     /* BENCHMARK */
     $this->benchmark->mark('func_set_image_in_node_end');
 }
 public function node_details_data($panel, $data, $user, $node)
 {
     /* BENCHMARK */
     $this->benchmark->mark('func_node_details_data_start');
     // common to all nodes - things like tabs, images, inplace editing etc.
     // IMAGE - the main image for the node
     $img = $this->image_model->get_images($node['id'], 1);
     if (count($img)) {
         $data['main_image'] = "/user_img/" . $img[0]['user_id'] . "/" . $img[0]['image_filename'] . "s700" . $img[0]['image_ext'];
         $data['main_thumb'] = thumbnail_url($img[0], 360);
         $data['small_thumb'] = thumbnail_url($img[0], 120);
     }
     // IMAGES
     // all the images
     $data['images'] = $this->image_model->get_images($node['id'], 1);
     // a large image slider
     // INPLACE EDITING - set up the in place editing
     if (($user['user_type'] == 'super_admin' or $user['user_type'] == 'admin_user' or 1 == $data['owns_node']) && 0 == $data['admin_page']) {
         $data['javascript'] .= "<script type='text/javascript' src='/js/tinymce/tiny_mce.js'></script>";
         $data['admin_user'] = 1;
         $data['clean_html'] = quotes_to_entities(preg_replace('/\\s+/', ' ', addslashes($data['node_details']['node_html'])));
         $hidden_data = array('node_id' => $node['id']);
         $data['html_form_open'] = form_open($node['type'] . '/' . $node['id'] . '/inplace_save', '', $hidden_data);
     } else {
         $data['admin_user'] = 0;
         $data['clean_html'] = '';
         $data['html_form_open'] = '';
     }
     $data['details_text'] = '';
     $data['in_page'] = '';
     // where is it going ?
     if (1 == $node['show_in_details'] ? $ref = 'details_text' : ($ref = 'in_page')) {
     }
     // build the deatils text, in a form if needed
     $data[$ref] .= "<div id='" . $node['type'] . "_text' class='node_text'>";
     if (1 == $data['admin_user'] && 1 == $node['show_edit']) {
         $data[$ref] .= $data['html_form_open'];
         $data[$ref] .= "<div id='node_html_edit_button' class='submit' onclick='load_inplace(\"" . $data['clean_html'] . "\",\"" . $user['user_id'] . "\")'>click to edit</div>";
         $data[$ref] .= "<div id='" . $node['type'] . "_html_display' class='node_html_display'>";
         $data[$ref] .= "<div class='" > $node['type'] . "_html editable'>";
         $data[$ref] .= $data['node_details']['node_html'];
         $data[$ref] .= "</div>";
         $data[$ref] .= "</form>";
     } else {
         $data[$ref] .= "<div class='" . $node['type'] . "_html_display node_html_display'>";
         $data[$ref] .= $data['node_details']['node_html'];
         $data[$ref] .= "</div>";
     }
     $data[$ref] .= "</div>";
     // SCROLLERS - next and previous nodes in this set of nodes
     if (in_array($node['type'], $this->config->item('scroller_array'))) {
         $panel_suffix = '';
         if (isset($panel)) {
             if ($node['type'] != 'calendar' || $panel != 'details') {
                 $panel_suffix = "/" . $panel;
             } else {
                 if (strlen($data['url_extra'])) {
                     $panel_suffix = "/" . $data['url_extra'];
                 }
             }
         }
         if ($this->session->userdata('search_term')) {
             $this->load->model('search_model');
             $nodes = $this->search_model->search($this->session->userdata('search_term'), $this->config->item('search_nodes'));
             $next_prev_text = 'search result';
         } else {
             $nodes = $this->node_model->get_nodes(array('type' => $node['type'], 'visible' => 1));
             $next_prev_text = $node['human_type'];
         }
         $scroll_intro_text = "scroll through " . $next_prev_text . "s:";
         $nc = count($nodes);
         for ($x = 0; $x < $nc; $x++) {
             if ($nodes[$x]['url'] == $node['url']) {
                 if (0 == $x) {
                     $pl = "<span class='left_scr_deact scr_deact sprite'>previous " . $next_prev_text . "</span>";
                     $pl .= "<span class='scr_divider'>|</span>";
                     if (1 == $nc) {
                         $nl = "<span class='right_scr_deact scr_deact sprite'>next " . $next_prev_text . "</span>";
                     } else {
                         $nl = "<a href='/" . $nodes[$x + 1]['url'] . $panel_suffix . "' title='next " . $next_prev_text . ": " . str_replace("'", '', $nodes[$x + 1]['name']) . "'><span class='right_scr scr sprite'>next " . $next_prev_text . "</span></a>";
                     }
                 } elseif ($x == $nc - 1) {
                     $pl = "<a href='/" . $nodes[$x - 1]['url'] . $panel_suffix . "' title='previous " . $next_prev_text . ": " . str_replace("'", '', $nodes[$x - 1]['name']) . "'><span class='left_scr scr sprite'>previous " . $next_prev_text . "</span></a>";
                     $pl .= "<span class='scr_divider'>|</span>";
                     $nl = "<span class='right_scr_deact scr_deact sprite'>next " . $next_prev_text . "</span>";
                 } else {
                     $pl = "<a href='/" . $nodes[$x - 1]['url'] . $panel_suffix . "' title='previous " . $next_prev_text . ": " . str_replace("'", '', $nodes[$x - 1]['name']) . "'><span class='left_scr scr sprite'>previous " . $next_prev_text . "</span></a>";
                     $pl .= "<span class='scr_divider'>|</span>";
                     $nl = "<a href='/" . $nodes[$x + 1]['url'] . $panel_suffix . "' title='next " . $next_prev_text . ": " . str_replace("'", '', $nodes[$x + 1]['name']) . "'><span class='right_scr scr sprite'>next " . $next_prev_text . "</span></a>";
                 }
             }
         }
     }
     // set the html snippet
     $scr = '';
     if (0 == $data['admin_page']) {
         if (isset($pl) && isset($nl)) {
             $scr .= "<div id='scrollers'>";
             $scr .= "<span id='scroll_intro'>" . $scroll_intro_text . "</span>";
             $scr .= "<div id='scroll_buttons'>";
             $scr .= $pl;
             $scr .= $nl;
             $scr .= "</div>";
             $scr .= "</div>";
         }
     }
     $data['scrollers'] = $scr;
     // SOCIAL - includes share this stuff etc.
     $sb = '';
     if (1 == $node['social']) {
         // !!!!!
         // NB needs to be in a model so it can be used on lists
         // get the sites to share to from this node
         $sites = $this->config->item('social_sites');
         // open social_buttons
         $sb .= "<div id='share_buttons'>";
         // iterate - we can add extra ones in here as and when
         foreach ($sites as $site => $config) {
             switch ($site) {
                 case 'facebook':
                     $sb .= $this->share_model->facebook_like($config, $node, $data);
                     break;
                 case 'twitter':
                     $sb .= $this->share_model->tweet_button($config, $node, $data);
                     break;
             }
         }
         // close social_buttons
         $sb .= "</div>";
     }
     $data['share_buttons'] = $sb;
     // TABS - tab menus, different for each type of node, not if admin
     $data['tabs'] = array();
     $data['count_unread'] = '';
     if (1 == $node['show_tabs']) {
         $tabs_config = $this->config->item('tabs');
         if (is_array($tabs_config)) {
             // first look for type based tabs
             $data['tabs'] = $tabs_config[$node['type']];
         } else {
             // old sites, only ever used details
             $data['tabs'][] = 'details';
         }
     }
     // TAB - specific data for each tab type
     $actions = array();
     $articles = array();
     $comments = array();
     $comment_form = '';
     $conversations = array();
     $images = array();
     $messages = array();
     $message_form = '';
     $stream = array();
     switch ($panel) {
         case 'articles':
         case 'blog':
             $articles = $this->node_model->get_nodes(array('type' => 'article', 'user_id' => $node['id'], 'visible' => 1), 1);
             break;
         case 'calendar':
             $calendar = array();
             $calendars = $this->node_model->get_nodes(array('type' => 'calendar', 'user_id' => $node['id']));
             if (count($calendars) > 0) {
                 $this->load->model('events_model');
                 $calendar = $this->node_model->get_node($calendars[0]['id'], 'calendar');
                 $calendar = $this->events_model->get_calendar($calendar, $node['url'] . "/calendar", $data['params']);
             }
             $data['calendar'] = $calendar;
         case 'comments':
         case 'details':
         case 'intro':
             $this->load->model('comment_model');
             $comments = $this->comment_model->get_comments($node);
             $comment_form = $this->comment_model->comment_form($node);
             $data['javascript'] .= "<script src='/js/comments.js'></script>";
             $data['javascript'] .= "<script type='text/javascript' src='/js/tinymce/tiny_mce.js'></script>";
         case 'images':
         case 'gallery':
             $images = $this->image_model->get_images($node['id']);
             break;
         case 'messages':
             if (isset($this->user['user_id'])) {
                 $this->load->model('conversation_model');
                 $this->load->model('message_model');
                 if ($node['id'] == $user['id']) {
                     // get the conversations
                     $conversations = $this->conversation_model->get_users_conversations($user);
                     if (count($conversations) > 0) {
                         $conversation = $conversations[0];
                         $messages = $this->message_model->get_conversation_messages($user, $conversation);
                     }
                     // form if we have a conversation
                     if (isset($conversation) && count($conversation) > 0) {
                         $message_form = $this->message_model->message_form($conversation);
                     }
                 } else {
                     // just get the messages between the user and the node
                     $conversation = $this->conversation_model->get_conversation($user, $node);
                     // form anyway, to start a conversation
                     if (!is_array($conversation)) {
                         $conversation = array('conversation_id' => 0);
                     }
                     if (count($conversation) > 0) {
                         $messages = $this->message_model->get_conversation_messages($user, $conversation);
                     }
                     $message_form = $this->message_model->message_form($conversation, $node);
                 }
                 $data['javascript'] .= "<script src='/js/messages.js'></script>";
                 $data['javascript'] .= "<script type='text/javascript' src='/js/tinymce/tiny_mce.js'></script>";
             }
             break;
         case 'stream':
         case 'activity':
             // stream model is also used below to merge streams for users
             $this->load->model('stream_output_model');
             $stream = $this->stream_output_model->get_actions($node);
             $this->load->config('action');
             $actions = $this->config->item('stream_actions');
             break;
     }
     $data['actions'] = $actions;
     $data['articles'] = $articles;
     $data['comments'] = $comments;
     $data['comment_form'] = $comment_form;
     $data['conversations'] = $conversations;
     $data['images'] = $images;
     $data['messages'] = $messages;
     $data['message_form'] = $message_form;
     $data['stream'] = $stream;
     // TAB HTML
     $ntb = '';
     // only if there are tabs (and they are shown as this array will be empty if not)
     if (count($data['tabs']) > 0) {
         // open the list
         $ntb .= "<div id='node_tabs'>";
         $ntb .= "<ul>";
         // iterate over the tabs set above
         for ($x = 0; $x < count($data['tabs']); $x++) {
             // class for selected
             if ($data['current_tab'] == $data['tabs'][$x] ? $class = 'tab_sel' : ($class = 'tab')) {
             }
             // message count for the message tab
             if ('messages' == $data['tabs'][$x]) {
                 $this->load->model('message_model');
                 $count_unread = $this->message_model->count_unread($user);
                 $suffix = '';
                 if (isset($count_unread['unread'])) {
                     $suffix = " [" . $count_unread['unread'] . "]";
                 }
                 $tab_text = $data['tabs'][$x] . $suffix;
             } else {
                 $tab_text = $data['tabs'][$x];
             }
             // the tab itself
             $ntb .= "<li>";
             $ntb .= "<a href='/" . $data['node']['url'] . "/" . $data['tabs'][$x] . "'>";
             $ntb .= "<span class='" . $class . "'>";
             $ntb .= $tab_text;
             $ntb .= "</span>";
             $ntb .= "</a>";
             $ntb .= "</li>";
         }
         // close the list
         $ntb .= "</ul>";
         $ntb .= "</div>";
     }
     $data['node_tabs'] = $ntb;
     // VOTE BUTTONS
     $data['vote_buttons'] = '';
     if (isset($user['id']) && is_numeric($user['id'])) {
         $this->load->model('voting_model');
         $data['vote_buttons'] = "<div class='vote_buttons votes" . $node['id'] . "'>" . $this->voting_model->get_vote_buttons($user, $node) . "</div>";
     }
     // specific to node type, such as add to basket, variations and user connection stuff
     // CALENDAR
     if (!isset($calendar)) {
         $calendar = '';
     }
     if ('calendar' == $node['type']) {
         $this->load->model('events_model');
         $calendar = $this->events_model->get_calendar($node, $node['url'], $data['url_extra']);
     }
     if (isset($node['calendar_id']) && $node['calendar_id'] > 0) {
         $this->load->model('events_model');
         $calendar = $this->events_model->get_calendar($this->node_model->get_node($node['calendar_id'], 'calendar'), $node['url'] . "/calendar", $data['params']);
     }
     $data['calendar'] = $calendar;
     // EVENT (OR ANY EVENTS ARE FOUND WITH THIS AS A CATEGORY ID)
     $query = $this->db->select('*')->from('node')->where("type = 'event' and (id = " . $node['id'] . " or category_id = " . $node['id'] . ")");
     $res = $query->get();
     $events = $res->result_array();
     $el = array('past' => array(), 'upcoming' => array());
     if (count($events) > 0) {
         $now = time();
         $events_by_id = $this->node_model->nodes_by_id($events);
         // get all the ids into an array
         $nids = array();
         foreach ($events as $e) {
             $nids[] = $e['id'];
         }
         // get all the event instances from the nvar table, ordered by time stamp
         $seq = array();
         if (count($nids)) {
             $query = $this->db->select('*')->from('nvar')->where_in('node_id', $nids)->order_by('event_timestamp');
             $res = $query->get();
             $seq = $res->result_array();
         }
         // iterate over all the event instances
         foreach ($seq as $e) {
             // place into the correct array
             if ($now > $e['event_timestamp'] ? $akey = 'past' : ($akey = 'upcoming')) {
             }
             // get the event for this iteration
             $event = $events_by_id[$e['node_id']];
             // convert the timestamp
             $dt = get_now($e['event_timestamp']);
             // if this is node is a category into which events falls
             if (count($events) > 1) {
                 // just the sequence details, rest on the page
                 $edet = $e['event_timestamp'];
             } else {
                 // output heading with link to event, use event query data
                 $edet = $event['name'] . '-' . $e['event_timestamp'];
             }
             // add to array - include the event and sequence details in case we want to use that in
             // project data model to build something more complex than a basic html output
             $el[$akey][] = array('html' => $edet, 'e' => array_merge($event, $e));
         }
         // reverse the past events so that the list starts with the most recent past event
         $el['past'] = array_reverse($el['past']);
     }
     $data['event_list'] = $el;
     // PRODUCT
     // add to basket button
     $data['add_to_basket'] = '';
     // add this product to basket panel
     $add_quantity = "<div id='add_quantity_field'><input id='add_quantity' class='form_field' type='text' name='add_quantity' value='1' onkeyup='check_quantity()' tabindex='11'/></div>";
     // only if product
     if ('product' == $node['type']) {
         $this->load->model('variation_model');
         $variations = json_decode($data['node_details']['nvar_json'], true);
         $c = 0;
         foreach ($variations as $v) {
             // select the first variation as default
             if (0 == $c) {
                 $data['main_variation'] = $this->variation_model->format_add_panel($v);
                 $selected = $v['nvar_id'];
             }
             // if we hit a main variation then update the variation
             if (1 == $v['main']) {
                 $data['main_variation'] = $this->variation_model->format_add_panel($v);
                 if (isset($data['selected']) ? $selected = $data['selected'] : ($selected = $v['nvar_id'])) {
                 }
                 break;
             }
             $c++;
         }
         $data['variation_selector'] = $this->variation_model->variation_selector($data['node_details'], $selected);
         $atb = '';
         // open add to basket panel
         $atb .= "<div id='add_basket_panel'>";
         // add panel text
         $atb .= "<div id='add_panel_text'>";
         $atb .= $data['main_variation'];
         $atb .= "</div>";
         // add panel - updated by js
         $atb .= "<div id='add_panel'>";
         $atb .= form_open('/basket/add');
         $atb .= "<input type='hidden' name='product_add' value=''/>";
         $atb .= $data['variation_selector'];
         $atb .= $add_quantity;
         $atb .= "<input id='add_submit' class='submit checkout' type='submit' name='submit' value='add to basket'/>";
         // no closing div for add_panel, its somewhere in the variation selector or :-\ must fix this !!
         $atb .= "</form>";
         // script builds button
         $atb .= '<script type="text/javascript">';
         $atb .= 'if (window.focus)';
         $atb .= '{';
         $atb .= 'var add_span="<div id=\'variation_selector_field\' class=\'check_this\'>' . $data['variation_selector'] . '</div>";';
         $atb .= 'add_span+="<span id=\'add_button\' class=\'submit checkout\' onclick=\'basket_add()\' tabindex=\'12\'>add to basket</span>";';
         $atb .= 'add_span+="' . $add_quantity . '<span id=\'not_enough_stock\'></span>";';
         $atb .= '$("#add_panel").html(add_span);';
         $atb .= '}';
         $atb .= '</script>';
         // close add to basket panel
         $atb .= "</div>";
         $data['add_to_basket'] = $atb;
     }
     // USER AND GROUP
     $data['connection_buttons'] = array();
     $followable = $this->config->item('followable');
     if ('user' == $node['type'] or 'groupnode' == $node['type'] or is_array($followable) && in_array($node['type'], $followable)) {
         $this->load->model('connection_model');
         $this->load->model('connection_button_model');
         // user and group connections - users have more connection types
         $data['connections'] = $this->connection_model->get_connections($node);
         // connection buttons
         if (isset($this->user['user_id'])) {
             $data['connection_buttons'] = $this->connection_button_model->connection_buttons($user, $node);
         }
     }
     // friends stream data
     if ('user' == $node['type'] && in_array($panel, array('stream', 'activity'))) {
     }
     return $data;
     /* BENCHMARK */
     $this->benchmark->mark('func_node_details_data_end');
 }
Exemple #10
0
<p>This site is part of <a href="http://www.teachingmen.com.au/">Teaching Men</a>, a research study by Ian Davis that explores how text and context, trope and history, narrative and construction operate within educational settings to produce and promote strategic styles of masculinity. This project highlights the importance of narrative, fictional and otherwise, in the practice and design of teaching, education and masculinity.</p>

<p>Ian and Stefan worked together on this site. Please let us know if you have any thoughts or comments about it.</p>

<div class="homepage-stories">
  <?php 
foreach ($homepage_stories as $homepage_story) {
    ?>
<div class="homepage-story">
    <a href="<?php 
    echo site_url('story/view/' . $homepage_story->story_id);
    ?>
">
      <img src="<?php 
    echo thumbnail_url($homepage_story->attachment);
    ?>
">
      <p><?php 
    echo $homepage_story->title . ' - ' . $homepage_story->description;
    ?>
</p>
    </a>
  </div><?php 
}
?>
</div>
<script>$(function() {
  $('.homepage-story img').addClass('instant');
  $('.homepage-stories').cycle({timeout: 10000, pause: true});
});</script>
Exemple #11
0
<?php

if (count($images) > 0) {
    //echo "<img class='main_image' src='".thumbnail_url($images[0],940,'s')."' alt=''/>";
    foreach ($images as $i) {
        echo "<img class='thumb' src='" . thumbnail_url($i, 300, 't') . "' alt='' width='225'/>";
    }
}
Exemple #12
0
 function set_image_in_stream($node_id, $img)
 {
     /* BENCHMARK */
     $this->benchmark->mark('func_set_image_in_stream_start');
     $image_path = thumbnail_url($img, '300');
     // actor first
     $update_data = array('actor_image' => $image_path);
     $this->db->where('actor_id', $node_id);
     $this->db->update('action', $update_data);
     // then target
     $update_data = array('target_image' => $image_path);
     $this->db->where(array('target_id' => $node_id, 'action_code !=' => 2));
     $this->db->update('action', $update_data);
     // then target owner
     $update_data = array('target_owner_image' => $image_path);
     $this->db->where('target_owner_id', $node_id);
     $this->db->update('action', $update_data);
     /* BENCHMARK */
     $this->benchmark->mark('func_set_image_in_stream_end');
 }
Exemple #13
0
function thumbnail_tag($img, $size, $resize = null, $classes = '')
{
    $img = get_image($img);
    if (null == $resize) {
        $resize = $size;
    }
    $img_url = thumbnail_url($img, $size);
    return "<img class='" . $classes . "' itemprop='image' src='" . $img_url . "' alt='thumbail of " . $img['image_name'] . "' width='" . $resize . "' height='" . $resize . "' title='" . $img['image_name'] . "'/>";
}