earliest_day = 5; $this->latest_day = 20; } protected function get_all_posts() { // very quickly work out if we are sorting by cat or tag $cat = ''; if ($_POST['incategory'] != '') { $cat = '&cat=' . (int)$_POST['incategory']; } $tag = ''; if ($_POST['tagid'] != '') { $tag = "&tag_id=" . (int) $_POST['tagid']; } $all_posts = array(); $all_query = new WP_Query('showposts=' . $this->abs_max_posts . $cat . $tag); while($all_query->have_posts()) { $all_query->the_post(); $orig_date = get_the_date("Y-m-d H:i:s"); $i++; $all_posts[get_the_ID()] = array ( "link" => get_permalink(), "title" => the_title('','',false), "orig_date" => $orig_date, ); } return $all_posts; } public function redate_posts() { if (isset($_POST['latest_day']) && is_numeric($_POST['latest_day'])) { $this->latest_day = (int) $_POST['latest_day']; } if (isset($_POST['earliest_day']) && is_numeric($_POST['earliest_day'])) { $this->earliest_day = (int) $_POST['earliest_day']; } if ($this->earliest_day == 0 && $this->latest_day == 0) { echo "

Please go back - you cannot set latest and earliest at 0

"; return; } if ($this->earliest_day < 0 || $this->latest_day < 0 ) { echo "

Please go back - you cannot either value as lower than 0

"; return; } if ($_POST['tagid'] !='' && $_POST['incategory'] != '') { echo "

Please go back - you cannot set both slug and category!

"; return; } $total_diff_in_days = $this->latest_day + $this->earliest_day; echo "

Reordering

"; echo "

The earliest day is {$this->earliest_day} days ago. The latest day is {$this->latest_day} days in the future

"; $allposts = $this->get_all_posts(); if (count($allposts) > 0) { $doneDays = array(); echo ""; foreach($allposts as $id => $postData) { $link = $postData['link']; $title = $postData['title']; $random_days_behind = rand(0,$total_diff_in_days); $random_days_behind = (int) $random_days_behind; $day_diff = $random_days_behind - ($this->earliest_day ); if ($day_diff > 0) { $plus_minus = '+'; } else { $day_diff = abs($day_diff); // get positive $plus_minus = '-'; } $doneDays[str_replace("+","",$plus_minus) . $day_diff]++; $strtotimestring = $plus_minus . $day_diff . ' days'; $date_time = (strtotime($strtotimestring)); // H:i:s // get the year/mo/day from strtotime(- xx days) $newDate = date('Y-m-d', $date_time); // randomly select a hh:mm:ss to post $newDate.= " " . str_pad( rand(0,23) , 2, '0', STR_PAD_LEFT) . ":" . str_pad( rand(0,59) , 2, '0', STR_PAD_LEFT) . ":". str_pad( rand(0,59) , 2, '0', STR_PAD_LEFT) ; $updateArray = array( 'ID' => $id, 'post_date' => $newDate, 'post_date_gmt' => $newDate, 'edit_date' => true, ); $result = wp_update_post($updateArray); echo ""; } echo "
$id $link $title Original date: {$postData['orig_date']} Changed date to : $newDate
"; echo "

Counter:

"; ksort($doneDays); echo "

This shows the frequency of each post being posted x days ago/in future. It doesn't show every single day - only the ones with at least one post

"; //change for for() to show all days? might be handy echo ""; foreach($doneDays as $id => $val) { if ($id > 0) { $id = "+" . $id; } echo ""; } echo "
+/- daysNumber of posts
$id days$val posts
"; } else { echo "

Error - Could not find any posts to reorder!

"; } } protected function get_all_cats_options() { $args = array( 'type' => 'post', 'child_of' => 0, 'parent' => '', 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 1, 'hierarchical' => 1, 'exclude' => '', 'include' => '', 'number' => '', 'taxonomy' => 'category', 'pad_counts' => true ); $categories = get_categories( $args ); $returnhtml = ''; foreach($categories as $cat) { $id = $cat->cat_ID; $name = $cat->name; $c = $cat->category_count; $returnhtml .= ""; } return $returnhtml; } protected function get_all_tags_options() { $tags = get_tags(); $returnhtml = ''; if ($tags) { foreach ($tags as $tag) { $id = $tag->term_id; $name = $tag->name; $c = $tag->count; $returnhtml .= ""; } } else { $returnhtml = ""; } return $returnhtml; } public function show_options() { ?>

Ash's Random Post Dater

Use this form to set ALL posts in the selected category to a random date between these two values.

This will update the post dates on ALL posts within the selected category/tag (or ALL posts in your wordpress blog if both are set to default). Please do not use if you do not want to reset ALL post dates. I do not recommend using this on a site with lots of live posts - especially if you use a permalink structure that includes the date in the url. I use it on new sites (add all content, then set all posts to random date in the past). Use at your own risk! You will lose the current post date time (it only changes the date posted - nothing else)

Only use one of the following two. Leave both at their defaults ("ALL CATEGORIES"/"ALL TAGS") to reorder ALL posts

Reorder post dates in this category:


(leave on "ALL CATEGORIES" if you don't want to reorder all within a certain category)
OR

Reorder post dates with this tag slug (use the tag slug, not the tag):


(leave on "ALL TAGS" if you don't want to reorder all within a certain category)

Earliest Day - how many days back do you want the maximum one?

(put at 0 to put all posts in future)

Latest Day - Leave at 0 to make sure all posts are BACK dated.

(leave 0 to put all posts in past)

For example if you wanted your posts randomly set to a date in the next 30 days set the latest day as 30, the earliest day at 0

If you wanted your posts randomly set to a day in the previous 180 days then set the latest day as 0 and the earliest day as 180.

It randomly sets each post - the posts are not spaced out at exact intervals. It will readjust ALL your posts. Please make sure that you want ALL your posts to be randomised.

(Clicking this will randomly reorder all posts)
redate_posts(); } else { $random_post_dater->show_options(); } } Social enterprises on a mission to make money – and change lives – Social Care Team

Social enterprises on a mission to make money – and change lives

Keswick-based skincare specialist The Soap Co is a business on a social mission. As well as creating handmade products with natural ingredients, it provides employment opportunities for groups underrepresented in the UK’s workforce. More than 80% of its staff are disabled or from disadvantaged backgrounds, with an emphasis on employment for blind people – a mission its parent company, Clarity, has been pursuing since 1854.

“We provide real jobs to help build people’s skills and confidence, enabling them to progress in our organisation and freeing up space for the next person who needs this opportunity,” says Jeremy Robinson, CEO of both companies. “Everyday decisions are made with both financial and employment objectives in mind. Sometimes these are consistent with each other, sometimes there is a tradeoff to be made.”

Research from the National Enterprise Network indicates that more than one in four people starting their own business is motivated by a social purpose or cause. The most recent government figures indicate that more than 70,000 social enterprises currently operate in the UK.

But what exactly is a social enterprise? According to membership body Social Enterprise UK, it’s a business that is set up specifically to make a difference, generates its income by selling goods and services (rather than through grants and donations), and reinvests its profits in a social mission.

“A social venture can come in many different legal structures, but its number one purpose must be to have social impact,” says Tom Fox, policy lead at UnLtd, a support foundation for UK social enterprises. He adds that mutuals and co-ops – where employees own shares in the company, a well-known example being The Co-operative Group – and “profit with purpose” businesses – where a product or service exists to serve a specific social need, as with The Big Issue – can fit the description of a social enterprise, just as charities and voluntary groups do.

The social entrepreneurs are brought together by a variety of social missions. “They are people who are passionate about tackling a problem, have an idea for a solution, and the determination to make that solution happen,” says Fox.

Former investment banker Roshni Assomull is one of these social problem-solvers. She co-founded Bella Kinesis, an ethical sportswear brand for women, with the desire to empower Indian women after her travel experiences in the country. For each item sold her company makes a donation to fund education in business for women in rural India through an ongoing partnership with the Mann Deshi Foundation.

“Educating women so that they can sustain and support themselves is something that will have a serious long-term impact in Indian communities,” Assomull says. “We’re hoping it will help with a much-needed attitude change towards the value and role of women in society too.”

Concern for social impact alongside profitability is producing an effective and sustainable business model. The State of Social Enterprise Survey 2015reveals that 50% of social enterprises made a profit in the last year. The same research shows that social enterprises are at the forefront of the economic recovery, with 52% of them increasing their turnover in the last 12 months, compared with 40% of SMEs.

“Social ventures are like any other business; we have the goal of making as much profit as possible,” says Leon Patel, artistic director of Bangdrum CIC, a community interest company working across arts and culture in Greater Manchester. “But the driver behind this isn’t a new car for the directors or a large bonus to go on holiday with. It’s to make positive change in the world – so we look at where we can reinvest profit to make the biggest social impact.”

The higher costs of running an ethical, socially minded business can result in a more expensive product. Yet this may not be bad for business; a 2014 survey by Social Enterprise UK and the cabinet office shows that British people are concerned about where and how they buy products and services. One in three admitted feeling ashamed buying from businesses they deemed socially irresponsible.

However, a company can’t rely on the social enterprise tag to excuse an inferior or uncompetitive product or service, a point that Robinson reiterates: “Because of our business model, our costs will be higher than automated factories from overseas. So the design, the packaging, the contents and our service has to be exemplary. The social impact is the ‘added extra’.”

More public awareness about social enterprise has led to marketing and promotional benefits for ethical companies. “Having a social angle to your business, people talk about it more,” Assomull says. “Most of our sales are driven by word of mouth. Customers seem to become like cheerleaders for your brand when you’re working towards something bigger than profit.”

There are, of course, many practical considerations for those looking to enter the world of social enterprise. “Make sure your enterprise is a viable business in its own right. Be clear on your social mission and how your business will achieve it. Ensure you can demonstrate the social impact you are seeking to have,” says Charlie Wigglesworth, director of business at Social Enterprise UK.

Practical support is available from organisations such as The School of Social Entrepreneurs, which offers startup programmes, while the Bright Ideas Trust has a free phone consultation service and funding opportunities. UnLtd also offers small pots of money to individuals starting a new social enterprise, and has a large network for collaboration and support. “We now have a large number of partners who find, fund and support social entrepreneurs – partners like universities, colleges, community groups and housing associations,” Fox says. “The aim is to reach far more people than we could alone, building a strong ‘ecosystem of support’.”

That ecosystem extends beyond the public and voluntary sectors to social companies too – the UK’s social enterprise community is strong, supportive and collaborative. “We are active partners in social enterprise networks and we host visits for people to understand more about social enterprise,” Robinson says.

Patel adds that social enterprises are needed now more than ever: “The UK needs social entrepreneurs to plug holes in the arts, culture and social budgets. Those holes are only going to get bigger. I see social enterprise as the way to transform how we do things.”

Capture21

http://www.theguardian.com/small-business-network/2015/oct/14/social-enterprises-mission-money-change-lives