Example #1
0
    function index()
    {
        $q_vars = get_url_vars();
        $sort = isset($q_vars->sort) ? $q_vars->sort : "";
        $search = isset($q_vars->search_tag) ? $q_vars->search_tag : "";
        $base = base_url();
        if ($search != "") {
            $cache = cacheFetch("tagsCache");
        } else {
            $cache = cacheFetch("tagsPopularCache");
        }
        if (isset($cache["data"]) !== false) {
            $tags = json_decode($cache["data"]);
            if (is_array($tags) || !empty($tags)) {
                // start the query_string
                $q_str = "";
                if ($search != "") {
                    $q_str = '?search_tag=' . $search . '&';
                } else {
                    $q_str = '?';
                }
                // sort links
                $sort_alpha = '<a href="' . $base . 'tags/' . $q_str . 'sort=sort-alpha-';
                $sort_total = '<a href="' . $base . 'tags/' . $q_str . 'sort=sort-total-';
                if ($sort == "sort-alpha-desc") {
                    quicksort($tags, "value");
                    $tags = array_reverse($tags);
                    $sort_alpha .= 'asc" title="List Alphabetically descending"><strong>List Alphabetically</strong></a>';
                    $sort_total .= 'desc" title="List By Total descending"><strong>List By Total</strong></a>';
                } else {
                    if ($sort == "sort-total-asc") {
                        quicksort($tags, "total");
                        $sort_alpha .= 'desc" title="List Alphabetically ascending"><strong>List Alphabetically</strong></a>';
                        $sort_total .= 'desc" title="List By Total descending"><strong>List By Total</strong></a>';
                    } else {
                        if ($sort == "sort-total-desc") {
                            quicksort($tags, "total");
                            $tags = array_reverse($tags);
                            $sort_alpha .= 'desc" title="List Alphabetically ascending"><strong>List Alphabetically</strong></a>';
                            $sort_total .= 'asc" title="List By Total ascending"><strong>List By Total</strong></a>';
                        } else {
                            quicksort($tags, "value");
                            $sort_alpha .= 'desc" title="List Alphabetically ascending"><strong>List Alphabetically</strong></a>';
                            $sort_total .= 'desc" title="List By Total descending"><strong>List By Total</strong></a>';
                        }
                    }
                }
                // grab heighest total value
                $temp_tags = $tags;
                quicksort($temp_tags, "total");
                $temp_tags = array_reverse($temp_tags);
                $highest = $temp_tags[0]->total;
                // now sort
                $tags_count = count($tags);
                $list_html = "";
                $details_html = "";
                $sort_html = 'Sort:  ' . $sort_alpha . ' <span class="sep">|</span> ' . $sort_total . ' <span class="sep">|</span> <a href="' . $base . 'tags/' . $q_str . 'tag_cloud=1" title="View popular tags as tag cloud"><strong>View as Tag Cloud</strong></a>';
                if ($search != "") {
                    $details_html = '
					<ul class="search_filters">
						<li><a href="' . $base . 'tags/" title="Remove this filter" class="remove_filter"><span class="hide">Remove</span></a> Showing tags containing "<strong>' . $q_vars->search_tag . '</strong>"</li>
						<li>' . $sort_html . '</li>
					</ul>';
                } else {
                    $details_html = '<ul class="search_filters">
						<li>Showing popular tags</li>
						<li>' . $sort_html . '</li>
					</ul>';
                }
                if (isset($q_vars->tag_cloud)) {
                    // tag cloud mode
                    // we'll have 8 font-sizes, ranging from 10-18
                    // and therefore six colours
                    $list_html .= '<div style="text-align: center;"><ul class="tag_cloud">';
                    $max = 30;
                    $min = 10;
                    $colours = array("10" => "#aaa", "11" => "#909090", "12" => "#909090", "13" => "#999", "14" => "#808080", "15" => "#808080", "16" => "#888", "17" => "#707070", "18" => "#707070", "19" => "#777", "20" => "#606060", "21" => "#606060", "22" => "#666", "23" => "#505050", "24" => "#505050", "25" => "#555", "26" => "#404040", "27" => "#404040", "28" => "#444", "29" => "#303030", "30" => "#333");
                    for ($i = 0; $i < $tags_count; $i++) {
                        if ($search != "") {
                            if (strpos($tags[$i]->value, $search) === FALSE) {
                                continue;
                            }
                        }
                        $font_size = (string) $min + round($tags[$i]->total / $highest * ($max - $min));
                        $list_html .= '<li>
							<a style="font-size: ' . $font_size . 'px; color: ' . $colours[$font_size] . ';" href="' . $base . 'browse/?tag=' . str_replace(" ", "+", $tags[$i]->value) . '" title="view uploads with this tag">
								' . $tags[$i]->value . '
								<em>' . $tags[$i]->total . '</em>
							</a>
						</li>';
                    }
                    $list_html .= '</ul><div class="clear">&nbsp;</div></div>';
                } else {
                    $list_html .= '<ul class="tag_list">';
                    for ($i = 0; $i < $tags_count; $i++) {
                        if ($search != "") {
                            if (strpos($tags[$i]->value, $q_vars->search_tag) === FALSE) {
                                continue;
                            }
                        }
                        $perc = round($tags[$i]->total / $highest * 100);
                        $list_html .= '<li>
							<a href="' . $base . 'browse/?tag=' . str_replace(" ", "+", $tags[$i]->value) . '" title="view uploads with this tag">
								' . $tags[$i]->value . '
								<em>' . $tags[$i]->total . '</em>
							</a>
							<span style="width:' . $perc . '%;" class="bar">' . $perc . '%</span>
						</li>';
                    }
                    $list_html .= '</ul>';
                }
            } else {
                $list_html = "<ul><li>No tags yet</li></ul>";
            }
            // template stuff
            $data = array("list_html" => $list_html, "details_html" => $details_html, "search" => $search);
            $this->template->write("title", "Tags");
            $this->template->write_view("content", "browse/tags", $data);
            $this->template->render();
        } else {
            redirect("", "location");
        }
    }
Example #2
0
 function fpassword()
 {
     $q_vars = get_url_vars();
     if ($this->input->post("fp_username") !== FALSE) {
         // 1) Form validation
         $this->load->library('form_validation');
         // field name, error message, validation rules
         $this->form_validation->set_rules('fp_username', 'Username', 'required');
         // used for additional errors
         $message = "";
         // process post input
         if ($this->user_model->user_attr_exists('u_username', $this->input->post("fp_username")) == FALSE) {
             $message = '<p class="error">No user exists with this username. Try checking the user list for your own username</p>';
         } else {
             /*
             	Send the Email
             */
             $query = $this->user_model->getUser($this->input->post("fp_username"), "u_username");
             $row = $query->row();
             $this->load->library("email");
             $this->email->from("*****@*****.**", "UR!KA");
             $this->email->to($row->u_email);
             // sort out base url and safe email
             $base = base_url();
             $safe_email = str_replace("@", ".at-urika.", $row->u_email);
             $link = $base . 'user/fpassword/?userid=' . $row->user_id . '&newpassverify=' . strrev($row->u_confirmation_string);
             $message = "\nThis email has been sent because someone requested a password reset for your account. If this was your action,\nplease click the link below to reset your password. Otherwise, please delete this e-mail.\n\n" . $link . "\n\nThanks!\nThe Team @ UR!KA\n\t\t\t\t\n\t\t\t\t";
             $this->email->subject("UR!KA - New Password Verificaton");
             $this->email->message($message);
             $this->email->send();
             /*
             	End Email sending
             */
             $message = '<p class="success">A verification e-mail has been to sent to <strong>' . $this->input->post("fp_username") . '</strong>\'s e-mail address. Please click the link in the e-mail to reset your password.</p>';
         }
         $data["message"] = $message;
         $this->template->write("title", "Forgotten Password");
         $this->template->write_view("content", "user/fpassword_form", $data, TRUE);
         //now render templates
         $this->template->render();
     } else {
         if (isset($q_vars->userid) && isset($q_vars->newpassverify)) {
             // check if this user exists and the verification matches
             $send_new = false;
             $message = "";
             $user = $this->user_model->getUser($q_vars->userid, "user_id");
             if ($user == false) {
                 $message = '<p class="error">User not found, no password reset</p>';
                 $send_new = false;
             } else {
                 $user = $user->row();
                 // if we've got a match, reset
                 if (trim(strrev($q_vars->newpassverify)) == $user->u_confirmation_string) {
                     $send_new = true;
                 }
                 if ($send_new == true) {
                     //genereate a new password and update database
                     $new_pass = random_string('alnum', 8);
                     $new_pass_data = array("u_password" => md5($new_pass));
                     /*
                     	Send the new password
                     */
                     $query = $this->user_model->getUser($q_vars->userid, "user_id");
                     $row = $query->row();
                     $this->load->library("email");
                     $this->email->from("*****@*****.**", "UR!KA");
                     $this->email->to($row->u_email);
                     // sort out base url and safe email
                     $base = base_url();
                     $safe_email = str_replace("@", ".at-urika.", $row->u_email);
                     $message = "\n\tThanks for verifying your identity in order to reset your password\n\n\tYour new password is " . $new_pass . ".\n\n\tThanks!\n\tThe Team @ UR!KA\n\t\t\t\t\t\n\t\t\t\t\t";
                     $this->email->subject("UR!KA - New Password");
                     $this->email->message($message);
                     $this->email->send();
                     /*
                     	End Email sending
                     */
                     $update = $this->user_model->updateUser($new_pass_data, $q_vars->userid, "user_id");
                     if ($update) {
                         $message = '<p class="success">A new password has been to sent to <strong>' . $row->u_username . '</strong>\'s e-mail address. Please check your e-mails. You can change your password once you have logged in.</p>';
                     } else {
                         $message = '<p class="error"> Unfortunately something went wrong. Please try again</p>';
                     }
                 }
             }
             $data["message"] = $message;
             $this->template->write("title", "Forgotten Password");
             $this->template->write_view("content", "user/fpassword_form", $data, TRUE);
             //now render templates
             $this->template->render();
         } else {
             // display form
             $data = array("message" => "");
             $this->template->add_js("assets/js/formvalidation.js");
             $this->template->write("title", "Forgotten Password");
             $this->template->write_view("content", "user/fpassword_form", $data, TRUE);
             //now render templates
             $this->template->render();
         }
     }
 }
Example #3
0
    function index()
    {
        //query vars
        $q_vars = get_url_vars();
        $base = base_url();
        // set search vars
        $order_by = isset($q_vars->sort) ? $q_vars->sort : "datetime";
        $order_dir = isset($q_vars->sort_dir) ? strtoupper($q_vars->sort_dir) : "DESC";
        $per_page = 20;
        $offset = isset($q_vars->page) ? ($q_vars->page - 1) * $per_page : 0;
        $current_page = isset($q_vars->page) ? $q_vars->page : 1;
        $search_val = isset($q_vars->search) ? str_replace("+", " ", $q_vars->search) : "";
        $tag_val = isset($q_vars->tag) ? str_replace("+", " ", $q_vars->tag) : "";
        $type = isset($q_vars->type) ? $q_vars->type : "both";
        $results = $this->general_model->searchAll($tag_val, $search_val, $type, $offset, $per_page, $order_by, $order_dir);
        if ($results == false) {
            $total = 0;
            $count_string = 0;
            $show_prev = false;
            $show_next = false;
        } else {
            // calculate offset and info
            $total = $results["total"];
            $count = count($results["results"]);
            // work out page results text
            // so we can control what appears in the same conditional
            $show_next = true;
            $show_prev = false;
            // if a page is set
            if (isset($q_vars->page)) {
                $show_prev = true;
                $current_start = $per_page * ($q_vars->page - 1) + 1;
                // determine end
                if ($per_page * $q_vars->page < $total) {
                    // if there are more on the next page
                    $current_end = $per_page * $q_vars->page;
                    $show_next = true;
                } else {
                    // else we dont need a previ button
                    $current_end = $total;
                    $show_next = false;
                }
            } else {
                // now page, so determine when the end should say
                $current_start = 1;
                if ($total >= $per_page) {
                    $current_end = $per_page;
                } else {
                    $current_end = $total;
                    $show_next = false;
                }
            }
            $count_string = $current_start . ' - ' . $current_end;
        }
        // query html
        // same as batave, x of y records, filter info
        $results_info = "";
        // count
        $results_info .= 'Showing <strong>' . $count_string . '</strong> of <strong>' . $total . '</strong> results';
        if ($tag_val != "") {
            $results_info .= '. Filtering for tags containing <strong>' . $tag_val . '</strong>';
        }
        if ($search_val != "") {
            $results_info .= '. Filtering for search term <strong>' . $search_val . '</strong>';
        }
        // now reassign results
        $results = $results["results"];
        if ($total > 0 && isset($results[0])) {
            $out = '<ul class="uploadList">';
            for ($i = 0; $i < $per_page; $i++) {
                if (isset($results[$i]->image_id)) {
                    //parse Image
                    $data = array("thumb_url" => $results[$i]->i_thumb_url, "title" => $results[$i]->i_title, "url" => $base . 'image/view/' . $results[$i]->image_id . '/' . slugify($results[$i]->i_title) . '/', "user_url" => $base . 'user/u/' . $results[$i]->u_username . '/', "username" => $results[$i]->u_username, "views" => $results[$i]->i_views, "overlay" => $base . 'assets/images/layout/uploadListOverlay.gif');
                    $out .= $this->load->view("components/uploadListLi", $data, true);
                } else {
                    if (isset($results[$i]->moodboard_id)) {
                        // parse Moodboard
                        $data = array("thumb_url" => $results[$i]->m_thumb_url, "title" => $results[$i]->m_title, "url" => $base . 'moodboard/view/' . $results[$i]->moodboard_id . '/' . slugify($results[$i]->m_title) . '/', "user_url" => $base . 'user/u/' . $results[$i]->u_username . '/', "username" => $results[$i]->u_username, "views" => $results[$i]->m_views, "overlay" => $base . 'assets/images/layout/mbListOverlay.gif');
                        $out .= $this->load->view("components/mbListLi", $data, true);
                    } else {
                        if (isset($results[$i]->row_id)) {
                            // this is from the UNION sql so we have to be a bit smarter here
                            if ($results[$i]->type == "image") {
                                $row_url = $base . 'image/view/' . $results[$i]->row_id . '/' . slugify($results[$i]->row_title) . '/';
                                $overlay = $base . 'assets/images/layout/uploadListOverlay.gif';
                                $view = "components/uploadListLi";
                            } else {
                                $row_url = $base . 'moodboard/view/' . $results[$i]->row_id . '/' . slugify($results[$i]->row_title) . '/';
                                $overlay = $base . 'assets/images/layout/mbListOverlay.gif';
                                $view = "components/mbListLi";
                            }
                            // parse object
                            // parse Moodboard
                            $data = array("thumb_url" => $results[$i]->row_thumb_url, "title" => $results[$i]->row_title, "url" => $row_url, "user_url" => $base . 'user/u/' . $results[$i]->u_username . '/', "username" => $results[$i]->u_username, "views" => $results[$i]->views, "overlay" => $overlay);
                            $out .= $this->load->view($view, $data, true);
                        }
                    }
                }
            }
            $out .= '</ul>';
        } else {
            $out = '<p class="error">No results for this criteria</p>';
        }
        // pagination links
        $no_list = array('page', 'browse_search');
        $out .= '
		<div class="pagination_buttons clear">
		';
        if ($show_prev) {
            $out .= '<a class="pagination" href="' . $base . 'browse/' . queryStringDrop(null, $no_list, -1) . '"  title="View previous page of results">< Previous</a>';
        }
        if ($show_next && $total > $per_page) {
            $out .= '<a class="pagination"  href="' . $base . 'browse/' . queryStringDrop(null, $no_list, 1) . '"  title="Viewnext page of results">Next ></a>';
        }
        $out .= '
		</div>
		';
        // now render
        $data = array("list_html" => $out, "search" => $search_val, "tag" => $tag_val, "type" => $type, "order_by" => $order_by, "results_info" => $results_info);
        $this->template->write("title", "Browsing");
        $this->template->write_view("content", "browse/browse_default", $data);
        $this->template->render();
    }
Example #4
0
echo 'user/u/' . $username;
?>
" title="link for this profile"><?php 
echo $username;
?>
</a></h2>
	<p class="u_info_string"><?php 
echo $info_string;
?>
</p>
	<div class="clear">&nbsp;</div>
</div>
<div id="user_profile" class="bumpUp">
	<div class="left col-12">
	<?php 
$q_vars = get_url_vars();
if (isset($q_vars->image_deleted)) {
    echo '<p class="success">Image deleted successfully!</p>';
}
if (isset($q_vars->collection_deleted)) {
    echo '<p class="success">Collection deleted successfully!</p>';
}
if (isset($q_vars->moodboard_deleted)) {
    echo '<p class="success">Moodboard deleted successfully!</p>';
}
if (isset($q_vars->moodboard_add)) {
    echo '<p class="borderbox"><strong>You can add a moodboard from a collection, under the <em>Collections</em> tab.</strong></p>';
}
?>
		<div id="userImagesTabs" class="tabs fullWidthTabs">
			<ul class="tabNav">
Example #5
0
    function view($id, $name = null)
    {
        $collection = $this->collection_model->getCollection($id);
        if ($collection != false) {
            $collection = $collection->row();
            if ($name !== slugify($collection->col_name)) {
                // redirect to right version
                redirect('collection/view/' . $collection->collection_id . '/' . slugify($collection->col_name) . '/', 'location');
            }
            $images = $this->collection_model->getCollectionImages($id);
            $base = base_url();
            $q_vars = get_url_vars();
            // image string
            if ($images != false) {
                $image_count = count($images);
            } else {
                $image_count = 0;
            }
            $col_images_string = "Contains ";
            if ($image_count == 1) {
                $col_images_string .= "1 Image";
            } else {
                $col_images_string .= $image_count . " Images";
            }
            $col_images_string .= '<span class="sep">|</span> Last Updated ' . date("F j, Y, G:i", strtotime($collection->col_updated));
            //mages
            if ($image_count > 0) {
                $images_html = '<ul class="uploadList">';
                for ($i = 0; $i < $image_count; $i++) {
                    $irow = $images[$i];
                    // load li through view
                    $data = array("thumb_url" => $irow->i_thumb_url, "title" => $irow->i_title, "url" => $base . 'image/view/' . $irow->image_id . '/' . slugify($irow->i_title) . '/', "user_url" => $base . 'user/u/' . $irow->u_username . '/', "username" => $irow->u_username, "views" => $irow->i_views, "overlay" => $base . 'assets/images/layout/uploadListOverlay.gif');
                    $images_html .= $this->load->view("components/uploadListLi", $data, true);
                }
                $images_html .= '</ul>';
            } else {
                if ($collection->col_user_id == $this->session->userdata("user_id")) {
                    $base = base_url();
                    $images_html = '
						<p class="borderbox">
							<img class="right" src="' . $base . 'assets/images/content/add_fav_col_small.jpg" alt="new add to collection button" width="120" height="62" />
							<strong>Welcome to your new collection!</strong>. You can use the <strong>Add to Collection</strong> button on any upload to add it to a collection. This button
							appears under the Add to Favourites button on any upload, including your own.
							<br/>
							<br/>
							For information, see the <a href="' . $base . 'page/faq/" title="FAQ section">FAQ section</a>
							<span class="clear">&nbsp;</span>
						</p>
					';
                } else {
                    $images_html = "No images have been added to this collection.";
                }
            }
            // message start
            $message = "";
            if (isset($q_vars->saved)) {
                $message = "saved";
            }
            // controls start
            $controls_html = "";
            if ($this->session->userdata("user_id") == $collection->col_user_id) {
                $controls_html = '
					<ul class="collection_controls">
						<li><a class="edit_link" href="' . $base . 'collection/edit/' . $collection->collection_id . '/">Edit Collection</a></li> 
						<li><a class="delete_link"  href="' . $base . 'collection/delete/' . $collection->collection_id . '/">Delete Collection</a></li>
						<li><a class="moodboard_link"  href="' . $base . 'moodboard/add/' . $collection->collection_id . '/col/">Create Moodboard</a></li>
					</ul>
					<div class="clear">&nbsp;</div>
				';
            }
            $view_data = array("col_title" => $collection->col_name, "username" => $collection->u_username, "profile_url" => getUserProfileURL($collection->u_profile_id, $collection->u_email), "col_images_string" => $col_images_string, "images_html" => $images_html, "message" => $message, "controls_html" => $controls_html);
            // render templates
            $this->template->write("title", "Collection: " . $collection->col_name);
            $this->template->write_view("content", "collections/view", $view_data, TRUE);
            //now render templates
            $this->template->render();
        } else {
            $data = array("errorTitle" => "Collection Not Found", "content" => "An error has occurred: the collection with the id <strong>" . $id . "</strong> could not be found. It may have been deleted.");
            $this->template->write_view("content", "general/error", $data, TRUE);
            //now render templates
            $this->template->render();
        }
    }
function product_display_paginated($search_sql = '', $offset, $items_on_page)
{
    global $wpdb, $colorfilter, $totalitems, $siteurl, $sword;
    $siteurl = get_option('siteurl');
    $javascript_functions = '';
    $product_list = $GLOBALS['wpdb']->get_results($search_sql, ARRAY_A);
    //$totalitems =  count($product_list);
    if ($product_list != null) {
        $preview_mode = 1;
        // display as popup window
        //          $preview_mode=0; // display as Lightbox slideshow
        $output = "<div id='items' class='items'>";
        $counter = 0;
        foreach ($product_list as $product) {
            if ($product['image'] != null and $counter < $items_on_page) {
                $imagedir = ABSPATH . "wp-content/plugins/wp-shopping-cart/product_images/";
                $image_size = @getimagesize($imagedir . $product['image']);
                $image_link = "index.php?productid=" . $product['id'] . "&width=" . $image_size[0] . "&height=" . $image_size[1] . "";
                // thumbs output
                $output .= "<div id='item" . $counter . "' class='item'>";
                // start item
                //$vstavka = "jQuery('#bigpic').html('<img src=\'".$siteurl."/wp-content/plugins/wp-shopping-cart/product_images/".$product['image']."\'>');";
                $vstavka = "jQuery('#bigpic').html('<img src=http://sl.cartoonbank.ru/" . $product['image'] . ">');";
                // here we prepare data for the BIGPIC preview
                if (stristr($product['image'], 'jpg') != FALSE) {
                    $_file_format = 'jpg';
                }
                if (stristr($product['image'], 'gif') != FALSE) {
                    $_file_format = 'gif';
                }
                if (stristr($product['image'], 'png') != FALSE) {
                    $_file_format = 'png';
                }
                $_number = $product['id'];
                $_description = htmlspecialchars_decode(nl2br(hilite(htmlspecialchars(stripslashes($product['description']), ENT_QUOTES))));
                $_size_warning = '';
                if (isset($product['brandid'])) {
                    $_brandid = $product['brandid'];
                } else {
                    $_brandid = '';
                }
                if (isset($product['category_id'])) {
                    $_category_id = $product['category_id'];
                } else {
                    $_category_id = '';
                }
                $_author = "<a href=\\'" . $siteurl . "/?page_id=29&brand=" . $_brandid . "\\'>" . $product['brand'] . "</a>";
                //$product['brand'];
                //$_name = hilite(nl2br(htmlspecialchars(stripslashes($product['name']),ENT_QUOTES)));
                $_name = nl2br(stripslashes($product['name']));
                $_avatarurl = "";
                //"<a href=\"".get_option('siteurl')."/?page_id=29&brand=$_brandid\"><img src=".$product['avatarurl']." width=32 height=32 align=top border=0></a>";
                $_category = "<a href=\\'" . get_option('product_list_url') . "&category=" . $_category_id . "\\'>" . $product['kategoria'] . "</a>";
                //$options .= "<a href='".get_option('product_list_url')."/&category=".$option['id']."'>".stripslashes($option['name'])."</a><br />";
                $product['additional_description'] = stripslashes($product['additional_description']);
                $product['additional_description'] = htmlspecialchars($product['additional_description'], ENT_QUOTES);
                $_tags = hilite(nl2br($product['additional_description']));
                if (isset($product['sold'])) {
                    $psold = $product['sold'];
                } else {
                    $psold = 0;
                }
                if ($psold == 0) {
                    $_sold = "";
                } else {
                    $_sold = "<h2><b>Продажи:</b> <span class=\\'sold\\'>" . $psold . "</span></h2><br />";
                }
                //$_tags = hilite(nl2br(htmlspecialchars(stripslashes($product['additional_description']))));
                //$_tags = hilite($product[0]['additional_description']);
                $_bigpicimgalt = addslashes($_name . ", " . $product['brand']);
                $_bigpicimgtitle = addslashes($_name . " в категории " . $product['kategoria'] . ", " . $product['brand']);
                //."". ".$_description.". ".$_tags);
                $_tags_array = explode(',', $_tags);
                //$i=0;
                foreach ($_tags_array as $key => $value) {
                    $_tags_array[$key] = "<li><a href=\\'" . get_option('siteurl') . "/?page_id=29&cs=" . trim($_tags_array[$key]) . "\\'>" . trim($_tags_array[$key]) . "</a></li>";
                }
                $_tags_imploded = implode(" ", $_tags_array);
                $_tags = $_tags_imploded;
                $_sharethis_html = "<div id=\\'share_this\\' class=\\'lh2\\'></div>";
                $_dimensions_html = "<div id='dimensions'><img src='" . get_option('siteurl') . "/img/ldng.gif' alt='loading'></div>";
                $_dimensions_html = str_replace("\"", "\\'", $_dimensions_html);
                $_dimensions_html = str_replace("'", "\\'", $_dimensions_html);
                $_rating_html = "<div id='star_rating'><img src='" . get_option('siteurl') . "/img/ldng.gif' alt='loading'></div>";
                $_rating_html = str_replace("\"", "\\'", $_rating_html);
                $_rating_html = str_replace("'", "\\'", $_rating_html);
                if (current_user_can('manage_options')) {
                    $_edid = "";
                    //$_edid = " <a href=".get_option('siteurl')."/wp-admin/admin.php?page=wp-shopping-cart/display-items.php&edid=".$_number."  target=_blank><img border=0 src=".get_option('siteurl')."/img/edit.jpg title=\'открыть редактор\'></a> <a href=".get_option('siteurl')."/wp-admin/admin.php?page=wp-shopping-cart/display-items.php&updateimage=".$_number." target=_blank><img border=0 src=".get_option('siteurl')."/img/reload.gif title=\'обновить водяной знак\'></a> <a href=".get_option('siteurl')."/ales/wordassociations/words.php?id=".$_number." target=_blank><img border=0 src=".get_option('siteurl')."/img/tags.gif title=\'добавить тэгов\'></a>";
                } else {
                    $_edid = "";
                }
                $current_user = wp_get_current_user();
                //    $_SESSION['id']= $current_user->ID;
                //    setcookie('uid', $_SESSION['id']);
                //pokazh($_COOKIE,"cookie");
                //pokazh ($_SESSION,"session");
                //pokazh ($current_user);
                ///pokazh($_SERVER);
                if (is_user_logged_in()) {
                    $logged = true;
                    //" залогинен ";
                    $klop = "";
                    //"_";
                } else {
                    $logged = false;
                    //" не залогинен ";
                    $klop = "";
                    //"|";
                }
                if ($logged) {
                    //$_bigpicstrip = "<div style=\'float:left;\'><b>Название: </b><h1>" .$_name."</h1>&nbsp;$klop<span id=\'thumb\' onclick=\'fave_it();\'>$klop<img src=\'".$siteurl."/img/thumbupp.jpg\' border=0 title=\'добавить в любимое\'></span></div> "."<div>№&nbsp;<a id=\'cuid\' title=\'".$product['kategoria'].", ".$_name.", ".$product['brand']."\' href=\'".get_option('siteurl')."/?page_id=29&cartoonid=".$_number."\'>".$_number."</a>&nbsp;<b>".$_author."</a></b></div>";
                    $_bigpicstrip = "<div class=\\'fll\\'><b>Название: </b><h3>" . $_name . "</h3>&nbsp;{$klop}</div> " . "<div>№&nbsp;<a id=\\'cuid\\' title=\\'" . $product['kategoria'] . ", " . $_name . ", " . $product['brand'] . "\\' href=\\'" . get_option('siteurl') . "/?page_id=29&cartoonid=" . $_number . "\\'>" . $_number . "</a>&nbsp;<b>" . $_author . "</a></b></div>";
                } else {
                    $_bigpicstrip = "<div class=\\'fll\\'><b>Название: </b><h3>" . $_name . "</h3> {$klop}</div> " . "<div>№&nbsp;<a id=\\'cuid\\' title=\\'" . $product['kategoria'] . ", " . $_name . ", " . $product['brand'] . "\\' href=\\'" . get_option('siteurl') . "/?page_id=29&cartoonid=" . $_number . "\\'>" . $_number . "</a>&nbsp;<b>" . $_author . "</a></b></div>";
                }
                $_bigpictext = "<h2><b>Категория: </b>" . $_category . "</h2><h2><b>Описание: </b></h2> " . $_description . "<br /><h2><b>Тэги: </b></h2><ul>" . $_tags . "</ul><h2><b>Ссылка:</b></h2><a title=\\'" . $product['kategoria'] . ", " . $_name . ", " . $product['brand'] . "\\' href=\\'" . get_option('siteurl') . "/?page_id=29&cartoonid=" . $_number . "\\'> №&nbsp;" . $_number . "</a><br /><b>Размер:</b><br />" . $_dimensions_html . $_sold . "<b>Оценка:</b><br />" . $_rating_html . $_sharethis_html . $_edid;
                $_bigpictext .= '<br><a title="Заказать печать у нашего партнера" class="btn-s btn-blue" target=_blank href="http://www.artwall.ru/products/upload?url=http://sl.cartoonbank.ru/' . $product['image'] . '">Печатать в раме</a><br>';
                $_bigpic = "<img src=http://sl.cartoonbank.ru/" . rawurlencode($product['image']) . " border=0 alt=\\'" . $_bigpicimgalt . "\\' title=\\'" . $_bigpicimgtitle . "\\' />";
                if ($product['l1_price'] == '0') {
                    $l1_disabled = 'disabled=true';
                } else {
                    $l1_disabled = '';
                }
                if ($product['l2_price'] == '0') {
                    $l2_disabled = 'disabled=true';
                } else {
                    $l2_disabled = '';
                }
                if ($product['l3_price'] == '0') {
                    $l3_disabled = 'disabled=true';
                } else {
                    $l3_disabled = '';
                }
                if ($psold == 0) {
                    $_soldd = '';
                } else {
                    $_soldd = '<div class="cntrsold" title="продажи">' . $psold . '</div>';
                }
                if (isset($product['not_for_sale']) && $product['not_for_sale'] == '1') {
                    $_bottomstriptext = "Лицензии на это изображение временно недоступны";
                } else {
                    // отключить лицензию
                    if (isset($product['l1_price']) && $product['l1_price'] != 0) {
                        $l1_price_text = "<td class=\\'vamtar\\'><b>" . round($product['l1_price']) . "&nbsp;руб.</b></td>";
                    } else {
                        $l1_price_text = "<td class=\\'vamtar\\'>не доступна</td>";
                    }
                    if (isset($product['l2_price']) && $product['l2_price'] != 0) {
                        $l2_price_text = "<td class=\\'vamtar\\'><b>" . round($product['l2_price']) . "&nbsp;руб.</b></td>";
                    } else {
                        $l2_price_text = "<td class=\\'vamtar\\'>не доступна</td>";
                    }
                    if (isset($product['l3_price']) && $product['l3_price'] != 0) {
                        $l3_price_text = "<td class=\\'vamtar\\'><b>" . round($product['l3_price']) . "&nbsp;руб.</b></td>";
                    } else {
                        $l3_price_text = "<td class=\\'vamtar\\'>не доступна</td>";
                    }
                    if ($_brandid == 1 || $_brandid == 6 || $_brandid == 8) {
                        //$printdirect = "<div class=\'prdrrdr\'>.</div>";
                        $printdirect = "<div class=\\'fll\\'><a onclick=\"prdrrdr(" . $product['id'] . ");\";);\" rel=\\'nofollow\\' href=\\'#\\'><img src=\\'/img/tshirt.jpg\\' title=\\'Закажите этот рисунок на кружке, футболке или другом сувенире\\' alt=\\'t-shirt\\'></a></div><div class=\\'mrktimg\\'><a onclick=\"prdrrdr(" . $product['id'] . ");\";);\" rel=\\'nofollow\\' href=\\'#\\'>Заказать сувенир<br>с этим рисунком</a>.</div>";
                    } else {
                        $printdirect = "";
                    }
                    $_bottomstriptext = $printdirect . $_size_warning . "<div class=\\'w4fr\\'><form name=\\'licenses\\' id=\\'licenses\\' onsubmit=\\'submitform(this);return false;\\' action=\\'" . get_option('siteurl') . "/?page_id=29\\' method=\\'POST\\'><table class=\\'licenses\\'> <tr> <td class=\\'wh w8vb\\'><b>Выбор</b></td> <td class=\\'wh tal\\'><input type=\\'radio\\' name=\\'license\\' {$l1_disabled} value=\\'l1_price\\'></td> " . $l1_price_text . " <td rowspan=\\'2\\' class=\\'w20\\'>&nbsp;</td> <td class=\\'wh\\' class=\\'tal\\'><input type=\\'radio\\' name=\\'license\\' {$l2_disabled} value=\\'l2_price\\'></td> " . $l2_price_text . " <td rowspan=\\'2\\' class=\\'w20\\'>&nbsp;</td> <td class=\\'wh\\' class=\\'tal\\'><input type=\\'radio\\' name=\\'license\\' {$l3_disabled} value=\\'l3_price\\'></td> " . $l3_price_text . " <td rowspan=\\'2\\' class=\\'wh\\' class=\\'w8tarvab\\'><input id=\\'searchsubmit\\' value=\\'Купить\\' type=\\'submit\\' class=\\'btn-s\\' title=\\'Добавить рисунок в корзину заказов\\'></td> </tr> <tr> <td class=\\'wh vat\\'><b>лицензии:</b></td> <td colspan=\\'2\\' class=\\'pl6\\'><a target=\\'_blank\\' href=\\'" . get_option('siteurl') . "/?page_id=238\\' title=\\'подробнее об ограниченной лицензии\\'>ограниченная</a></td> <td colspan=\\'2\\' class=\\'pl6\\'><a target=\\'_blank\\' href=\\'" . get_option('siteurl') . "/?page_id=242\\' title=\\'подробнее о стандартной лицензии\\'>стандартная</a></td> <td colspan=\\'2\\' class=\\'pl6\\'><a target=\\'_blank\\' href=\\'" . get_option('siteurl') . "/?page_id=245\\' title=\\'подробнее об расширенной лицензии\\'>расширенная</a></td> </tr> </table><input type=\\'hidden\\' value=\\'" . $_number . "\\' name=\\'prodid\\'> </form></div>";
                }
                $_next_item = $counter + 1;
                if ($_next_item == 20) {
                    $vstavka = "jQuery('#bigpic').html('<a title=\"следующая страница > \" href=\"" . get_option('siteurl') . "/cartoon/" . $_number . "\" onclick=\"next_page();return false;\">" . $_bigpic . "</a>');";
                } else {
                    $vstavka = "jQuery('#bigpic').html('<a title=\"следующее изображение > \" href=\"" . get_option('siteurl') . "/cartoon/" . $_number . "\" onclick=\"get_item" . $_next_item . "();return false;\">" . $_bigpic . "</a>');";
                }
                $vstavka .= "jQuery('#bigpictext').html('" . $_bigpictext . "');";
                $vstavka .= "jQuery('#bigpictopstrip').html ('" . $_bigpicstrip . "');";
                //$vstavka .= "jQuery('#hone').html('<h1>Карикатура «".$_name."», ".$_author."</h1>');";
                $vstavka .= "jQuery('#bigpicbottomstrip').html ('" . $_bottomstriptext . "');";
                $output .= "<a href=\"" . get_option('siteurl') . "/cartoon/" . $_number . "\" onclick=\"get_item" . ($_next_item - 1) . "();return false;\">";
                $jq_stars = ' get_5stars(); ';
                $jq_dimensions = ' get_dimensions(); ';
                $share_this = ' get_share_this(); ';
                $add_hash_2url = ' change_url(); ';
                $get_favorite = ' get_fave(); ';
                if (isset($sword) && $sword != '') {
                    //$highlight = " highlight(\"".$sword."\"); ";
                    $highlight = " highlight(\"" . htmlentities($sword, ENT_QUOTES) . "\"); ";
                } else {
                    $highlight = "";
                }
                $javascript_functions .= " function get_item" . $counter . "() { jQuery('#pt')[0].scrollIntoView(true);" . $vstavka . $highlight . " scrpts(); } ";
                $_offset = $offset + 20;
                $javascript_functions .= ' function next_page(){window.location = "' . get_option('siteurl') . '/?' . get_url_vars() . 'offset=' . $_offset . '";    var cuid = jQuery("#cuid").html(); jQuery("#navbar").html(cuid);}';
                $fiilename = ABSPATH . '/wp-content/plugins/wp-shopping-cart/images/' . $product['image'];
                if (file_exists($fiilename)) {
                    $output .= "<img src='http://th.cartoonbank.ru/" . $product['image'] . "' title='" . $product['name'] . "' alt='" . $_bigpicimgalt . "' width='140' height='140' class='thumb' />";
                } else {
                    $output .= "<img src='http://th.cartoonbank.ru/icon-rest.gif' width='140' height='140' class='thumb' />";
                }
                $output .= "</a>";
                $output .= $_soldd . "</div>";
                // stop item
            }
            $counter = $counter + 1;
        }
        $output .= "</div>";
        $pagination = pagination($offset, $totalitems, $items_on_page);
        return "<script>get_item0();" . $javascript_functions . "</script>" . " " . $pagination . $output;
    }
    // end function output first page
}
Example #7
0

<!-- main start -->
<div id="content">
<div id="contentmiddle">


	<!-- page navigator -->
	<?php 
$totalitems = 200;
if (isset($_GET['offset']) && is_numeric($_GET['offset'])) {
    $page = $_GET['offset'] / 20 + 1;
} else {
    $page = 1;
}
$_pages_navigation = getPaginationString($page, $totalitems, $limit, $adjacents = 1, $targetpage = "index.php", $pagestring = "?" . get_url_vars() . "offset=");
echo $_pages_navigation;
?>
	<!-- ///page navigator -->


<div id="container">
	<div id="slides">
        <!-- Slider -->
        <ul class="bjqs">
			<?php 
echo $licontent;
?>
		</ul>
</div> <!-- ///slides -->
</div> <!-- ///container -->
Example #8
0
    function invites()
    {
        if (isAdmin() == false) {
            redirect('', 'location');
        }
        if ($this->input->post("inviteAction") !== FALSE) {
            if (!is_numeric($this->input->post("inviteCount"))) {
                $out = '<p class="error">Invite count was not a number</p>';
            } else {
                $count = $this->input->post("inviteCount");
                $this->load->model("invite_model");
                if ($this->input->post("inviteAction") == "allGenerate") {
                    $this->invite_model->generateInvites($count);
                    redirect('batcave/invites/?allGen=' . $count, 'location');
                } else {
                    if ($this->input->post("inviteAction") == "userGenerate") {
                        $this->invite_model->generateInvitesForUsers($count);
                        redirect('batcave/invites/?userGen=' . $count, 'location');
                    }
                }
            }
        } else {
            $out = "<p><strong>Use the form below to generate invites:</strong></p>";
            $q_vars = get_url_vars();
            if (isset($q_vars->userGen)) {
                $out .= '<p class="success"><strong>' . $q_vars->userGen . '</strong> new invites generated for all users</p>';
            } else {
                if (isset($q_vars->allGen)) {
                    $out .= '<p class="success"><strong>' . $q_vars->allGen . '</strong> new invites generated</p>';
                }
            }
            $out .= '
					<form action="" method="post" style="width: 250px">
						<fieldset width="250">
							<ul>
								<li>
									<label for="inviteAction">Action to perform:</label>
									<select name="inviteAction">
										<option value="allGenerate">Generate Non-User</option> 
										<option value="userGenerate">Generate For Each User</option>
									</select>
								</li>
								<li>
									<label for="inviteCount">How Many Invites:</label>
									<input name="inviteCount" type="number" value="5" />
								</li>
								<li>
									<input type="submit" value="Generate Invites" name="inviteSub" />
								</li>
						</fieldset>
					</form>
				';
        }
        // list table fields
        $this->template->set_template("urika_admin");
        $this->template->add_css("assets/css/admin.css");
        $this->template->write("menu_lis", $this->_tableMenuLinksHTML());
        $this->template->write("feature", "<h2>Generate Invites</h2>");
        $this->template->write("content", $out);
        $this->template->render();
        // set back to defaut
        $this->template->set_template("urika");
    }
Example #9
0
 /**
 	Set tagging files. This funtions creates and stores the file, if the timestamp
 	is less than an hour dont bother
 */
 function _setTaggingFile()
 {
     // first attempt to hit the cache
     $cache = cacheFetch("tagsCache");
     $popcache = cacheFetch("tagsPopularCache");
     $regenerate = false;
     if (isset($cache["expire"]) == false || isset(get_url_vars()->forcerefresh) == true) {
         $regenerate = true;
     } else {
         // now check time stamp
         $time_diff = $cache["expire"] - time();
         if ($time_diff < 1) {
             $regenerate = true;
         }
     }
     if ($regenerate == true) {
         // create cache file etc
         $tags_json = $this->image_model->getTags();
         $full = json_encode($tags_json["full"]) . "";
         $popular = json_encode($tags_json["popular"]) . "";
         $result = cacheStore(trim($full), "tagsCache", 60);
         $resultp = cacheStore(trim($popular), "tagsPopularCache", 60);
         // the other thing we have to do is add our own file outside of the cache
         // for use by the autocomplete
         $this->load->helper("file");
         write_file("./assets/tags/tags.txt", trim($full));
         write_file("./assets/tags/popular.txt", trim($popular));
         $this->tags_array = $tags_json["full"];
     } else {
         // cache hit or data is less than an hour old
         $this->tags_array = json_decode($cache["data"]);
     }
     return true;
     // arbitary since it doesnt do anything
 }